[Opensrf-commits] r1132 - in trunk: include/opensrf src/libopensrf

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Nov 20 14:14:50 EST 2007


Author: miker
Date: 2007-11-20 13:57:16 -0500 (Tue, 20 Nov 2007)
New Revision: 1132

Modified:
   trunk/include/opensrf/osrf_json.h
   trunk/include/opensrf/osrf_json_xml.h
   trunk/src/libopensrf/osrf_json_xml.c
Log:
for-loop initial declaration issue; realigned some const-ification

Modified: trunk/include/opensrf/osrf_json.h
===================================================================
--- trunk/include/opensrf/osrf_json.h	2007-11-20 18:46:25 UTC (rev 1131)
+++ trunk/include/opensrf/osrf_json.h	2007-11-20 18:57:16 UTC (rev 1132)
@@ -369,7 +369,7 @@
 
 /**
  *	Generates an XML representation of a JSON object */
-char* jsonObjectToXML(jsonObject*);
+char* jsonObjectToXML(const jsonObject*);
 
 
 /*

Modified: trunk/include/opensrf/osrf_json_xml.h
===================================================================
--- trunk/include/opensrf/osrf_json_xml.h	2007-11-20 18:46:25 UTC (rev 1131)
+++ trunk/include/opensrf/osrf_json_xml.h	2007-11-20 18:57:16 UTC (rev 1132)
@@ -15,7 +15,7 @@
 
 /**
  *	Generates an XML representation of a JSON object */
-char* jsonObjectToXML(jsonObject*);
+char* jsonObjectToXML( const jsonObject*);
 
 
 /*

Modified: trunk/src/libopensrf/osrf_json_xml.c
===================================================================
--- trunk/src/libopensrf/osrf_json_xml.c	2007-11-20 18:46:25 UTC (rev 1131)
+++ trunk/src/libopensrf/osrf_json_xml.c	2007-11-20 18:57:16 UTC (rev 1132)
@@ -229,7 +229,7 @@
 
 
 static char* _escape_xml (const char*);
-static int _recurse_jsonObjectToXML(jsonObject*, growing_buffer*);
+static int _recurse_jsonObjectToXML(const jsonObject*, growing_buffer*);
 
 char* jsonObjectToXML(const jsonObject* obj) {
 
@@ -304,8 +304,9 @@
 		else
                		buffer_add(res_xml,"<array>");
 
-	       	for ( int i = 0; i!= obj->size; i++ )
-			_recurse_jsonObjectToXML(jsonObjectGetIndex(obj,i), res_xml);
+        int i;
+        for ( i = 0; i!= obj->size; i++ )
+		    _recurse_jsonObjectToXML(jsonObjectGetIndex(obj,i), res_xml);
 
 		buffer_add(res_xml,"</array>");
 



More information about the opensrf-commits mailing list