From babec330acced3915332fa9a09b8252cfa99cf34 Mon Sep 17 00:00:00 2001 From: Jonathan Beck Date: Thu, 21 Jan 2010 21:19:41 +0100 Subject: Fix some warnings --- src/bplist.c | 5 ++--- src/plist.c | 36 ++---------------------------------- src/xplist.c | 3 ++- 3 files changed, 6 insertions(+), 38 deletions(-) (limited to 'src') diff --git a/src/bplist.c b/src/bplist.c index d37ed7a..a9e2638 100644 --- a/src/bplist.c +++ b/src/bplist.c @@ -82,7 +82,7 @@ static void byte_convert(uint8_t * address, size_t size) static uint32_t uint24_from_be(char *buff) { uint32_t ret = 0; - char *tmp = (char *) &ret; + uint8_t *tmp = (uint8_t *) &ret; memcpy(tmp + 1, buff, 3 * sizeof(char)); byte_convert(tmp, sizeof(uint32_t)); return ret; @@ -192,7 +192,6 @@ static plist_t parse_unicode_node(char *bnode, uint64_t size) uint64_t i = 0; gunichar2 *unicodestr = NULL; gchar *tmpstr = NULL; - int type = 0; glong items_read = 0; glong items_written = 0; GError *error = NULL; @@ -858,7 +857,7 @@ void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length) case PLIST_KEY: case PLIST_STRING: len = strlen(data->strval); - type = xmlDetectCharEncoding(data->strval, len); + type = xmlDetectCharEncoding((const unsigned char *)data->strval, len); if (XML_CHAR_ENCODING_UTF8 == type) { unicodestr = g_utf8_to_utf16(data->strval, len, &items_read, &items_written, &error); diff --git a/src/plist.c b/src/plist.c index 1abd0f9..7028d81 100644 --- a/src/plist.c +++ b/src/plist.c @@ -414,38 +414,6 @@ void plist_dict_remove_item(plist_t node, const char* key) return; } -static char compare_node_value(plist_type type, plist_data_t data, const void *value, uint64_t length) -{ - char res = FALSE; - switch (type) - { - case PLIST_BOOLEAN: - res = data->boolval == *((char *) value) ? TRUE : FALSE; - break; - case PLIST_UINT: - res = data->intval == *((uint64_t *) value) ? TRUE : FALSE; - break; - case PLIST_REAL: - res = data->realval == *((double *) value) ? TRUE : FALSE; - break; - case PLIST_KEY: - case PLIST_STRING: - res = !strcmp(data->strval, ((char *) value)); - break; - case PLIST_DATA: - res = !memcmp(data->buff, (char *) value, length); - break; - case PLIST_DATE: - res = !memcmp(&(data->timeval), value, sizeof(GTimeVal)); - break; - case PLIST_ARRAY: - case PLIST_DICT: - default: - break; - } - return res; -} - plist_t plist_access_pathv(plist_t plist, uint32_t length, va_list v) { plist_t current = plist; @@ -458,8 +426,8 @@ plist_t plist_access_pathv(plist_t plist, uint32_t length, va_list v) if (type == PLIST_ARRAY) { - uint32_t index = va_arg(v, uint32_t); - current = plist_array_get_item(current, index); + uint32_t n = va_arg(v, uint32_t); + current = plist_array_get_item(current, n); } else if (type == PLIST_DICT) { diff --git a/src/xplist.c b/src/xplist.c index ce8dec1..8b6a632 100644 --- a/src/xplist.c +++ b/src/xplist.c @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -149,7 +150,7 @@ static void node_to_xml(GNode * node, gpointer xml_struct) case PLIST_UINT: tag = XPLIST_INT; - val = g_strdup_printf("%llu", node_data->intval); + val = g_strdup_printf("%"PRIu64, node_data->intval); break; case PLIST_REAL: -- cgit v1.1-32-gdbae