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:
authorBastien Montagne <montagne29@wanadoo.fr>2015-06-27 12:00:47 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-06-27 12:00:47 +0300
commite170d6be7fb3f7853fac6e8b2bf0142347a5dcf9 (patch)
tree9742b42055d7c1865334bb5d47902daba7175fa7
parentecb6a6df52a9f3852c9bec12e63b4ab8b06fe5f4 (diff)
Cleanup: all params of BLI_str partition funcs can be const...
-rw-r--r--source/blender/blenkernel/BKE_scene.h2
-rw-r--r--source/blender/blenkernel/intern/image.c2
-rw-r--r--source/blender/blenkernel/intern/scene.c4
-rw-r--r--source/blender/blenkernel/intern/sequencer.c10
-rw-r--r--source/blender/blenlib/BLI_string.h6
-rw-r--r--source/blender/blenlib/BLI_string_utf8.h6
-rw-r--r--source/blender/blenlib/intern/string.c8
-rw-r--r--source/blender/blenlib/intern/string_utf8.c6
-rw-r--r--source/blender/editors/space_node/node_select.c2
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.cpp8
-rw-r--r--source/blender/render/intern/source/render_result.c4
-rw-r--r--tests/gtests/blenlib/BLI_string_test.cc12
12 files changed, 35 insertions, 35 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);
diff --git a/tests/gtests/blenlib/BLI_string_test.cc b/tests/gtests/blenlib/BLI_string_test.cc
index b99c67a9823..fa10e21730b 100644
--- a/tests/gtests/blenlib/BLI_string_test.cc
+++ b/tests/gtests/blenlib/BLI_string_test.cc
@@ -36,7 +36,7 @@ int mk_wcswidth(const wchar_t *pwcs, size_t n)
TEST(string, StrPartition)
{
const char delim[] = {'-', '.', '_', '~', '\\', '\0'};
- char *sep, *suf;
+ const char *sep, *suf;
size_t pre_ln;
{
@@ -95,7 +95,7 @@ TEST(string, StrPartition)
TEST(string, StrRPartition)
{
const char delim[] = {'-', '.', '_', '~', '\\', '\0'};
- char *sep, *suf;
+ const char *sep, *suf;
size_t pre_ln;
{
@@ -154,7 +154,7 @@ TEST(string, StrRPartition)
TEST(string, StrPartitionEx)
{
const char delim[] = {'-', '.', '_', '~', '\\', '\0'};
- char *sep, *suf;
+ const char *sep, *suf;
size_t pre_ln;
/* Only considering 'from_right' cases here. */
@@ -185,7 +185,7 @@ TEST(string, StrPartitionEx)
TEST(string, StrPartitionUtf8)
{
const unsigned int delim[] = {'-', '.', '_', 0x00F1 /* n tilde */, 0x262F /* ying-yang */, '\0'};
- char *sep, *suf;
+ const char *sep, *suf;
size_t pre_ln;
{
@@ -244,7 +244,7 @@ TEST(string, StrPartitionUtf8)
TEST(string, StrRPartitionUtf8)
{
const unsigned int delim[] = {'-', '.', '_', 0x00F1 /* n tilde */, 0x262F /* ying-yang */, '\0'};
- char *sep, *suf;
+ const char *sep, *suf;
size_t pre_ln;
{
@@ -303,7 +303,7 @@ TEST(string, StrRPartitionUtf8)
TEST(string, StrPartitionExUtf8)
{
const unsigned int delim[] = {'-', '.', '_', 0x00F1 /* n tilde */, 0x262F /* ying-yang */, '\0'};
- char *sep, *suf;
+ const char *sep, *suf;
size_t pre_ln;
/* Only considering 'from_right' cases here. */