summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-01-12 00:30:01 +0100
committerGravatar Nikias Bassen2012-01-12 00:30:01 +0100
commit33b8dfb90ecc5b4b2559c1fb43d7b743b72bf425 (patch)
treec64f6f780500df4e0f216d774601f5465a7339ed /src
parent83fa6982dfddaed93195402e2e0b7435bc707e06 (diff)
downloadlibplist-33b8dfb90ecc5b4b2559c1fb43d7b743b72bf425.tar.gz
libplist-33b8dfb90ecc5b4b2559c1fb43d7b743b72bf425.tar.bz2
fix compiler warnings
Diffstat (limited to 'src')
-rw-r--r--src/base64.c6
-rw-r--r--src/bplist.c8
-rw-r--r--src/hashtable.c1
-rw-r--r--src/xplist.c2
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
unsigned char *base64decode(const char *buf, size_t *size)
{
- if (!buf) return;
+ if (!buf) return NULL;
size_t len = strlen(buf);
- if (len <= 0) return;
+ if (len <= 0) return NULL;
unsigned char *outbuf = (unsigned char*)malloc((len/4)*3+3);
unsigned char *line;
@@ -114,7 +114,7 @@ unsigned char *base64decode(const char *buf, size_t *size)
line = (unsigned char*)strtok((char*)buf, "\r\n\t ");
while (line) {
- p+=base64decode_block(outbuf+p, line, strlen((char*)line));
+ p+=base64decode_block(outbuf+p, (const char*)line, strlen((char*)line));
// get next line of base64 encoded block
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)
return;
}
-static int free_index(void* key, void* value, void* user_data)
-{
- free((uint64_t *) value);
- return TRUE;
-}
-
#define Log2(x) (x == 8 ? 3 : (x == 4 ? 2 : (x == 2 ? 1 : 0)))
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)
uint8_t trailer[BPLIST_TRL_SIZE];
//for string
long len = 0;
- int type = 0;
long items_read = 0;
long items_written = 0;
uint16_t *unicodestr = NULL;
@@ -1087,7 +1080,6 @@ void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length)
}
//free intermediate objects
- //hash_table_foreach_remove(ref_table, free_index, NULL);
ptr_array_free(objects);
hash_table_destroy(ref_table);
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)
void hash_table_insert(hashtable_t* ht, void *key, void *value)
{
if (!ht || !key) return;
- int i;
unsigned int hash = ht->hash_func(key);
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)
{
xmlChar *strval = xmlNodeGetContent(node);
time_t time = 0;
- if (strlen(strval) >= 11) {
+ if (strlen((const char*)strval) >= 11) {
struct tm btime;
parse_date((const char*)strval, &btime);
time = mktime(&btime);