M: Matthew Smith <mgsmith@netgate.com>
F: src/plugins/linux-cp/
+cJSON
+I: cjson
+M: Ole Troan <ot@cisco.com>
+F: src/vppinfra/cJSON.[ch]
+
THE REST
I: misc
M: vpp-dev Mailing List <vpp-dev@fd.io>
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-
+/* clang-format off */
/* cJSON */
/* JSON parser in C. */
#endif
#ifndef NAN
+#ifdef _WIN32
+#define NAN sqrt (-1.0)
+#else
#define NAN 0.0/0.0
#endif
+#endif
typedef struct {
const unsigned char *json;
return NULL;
}
- if (newbuffer)
- {
- memcpy(newbuffer, p->buffer, p->offset + 1);
- }
- p->hooks.deallocate(p->buffer);
+
+ memcpy (newbuffer, p->buffer, p->offset + 1);
+ p->hooks.deallocate (p->buffer);
}
p->length = newsize;
p->buffer = newbuffer;
}
a = cJSON_CreateArray();
+
for(i = 0; a && (i < (size_t)count); i++)
{
n = cJSON_CreateNumber(numbers[i]);
}
p = n;
}
- a->child->prev = n;
+
+ if (a && a->child)
+ {
+ a->child->prev = n;
+ }
return a;
}
}
p = n;
}
- a->child->prev = n;
+
+ if (a && a->child)
+ {
+ a->child->prev = n;
+ }
return a;
}
a = cJSON_CreateArray();
- for(i = 0;a && (i < (size_t)count); i++)
- {
- n = cJSON_CreateNumber(numbers[i]);
+ for (i = 0; a && (i < (size_t) count); i++)
+ {
+ n = cJSON_CreateNumber(numbers[i]);
if(!n)
{
cJSON_Delete(a);
suffix_object(p, n);
}
p = n;
- }
- a->child->prev = n;
+ }
+
+ if (a && a->child)
+ {
+ a->child->prev = n;
+ }
return a;
}
}
p = n;
}
- a->child->prev = n;
+
+ if (a && a->child)
+ {
+ a->child->prev = n;
+ }
return a;
}