mirror of
https://github.com/kgabis/parson.git
synced 2025-03-12 22:05:30 +00:00
Removes trailing whitespace.
This commit is contained in:
parent
473c7f3d8d
commit
5c4a11b036
12
parson.c
12
parson.c
@ -713,14 +713,14 @@ static JSON_Value * parse_null_value(const char **string) {
|
||||
}
|
||||
|
||||
/* Serialization */
|
||||
#define APPEND_STRING(str) do { written = append_string(buf, (str)); \
|
||||
if (written < 0) { return -1; } \
|
||||
if (buf != NULL) { buf += written; } \
|
||||
#define APPEND_STRING(str) do { written = append_string(buf, (str));\
|
||||
if (written < 0) { return -1; }\
|
||||
if (buf != NULL) { buf += written; }\
|
||||
written_total += written; } while(0)
|
||||
|
||||
#define APPEND_INDENT(level) do { written = append_indent(buf, (level)); \
|
||||
if (written < 0) { return -1; } \
|
||||
if (buf != NULL) { buf += written; } \
|
||||
#define APPEND_INDENT(level) do { written = append_indent(buf, (level));\
|
||||
if (written < 0) { return -1; }\
|
||||
if (buf != NULL) { buf += written; }\
|
||||
written_total += written; } while(0)
|
||||
|
||||
static int json_serialize_to_buffer_r(const JSON_Value *value, char *buf, int level, int is_pretty, char *num_buf)
|
||||
|
4
parson.h
4
parson.h
@ -104,7 +104,7 @@ int json_value_equals(const JSON_Value *a, const JSON_Value *b);
|
||||
JSON_Status json_validate(const JSON_Value *schema, const JSON_Value *value);
|
||||
|
||||
/*
|
||||
* JSON Object
|
||||
* JSON Objec
|
||||
*/
|
||||
JSON_Value * json_object_get_value (const JSON_Object *object, const char *name);
|
||||
const char * json_object_get_string (const JSON_Object *object, const char *name);
|
||||
@ -125,7 +125,7 @@ double json_object_dotget_number (const JSON_Object *object, const char *
|
||||
int json_object_dotget_boolean(const JSON_Object *object, const char *name); /* returns -1 on fail */
|
||||
|
||||
/* Functions to get available names */
|
||||
size_t json_object_get_count(const JSON_Object *object);
|
||||
size_t json_object_get_count (const JSON_Object *object);
|
||||
const char * json_object_get_name (const JSON_Object *object, size_t index);
|
||||
JSON_Value * json_object_get_value_at(const JSON_Object *object, size_t index);
|
||||
|
||||
|
4
tests.c
4
tests.c
@ -31,8 +31,8 @@
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#define TEST(A) printf("%-72s-",#A); \
|
||||
if(A){puts(" OK");tests_passed++;} \
|
||||
#define TEST(A) printf("%-72s-",#A);\
|
||||
if(A){puts(" OK");tests_passed++;}\
|
||||
else{puts(" FAIL");tests_failed++;}
|
||||
#define STREQ(A, B) ((A) && (B) ? strcmp((A), (B)) == 0 : 0)
|
||||
#define EPSILON 0.000001
|
||||
|
Loading…
Reference in New Issue
Block a user