diff options
Diffstat (limited to 'source/blender/blenkernel/intern/icons.c')
-rw-r--r-- | source/blender/blenkernel/intern/icons.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c index 78306705d6b..8ce3847bf08 100644 --- a/source/blender/blenkernel/intern/icons.c +++ b/source/blender/blenkernel/intern/icons.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -40,6 +40,7 @@ #include "DNA_world_types.h" #include "DNA_brush_types.h" +#include "BLI_utildefines.h" #include "BLI_ghash.h" #include "BKE_icons.h" @@ -76,7 +77,7 @@ static void icon_free(void *val) /* create an id for a new icon and make sure that ids from deleted icons get reused after the integer number range is used up */ -static int get_next_free_id() +static int get_next_free_id(void) { int startId = gFirstIconId; @@ -105,14 +106,14 @@ void BKE_icons_init(int first_dyn_id) gIcons = BLI_ghash_new(BLI_ghashutil_inthash, BLI_ghashutil_intcmp, "icons_init gh"); } -void BKE_icons_free() +void BKE_icons_free(void) { if(gIcons) - BLI_ghash_free(gIcons, 0, icon_free); + BLI_ghash_free(gIcons, NULL, icon_free); gIcons = NULL; } -struct PreviewImage* BKE_previewimg_create() +struct PreviewImage* BKE_previewimg_create(void) { PreviewImage* prv_img = NULL; int i; @@ -218,7 +219,7 @@ PreviewImage* BKE_previewimg_get(ID *id) void BKE_icon_changed(int id) { - Icon* icon = 0; + Icon* icon = NULL; if (!id || G.background) return; @@ -241,7 +242,7 @@ void BKE_icon_changed(int id) int BKE_icon_getid(struct ID* id) { - Icon* new_icon = 0; + Icon* new_icon = NULL; if (!id || G.background) return 0; @@ -262,8 +263,8 @@ int BKE_icon_getid(struct ID* id) new_icon->type = GS(id->name); /* next two lines make sure image gets created */ - new_icon->drawinfo = 0; - new_icon->drawinfo_free = 0; + new_icon->drawinfo = NULL; + new_icon->drawinfo_free = NULL; BLI_ghash_insert(gIcons, SET_INT_IN_POINTER(id->icon_id), new_icon); @@ -272,13 +273,13 @@ int BKE_icon_getid(struct ID* id) Icon* BKE_icon_get(int icon_id) { - Icon* icon = 0; + Icon* icon = NULL; icon = BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(icon_id)); if (!icon) { printf("BKE_icon_get: Internal error, no icon for icon ID: %d\n", icon_id); - return 0; + return NULL; } return icon; @@ -286,7 +287,7 @@ Icon* BKE_icon_get(int icon_id) void BKE_icon_set(int icon_id, struct Icon* icon) { - Icon* old_icon = 0; + Icon* old_icon = NULL; old_icon = BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(icon_id)); @@ -304,6 +305,6 @@ void BKE_icon_delete(struct ID* id) if (!id->icon_id) return; /* no icon defined for library object */ - BLI_ghash_remove(gIcons, SET_INT_IN_POINTER(id->icon_id), 0, icon_free); + BLI_ghash_remove(gIcons, SET_INT_IN_POINTER(id->icon_id), NULL, icon_free); id->icon_id = 0; } |