diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-01-31 17:51:53 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-01-31 19:01:00 +0400 |
commit | 34a05325842eb6a0d87904399a41336b04f701d0 (patch) | |
tree | 9e3f27c6a249db0776c4a328306c734bfcfb5b59 | |
parent | eeefbbcc78ff308c06b32b5887be0faca781c3c6 (diff) |
Code cleanup: comments and warnings
-rw-r--r-- | source/blender/blenkernel/BKE_customdata.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_dynamicpaint.h | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/dynamicpaint.c | 4 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_path_util.h | 18 | ||||
-rw-r--r-- | source/blender/blenloader/BLO_readfile.h | 73 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 7 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 2 |
8 files changed, 57 insertions, 55 deletions
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h index f28d16427cf..12a6be3e328 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 62715c20500..579da194798 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 5938dbec3c1..b0968377ece 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 2a4efd196b6..efc5731c7cf 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 b39f247ccd3..4fb983c119b 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. */ -struct ID *BLO_library_append_named_part(struct Main *mainl, BlendHandle **bh, const char *idname, const int idcode); +struct ID *BLO_library_append_named_part( + struct Main *mainl, BlendHandle **bh, + const char *idname, const int idcode); /** * Link/Append a named datablock from an external blend file. @@ -237,7 +243,9 @@ struct ID *BLO_library_append_named_part(struct Main *mainl, BlendHandle **bh, c * \param flag Options for linking, used for instancing. * \return the appended ID when found. */ -struct ID *BLO_library_append_named_part_ex(const struct bContext *C, struct Main *mainl, BlendHandle **bh, const char *idname, const int idcode, const short flag); +struct ID *BLO_library_append_named_part_ex( + const struct bContext *C, struct Main *mainl, BlendHandle **bh, + const char *idname, const int idcode, const short flag); void BLO_library_append_end(const struct bContext *C, struct Main *mainl, BlendHandle **bh, int idcode, short flag); @@ -246,7 +254,7 @@ void BLO_library_append_all(struct Main *mainl, BlendHandle *bh); void *BLO_library_read_struct(struct FileData *fd, struct BHead *bh, const char *blockname); BlendFileData *blo_read_blendafterruntime(int file, const char *name, int actualsize, struct ReportList *reports); - + /* internal function but we need to expose it */ void blo_lib_link_screen_restore(struct Main *newmain, struct bScreen *curscreen, struct Scene *curscene); @@ -274,5 +282,4 @@ void BLO_update_defaults_startup_blend(struct Main *mainvar); } #endif -#endif - +#endif /* __BLO_READFILE_H__ */ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 2a1ca226d31..3e10d7440bb 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1192,7 +1192,7 @@ bool BLO_is_a_library(const char *path, char *dir, char *group) /* now we know that we are in a blend file and it is safe to * assume that gp actually points to a group */ if (strcmp("Screen", gp) != 0) - BLI_strncpy(group, gp, GROUP_MAX); + BLI_strncpy(group, gp, BLO_GROUP_MAX); } return 1; } diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 9e674b34d36..79b6a13b459 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -81,9 +81,6 @@ #include "filelist.h" -/* max length of library group name within filesel */ -#define GROUP_MAX 32 - struct FileList; typedef struct FileImage { @@ -344,7 +341,7 @@ static bool is_filtered_file(struct direntry *file, const char *UNUSED(dir), uns static bool is_filtered_lib(struct direntry *file, const char *dir, unsigned int filter, short hide_dot) { bool is_filtered = false; - char tdir[FILE_MAX], tgroup[GROUP_MAX]; + char tdir[FILE_MAX], tgroup[BLO_GROUP_MAX]; if (BLO_is_a_library(dir, tdir, tgroup)) { is_filtered = !is_hidden_file(file->relname, hide_dot); } @@ -1055,7 +1052,7 @@ void filelist_from_library(struct FileList *filelist) struct ImBuf *ima; int ok, i, nprevs, nnames, idcode; char filename[FILE_MAX]; - char dir[FILE_MAX], group[GROUP_MAX]; + char dir[FILE_MAX], group[BLO_GROUP_MAX]; /* name test */ ok = filelist_islibrary(filelist, dir, group); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 6f82361d64e..af01cf10708 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -2400,7 +2400,7 @@ static int wm_link_append_exec(bContext *C, wmOperator *op) Main *mainl = NULL; BlendHandle *bh; PropertyRNA *prop; - char name[FILE_MAX], dir[FILE_MAX], libname[FILE_MAX], group[GROUP_MAX]; + char name[FILE_MAX], dir[FILE_MAX], libname[FILE_MAX], group[BLO_GROUP_MAX]; int idcode, totfiles = 0; short flag; |