diff options
| author | 2012-01-12 00:30:01 +0100 | |
|---|---|---|
| committer | 2012-01-12 00:30:01 +0100 | |
| commit | 33b8dfb90ecc5b4b2559c1fb43d7b743b72bf425 (patch) | |
| tree | c64f6f780500df4e0f216d774601f5465a7339ed | |
| parent | 83fa6982dfddaed93195402e2e0b7435bc707e06 (diff) | |
| download | libplist-33b8dfb90ecc5b4b2559c1fb43d7b743b72bf425.tar.gz libplist-33b8dfb90ecc5b4b2559c1fb43d7b743b72bf425.tar.bz2 | |
fix compiler warnings
| -rw-r--r-- | src/base64.c | 6 | ||||
| -rw-r--r-- | src/bplist.c | 8 | ||||
| -rw-r--r-- | src/hashtable.c | 1 | ||||
| -rw-r--r-- | src/xplist.c | 2 |
4 files changed, 4 insertions, 13 deletions
diff --git a/src/base64.c b/src/base64.c index 65c6061..e558d9e 100644 --- a/src/base64.c +++ b/src/base64.c | |||
| @@ -104,9 +104,9 @@ static int base64decode_block(unsigned char *target, const char *data, size_t da | |||
| 104 | 104 | ||
| 105 | unsigned char *base64decode(const char *buf, size_t *size) | 105 | unsigned char *base64decode(const char *buf, size_t *size) |
| 106 | { | 106 | { |
| 107 | if (!buf) return; | 107 | if (!buf) return NULL; |
| 108 | size_t len = strlen(buf); | 108 | size_t len = strlen(buf); |
| 109 | if (len <= 0) return; | 109 | if (len <= 0) return NULL; |
| 110 | unsigned char *outbuf = (unsigned char*)malloc((len/4)*3+3); | 110 | unsigned char *outbuf = (unsigned char*)malloc((len/4)*3+3); |
| 111 | 111 | ||
| 112 | unsigned char *line; | 112 | unsigned char *line; |
| @@ -114,7 +114,7 @@ unsigned char *base64decode(const char *buf, size_t *size) | |||
| 114 | 114 | ||
| 115 | line = (unsigned char*)strtok((char*)buf, "\r\n\t "); | 115 | line = (unsigned char*)strtok((char*)buf, "\r\n\t "); |
| 116 | while (line) { | 116 | while (line) { |
| 117 | p+=base64decode_block(outbuf+p, line, strlen((char*)line)); | 117 | p+=base64decode_block(outbuf+p, (const char*)line, strlen((char*)line)); |
| 118 | 118 | ||
| 119 | // get next line of base64 encoded block | 119 | // get next line of base64 encoded block |
| 120 | line = (unsigned char*)strtok(NULL, "\r\n\t "); | 120 | line = (unsigned char*)strtok(NULL, "\r\n\t "); |
diff --git a/src/bplist.c b/src/bplist.c index d03dc2b..43354be 100644 --- a/src/bplist.c +++ b/src/bplist.c | |||
| @@ -740,12 +740,6 @@ static void serialize_plist(node_t* node, void* data) | |||
| 740 | return; | 740 | return; |
| 741 | } | 741 | } |
| 742 | 742 | ||
| 743 | static int free_index(void* key, void* value, void* user_data) | ||
| 744 | { | ||
| 745 | free((uint64_t *) value); | ||
| 746 | return TRUE; | ||
| 747 | } | ||
| 748 | |||
| 749 | #define Log2(x) (x == 8 ? 3 : (x == 4 ? 2 : (x == 2 ? 1 : 0))) | 743 | #define Log2(x) (x == 8 ? 3 : (x == 4 ? 2 : (x == 2 ? 1 : 0))) |
| 750 | 744 | ||
| 751 | static void write_int(bytearray_t * bplist, uint64_t val) | 745 | static void write_int(bytearray_t * bplist, uint64_t val) |
| @@ -998,7 +992,6 @@ void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length) | |||
| 998 | uint8_t trailer[BPLIST_TRL_SIZE]; | 992 | uint8_t trailer[BPLIST_TRL_SIZE]; |
| 999 | //for string | 993 | //for string |
| 1000 | long len = 0; | 994 | long len = 0; |
| 1001 | int type = 0; | ||
| 1002 | long items_read = 0; | 995 | long items_read = 0; |
| 1003 | long items_written = 0; | 996 | long items_written = 0; |
| 1004 | uint16_t *unicodestr = NULL; | 997 | uint16_t *unicodestr = NULL; |
| @@ -1087,7 +1080,6 @@ void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length) | |||
| 1087 | } | 1080 | } |
| 1088 | 1081 | ||
| 1089 | //free intermediate objects | 1082 | //free intermediate objects |
| 1090 | //hash_table_foreach_remove(ref_table, free_index, NULL); | ||
| 1091 | ptr_array_free(objects); | 1083 | ptr_array_free(objects); |
| 1092 | hash_table_destroy(ref_table); | 1084 | hash_table_destroy(ref_table); |
| 1093 | 1085 | ||
diff --git a/src/hashtable.c b/src/hashtable.c index 9716c25..08ff934 100644 --- a/src/hashtable.c +++ b/src/hashtable.c | |||
| @@ -55,7 +55,6 @@ void hash_table_destroy(hashtable_t *ht) | |||
| 55 | void hash_table_insert(hashtable_t* ht, void *key, void *value) | 55 | void hash_table_insert(hashtable_t* ht, void *key, void *value) |
| 56 | { | 56 | { |
| 57 | if (!ht || !key) return; | 57 | if (!ht || !key) return; |
| 58 | int i; | ||
| 59 | 58 | ||
| 60 | unsigned int hash = ht->hash_func(key); | 59 | unsigned int hash = ht->hash_func(key); |
| 61 | 60 | ||
diff --git a/src/xplist.c b/src/xplist.c index edce2f9..ba312a1 100644 --- a/src/xplist.c +++ b/src/xplist.c | |||
| @@ -342,7 +342,7 @@ static void xml_to_node(xmlNodePtr xml_node, plist_t * plist_node) | |||
| 342 | { | 342 | { |
| 343 | xmlChar *strval = xmlNodeGetContent(node); | 343 | xmlChar *strval = xmlNodeGetContent(node); |
| 344 | time_t time = 0; | 344 | time_t time = 0; |
| 345 | if (strlen(strval) >= 11) { | 345 | if (strlen((const char*)strval) >= 11) { |
| 346 | struct tm btime; | 346 | struct tm btime; |
| 347 | parse_date((const char*)strval, &btime); | 347 | parse_date((const char*)strval, &btime); |
| 348 | time = mktime(&btime); | 348 | time = mktime(&btime); |
