diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-03-22 09:34:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-03-22 09:34:10 +0400 |
commit | a79e10157dc7a1c8a102bf88f236d325ecdd8d80 (patch) | |
tree | 2026c37ec8c7da9094bbb20d3aedcdd82d565765 /source/blender/blenkernel/intern | |
parent | dd0e2da7847d31cbaf02c665e2c55b5e8c384ed4 (diff) |
code cleanup: use NULL rather then 0 for pointers, and make vars static where possible.
also found unintentionally defined enum/struct variables that where only meant to be defining the type.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/bpath.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/writeavi.c | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/bpath.c b/source/blender/blenkernel/intern/bpath.c index b0021050e8f..da8b97976f3 100644 --- a/source/blender/blenkernel/intern/bpath.c +++ b/source/blender/blenkernel/intern/bpath.c @@ -671,14 +671,14 @@ int BKE_bpath_relocate_visitor(void *pathbase_v, char *path_dst, const char *pat struct PathStore { struct PathStore *next, *prev; -} PathStore; +}; static int bpath_list_append(void *userdata, char *UNUSED(path_dst), const char *path_src) { /* store the path and string in a single alloc */ ListBase *ls = userdata; size_t path_size = strlen(path_src) + 1; - struct PathStore *path_store = MEM_mallocN(sizeof(PathStore) + path_size, __func__); + struct PathStore *path_store = MEM_mallocN(sizeof(struct PathStore) + path_size, __func__); char *filepath = (char *)(path_store + 1); memcpy(filepath, path_src, path_size); diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 4e79c086d4d..26651d76f68 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1819,7 +1819,7 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec } /* cleanup the buffer. */ - BLF_buffer(mono, NULL, NULL, 0, 0, 0, FALSE); + BLF_buffer(mono, NULL, NULL, 0, 0, 0, NULL); #undef BUFF_MARGIN_X #undef BUFF_MARGIN_Y @@ -3379,7 +3379,7 @@ void BKE_image_get_aspect(Image *image, float *aspx, float *aspy) unsigned char *BKE_image_get_pixels_for_frame(struct Image *image, int frame) { - ImageUser iuser = {0}; + ImageUser iuser = {NULL}; void *lock; ImBuf *ibuf; unsigned char *pixels = NULL; @@ -3406,7 +3406,7 @@ unsigned char *BKE_image_get_pixels_for_frame(struct Image *image, int frame) float *BKE_image_get_float_pixels_for_frame(struct Image *image, int frame) { - ImageUser iuser = {0}; + ImageUser iuser = {NULL}; void *lock; ImBuf *ibuf; float *pixels = NULL; diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 559a1cb7136..4151120b12f 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -2445,7 +2445,7 @@ typedef struct bNodeClipboard { int type; } bNodeClipboard; -bNodeClipboard node_clipboard = {{0}}; +static bNodeClipboard node_clipboard = {{NULL}}; void BKE_node_clipboard_init(struct bNodeTree *ntree) { diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c index d4428be3faf..ff6212f6b09 100644 --- a/source/blender/blenkernel/intern/writeavi.c +++ b/source/blender/blenkernel/intern/writeavi.c @@ -73,7 +73,7 @@ static void filepath_avi(char *string, RenderData *rd); bMovieHandle *BKE_movie_handle_get(const char imtype) { - static bMovieHandle mh = {0}; + static bMovieHandle mh = {NULL}; /* set the default handle, as builtin */ #ifdef WITH_AVI |