diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-06-27 12:00:47 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-06-27 12:00:47 +0300 |
commit | e170d6be7fb3f7853fac6e8b2bf0142347a5dcf9 (patch) | |
tree | 9742b42055d7c1865334bb5d47902daba7175fa7 /source/blender | |
parent | ecb6a6df52a9f3852c9bec12e63b4ab8b06fe5f4 (diff) |
Cleanup: all params of BLI_str partition funcs can be const...
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_scene.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 10 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_string.h | 6 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_string_utf8.h | 6 | ||||
-rw-r--r-- | source/blender/blenlib/intern/string.c | 8 | ||||
-rw-r--r-- | source/blender/blenlib/intern/string_utf8.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_select.c | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/openexr/openexr_api.cpp | 8 | ||||
-rw-r--r-- | source/blender/render/intern/source/render_result.c | 4 |
11 files changed, 29 insertions, 29 deletions
diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index 442a43871c1..027bdbbbe58 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -160,7 +160,7 @@ void BKE_scene_multiview_filepath_get(struct SceneRenderView *srv, const void BKE_scene_multiview_view_filepath_get(const struct RenderData *rd, const char *filepath, const char *view, char *r_filepath); const char *BKE_scene_multiview_view_suffix_get(const struct RenderData *rd, const char *viewname); const char *BKE_scene_multiview_view_id_suffix_get(const struct RenderData *rd, const size_t view_id); -void BKE_scene_multiview_view_prefix_get(struct Scene *scene, const char *name, char *rprefix, char **rext); +void BKE_scene_multiview_view_prefix_get(struct Scene *scene, const char *name, char *rprefix, const char **rext); void BKE_scene_multiview_videos_dimensions_get(const struct RenderData *rd, const size_t width, const size_t height, size_t *r_width, size_t *r_height); size_t BKE_scene_multiview_num_videos_get(const struct RenderData *rd); diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 45ae390a5e9..d648db77186 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -4595,7 +4595,7 @@ static void image_update_views_format(Image *ima, ImageUser *iuser) /* R_IMF_VIEWS_INDIVIDUAL */ char prefix[FILE_MAX] = {'\0'}; char *name = ima->name; - char *ext = NULL; + const char *ext = NULL; BKE_scene_multiview_view_prefix_get(scene, name, prefix, &ext); diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 08135766392..28c94c889a2 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -2428,11 +2428,11 @@ const char *BKE_scene_multiview_view_id_suffix_get(const RenderData *rd, const s } } -void BKE_scene_multiview_view_prefix_get(Scene *scene, const char *name, char *rprefix, char **rext) +void BKE_scene_multiview_view_prefix_get(Scene *scene, const char *name, char *rprefix, const char **rext) { SceneRenderView *srv; size_t index_act; - char *suf_act; + const char *suf_act; const char delims[] = {'.', '\0'}; rprefix[0] = '\0'; diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 21ef9feae02..4ec5dd58973 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -854,7 +854,7 @@ void BKE_sequence_reload_new_file(Scene *scene, Sequence *seq, const bool lock_r if (is_multiview && (seq->views_format == R_IMF_VIEWS_INDIVIDUAL)) { char prefix[FILE_MAX]; - char *ext = NULL; + const char *ext = NULL; size_t totfiles = seq_num_files(scene, seq->views_format, true); int i = 0; @@ -1479,7 +1479,7 @@ static void seq_open_anim_file(Scene *scene, Sequence *seq, bool openfile) if (is_multiview && seq->views_format == R_IMF_VIEWS_INDIVIDUAL) { size_t totfiles = seq_num_files(scene, seq->views_format, true); char prefix[FILE_MAX]; - char *ext = NULL; + const char *ext = NULL; int i; BKE_scene_multiview_view_prefix_get(scene, name, prefix, &ext); @@ -1773,7 +1773,7 @@ static bool seq_proxy_multiview_context_invalid(Sequence *seq, Scene *scene, con if ((seq->type == SEQ_TYPE_IMAGE) && (seq->views_format == R_IMF_VIEWS_INDIVIDUAL)) { static char prefix[FILE_MAX]; - static char *ext = NULL; + static const char *ext = NULL; char str[FILE_MAX]; if (view_id == 0) { @@ -2739,7 +2739,7 @@ static ImBuf *seq_render_image_strip(const SeqRenderData *context, Sequence *seq size_t totviews; struct ImBuf **ibufs_arr; char prefix[FILE_MAX]; - char *ext = NULL; + const char *ext = NULL; int i; if (totfiles > 1) { @@ -5068,7 +5068,7 @@ Sequence *BKE_sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoad if (is_multiview && (seq_load->views_format == R_IMF_VIEWS_INDIVIDUAL)) { char prefix[FILE_MAX]; - char *ext = NULL; + const char *ext = NULL; size_t j = 0; BKE_scene_multiview_view_prefix_get(scene, path, prefix, &ext); diff --git a/source/blender/blenlib/BLI_string.h b/source/blender/blenlib/BLI_string.h index a94777d278b..c8491f4c8f1 100644 --- a/source/blender/blenlib/BLI_string.h +++ b/source/blender/blenlib/BLI_string.h @@ -90,10 +90,10 @@ int BLI_str_index_in_array(const char *__restrict str, const char **__restrict s bool BLI_str_endswith(const char *__restrict str, const char *__restrict end) ATTR_NONNULL(); bool BLI_strn_endswith(const char *__restrict str, const char *__restrict end, size_t length) ATTR_NONNULL(); -size_t BLI_str_partition(const char *str, const char delim[], char **sep, char **suf) ATTR_NONNULL(); -size_t BLI_str_rpartition(const char *str, const char delim[], char **sep, char **suf) ATTR_NONNULL(); +size_t BLI_str_partition(const char *str, const char delim[], const char **sep, const char **suf) ATTR_NONNULL(); +size_t BLI_str_rpartition(const char *str, const char delim[], const char **sep, const char **suf) ATTR_NONNULL(); size_t BLI_str_partition_ex( - const char *str, const char *end, const char delim[], char **sep, char **suf, const bool from_right) + const char *str, const char *end, const char delim[], const char **sep, const char **suf, const bool from_right) ATTR_NONNULL(1, 3, 4, 5); #ifdef __cplusplus diff --git a/source/blender/blenlib/BLI_string_utf8.h b/source/blender/blenlib/BLI_string_utf8.h index 18eff6737c8..0740b574c1a 100644 --- a/source/blender/blenlib/BLI_string_utf8.h +++ b/source/blender/blenlib/BLI_string_utf8.h @@ -67,10 +67,10 @@ int BLI_wcswidth(const wchar_t *pwcs, size_t n) ATTR_NONNULL(); int BLI_str_utf8_char_width(const char *p) ATTR_NONNULL(); /* warning, can return -1 on bad chars */ int BLI_str_utf8_char_width_safe(const char *p) ATTR_NONNULL(); -size_t BLI_str_partition_utf8(const char *str, const unsigned int delim[], char **sep, char **suf) ATTR_NONNULL(); -size_t BLI_str_rpartition_utf8(const char *str, const unsigned int delim[], char **sep, char **suf) ATTR_NONNULL(); +size_t BLI_str_partition_utf8(const char *str, const unsigned int delim[], const char **sep, const char **suf) ATTR_NONNULL(); +size_t BLI_str_rpartition_utf8(const char *str, const unsigned int delim[], const char **sep, const char **suf) ATTR_NONNULL(); size_t BLI_str_partition_ex_utf8( - const char *str, const char *end, const unsigned int delim[], char **sep, char **suf, const bool from_right) + const char *str, const char *end, const unsigned int delim[], const char **sep, const char **suf, const bool from_right) ATTR_NONNULL(1, 3, 4, 5); #define BLI_UTF8_MAX 6 /* mem */ diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c index 0dcb84c9c6e..3177bc659b2 100644 --- a/source/blender/blenlib/intern/string.c +++ b/source/blender/blenlib/intern/string.c @@ -854,7 +854,7 @@ bool BLI_str_endswith(const char *__restrict str, const char *end) * \param suf Return value, set to next char after the first delimiter found (or NULL if none found). * \return The length of the prefix (i.e. *sep - str). */ -size_t BLI_str_partition(const char *str, const char delim[], char **sep, char **suf) +size_t BLI_str_partition(const char *str, const char delim[], const char **sep, const char **suf) { return BLI_str_partition_ex(str, NULL, delim, sep, suf, false); } @@ -868,7 +868,7 @@ size_t BLI_str_partition(const char *str, const char delim[], char **sep, char * * \param suf Return value, set to next char after the first delimiter found (or NULL if none found). * \return The length of the prefix (i.e. *sep - str). */ -size_t BLI_str_rpartition(const char *str, const char delim[], char **sep, char **suf) +size_t BLI_str_rpartition(const char *str, const char delim[], const char **sep, const char **suf) { return BLI_str_partition_ex(str, NULL, delim, sep, suf, true); } @@ -885,7 +885,7 @@ size_t BLI_str_rpartition(const char *str, const char delim[], char **sep, char * \return The length of the prefix (i.e. *sep - str). */ size_t BLI_str_partition_ex( - const char *str, const char *end, const char delim[], char **sep, char **suf, const bool from_right) + const char *str, const char *end, const char delim[], const char **sep, const char **suf, const bool from_right) { const char *d; char *(*func)(const char *str, int c) = from_right ? strrchr : strchr; @@ -916,7 +916,7 @@ size_t BLI_str_partition_ex( } if (tmp && (from_right ? (*sep < tmp) : (!*sep || *sep > tmp))) { - *sep = (char *)tmp; + *sep = tmp; } } diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c index 85306ccbdd7..96033615cf5 100644 --- a/source/blender/blenlib/intern/string_utf8.c +++ b/source/blender/blenlib/intern/string_utf8.c @@ -734,18 +734,18 @@ char *BLI_str_prev_char_utf8(const char *p) } /* end glib copy */ -size_t BLI_str_partition_utf8(const char *str, const unsigned int delim[], char **sep, char **suf) +size_t BLI_str_partition_utf8(const char *str, const unsigned int delim[], const char **sep, const char **suf) { return BLI_str_partition_ex_utf8(str, NULL, delim, sep, suf, false); } -size_t BLI_str_rpartition_utf8(const char *str, const unsigned int delim[], char **sep, char **suf) +size_t BLI_str_rpartition_utf8(const char *str, const unsigned int delim[], const char **sep, const char **suf) { return BLI_str_partition_ex_utf8(str, NULL, delim, sep, suf, true); } size_t BLI_str_partition_ex_utf8( - const char *str, const char *end, const unsigned int delim[], char **sep, char **suf, const bool from_right) + const char *str, const char *end, const unsigned int delim[], const char **sep, const char **suf, const bool from_right) { const unsigned int *d; const size_t str_len = end ? (size_t)(end - str) : strlen(str); diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c index cd03f309fa9..78302fedd97 100644 --- a/source/blender/editors/space_node/node_select.c +++ b/source/blender/editors/space_node/node_select.c @@ -249,7 +249,7 @@ static bool node_select_grouped_name(SpaceNode *snode, bNode *node_act, const bo bool changed = false; const unsigned int delims[] = {'.', '-', '_', '\0'}; size_t pref_len_act, pref_len_curr; - char *sep, *suf_act, *suf_curr; + const char *sep, *suf_act, *suf_curr; pref_len_act = BLI_str_partition_ex_utf8(node_act->name, NULL, delims, &sep, &suf_act, from_right); diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index eb25ca811f2..44b7fbf6315 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -770,8 +770,8 @@ static const char *imb_exr_insert_view_name(const char *passname, const char *vi static char retstr[EXR_PASS_MAXNAME]; const char delims[] = {'.', '\0'}; - char *sep; - char *token; + const char *sep; + const char *token; size_t len; len = BLI_str_rpartition(passname, delims, &sep, &token); @@ -1419,9 +1419,9 @@ void IMB_exr_close(void *handle) static int imb_exr_split_token(const char *str, const char *end, const char **token) { const char delims[] = {'.', '\0'}; - char *sep; + const char *sep; - BLI_str_partition_ex(str, end, delims, &sep, (char **)token, true); + BLI_str_partition_ex(str, end, delims, &sep, token, true); if (!sep) { *token = str; diff --git a/source/blender/render/intern/source/render_result.c b/source/blender/render/intern/source/render_result.c index 117d28d2e50..19beec9a6fe 100644 --- a/source/blender/render/intern/source/render_result.c +++ b/source/blender/render/intern/source/render_result.c @@ -460,8 +460,8 @@ static int passtype_from_name(const char *str) static void set_pass_name(char *passname, int passtype, int channel, const char *view) { const char delims[] = {'.', '\0'}; - char *sep; - char *token; + const char *sep; + const char *token; size_t len; const char *passtype_name = name_from_passtype(passtype, channel); |