[oe-commits] Rui Miguel Silva Seabra : Elmdentica abandoned json-c in favor of cjson

git version control git at git.openembedded.org
Sun Sep 12 14:38:58 UTC 2010


Module: openembedded.git
Branch: org.openembedded.dev
Commit: 55b3912f14b1919bf2cd330e48546f11c179794f
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=55b3912f14b1919bf2cd330e48546f11c179794f

Author: Rui Miguel Silva Seabra <rms at 1407.org>
Date:   Sat Sep 11 15:00:51 2010 +0000

Elmdentica abandoned json-c in favor of cjson

Hi,

cJSON is not a properly setup library, but drop in files (this should be
fixed in the future), however it seems to be working a lot better than
json-c.

I was running into a lot of weird problems and crashes derived from
json-c and so I tried cJSON as advised by disconfitor.

Indeed it's working, faster, and more reliably, so I now add two patches:
  1) removes elmdentica svn dependency on libjson (already commit in e's
svn)
  2) removes my naive patch to json-c (or libjson) as they're working on
a much better patch and I was the only one using it AFAICT

Please apply!

Rui

Signed-off-by: Klaus Kurzmann <mok at fluxnetz.de>

---

 recipes/e17/elmdentica_svn.bb                    |    2 +-
 recipes/libjson/libjson/json-c-longlongint.patch |  112 ----------------------
 recipes/libjson/libjson_svn.bb                   |    3 +-
 3 files changed, 2 insertions(+), 115 deletions(-)

diff --git a/recipes/e17/elmdentica_svn.bb b/recipes/e17/elmdentica_svn.bb
index 5d08c69..460dbc1 100644
--- a/recipes/e17/elmdentica_svn.bb
+++ b/recipes/e17/elmdentica_svn.bb
@@ -1,5 +1,5 @@
 DESCRIPTION = "A indenti.ca client for E"
-DEPENDS = "glib-2.0 gconf curl elementary sqlite3-native libjson"
+DEPENDS = "glib-2.0 gconf curl elementary sqlite3-native"
 LICENSE = "GPLv3+"
 SECTION = "e/apps"
 HOMEPAGE = "http://elmdentica.googlecode.com"
diff --git a/recipes/libjson/libjson/json-c-longlongint.patch b/recipes/libjson/libjson/json-c-longlongint.patch
deleted file mode 100644
index 5d68249..0000000
--- a/recipes/libjson/libjson/json-c-longlongint.patch
+++ /dev/null
@@ -1,112 +0,0 @@
-Index: jsonjson_object_private.h
-===================================================================
---- json.old/json_object_private.h	(revision 55)
-+++ json/json_object_private.h	(working copy)
-@@ -30,7 +30,7 @@
-   union data {
-     boolean c_boolean;
-     double c_double;
--    int c_int;
-+    long long int c_int;
-     struct lh_table *c_object;
-     struct array_list *c_array;
-     char *c_string;
-Index: jsonjson_object.c
-===================================================================
---- json.old/json_object.c	(revision 55)
-+++ json/json_object.c	(working copy)
-@@ -319,10 +319,10 @@
- static int json_object_int_to_json_string(struct json_object* jso,
- 					  struct printbuf *pb)
- {
--  return sprintbuf(pb, "%d", jso->o.c_int);
-+  return sprintbuf(pb, "%lld", jso->o.c_int);
- }
- 
--struct json_object* json_object_new_int(int i)
-+struct json_object* json_object_new_int(long long int i)
- {
-   struct json_object *jso = json_object_new(json_type_int);
-   if(!jso) return NULL;
-@@ -331,20 +331,20 @@
-   return jso;
- }
- 
--int json_object_get_int(struct json_object *jso)
-+long long int json_object_get_int(struct json_object *jso)
- {
--  int cint;
-+  long long int cint;
- 
-   if(!jso) return 0;
-   switch(jso->o_type) {
-   case json_type_int:
-     return jso->o.c_int;
-   case json_type_double:
--    return (int)jso->o.c_double;
-+    return (long long int)jso->o.c_double;
-   case json_type_boolean:
-     return jso->o.c_boolean;
-   case json_type_string:
--    if(sscanf(jso->o.c_string, "%d", &cint) == 1) return cint;
-+    if(sscanf(jso->o.c_string, "%lld", &cint) == 1) return cint;
-   default:
-     return 0;
-   }
-Index: jsonjson_tokener.c
-===================================================================
---- json.old/json_tokener.c	(revision 55)
-+++ json/json_tokener.c	(working copy)
-@@ -542,9 +542,9 @@
-           printbuf_memappend_fast(tok->pb, case_start, case_len);
-       }
-       {
--        int numi;
-+        long long int numi;
-         double numd;
--        if(!tok->is_double && sscanf(tok->pb->buf, "%d", &numi) == 1) {
-+        if(!tok->is_double && sscanf(tok->pb->buf, "%lld", &numi) == 1) {
-           current = json_object_new_int(numi);
-         } else if(tok->is_double && sscanf(tok->pb->buf, "%lf", &numd) == 1) {
-           current = json_object_new_double(numd);
-Index: jsonjson_object.h
-===================================================================
---- json.old/json_object.h	(revision 55)
-+++ json/json_object.h	(working copy)
-@@ -252,18 +252,18 @@
-  * @param i the integer
-  * @returns a json_object of type json_type_int
-  */
--extern struct json_object* json_object_new_int(int i);
-+extern struct json_object* json_object_new_int(long long int i);
- 
--/** Get the int value of a json_object
-+/** Get the long long int value of a json_object
-  *
-  * The type is coerced to a int if the passed object is not a int.
-  * double objects will return their integer conversion. Strings will be
-  * parsed as an integer. If no conversion exists then 0 is returned.
-  *
-  * @param obj the json_object instance
-- * @returns an int
-+ * @returns a long long int
-  */
--extern int json_object_get_int(struct json_object *obj);
-+extern long long int json_object_get_int(struct json_object *obj);
- 
- 
- /* double type methods */
-Index: jsonChangeLog
-===================================================================
---- json.old/ChangeLog	(revision 55)
-+++ json/ChangeLog	(working copy)
-@@ -8,6 +8,9 @@
-     Brent Miller, bdmiller at yahoo dash inc dot com
-   * Correction to comment describing printbuf_memappend in printbuf.h
-     Brent Miller, bdmiller at yahoo dash inc dot com
-+  * Use long long int instead of plain int for integers (needed for stuff like
-+    twitter, which has some long long ints in it's status IDs
-+    Rui Miguel Seabra, rms at 1407 dot org
- 
- 0.9
-   * Add README.html README-WIN32.html config.h.win32 to Makefile.am
diff --git a/recipes/libjson/libjson_svn.bb b/recipes/libjson/libjson_svn.bb
index 71c243d..a3ce14c 100644
--- a/recipes/libjson/libjson_svn.bb
+++ b/recipes/libjson/libjson_svn.bb
@@ -5,8 +5,7 @@ SECTION = "libs"
 LICENSE = "MIT/X11"
 PV = "0.9+svnr${SRCPV}"
 
-SRC_URI = "svn://svn.metaparadigm.com/svn/json-c/;module=trunk;proto=http \
-           file://json-c-longlongint.patch"
+SRC_URI = "svn://svn.metaparadigm.com/svn/json-c/;module=trunk;proto=http"
 
 SRCREV = "55"
 S = "${WORKDIR}/trunk"





More information about the Openembedded-commits mailing list