0008-libubox-jshn-increase-int-width-to-64bit.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Thu, 13 Feb 2014 19:33:07 +0100
  3. Subject: libubox: jshn: increase int width to 64bit
  4. diff --git a/package/libubox/patches/001-jshn-increase-int-width-to-64bit.patch b/package/libubox/patches/001-jshn-increase-int-width-to-64bit.patch
  5. new file mode 100644
  6. index 0000000..0fc8977
  7. --- /dev/null
  8. +++ b/package/libubox/patches/001-jshn-increase-int-width-to-64bit.patch
  9. @@ -0,0 +1,30 @@
  10. +From e90344324b07aea040d818ec7eadb814570fa691 Mon Sep 17 00:00:00 2001
  11. +Message-Id: <e90344324b07aea040d818ec7eadb814570fa691.1392316273.git.mschiffer@universe-factory.net>
  12. +From: Matthias Schiffer <mschiffer@universe-factory.net>
  13. +Date: Thu, 13 Feb 2014 19:30:06 +0100
  14. +Subject: [PATCH] jshn: increase int width to 64bit
  15. +
  16. +---
  17. + jshn.c | 4 ++--
  18. + 1 file changed, 2 insertions(+), 2 deletions(-)
  19. +
  20. +--- a/jshn.c
  21. ++++ b/jshn.c
  22. +@@ -142,7 +142,7 @@ static int add_json_element(const char *
  23. + fprintf(stdout, "' %d;\n", json_object_get_boolean(obj));
  24. + break;
  25. + case json_type_int:
  26. +- fprintf(stdout, "' %d;\n", json_object_get_int(obj));
  27. ++ fprintf(stdout, "' %lld;\n", (long long)json_object_get_int64(obj));
  28. + break;
  29. + case json_type_double:
  30. + fprintf(stdout, "' %lf;\n", json_object_get_double(obj));
  31. +@@ -217,7 +217,7 @@ static void jshn_add_object_var(json_obj
  32. + } else if (!strcmp(type, "string")) {
  33. + new = json_object_new_string(var);
  34. + } else if (!strcmp(type, "int")) {
  35. +- new = json_object_new_int(atoi(var));
  36. ++ new = json_object_new_int64(atoll(var));
  37. + } else if (!strcmp(type, "double")) {
  38. + new = json_object_new_double(strtod(var, NULL));
  39. + } else if (!strcmp(type, "boolean")) {