diff options
Diffstat (limited to 'source/blender/blenkernel/intern/icons.c')
-rw-r--r-- | source/blender/blenkernel/intern/icons.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c index 23cb6c71696..2a348751365 100644 --- a/source/blender/blenkernel/intern/icons.c +++ b/source/blender/blenkernel/intern/icons.c @@ -157,7 +157,7 @@ static int get_next_free_id(void) return gNextIconId++; /* now we try to find the smallest icon id not stored in the gIcons hash */ - while (BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(startId)) && startId >= gFirstIconId) + while (BLI_ghash_lookup(gIcons, POINTER_FROM_INT(startId)) && startId >= gFirstIconId) startId++; /* if we found a suitable one that isn't used yet, return it */ @@ -211,7 +211,7 @@ void BKE_icons_deferred_free(void) node != NULL; node = node->next) { - BLI_ghash_remove(gIcons, SET_INT_IN_POINTER(node->icon_id), NULL, icon_free); + BLI_ghash_remove(gIcons, POINTER_FROM_INT(node->icon_id), NULL, icon_free); } BLI_linklist_lockfree_clear(&g_icon_delete_queue, MEM_freeN); } @@ -522,7 +522,7 @@ void BKE_icon_changed(const int icon_id) if (!icon_id || G.background) return; - icon = BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(icon_id)); + icon = BLI_ghash_lookup(gIcons, POINTER_FROM_INT(icon_id)); if (icon) { /* We *only* expect ID-tied icons here, not non-ID icon/preview! */ @@ -557,7 +557,7 @@ static Icon *icon_create(int icon_id, int obj_type, void *obj) new_icon->drawinfo = NULL; new_icon->drawinfo_free = NULL; - BLI_ghash_insert(gIcons, SET_INT_IN_POINTER(icon_id), new_icon); + BLI_ghash_insert(gIcons, POINTER_FROM_INT(icon_id), new_icon); return new_icon; } @@ -687,7 +687,7 @@ Icon *BKE_icon_get(const int icon_id) Icon *icon = NULL; - icon = BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(icon_id)); + icon = BLI_ghash_lookup(gIcons, POINTER_FROM_INT(icon_id)); if (!icon) { printf("%s: Internal error, no icon for icon ID: %d\n", __func__, icon_id); @@ -703,7 +703,7 @@ void BKE_icon_set(const int icon_id, struct Icon *icon) void **val_p; - if (BLI_ghash_ensure_p(gIcons, SET_INT_IN_POINTER(icon_id), &val_p)) { + if (BLI_ghash_ensure_p(gIcons, POINTER_FROM_INT(icon_id), &val_p)) { printf("%s: Internal error, icon already set: %d\n", __func__, icon_id); return; } @@ -732,7 +732,7 @@ void BKE_icon_id_delete(struct ID *id) } BKE_icons_deferred_free(); - BLI_ghash_remove(gIcons, SET_INT_IN_POINTER(icon_id), NULL, icon_free); + BLI_ghash_remove(gIcons, POINTER_FROM_INT(icon_id), NULL, icon_free); } /** @@ -745,7 +745,7 @@ bool BKE_icon_delete(const int icon_id) return false; } - Icon *icon = BLI_ghash_popkey(gIcons, SET_INT_IN_POINTER(icon_id), NULL); + Icon *icon = BLI_ghash_popkey(gIcons, POINTER_FROM_INT(icon_id), NULL); if (icon) { icon_free_data(icon_id, icon); icon_free(icon); @@ -763,10 +763,10 @@ bool BKE_icon_delete_unmanaged(const int icon_id) return false; } - Icon *icon = BLI_ghash_popkey(gIcons, SET_INT_IN_POINTER(icon_id), NULL); + Icon *icon = BLI_ghash_popkey(gIcons, POINTER_FROM_INT(icon_id), NULL); if (icon) { if (UNLIKELY(icon->flag & ICON_FLAG_MANAGED)) { - BLI_ghash_insert(gIcons, SET_INT_IN_POINTER(icon_id), icon); + BLI_ghash_insert(gIcons, POINTER_FROM_INT(icon_id), icon); return false; } else { |