Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-02-13 13:52:18 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-13 13:52:18 +0300
commit0955c664aa7c5fc5f0bd345c58219c40f04ab9c1 (patch)
tree20b6a2ab2e1130d75d119eba09f3b195a33a9434 /source/blender/blenkernel/intern/icons.c
parentf3bd89b1b7a86778ff4c633a6b4115309a1b3c7e (diff)
fix for warnings from Sparse static source code checker, mostly BKE/BLI and python functions.
- use NULL rather then 0 where possible (makes code & function calls more readable IMHO). - set static variables and functions (exposed some unused vars/funcs). - use func(void) rather then func() for definitions.
Diffstat (limited to 'source/blender/blenkernel/intern/icons.c')
-rw-r--r--source/blender/blenkernel/intern/icons.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c
index 1df272fad30..b575305171a 100644
--- a/source/blender/blenkernel/intern/icons.c
+++ b/source/blender/blenkernel/intern/icons.c
@@ -106,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;
@@ -219,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;
@@ -242,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;
@@ -263,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);
@@ -273,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;
@@ -287,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));
@@ -305,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;
}