Commits

Fredrik Lundh  committed 5218935

Use C89 comments throughout.

  • Participants
  • Parent commits 9f3809f

Comments (0)

Files changed (1)

 #include <math.h>
 
 typedef struct JSONData {
-    char *str; // the actual json string
-    char *end; // pointer to the string end
-    char *ptr; // pointer to the current parsing position
-    int  all_unicode; // make all output strings unicode if true
+    char *str; /* the actual json string */
+    char *end; /* pointer to the string end */
+    char *ptr; /* pointer to the current parsing position */
+    int  all_unicode; /* make all output strings unicode if true */
 } JSONData;
 
 
     Py_ssize_t len;
     char *ptr;
 
-    // look for the closing quote
+    /* look for the closing quote */
     escaping = has_unicode = string_escape = False;
     ptr = jsondata->ptr + 1;
     while (True) {
     int c, is_float, should_stop;
     char *ptr;
 
-    // check if we got a floating point number
+    /* check if we got a floating point number */
     ptr = jsondata->ptr;
     is_float = should_stop = False;
     while (True) {
         return encode_list(encode, object);
     } else if (PyTuple_Check(object)) {
         return encode_tuple(encode, object);
-    } else if (PyDict_Check(object)) { // use PyMapping_Check(object) instead? -Dan
+    } else if (PyDict_Check(object)) { /* use PyMapping_Check(object) instead? -Dan */
         return encode_dict(encode, object);
     } else {
         PyErr_SetString(JSON_EncodeError, "object is not JSON encodable");
 }
 
 
-/* Decode JSON representation into pyhton objects */
+/* Decode JSON representation into Python objects */
 
 static PyObject*
 JSON_decode(PyObject *self, PyObject *args, PyObject *kwargs)
 {
     static char *kwlist[] = {"json", "all_unicode", NULL};
-    int all_unicode = False; // by default return unicode only when needed
+    int all_unicode = False; /* by default return unicode only when needed */
     PyObject *object, *string, *str;
     JSONData jsondata;
 
 
     if (PyString_AsStringAndSize(str, &(jsondata.str), NULL) == -1) {
         Py_DECREF(str);
-        return NULL; // not a string object or it contains null bytes
+        return NULL; /* not a string object or it contains null bytes */
     }
 
     jsondata.ptr = jsondata.str;
               "and unicode objects only where necessary, else it will return unicode\n"
               "objects everywhere (this is slower).")},
 
-    {NULL, NULL}  // sentinel
+    {NULL, NULL}  /* sentinel */
 };
 
 PyDoc_STRVAR(module_doc,
     Py_INCREF(JSON_DecodeError);
     PyModule_AddObject(m, "DecodeError", JSON_DecodeError);
 
-    // Module version (the MODULE_VERSION macro is defined by setup.py)
+    /* Module version (the MODULE_VERSION macro is defined by setup.py) */
     PyModule_AddStringConstant(m, "__version__", STRINGIFY(MODULE_VERSION));
 
 }