summaryrefslogtreecommitdiffstats
path: root/src/bplist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bplist.c')
-rw-r--r--src/bplist.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/bplist.c b/src/bplist.c
index 48b996d..741a92c 100644
--- a/src/bplist.c
+++ b/src/bplist.c
@@ -80,7 +80,7 @@ void byte_convert(char *address, size_t size)
80 80
81#define be64dec(x) bswap_64( *(uint64_t*)(x) ) 81#define be64dec(x) bswap_64( *(uint64_t*)(x) )
82 82
83#define get_needed_bytes(x) (x <= 1<<8 ? 1 : ( x <= 1<<16 ? 2 : ( x <= 1<<32 ? 4 : 8))) 83#define get_needed_bytes(x) (x <= 1<<8 ? 1 : ( x <= 1<<16 ? 2 : ( x <= (uint64_t)1<<32 ? 4 : 8)))
84#define get_real_bytes(x) (x >> 32 ? 4 : 8) 84#define get_real_bytes(x) (x >> 32 ? 4 : 8)
85 85
86plist_t parse_uint_node(char *bnode, uint8_t size, char **next_object) 86plist_t parse_uint_node(char *bnode, uint8_t size, char **next_object)
@@ -446,7 +446,7 @@ void plist_from_bin(const char *plist_bin, uint32_t length, plist_t * plist)
446 446
447guint plist_data_hash(gconstpointer key) 447guint plist_data_hash(gconstpointer key)
448{ 448{
449 plist_data_t data = plist_get_data(key); 449 plist_data_t data = plist_get_data((plist_t) key);
450 450
451 guint hash = data->type; 451 guint hash = data->type;
452 guint i = 0; 452 guint i = 0;
@@ -467,14 +467,14 @@ guint plist_data_hash(gconstpointer key)
467 size = strlen(buff); 467 size = strlen(buff);
468 break; 468 break;
469 case PLIST_UNICODE: 469 case PLIST_UNICODE:
470 buff = data->unicodeval; 470 buff = (char *) data->unicodeval;
471 size = strlen(buff) * sizeof(wchar_t); 471 size = strlen(buff) * sizeof(wchar_t);
472 break; 472 break;
473 case PLIST_DATA: 473 case PLIST_DATA:
474 case PLIST_ARRAY: 474 case PLIST_ARRAY:
475 case PLIST_DICT: 475 case PLIST_DICT:
476 //for these types only hash pointer 476 //for these types only hash pointer
477 buff = &key; 477 buff = (char *) &key;
478 size = sizeof(gconstpointer); 478 size = sizeof(gconstpointer);
479 break; 479 break;
480 case PLIST_DATE: 480 case PLIST_DATE:
@@ -497,8 +497,8 @@ gboolean plist_data_compare(gconstpointer a, gconstpointer b)
497 if (!((GNode *) a)->data || !((GNode *) b)->data) 497 if (!((GNode *) a)->data || !((GNode *) b)->data)
498 return FALSE; 498 return FALSE;
499 499
500 plist_data_t val_a = plist_get_data(a); 500 plist_data_t val_a = plist_get_data((plist_t) a);
501 plist_data_t val_b = plist_get_data(b); 501 plist_data_t val_b = plist_get_data((plist_t) b);
502 502
503 if (val_a->type != val_b->type) 503 if (val_a->type != val_b->type)
504 return FALSE; 504 return FALSE;
@@ -519,7 +519,7 @@ gboolean plist_data_compare(gconstpointer a, gconstpointer b)
519 else 519 else
520 return FALSE; 520 return FALSE;
521 case PLIST_UNICODE: 521 case PLIST_UNICODE:
522 if (!strcmp(val_a->unicodeval, val_b->unicodeval)) 522 if (!wcscmp(val_a->unicodeval, val_b->unicodeval))
523 return TRUE; 523 return TRUE;
524 else 524 else
525 return FALSE; 525 return FALSE;