eina_file_map_key_cmp(const unsigned long long int *key1, int key1_length EINA_UNUSED,
const unsigned long long int *key2, int key2_length EINA_UNUSED)
{
- if (key1[0] - key2[0] == 0) return key1[1] - key2[1];
- return key1[0] - key2[0];
+ if (key1[0] == key2[0])
+ {
+ if (key1[1] == key2[1]) return 0;
+ if (key1[1] > key2[1]) return 1;
+ return -1;
+ }
+ if (key1[0] == key2[0]) return 0;
+ if (key1[0] > key2[0]) return 1;
+ return -1;
}
int
_eina_int32_key_cmp(const uint32_t *key1, EINA_UNUSED int key1_length,
const uint32_t *key2, EINA_UNUSED int key2_length)
{
- return *key1 - *key2;
+ if (*key1 == *key2) return 0;
+ if (*key1 > *key2) return 1;
+ return -1;
}
static unsigned int
-_eina_int64_key_length(EINA_UNUSED const uint32_t *key)
+_eina_int64_key_length(EINA_UNUSED const uint64_t *key)
{
- return 8;
+ return sizeof(int64_t);
}
static int
_eina_int64_key_cmp(const uint64_t *key1, EINA_UNUSED int key1_length,
const uint64_t *key2, EINA_UNUSED int key2_length)
{
- return *key1 - *key2;
+ if (*key1 == *key2) return 0;
+ if (*key1 > *key2) return 1;
+ return -1;
}
static Eina_Bool
const Eina_QuadTree_Item *i = a;
const Eina_QuadTree_Item *j = b;
- return i->index - j->index;
+ if (i->index == j->index) return 0;
+ if (i->index > j->index) return 1;
+ return -1;
}
static Eina_QuadTree_Root *