aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPetri Lehtinen <petri@digip.org>2009-09-12 12:49:17 +0300
committerPetri Lehtinen <petri@digip.org>2009-09-13 13:16:34 +0300
commit743af38e7f2453bb90190433b1c05615eed6d747 (patch)
tree4dbbb1d50e683b07448b3cddab0ed3caa578913c /src
parent9d16ec755c9754fe1f79fe55ab719a7f8578ce37 (diff)
downloadjansson-743af38e7f2453bb90190433b1c05615eed6d747.zip
jansson-743af38e7f2453bb90190433b1c05615eed6d747.tar.gz
jansson-743af38e7f2453bb90190433b1c05615eed6d747.tar.bz2
Use unsigned long instead of uint32_t
Some day we will have ANSI C compatibility... This change doesn't make the API backwards incompatible because uint32_t was only used in flags to json_dump*() and the flags are meant to be used only by ORing constants and macro output, and actually currently only JSON_INDENT can be used.
Diffstat (limited to 'src')
-rw-r--r--src/dump.c10
-rw-r--r--src/jansson.h6
2 files changed, 8 insertions, 8 deletions
diff --git a/src/dump.c b/src/dump.c
index 9505b7f..042b0c7 100644
--- a/src/dump.c
+++ b/src/dump.c
@@ -38,7 +38,7 @@ static int dump_to_file(const char *buffer, int size, void *data)
/* 256 spaces (the maximum indentation size) */
static char whitespace[] = " ";
-static int dump_indent(uint32_t flags, int depth, dump_func dump, void *data)
+static int dump_indent(unsigned long flags, int depth, dump_func dump, void *data)
{
if(JSON_INDENT(flags) > 0)
{
@@ -111,7 +111,7 @@ static int dump_string(const char *str, dump_func dump, void *data)
return dump("\"", 1, data);
}
-static int do_dump(const json_t *json, uint32_t flags, int depth,
+static int do_dump(const json_t *json, unsigned long flags, int depth,
dump_func dump, void *data)
{
switch(json_typeof(json)) {
@@ -232,7 +232,7 @@ static int do_dump(const json_t *json, uint32_t flags, int depth,
}
-char *json_dumps(const json_t *json, uint32_t flags)
+char *json_dumps(const json_t *json, unsigned long flags)
{
strbuffer_t strbuff;
char *result;
@@ -255,7 +255,7 @@ char *json_dumps(const json_t *json, uint32_t flags)
return result;
}
-int json_dumpf(const json_t *json, FILE *output, uint32_t flags)
+int json_dumpf(const json_t *json, FILE *output, unsigned long flags)
{
if(!json_is_array(json) && !json_is_object(json))
return -1;
@@ -265,7 +265,7 @@ int json_dumpf(const json_t *json, FILE *output, uint32_t flags)
return dump_to_file("\n", 1, (void *)output);
}
-int json_dump_file(const json_t *json, const char *path, uint32_t flags)
+int json_dump_file(const json_t *json, const char *path, unsigned long flags)
{
int result;
diff --git a/src/jansson.h b/src/jansson.h
index 2e8582b..b5cdddb 100644
--- a/src/jansson.h
+++ b/src/jansson.h
@@ -124,8 +124,8 @@ json_t *json_load_file(const char *path, json_error_t *error);
#define JSON_INDENT(n) (n & 0xFF)
-char *json_dumps(const json_t *json, uint32_t flags);
-int json_dumpf(const json_t *json, FILE *output, uint32_t flags);
-int json_dump_file(const json_t *json, const char *path, uint32_t flags);
+char *json_dumps(const json_t *json, unsigned long flags);
+int json_dumpf(const json_t *json, FILE *output, unsigned long flags);
+int json_dump_file(const json_t *json, const char *path, unsigned long flags);
#endif