~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to source/blender/blenlib/intern/BLI_ghash.c

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2012-05-12 20:02:22 UTC
  • mfrom: (14.2.16 sid)
  • Revision ID: package-import@ubuntu.com-20120512200222-lznjs2cxzaq96wua
Tags: 2.63a-1
* New upstream bugfix release
  + debian/patches/: re-worked since source code changed

Show diffs side-by-side

added added

removed removed

Lines of Context:
305
305
        return strcmp(a, b);
306
306
}
307
307
 
308
 
GHashPair *BLI_ghashutil_pairalloc(const void *first, int second)
 
308
GHashPair *BLI_ghashutil_pairalloc(const void *first, const void *second)
309
309
{
310
310
        GHashPair *pair = MEM_mallocN(sizeof(GHashPair), "GHashPair");
311
311
        pair->first = first;
317
317
{
318
318
        const GHashPair *pair = ptr;
319
319
        unsigned int hash = BLI_ghashutil_ptrhash(pair->first);
320
 
        return hash ^ BLI_ghashutil_inthash(SET_INT_IN_POINTER(pair->second));
 
320
        return hash ^ BLI_ghashutil_ptrhash(pair->second);
321
321
}
322
322
 
323
323
int BLI_ghashutil_paircmp(const void *a, const void *b)
327
327
 
328
328
        int cmp = BLI_ghashutil_ptrcmp(A->first, B->first);
329
329
        if (cmp == 0)
330
 
                return BLI_ghashutil_intcmp(SET_INT_IN_POINTER(A->second), SET_INT_IN_POINTER(B->second));
 
330
                return BLI_ghashutil_ptrcmp(A->second, B->second);
331
331
        return cmp;
332
332
}
333
333