[Bf-blender-cvs] [34a0532] master: Code cleanup: comments and warnings

Campbell Barton noreply at git.blender.org
Fri Jan 31 16:04:01 CET 2014


Commit: 34a05325842eb6a0d87904399a41336b04f701d0
Author: Campbell Barton
Date:   Sat Feb 1 00:51:53 2014 +1100
https://developer.blender.org/rB34a05325842eb6a0d87904399a41336b04f701d0

Code cleanup: comments and warnings

===================================================================

M	source/blender/blenkernel/BKE_customdata.h
M	source/blender/blenkernel/BKE_dynamicpaint.h
M	source/blender/blenkernel/intern/dynamicpaint.c
M	source/blender/blenlib/BLI_path_util.h
M	source/blender/blenloader/BLO_readfile.h
M	source/blender/blenloader/intern/readfile.c
M	source/blender/editors/space_file/filelist.c
M	source/blender/windowmanager/intern/wm_operators.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h
index f28d164..12a6be3 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -216,8 +216,6 @@ void CustomData_free_elem(struct CustomData *data, int index, int count);
  *     should be source->subElems * source->subElems in size)
  * count gives the number of source elements to interpolate from
  * dest_index gives the dest element to write the interpolated value to
- *
- * returns 1 on success, 0 on failure
  */
 void CustomData_interp(const struct CustomData *source, struct CustomData *dest,
                        int *src_indices, float *weights, float *sub_weights,
diff --git a/source/blender/blenkernel/BKE_dynamicpaint.h b/source/blender/blenkernel/BKE_dynamicpaint.h
index 62715c2..579da19 100644
--- a/source/blender/blenkernel/BKE_dynamicpaint.h
+++ b/source/blender/blenkernel/BKE_dynamicpaint.h
@@ -78,8 +78,8 @@ void dynamicPaint_freeBrush(struct DynamicPaintModifierData *pmd);
 void dynamicPaint_freeSurfaceData(struct DynamicPaintSurface *surface);
 
 void dynamicPaint_cacheUpdateFrames(struct DynamicPaintSurface *surface);
-int  dynamicPaint_surfaceHasColorPreview(struct DynamicPaintSurface *surface);
-int dynamicPaint_outputLayerExists(struct DynamicPaintSurface *surface, struct Object *ob, int output);
+bool  dynamicPaint_surfaceHasColorPreview(struct DynamicPaintSurface *surface);
+bool dynamicPaint_outputLayerExists(struct DynamicPaintSurface *surface, struct Object *ob, int output);
 void dynamicPaintSurface_updateType(struct DynamicPaintSurface *surface);
 void dynamicPaintSurface_setUniqueName(struct DynamicPaintSurface *surface, const char *basename);
 void dynamicPaint_resetPreview(struct DynamicPaintCanvasSettings *canvas);
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index 5938dbe..b096837 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -259,7 +259,7 @@ static int dynamicPaint_surfaceNumOfPoints(DynamicPaintSurface *surface)
 }
 
 /* checks whether surface's format/type has realtime preview */
-int dynamicPaint_surfaceHasColorPreview(DynamicPaintSurface *surface)
+bool dynamicPaint_surfaceHasColorPreview(DynamicPaintSurface *surface)
 {
 	if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ) {
 		return 0;
@@ -321,7 +321,7 @@ static void dynamicPaint_setPreview(DynamicPaintSurface *t_surface)
 	}
 }
 
-int dynamicPaint_outputLayerExists(struct DynamicPaintSurface *surface, Object *ob, int output)
+bool dynamicPaint_outputLayerExists(struct DynamicPaintSurface *surface, Object *ob, int output)
 {
 	char *name;
 
diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h
index 2a4efd1..efc5731 100644
--- a/source/blender/blenlib/BLI_path_util.h
+++ b/source/blender/blenlib/BLI_path_util.h
@@ -117,7 +117,7 @@ bool BLI_testextensie_array(const char *str, const char **ext_array) ATTR_NONNUL
 bool BLI_testextensie_glob(const char *str, const char *ext_fnmatch) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
 bool BLI_replace_extension(char *path, size_t maxlen, const char *ext) ATTR_NONNULL();
 bool BLI_ensure_extension(char *path, size_t maxlen, const char *ext) ATTR_NONNULL();
-bool BLI_ensure_filename(char *filepath, size_t maxlen, const char *filename) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
+bool BLI_ensure_filename(char *filepath, size_t maxlen, const char *filename) ATTR_NONNULL();
 void BLI_uniquename(struct ListBase *list, void *vlink, const char *defname, char delim, int name_offs, int len);
 bool BLI_uniquename_cb(bool (*unique_check)(void *arg, const char *name),
                        void *arg, const char *defname, char delim, char *name, int name_len);
@@ -157,14 +157,14 @@ bool BLI_parent_dir(char *path) ATTR_NONNULL();
  * \a framenum The framenumber to replace the frame code with.
  * \retval Returns true if the path was relative (started with "//").
  */
-bool BLI_path_abs(char *path, const char *basepath);
-bool BLI_path_frame(char *path, int frame, int digits);
-bool BLI_path_frame_range(char *path, int sta, int end, int digits);
-bool BLI_path_frame_check_chars(const char *path);
-bool BLI_path_cwd(char *path);
-void BLI_path_rel(char *file, const char *relfile);
-
-bool BLI_path_is_rel(const char *path);
+bool BLI_path_abs(char *path, const char *basepath)  ATTR_NONNULL();
+bool BLI_path_frame(char *path, int frame, int digits) ATTR_NONNULL();
+bool BLI_path_frame_range(char *path, int sta, int end, int digits) ATTR_NONNULL();
+bool BLI_path_frame_check_chars(const char *path) ATTR_NONNULL();
+bool BLI_path_cwd(char *path) ATTR_NONNULL();
+void BLI_path_rel(char *file, const char *relfile) ATTR_NONNULL();
+
+bool BLI_path_is_rel(const char *path) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
 
 /* path string comparisons: case-insensitive for Windows, case-sensitive otherwise */
 #if defined(WIN32)
diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h
index b39f247..4fb983c 100644
--- a/source/blender/blenloader/BLO_readfile.h
+++ b/source/blender/blenloader/BLO_readfile.h
@@ -83,7 +83,9 @@ typedef struct BlendFileData {
  * indicating the cause of the failure.
  * \return The data of the file.
  */
-BlendFileData *BLO_read_from_file(const char *filepath, struct ReportList *reports);
+BlendFileData *BLO_read_from_file(
+        const char *filepath,
+        struct ReportList *reports);
 
 /**
  * Open a blender file from memory. The function
@@ -96,34 +98,38 @@ BlendFileData *BLO_read_from_file(const char *filepath, struct ReportList *repor
  * indicating the cause of the failure.
  * \return The data of the file.
  */
-BlendFileData *BLO_read_from_memory(const void *mem, int memsize, struct ReportList *reports);
+BlendFileData *BLO_read_from_memory(
+        const void *mem, int memsize,
+        struct ReportList *reports);
 
 /**
  * oldmain is old main, from which we will keep libraries, images, ..
  * file name is current file, only for retrieving library data */
 
-BlendFileData *BLO_read_from_memfile(struct Main *oldmain, const char *filename, struct MemFile *memfile, struct ReportList *reports);
+BlendFileData *BLO_read_from_memfile(
+        struct Main *oldmain, const char *filename, struct MemFile *memfile,
+        struct ReportList *reports);
 
 /**
  * Free's a BlendFileData structure and _all_ the
  * data associated with it (the userdef data, and
  * the main libblock data).
- * 
+ *
  * \param bfd The structure to free.
  */
 void
 BLO_blendfiledata_free(BlendFileData *bfd);
-	
+
 /**
  * Open a blendhandle from a file path.
- * 
+ *
  * \param file The file path to open.
  * \param reports Report errors in opening the file (can be NULL).
  * \return A handle on success, or NULL on failure.
  */
-BlendHandle *
-BLO_blendhandle_from_file(const char *filepath,
-                          struct ReportList *reports);
+BlendHandle *BLO_blendhandle_from_file(
+        const char *filepath,
+        struct ReportList *reports);
 
 /**
  * Open a blendhandle from memory.
@@ -133,53 +139,49 @@ BLO_blendhandle_from_file(const char *filepath,
  * \return A handle on success, or NULL on failure.
  */
 
-BlendHandle *
-BLO_blendhandle_from_memory(const void *mem,
-                            int memsize);
+BlendHandle *BLO_blendhandle_from_memory(
+        const void *mem, int memsize);
 
 /**
  * Gets the names of all the datablocks in a file
  * of a certain type (ie. All the scene names in
  * a file).
- * 
+ *
  * \param bh The blendhandle to access.
  * \param ofblocktype The type of names to get.
  * \param tot_names The length of the returned list.
  * \return A BLI_linklist of strings. The string links
  * should be freed with malloc.
  */
-struct LinkNode *
-BLO_blendhandle_get_datablock_names(BlendHandle *bh,
-                                    int ofblocktype,
-                                    int *tot_names);
+struct LinkNode *BLO_blendhandle_get_datablock_names(
+        BlendHandle *bh,
+        int ofblocktype, int *tot_names);
 
 /**
  * Gets the previews of all the datablocks in a file
  * of a certain type (ie. All the scene names in
  * a file).
- * 
+ *
  * \param bh The blendhandle to access.
  * \param ofblocktype The type of names to get.
  * \param tot_prev The length of the returned list.
  * \return A BLI_linklist of PreviewImage. The PreviewImage links
  * should be freed with malloc.
  */
-struct LinkNode *
-BLO_blendhandle_get_previews(BlendHandle *bh,
-                             int ofblocktype,
-                             int *tot_prev);
+struct LinkNode *BLO_blendhandle_get_previews(
+        BlendHandle *bh,
+        int ofblocktype, int *tot_prev);
 
 /**
  * Gets the names of all the datablock groups in a
  * file. (ie. file contains Scene, Mesh, and Lamp
  * datablocks).
- * 
+ *
  * \param bh The blendhandle to access.
  * \return A BLI_linklist of strings. The string links
  * should be freed with malloc.
  */
-struct LinkNode *
-BLO_blendhandle_get_linkable_groups(BlendHandle *bh);
+struct LinkNode *BLO_blendhandle_get_linkable_groups(BlendHandle *bh);
 
 /**
  * Close and free a blendhandle. The handle
@@ -189,10 +191,10 @@ BLO_blendhandle_get_linkable_groups(BlendHandle *bh);
  */
 void
 BLO_blendhandle_close(BlendHandle *bh);
-	
+
 /***/
 
-#define GROUP_MAX 32
+#define BLO_GROUP_MAX 32
 
 bool BLO_has_bfile_extension(const char *str);
 
@@ -211,7 +213,9 @@ bool BLO_is_a_library(const char *path, char *dir, char *group);
  * \param filepath Used for relative linking, copied to the lib->name
  * \return the library Main, to be passed to BLO_library_append_named_part as mainl.
  */
-struct Main *BLO_library_append_begin(struct Main *mainvar, BlendHandle **bh, const char *filepath);
+struct Main *BLO_library_append_begin(
+        struct Main *mainvar, BlendHandle **bh,
+        const char *filepath);
 
 
 /**
@@ -223,7 +227,9 @@ struct Main *BLO_library_append_begin(struct Main *mainvar, BlendHandle **bh, co
  * \param idcode The kind of datablock to link.
  * \return the appended ID when found.
  */
-stru

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list