Cleanup: redundant use of string formatting functions
authorCampbell Barton <ideasman42@gmail.com>
Sun, 24 Mar 2019 05:09:46 +0000 (16:09 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 24 Mar 2019 05:09:46 +0000 (16:09 +1100)
29 files changed:
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/collection.c
source/blender/blenkernel/intern/mesh_runtime.c
source/blender/blenkernel/intern/tracking.c
source/blender/blenloader/intern/blend_validate.c
source/blender/draw/engines/eevee/eevee_materials.c
source/blender/draw/engines/eevee/eevee_screen_raytrace.c
source/blender/draw/engines/workbench/workbench_materials.c
source/blender/draw/intern/draw_cache_impl_particles.c
source/blender/draw/intern/draw_manager_profiling.c
source/blender/editors/object/object_add.c
source/blender/editors/transform/transform.c
source/blender/gpu/intern/gpu_codegen.c
source/blender/gpu/intern/gpu_texture.c
source/blender/gpu/intern/gpu_uniformbuffer.c
source/blender/makesrna/intern/rna_boid.c
source/blender/makesrna/intern/rna_color.c
source/blender/makesrna/intern/rna_constraint.c
source/blender/makesrna/intern/rna_gpencil.c
source/blender/makesrna/intern/rna_material.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_object_api.c
source/blender/makesrna/intern/rna_object_force.c
source/blender/makesrna/intern/rna_particle.c
source/blender/makesrna/intern/rna_rigidbody.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_tracking.c
source/blender/makesrna/intern/rna_wm_gizmo.c

index 86ec491..28b87d0 100644 (file)
@@ -2833,7 +2833,7 @@ char *DM_debug_info(DerivedMesh *dm)
        char *ret;
        const char *tstr;
 
-       BLI_dynstr_appendf(dynstr, "{\n");
+       BLI_dynstr_append(dynstr, "{\n");
        BLI_dynstr_appendf(dynstr, "    'ptr': '%p',\n", (void *)dm);
        switch (dm->type) {
                case DM_TYPE_CDDM:     tstr = "DM_TYPE_CDDM";     break;
@@ -2847,27 +2847,27 @@ char *DM_debug_info(DerivedMesh *dm)
        BLI_dynstr_appendf(dynstr, "    'numPolyData': %d,\n", dm->numPolyData);
        BLI_dynstr_appendf(dynstr, "    'deformedOnly': %d,\n", dm->deformedOnly);
 
-       BLI_dynstr_appendf(dynstr, "    'vertexLayers': (\n");
+       BLI_dynstr_append(dynstr, "    'vertexLayers': (\n");
        dm_debug_info_layers(dynstr, dm, &dm->vertData, dm->getVertDataArray);
-       BLI_dynstr_appendf(dynstr, "    ),\n");
+       BLI_dynstr_append(dynstr, "    ),\n");
 
-       BLI_dynstr_appendf(dynstr, "    'edgeLayers': (\n");
+       BLI_dynstr_append(dynstr, "    'edgeLayers': (\n");
        dm_debug_info_layers(dynstr, dm, &dm->edgeData, dm->getEdgeDataArray);
-       BLI_dynstr_appendf(dynstr, "    ),\n");
+       BLI_dynstr_append(dynstr, "    ),\n");
 
-       BLI_dynstr_appendf(dynstr, "    'loopLayers': (\n");
+       BLI_dynstr_append(dynstr, "    'loopLayers': (\n");
        dm_debug_info_layers(dynstr, dm, &dm->loopData, dm->getLoopDataArray);
-       BLI_dynstr_appendf(dynstr, "    ),\n");
+       BLI_dynstr_append(dynstr, "    ),\n");
 
-       BLI_dynstr_appendf(dynstr, "    'polyLayers': (\n");
+       BLI_dynstr_append(dynstr, "    'polyLayers': (\n");
        dm_debug_info_layers(dynstr, dm, &dm->polyData, dm->getPolyDataArray);
-       BLI_dynstr_appendf(dynstr, "    ),\n");
+       BLI_dynstr_append(dynstr, "    ),\n");
 
-       BLI_dynstr_appendf(dynstr, "    'tessFaceLayers': (\n");
+       BLI_dynstr_append(dynstr, "    'tessFaceLayers': (\n");
        dm_debug_info_layers(dynstr, dm, &dm->faceData, dm->getTessFaceDataArray);
-       BLI_dynstr_appendf(dynstr, "    ),\n");
+       BLI_dynstr_append(dynstr, "    ),\n");
 
-       BLI_dynstr_appendf(dynstr, "}\n");
+       BLI_dynstr_append(dynstr, "}\n");
 
        ret = BLI_dynstr_get_cstring(dynstr);
        BLI_dynstr_free(dynstr);
index 29d9d10..336a473 100644 (file)
@@ -360,7 +360,7 @@ void BKE_collection_new_name_get(Collection *collection_parent, char *rname)
        char *name;
 
        if (!collection_parent) {
-               name = BLI_sprintfN("Collection");
+               name = BLI_strdup("Collection");
        }
        else if (collection_parent->flag & COLLECTION_IS_MASTER) {
                name = BLI_sprintfN("Collection %d", BLI_listbase_count(&collection_parent->children) + 1);
index 2f845e3..f7c16b7 100644 (file)
@@ -274,7 +274,7 @@ char *BKE_mesh_runtime_debug_info(Mesh *me_eval)
        DynStr *dynstr = BLI_dynstr_new();
        char *ret;
 
-       BLI_dynstr_appendf(dynstr, "{\n");
+       BLI_dynstr_append(dynstr, "{\n");
        BLI_dynstr_appendf(dynstr, "    'ptr': '%p',\n", (void *)me_eval);
 #if 0
        const char *tstr;
@@ -291,27 +291,27 @@ char *BKE_mesh_runtime_debug_info(Mesh *me_eval)
        BLI_dynstr_appendf(dynstr, "    'totpoly': %d,\n", me_eval->totpoly);
        BLI_dynstr_appendf(dynstr, "    'deformed_only': %d,\n", me_eval->runtime.deformed_only);
 
-       BLI_dynstr_appendf(dynstr, "    'vertexLayers': (\n");
+       BLI_dynstr_append(dynstr, "    'vertexLayers': (\n");
        mesh_runtime_debug_info_layers(dynstr, &me_eval->vdata);
-       BLI_dynstr_appendf(dynstr, "    ),\n");
+       BLI_dynstr_append(dynstr, "    ),\n");
 
-       BLI_dynstr_appendf(dynstr, "    'edgeLayers': (\n");
+       BLI_dynstr_append(dynstr, "    'edgeLayers': (\n");
        mesh_runtime_debug_info_layers(dynstr, &me_eval->edata);
-       BLI_dynstr_appendf(dynstr, "    ),\n");
+       BLI_dynstr_append(dynstr, "    ),\n");
 
-       BLI_dynstr_appendf(dynstr, "    'loopLayers': (\n");
+       BLI_dynstr_append(dynstr, "    'loopLayers': (\n");
        mesh_runtime_debug_info_layers(dynstr, &me_eval->ldata);
-       BLI_dynstr_appendf(dynstr, "    ),\n");
+       BLI_dynstr_append(dynstr, "    ),\n");
 
-       BLI_dynstr_appendf(dynstr, "    'polyLayers': (\n");
+       BLI_dynstr_append(dynstr, "    'polyLayers': (\n");
        mesh_runtime_debug_info_layers(dynstr, &me_eval->pdata);
-       BLI_dynstr_appendf(dynstr, "    ),\n");
+       BLI_dynstr_append(dynstr, "    ),\n");
 
-       BLI_dynstr_appendf(dynstr, "    'tessFaceLayers': (\n");
+       BLI_dynstr_append(dynstr, "    'tessFaceLayers': (\n");
        mesh_runtime_debug_info_layers(dynstr, &me_eval->fdata);
-       BLI_dynstr_appendf(dynstr, "    ),\n");
+       BLI_dynstr_append(dynstr, "    ),\n");
 
-       BLI_dynstr_appendf(dynstr, "}\n");
+       BLI_dynstr_append(dynstr, "}\n");
 
        ret = BLI_dynstr_get_cstring(dynstr);
        BLI_dynstr_free(dynstr);
index 7910274..28f47cb 100644 (file)
@@ -2998,7 +2998,7 @@ void BKE_tracking_get_rna_path_prefix_for_track(
        MovieTrackingObject *object =
                BKE_tracking_find_object_for_track(tracking, track);
        if (object == NULL) {
-               BLI_snprintf(rna_path, rna_path_len, "tracking.tracks");
+               BLI_strncpy(rna_path, "tracking.tracks", rna_path_len);
        }
        else {
                char object_name_esc[MAX_NAME * 2];
@@ -3043,7 +3043,7 @@ void BKE_tracking_get_rna_path_prefix_for_plane_track(
        MovieTrackingObject *object =
                BKE_tracking_find_object_for_plane_track(tracking, plane_track);
        if (object == NULL) {
-               BLI_snprintf(rna_path, rna_path_len, "tracking.plane_tracks");
+               BLI_strncpy(rna_path, "tracking.plane_tracks", rna_path_len);
        }
        else {
                char object_name_esc[MAX_NAME * 2];
index cc0ce61..4d4a20a 100644 (file)
@@ -70,8 +70,8 @@ bool BLO_main_validate_libraries(Main *bmain, ReportList *reports)
        for (Main *curmain = bmain->next; curmain != NULL; curmain = curmain->next) {
                Library *curlib = curmain->curlib;
                if (curlib == NULL) {
-                       BKE_reportf(reports, RPT_ERROR,
-                                   "Library database with NULL library datablock!");
+                       BKE_report(reports, RPT_ERROR,
+                                  "Library database with NULL library datablock!");
                        continue;
                }
 
index 6b39566..15b3457 100644 (file)
@@ -274,58 +274,58 @@ static char *eevee_get_defines(int options)
        char *str = NULL;
 
        DynStr *ds = BLI_dynstr_new();
-       BLI_dynstr_appendf(ds, SHADER_DEFINES);
+       BLI_dynstr_append(ds, SHADER_DEFINES);
 
        if ((options & VAR_MAT_MESH) != 0) {
-               BLI_dynstr_appendf(ds, "#define MESH_SHADER\n");
+               BLI_dynstr_append(ds, "#define MESH_SHADER\n");
        }
        if ((options & VAR_MAT_HAIR) != 0) {
-               BLI_dynstr_appendf(ds, "#define HAIR_SHADER\n");
+               BLI_dynstr_append(ds, "#define HAIR_SHADER\n");
        }
        if ((options & VAR_MAT_PROBE) != 0) {
-               BLI_dynstr_appendf(ds, "#define PROBE_CAPTURE\n");
+               BLI_dynstr_append(ds, "#define PROBE_CAPTURE\n");
        }
        if ((options & VAR_MAT_FLAT) != 0) {
-               BLI_dynstr_appendf(ds, "#define USE_FLAT_NORMAL\n");
+               BLI_dynstr_append(ds, "#define USE_FLAT_NORMAL\n");
        }
        if ((options & VAR_MAT_CLIP) != 0) {
-               BLI_dynstr_appendf(ds, "#define USE_ALPHA_CLIP\n");
+               BLI_dynstr_append(ds, "#define USE_ALPHA_CLIP\n");
        }
        if ((options & VAR_MAT_SHADOW) != 0) {
-               BLI_dynstr_appendf(ds, "#define SHADOW_SHADER\n");
+               BLI_dynstr_append(ds, "#define SHADOW_SHADER\n");
        }
        if ((options & VAR_MAT_HASH) != 0) {
-               BLI_dynstr_appendf(ds, "#define USE_ALPHA_HASH\n");
+               BLI_dynstr_append(ds, "#define USE_ALPHA_HASH\n");
        }
        if ((options & VAR_MAT_BLEND) != 0) {
-               BLI_dynstr_appendf(ds, "#define USE_ALPHA_BLEND\n");
+               BLI_dynstr_append(ds, "#define USE_ALPHA_BLEND\n");
        }
        if ((options & VAR_MAT_MULT) != 0) {
-               BLI_dynstr_appendf(ds, "#define USE_MULTIPLY\n");
+               BLI_dynstr_append(ds, "#define USE_MULTIPLY\n");
        }
        if ((options & VAR_MAT_REFRACT) != 0) {
-               BLI_dynstr_appendf(ds, "#define USE_REFRACTION\n");
+               BLI_dynstr_append(ds, "#define USE_REFRACTION\n");
        }
        if ((options & VAR_MAT_SSS) != 0) {
-               BLI_dynstr_appendf(ds, "#define USE_SSS\n");
+               BLI_dynstr_append(ds, "#define USE_SSS\n");
        }
        if ((options & VAR_MAT_SSSALBED) != 0) {
-               BLI_dynstr_appendf(ds, "#define USE_SSS_ALBEDO\n");
+               BLI_dynstr_append(ds, "#define USE_SSS_ALBEDO\n");
        }
        if ((options & VAR_MAT_TRANSLUC) != 0) {
-               BLI_dynstr_appendf(ds, "#define USE_TRANSLUCENCY\n");
+               BLI_dynstr_append(ds, "#define USE_TRANSLUCENCY\n");
        }
        if ((options & VAR_MAT_VSM) != 0) {
-               BLI_dynstr_appendf(ds, "#define SHADOW_VSM\n");
+               BLI_dynstr_append(ds, "#define SHADOW_VSM\n");
        }
        if ((options & VAR_MAT_ESM) != 0) {
-               BLI_dynstr_appendf(ds, "#define SHADOW_ESM\n");
+               BLI_dynstr_append(ds, "#define SHADOW_ESM\n");
        }
        if (((options & VAR_MAT_VOLUME) != 0) && ((options & VAR_MAT_BLEND) != 0)) {
-               BLI_dynstr_appendf(ds, "#define USE_ALPHA_BLEND_VOLUMETRICS\n");
+               BLI_dynstr_append(ds, "#define USE_ALPHA_BLEND_VOLUMETRICS\n");
        }
        if ((options & VAR_MAT_LOOKDEV) != 0) {
-               BLI_dynstr_appendf(ds, "#define LOOKDEV\n");
+               BLI_dynstr_append(ds, "#define LOOKDEV\n");
        }
 
        str = BLI_dynstr_get_cstring(ds);
@@ -339,11 +339,11 @@ static char *eevee_get_volume_defines(int options)
        char *str = NULL;
 
        DynStr *ds = BLI_dynstr_new();
-       BLI_dynstr_appendf(ds, SHADER_DEFINES);
-       BLI_dynstr_appendf(ds, "#define VOLUMETRICS\n");
+       BLI_dynstr_append(ds, SHADER_DEFINES);
+       BLI_dynstr_append(ds, "#define VOLUMETRICS\n");
 
        if ((options & VAR_MAT_VOLUME) != 0) {
-               BLI_dynstr_appendf(ds, "#define MESH_SHADER\n");
+               BLI_dynstr_append(ds, "#define MESH_SHADER\n");
        }
 
        str = BLI_dynstr_get_cstring(ds);
index fe8d35f..f044d68 100644 (file)
@@ -74,19 +74,19 @@ static struct GPUShader *eevee_effects_screen_raytrace_shader_get(int options)
                        datatoc_effect_ssr_frag_glsl);
 
                DynStr *ds_defines = BLI_dynstr_new();
-               BLI_dynstr_appendf(ds_defines, SHADER_DEFINES);
+               BLI_dynstr_append(ds_defines, SHADER_DEFINES);
                if (options & SSR_RESOLVE) {
-                       BLI_dynstr_appendf(ds_defines, "#define STEP_RESOLVE\n");
+                       BLI_dynstr_append(ds_defines, "#define STEP_RESOLVE\n");
                }
                else {
-                       BLI_dynstr_appendf(ds_defines, "#define STEP_RAYTRACE\n");
-                       BLI_dynstr_appendf(ds_defines, "#define PLANAR_PROBE_RAYTRACE\n");
+                       BLI_dynstr_append(ds_defines, "#define STEP_RAYTRACE\n");
+                       BLI_dynstr_append(ds_defines, "#define PLANAR_PROBE_RAYTRACE\n");
                }
                if (options & SSR_FULL_TRACE) {
-                       BLI_dynstr_appendf(ds_defines, "#define FULLRES\n");
+                       BLI_dynstr_append(ds_defines, "#define FULLRES\n");
                }
                if (options & SSR_AO) {
-                       BLI_dynstr_appendf(ds_defines, "#define SSR_AO\n");
+                       BLI_dynstr_append(ds_defines, "#define SSR_AO\n");
                }
                char *ssr_define_str = BLI_dynstr_get_cstring(ds_defines);
                BLI_dynstr_free(ds_defines);
index 8ddcbd2..2cec691 100644 (file)
@@ -92,43 +92,43 @@ char *workbench_material_build_defines(WORKBENCH_PrivateData *wpd, bool use_text
        DynStr *ds = BLI_dynstr_new();
 
        if (wpd->shading.flag & V3D_SHADING_OBJECT_OUTLINE) {
-               BLI_dynstr_appendf(ds, "#define V3D_SHADING_OBJECT_OUTLINE\n");
+               BLI_dynstr_append(ds, "#define V3D_SHADING_OBJECT_OUTLINE\n");
        }
        if (wpd->shading.flag & V3D_SHADING_SHADOW) {
-               BLI_dynstr_appendf(ds, "#define V3D_SHADING_SHADOW\n");
+               BLI_dynstr_append(ds, "#define V3D_SHADING_SHADOW\n");
        }
        if (SSAO_ENABLED(wpd) || CURVATURE_ENABLED(wpd)) {
-               BLI_dynstr_appendf(ds, "#define WB_CAVITY\n");
+               BLI_dynstr_append(ds, "#define WB_CAVITY\n");
        }
        if (SPECULAR_HIGHLIGHT_ENABLED(wpd)) {
-               BLI_dynstr_appendf(ds, "#define V3D_SHADING_SPECULAR_HIGHLIGHT\n");
+               BLI_dynstr_append(ds, "#define V3D_SHADING_SPECULAR_HIGHLIGHT\n");
        }
        if (STUDIOLIGHT_ENABLED(wpd)) {
-               BLI_dynstr_appendf(ds, "#define V3D_LIGHTING_STUDIO\n");
+               BLI_dynstr_append(ds, "#define V3D_LIGHTING_STUDIO\n");
        }
        if (FLAT_ENABLED(wpd)) {
-               BLI_dynstr_appendf(ds, "#define V3D_LIGHTING_FLAT\n");
+               BLI_dynstr_append(ds, "#define V3D_LIGHTING_FLAT\n");
        }
        if (MATCAP_ENABLED(wpd)) {
-               BLI_dynstr_appendf(ds, "#define V3D_LIGHTING_MATCAP\n");
+               BLI_dynstr_append(ds, "#define V3D_LIGHTING_MATCAP\n");
        }
        if (OBJECT_ID_PASS_ENABLED(wpd)) {
-               BLI_dynstr_appendf(ds, "#define OBJECT_ID_PASS_ENABLED\n");
+               BLI_dynstr_append(ds, "#define OBJECT_ID_PASS_ENABLED\n");
        }
        if (MATDATA_PASS_ENABLED(wpd)) {
-               BLI_dynstr_appendf(ds, "#define MATDATA_PASS_ENABLED\n");
+               BLI_dynstr_append(ds, "#define MATDATA_PASS_ENABLED\n");
        }
        if (NORMAL_VIEWPORT_PASS_ENABLED(wpd)) {
-               BLI_dynstr_appendf(ds, "#define NORMAL_VIEWPORT_PASS_ENABLED\n");
+               BLI_dynstr_append(ds, "#define NORMAL_VIEWPORT_PASS_ENABLED\n");
        }
        if (use_textures) {
-               BLI_dynstr_appendf(ds, "#define V3D_SHADING_TEXTURE_COLOR\n");
+               BLI_dynstr_append(ds, "#define V3D_SHADING_TEXTURE_COLOR\n");
        }
        if (NORMAL_ENCODING_ENABLED()) {
-               BLI_dynstr_appendf(ds, "#define WORKBENCH_ENCODE_NORMALS\n");
+               BLI_dynstr_append(ds, "#define WORKBENCH_ENCODE_NORMALS\n");
        }
        if (is_hair) {
-               BLI_dynstr_appendf(ds, "#define HAIR_SHADER\n");
+               BLI_dynstr_append(ds, "#define HAIR_SHADER\n");
        }
 
        str = BLI_dynstr_get_cstring(ds);
index 2c940f9..def425e 100644 (file)
@@ -922,7 +922,7 @@ static void particle_batch_cache_ensure_procedural_strand_data(
                BLI_snprintf(cache->uv_layer_names[i][n++], MAX_LAYER_NAME_LEN, "a%u", hash);
 
                if (i == active_uv) {
-                       BLI_snprintf(cache->uv_layer_names[i][n], MAX_LAYER_NAME_LEN, "u");
+                       BLI_strncpy(cache->uv_layer_names[i][n], "u", MAX_LAYER_NAME_LEN);
                }
        }
        /* Vertex colors */
@@ -942,7 +942,7 @@ static void particle_batch_cache_ensure_procedural_strand_data(
                }
 
                if (i == active_col) {
-                       BLI_snprintf(cache->col_layer_names[i][n], MAX_LAYER_NAME_LEN, "c");
+                       BLI_strncpy(cache->col_layer_names[i][n], "c", MAX_LAYER_NAME_LEN);
                }
        }
 
index 1ce0a92..0381168 100644 (file)
@@ -317,7 +317,7 @@ void DRW_stats_draw(rcti *rect)
        v += 1;
 
        /* GPU Timings */
-       BLI_snprintf(stat_string, sizeof(stat_string), "GPU Render Timings");
+       BLI_strncpy(stat_string, "GPU Render Timings", sizeof(stat_string));
        draw_stat(rect, 0, v++, stat_string, sizeof(stat_string));
 
        for (int i = 0; i < DTP.timer_increment; ++i) {
index 7fdbed0..42c5c2b 100644 (file)
@@ -1879,8 +1879,8 @@ static int convert_exec(bContext *C, wmOperator *op)
                         * But at the very least, do not do that with linked IDs! */
                        if ((ID_IS_LINKED(ob) || (ob->data && ID_IS_LINKED(ob->data))) && !keep_original) {
                                keep_original = true;
-                               BKE_reportf(op->reports, RPT_INFO,
-                                           "Converting some linked object/object data, enforcing 'Keep Original' option to True");
+                               BKE_report(op->reports, RPT_INFO,
+                                          "Converting some linked object/object data, enforcing 'Keep Original' option to True");
                        }
 
                        DEG_id_tag_update(&base->object->id, ID_RECALC_GEOMETRY);
index f3974b0..e785268 100644 (file)
@@ -5142,7 +5142,7 @@ static void applyShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
        if (t->proptext[0]) {
                ofs += BLI_snprintf(str + ofs, sizeof(str) - ofs, " %s", t->proptext);
        }
-       ofs += BLI_snprintf(str + ofs, sizeof(str) - ofs, ", (");
+       ofs += BLI_strncpy_rlen(str + ofs, ", (", sizeof(str) - ofs);
 
        if (t->keymap) {
                wmKeyMapItem *kmi = WM_modalkeymap_find_propvalue(t->keymap, TFM_MODAL_RESIZE);
index 433f8b9..c94668c 100644 (file)
@@ -873,7 +873,7 @@ static char *code_generate_vertex(ListBase *nodes, const char *vert_code, bool u
                                /* NOTE : Replicate changes to mesh_render_data_create() in draw_cache_impl_mesh.c */
                                if (input->attr_type == CD_ORCO) {
                                        /* orco is computed from local positions, see below */
-                                       BLI_dynstr_appendf(ds, "uniform vec3 OrcoTexCoFactors[2];\n");
+                                       BLI_dynstr_append(ds, "uniform vec3 OrcoTexCoFactors[2];\n");
                                }
                                else if (input->attr_name[0] == '\0') {
                                        BLI_dynstr_appendf(ds, "DEFINE_ATTR(%s, %s);\n", GPU_DATATYPE_STR[input->type], attr_prefix_get(input->attr_type));
@@ -910,7 +910,7 @@ static char *code_generate_vertex(ListBase *nodes, const char *vert_code, bool u
        }
 
        if (builtins & GPU_BARYCENTRIC_DIST) {
-               BLI_dynstr_appendf(ds, "out vec3 barycentricPosg;\n");
+               BLI_dynstr_append(ds, "out vec3 barycentricPosg;\n");
        }
 
 
@@ -949,7 +949,7 @@ static char *code_generate_vertex(ListBase *nodes, const char *vert_code, bool u
                /* To match cycles without breaking into individual segment we encode if we need to invert
                 * the first component into the second component. We invert if the barycentricTexCo.y
                 * is NOT 0.0 or 1.0. */
-               BLI_dynstr_appendf(
+               BLI_dynstr_append(
                        ds, "\tint _base_id = hair_get_base_id();\n");
                BLI_dynstr_appendf(
                        ds, "\tbarycentricTexCo%s.x = float((_base_id %% 2) == 1);\n",
@@ -960,7 +960,7 @@ static char *code_generate_vertex(ListBase *nodes, const char *vert_code, bool u
        }
 
        if (builtins & GPU_BARYCENTRIC_DIST) {
-               BLI_dynstr_appendf(ds, "\tbarycentricPosg = position;\n");
+               BLI_dynstr_append(ds, "\tbarycentricPosg = position;\n");
        }
 
        for (node = nodes->first; node; node = node->next) {
@@ -993,7 +993,7 @@ static char *code_generate_vertex(ListBase *nodes, const char *vert_code, bool u
         * geometry shader is needed. */
 
        if (builtins & GPU_BARYCENTRIC_DIST) {
-               BLI_dynstr_appendf(ds, "\tbarycentricPosg = (ModelMatrix * vec4(position, 1.0)).xyz;\n");
+               BLI_dynstr_append(ds, "\tbarycentricPosg = (ModelMatrix * vec4(position, 1.0)).xyz;\n");
        }
 
        for (node = nodes->first; node; node = node->next) {
@@ -1087,8 +1087,8 @@ static char *code_generate_geometry(ListBase *nodes, const char *geom_code, cons
        bool is_hair_shader = (strstr(defines, "HAIR_SHADER") != NULL);
 
        /* Create prototype because attributes cannot be declared before layout. */
-       BLI_dynstr_appendf(ds, "void pass_attr(in int vert);\n");
-       BLI_dynstr_appendf(ds, "void calc_barycentric_distances(vec3 pos0, vec3 pos1, vec3 pos2);\n");
+       BLI_dynstr_append(ds, "void pass_attr(in int vert);\n");
+       BLI_dynstr_append(ds, "void calc_barycentric_distances(vec3 pos0, vec3 pos1, vec3 pos2);\n");
        BLI_dynstr_append(ds, "#define USE_ATTR\n");
 
        /* Generate varying declarations. */
@@ -1111,16 +1111,16 @@ static char *code_generate_geometry(ListBase *nodes, const char *geom_code, cons
        }
 
        if (builtins & GPU_BARYCENTRIC_TEXCO) {
-               BLI_dynstr_appendf(ds, "#ifdef HAIR_SHADER\n");
-               BLI_dynstr_appendf(ds, "in vec2 barycentricTexCog[];\n");
-               BLI_dynstr_appendf(ds, "#endif\n");
+               BLI_dynstr_append(ds, "#ifdef HAIR_SHADER\n");
+               BLI_dynstr_append(ds, "in vec2 barycentricTexCog[];\n");
+               BLI_dynstr_append(ds, "#endif\n");
 
-               BLI_dynstr_appendf(ds, "out vec2 barycentricTexCo;\n");
+               BLI_dynstr_append(ds, "out vec2 barycentricTexCo;\n");
        }
 
        if (builtins & GPU_BARYCENTRIC_DIST) {
-               BLI_dynstr_appendf(ds, "in vec3 barycentricPosg[];\n");
-               BLI_dynstr_appendf(ds, "flat out vec3 barycentricDist;\n");
+               BLI_dynstr_append(ds, "in vec3 barycentricPosg[];\n");
+               BLI_dynstr_append(ds, "flat out vec3 barycentricDist;\n");
        }
 
        if (geom_code == NULL) {
@@ -1134,37 +1134,37 @@ static char *code_generate_geometry(ListBase *nodes, const char *geom_code, cons
                else {
                        /* Force geom shader usage */
                        /* TODO put in external file. */
-                       BLI_dynstr_appendf(ds, "layout(triangles) in;\n");
-                       BLI_dynstr_appendf(ds, "layout(triangle_strip, max_vertices=3) out;\n");
+                       BLI_dynstr_append(ds, "layout(triangles) in;\n");
+                       BLI_dynstr_append(ds, "layout(triangle_strip, max_vertices=3) out;\n");
 
-                       BLI_dynstr_appendf(ds, "in vec3 worldPositiong[];\n");
-                       BLI_dynstr_appendf(ds, "in vec3 viewPositiong[];\n");
-                       BLI_dynstr_appendf(ds, "in vec3 worldNormalg[];\n");
-                       BLI_dynstr_appendf(ds, "in vec3 viewNormalg[];\n");
+                       BLI_dynstr_append(ds, "in vec3 worldPositiong[];\n");
+                       BLI_dynstr_append(ds, "in vec3 viewPositiong[];\n");
+                       BLI_dynstr_append(ds, "in vec3 worldNormalg[];\n");
+                       BLI_dynstr_append(ds, "in vec3 viewNormalg[];\n");
 
-                       BLI_dynstr_appendf(ds, "out vec3 worldPosition;\n");
-                       BLI_dynstr_appendf(ds, "out vec3 viewPosition;\n");
-                       BLI_dynstr_appendf(ds, "out vec3 worldNormal;\n");
-                       BLI_dynstr_appendf(ds, "out vec3 viewNormal;\n");
+                       BLI_dynstr_append(ds, "out vec3 worldPosition;\n");
+                       BLI_dynstr_append(ds, "out vec3 viewPosition;\n");
+                       BLI_dynstr_append(ds, "out vec3 worldNormal;\n");
+                       BLI_dynstr_append(ds, "out vec3 viewNormal;\n");
 
-                       BLI_dynstr_appendf(ds, "void main(){\n");
+                       BLI_dynstr_append(ds, "void main(){\n");
 
                        if (builtins & GPU_BARYCENTRIC_DIST) {
-                               BLI_dynstr_appendf(ds, "\tcalc_barycentric_distances(barycentricPosg[0], barycentricPosg[1], barycentricPosg[2]);\n");
+                               BLI_dynstr_append(ds, "\tcalc_barycentric_distances(barycentricPosg[0], barycentricPosg[1], barycentricPosg[2]);\n");
                        }
 
-                       BLI_dynstr_appendf(ds, "\tgl_Position = gl_in[0].gl_Position;\n");
-                       BLI_dynstr_appendf(ds, "\tpass_attr(0);\n");
-                       BLI_dynstr_appendf(ds, "\tEmitVertex();\n");
+                       BLI_dynstr_append(ds, "\tgl_Position = gl_in[0].gl_Position;\n");
+                       BLI_dynstr_append(ds, "\tpass_attr(0);\n");
+                       BLI_dynstr_append(ds, "\tEmitVertex();\n");
 
-                       BLI_dynstr_appendf(ds, "\tgl_Position = gl_in[1].gl_Position;\n");
-                       BLI_dynstr_appendf(ds, "\tpass_attr(1);\n");
-                       BLI_dynstr_appendf(ds, "\tEmitVertex();\n");
+                       BLI_dynstr_append(ds, "\tgl_Position = gl_in[1].gl_Position;\n");
+                       BLI_dynstr_append(ds, "\tpass_attr(1);\n");
+                       BLI_dynstr_append(ds, "\tEmitVertex();\n");
 
-                       BLI_dynstr_appendf(ds, "\tgl_Position = gl_in[2].gl_Position;\n");
-                       BLI_dynstr_appendf(ds, "\tpass_attr(2);\n");
-                       BLI_dynstr_appendf(ds, "\tEmitVertex();\n");
-                       BLI_dynstr_appendf(ds, "};\n");
+                       BLI_dynstr_append(ds, "\tgl_Position = gl_in[2].gl_Position;\n");
+                       BLI_dynstr_append(ds, "\tpass_attr(2);\n");
+                       BLI_dynstr_append(ds, "\tEmitVertex();\n");
+                       BLI_dynstr_append(ds, "};\n");
                }
        }
        else {
@@ -1172,41 +1172,41 @@ static char *code_generate_geometry(ListBase *nodes, const char *geom_code, cons
        }
 
        if (builtins & GPU_BARYCENTRIC_DIST) {
-               BLI_dynstr_appendf(ds, "void calc_barycentric_distances(vec3 pos0, vec3 pos1, vec3 pos2) {\n");
-               BLI_dynstr_appendf(ds, "\tvec3 edge21 = pos2 - pos1;\n");
-               BLI_dynstr_appendf(ds, "\tvec3 edge10 = pos1 - pos0;\n");
-               BLI_dynstr_appendf(ds, "\tvec3 edge02 = pos0 - pos2;\n");
-               BLI_dynstr_appendf(ds, "\tvec3 d21 = normalize(edge21);\n");
-               BLI_dynstr_appendf(ds, "\tvec3 d10 = normalize(edge10);\n");
-               BLI_dynstr_appendf(ds, "\tvec3 d02 = normalize(edge02);\n");
-
-               BLI_dynstr_appendf(ds, "\tfloat d = dot(d21, edge02);\n");
-               BLI_dynstr_appendf(ds, "\tbarycentricDist.x = sqrt(dot(edge02, edge02) - d * d);\n");
-               BLI_dynstr_appendf(ds, "\td = dot(d02, edge10);\n");
-               BLI_dynstr_appendf(ds, "\tbarycentricDist.y = sqrt(dot(edge10, edge10) - d * d);\n");
-               BLI_dynstr_appendf(ds, "\td = dot(d10, edge21);\n");
-               BLI_dynstr_appendf(ds, "\tbarycentricDist.z = sqrt(dot(edge21, edge21) - d * d);\n");
+               BLI_dynstr_append(ds, "void calc_barycentric_distances(vec3 pos0, vec3 pos1, vec3 pos2) {\n");
+               BLI_dynstr_append(ds, "\tvec3 edge21 = pos2 - pos1;\n");
+               BLI_dynstr_append(ds, "\tvec3 edge10 = pos1 - pos0;\n");
+               BLI_dynstr_append(ds, "\tvec3 edge02 = pos0 - pos2;\n");
+               BLI_dynstr_append(ds, "\tvec3 d21 = normalize(edge21);\n");
+               BLI_dynstr_append(ds, "\tvec3 d10 = normalize(edge10);\n");
+               BLI_dynstr_append(ds, "\tvec3 d02 = normalize(edge02);\n");
+
+               BLI_dynstr_append(ds, "\tfloat d = dot(d21, edge02);\n");
+               BLI_dynstr_append(ds, "\tbarycentricDist.x = sqrt(dot(edge02, edge02) - d * d);\n");
+               BLI_dynstr_append(ds, "\td = dot(d02, edge10);\n");
+               BLI_dynstr_append(ds, "\tbarycentricDist.y = sqrt(dot(edge10, edge10) - d * d);\n");
+               BLI_dynstr_append(ds, "\td = dot(d10, edge21);\n");
+               BLI_dynstr_append(ds, "\tbarycentricDist.z = sqrt(dot(edge21, edge21) - d * d);\n");
                BLI_dynstr_append(ds, "}\n");
        }
 
        /* Generate varying assignments. */
-       BLI_dynstr_appendf(ds, "void pass_attr(in int vert) {\n");
+       BLI_dynstr_append(ds, "void pass_attr(in int vert) {\n");
 
        /* XXX HACK: Eevee specific. */
        if (geom_code == NULL) {
-               BLI_dynstr_appendf(ds, "\tworldPosition = worldPositiong[vert];\n");
-               BLI_dynstr_appendf(ds, "\tviewPosition = viewPositiong[vert];\n");
-               BLI_dynstr_appendf(ds, "\tworldNormal = worldNormalg[vert];\n");
-               BLI_dynstr_appendf(ds, "\tviewNormal = viewNormalg[vert];\n");
+               BLI_dynstr_append(ds, "\tworldPosition = worldPositiong[vert];\n");
+               BLI_dynstr_append(ds, "\tviewPosition = viewPositiong[vert];\n");
+               BLI_dynstr_append(ds, "\tworldNormal = worldNormalg[vert];\n");
+               BLI_dynstr_append(ds, "\tviewNormal = viewNormalg[vert];\n");
        }
 
        if (builtins & GPU_BARYCENTRIC_TEXCO) {
-               BLI_dynstr_appendf(ds, "#ifdef HAIR_SHADER\n");
-               BLI_dynstr_appendf(ds, "\tbarycentricTexCo = barycentricTexCog[vert];\n");
-               BLI_dynstr_appendf(ds, "#else\n");
-               BLI_dynstr_appendf(ds, "\tbarycentricTexCo.x = float((vert %% 3) == 0);\n");
-               BLI_dynstr_appendf(ds, "\tbarycentricTexCo.y = float((vert %% 3) == 1);\n");
-               BLI_dynstr_appendf(ds, "#endif\n");
+               BLI_dynstr_append(ds, "#ifdef HAIR_SHADER\n");
+               BLI_dynstr_append(ds, "\tbarycentricTexCo = barycentricTexCog[vert];\n");
+               BLI_dynstr_append(ds, "#else\n");
+               BLI_dynstr_append(ds, "\tbarycentricTexCo.x = float((vert %% 3) == 0);\n");
+               BLI_dynstr_append(ds, "\tbarycentricTexCo.y = float((vert %% 3) == 1);\n");
+               BLI_dynstr_append(ds, "#endif\n");
        }
 
        for (node = nodes->first; node; node = node->next) {
index e2aa26c..5398db8 100644 (file)
@@ -645,10 +645,12 @@ GPUTexture *GPU_texture_create_nD(
        tex->bindcode = GPU_tex_alloc();
 
        if (!tex->bindcode) {
-               if (err_out)
-                       BLI_snprintf(err_out, 256, "GPUTexture: texture create failed\n");
-               else
+               if (err_out) {
+                       BLI_strncpy(err_out, "GPUTexture: texture create failed\n", 256);
+               }
+               else {
                        fprintf(stderr, "GPUTexture: texture create failed\n");
+               }
                GPU_texture_free(tex);
                return NULL;
        }
@@ -685,7 +687,7 @@ GPUTexture *GPU_texture_create_nD(
 
        if (!valid) {
                if (err_out) {
-                       BLI_snprintf(err_out, 256, "GPUTexture: texture alloc failed\n");
+                       BLI_strncpy(err_out, "GPUTexture: texture alloc failed\n", 256);
                }
                else {
                        fprintf(stderr, "GPUTexture: texture alloc failed. Likely not enough Video Memory.\n");
@@ -790,10 +792,12 @@ static GPUTexture *GPU_texture_cube_create(
        tex->bindcode = GPU_tex_alloc();
 
        if (!tex->bindcode) {
-               if (err_out)
-                       BLI_snprintf(err_out, 256, "GPUTexture: texture create failed\n");
-               else
+               if (err_out) {
+                       BLI_strncpy(err_out, "GPUTexture: texture create failed\n", 256);
+               }
+               else {
                        fprintf(stderr, "GPUTexture: texture create failed\n");
+               }
                GPU_texture_free(tex);
                return NULL;
        }
index fea23c1..4753972 100644 (file)
@@ -84,15 +84,17 @@ GPUUniformBuffer *GPU_uniformbuffer_create(int size, const void *data, char err_
        ubo->bindcode = GPU_buf_alloc();
 
        if (!ubo->bindcode) {
-               if (err_out)
-                       BLI_snprintf(err_out, 256, "GPUUniformBuffer: UBO create failed");
+               if (err_out) {
+                       BLI_strncpy(err_out, "GPUUniformBuffer: UBO create failed", 256);
+               }
                GPU_uniformbuffer_free(ubo);
                return NULL;
        }
 
        if (ubo->size > GPU_max_ubo_size()) {
-               if (err_out)
-                       BLI_snprintf(err_out, 256, "GPUUniformBuffer: UBO too big");
+               if (err_out) {
+                       BLI_strncpy(err_out, "GPUUniformBuffer: UBO too big", 256);
+               }
                GPU_uniformbuffer_free(ubo);
                return NULL;
        }
@@ -123,15 +125,17 @@ GPUUniformBuffer *GPU_uniformbuffer_dynamic_create(ListBase *inputs, char err_ou
        ubo->buffer.bindcode = GPU_buf_alloc();
 
        if (!ubo->buffer.bindcode) {
-               if (err_out)
-                       BLI_snprintf(err_out, 256, "GPUUniformBuffer: UBO create failed");
+               if (err_out) {
+                       BLI_strncpy(err_out, "GPUUniformBuffer: UBO create failed", 256);
+               }
                GPU_uniformbuffer_free(&ubo->buffer);
                return NULL;
        }
 
        if (ubo->buffer.size > GPU_max_ubo_size()) {
-               if (err_out)
-                       BLI_snprintf(err_out, 256, "GPUUniformBuffer: UBO too big");
+               if (err_out) {
+                       BLI_strncpy(err_out, "GPUUniformBuffer: UBO too big", 256);
+               }
                GPU_uniformbuffer_free(&ubo->buffer);
                return NULL;
        }
index 9906fa4..27e4ee6 100644 (file)
@@ -207,8 +207,9 @@ static char *rna_BoidSettings_path(PointerRNA *ptr)
        if (particle_id_check(ptr)) {
                ParticleSettings *part = (ParticleSettings *)ptr->id.data;
 
-               if (part->boids == boids)
-                       return BLI_sprintfN("boids");
+               if (part->boids == boids) {
+                       return BLI_strdup("boids");
+               }
        }
        return NULL;
 }
index 61c2600..faf9a99 100644 (file)
@@ -432,7 +432,7 @@ static void rna_ColorManagedDisplaySettings_display_device_update(Main *bmain, S
 
 static char *rna_ColorManagedDisplaySettings_path(PointerRNA *UNUSED(ptr))
 {
-       return BLI_sprintfN("display_settings");
+       return BLI_strdup("display_settings");
 }
 
 static int rna_ColorManagedViewSettings_view_transform_get(PointerRNA *ptr)
@@ -518,7 +518,7 @@ static void rna_ColorManagedViewSettings_use_curves_set(PointerRNA *ptr, bool va
 
 static char *rna_ColorManagedViewSettings_path(PointerRNA *UNUSED(ptr))
 {
-       return BLI_sprintfN("view_settings");
+       return BLI_strdup("view_settings");
 }
 
 
@@ -627,12 +627,12 @@ static void rna_ColorManagedColorspaceSettings_reload_update(Main *bmain, Scene
 
 static char *rna_ColorManagedSequencerColorspaceSettings_path(PointerRNA *UNUSED(ptr))
 {
-       return BLI_sprintfN("sequencer_colorspace_settings");
+       return BLI_strdup("sequencer_colorspace_settings");
 }
 
 static char *rna_ColorManagedInputColorspaceSettings_path(PointerRNA *UNUSED(ptr))
 {
-       return BLI_sprintfN("colorspace_settings");
+       return BLI_strdup("colorspace_settings");
 }
 
 static void rna_ColorManagement_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
index 0b5269c..eae9ca2 100644 (file)
@@ -449,7 +449,7 @@ static void rna_ArmatureConstraint_target_remove(
        bConstraintTarget *tgt = target_ptr->data;
 
        if (BLI_findindex(&acon->targets, tgt) < 0) {
-               BKE_reportf(reports, RPT_ERROR, "Target is not in the constraint target list");
+               BKE_report(reports, RPT_ERROR, "Target is not in the constraint target list");
                return;
        }
 
index 7c8a79a..dcdad5c 100644 (file)
@@ -756,7 +756,7 @@ static void rna_GpencilVertex_groups_begin(CollectionPropertyIterator *iter, Poi
 
 static char *rna_GreasePencilGrid_path(PointerRNA *UNUSED(ptr))
 {
-       return BLI_sprintfN("grid");
+       return BLI_strdup("grid");
 }
 
 #else
index 994efc3..5033ba4 100644 (file)
@@ -307,7 +307,7 @@ static void rna_gpcolordata_uv_update(Main *bmain, Scene *scene, PointerRNA *ptr
 
 static char *rna_GpencilColorData_path(PointerRNA *UNUSED(ptr))
 {
-       return BLI_sprintfN("grease_pencil");
+       return BLI_strdup("grease_pencil");
 }
 
 static int rna_GpencilColorData_is_stroke_visible_get(PointerRNA *ptr)
index 158f453..ce1f420 100644 (file)
@@ -958,7 +958,7 @@ static void rna_Mesh_face_map_remove(struct Mesh *me, ReportList *reports, struc
        }
 
        if (BKE_mesh_clear_facemap_customdata(me) == false) {
-               BKE_reportf(reports, RPT_ERROR, "Error removing face-map");
+               BKE_report(reports, RPT_ERROR, "Error removing face-map");
        }
 }
 
index c8e84c0..5e90f1f 100644 (file)
@@ -359,12 +359,12 @@ static void rna_Object_shape_key_remove(
        Key *key = BKE_key_from_object(ob);
 
        if ((key == NULL) || BLI_findindex(&key->block, kb) == -1) {
-               BKE_reportf(reports, RPT_ERROR, "ShapeKey not found");
+               BKE_report(reports, RPT_ERROR, "ShapeKey not found");
                return;
        }
 
        if (!BKE_object_shapekey_remove(bmain, ob, kb)) {
-               BKE_reportf(reports, RPT_ERROR, "Could not remove ShapeKey");
+               BKE_report(reports, RPT_ERROR, "Could not remove ShapeKey");
                return;
        }
 
index e620a8f..337b44a 100644 (file)
@@ -532,16 +532,16 @@ static char *rna_FieldSettings_path(PointerRNA *ptr)
                ParticleSettings *part = (ParticleSettings *)ptr->id.data;
 
                if (part->pd == pd)
-                       return BLI_sprintfN("force_field_1");
+                       return BLI_strdup("force_field_1");
                else if (part->pd2 == pd)
-                       return BLI_sprintfN("force_field_2");
+                       return BLI_strdup("force_field_2");
        }
        else {
                /* object force field */
                Object *ob = (Object *)ptr->id.data;
 
                if (ob->pd == pd)
-                       return BLI_sprintfN("field");
+                       return BLI_strdup("field");
        }
        return NULL;
 }
@@ -582,8 +582,9 @@ static char *rna_EffectorWeight_path(PointerRNA *ptr)
                /* particle effector weights */
                ParticleSettings *part = (ParticleSettings *)ptr->id.data;
 
-               if (part->effector_weights == ew)
-                       return BLI_sprintfN("effector_weights");
+               if (part->effector_weights == ew) {
+                       return BLI_strdup("effector_weights");
+               }
        }
        else {
                Object *ob = (Object *)ptr->id.data;
index 9d4ef83..635beed 100644 (file)
@@ -1052,8 +1052,9 @@ static char *rna_SPHFluidSettings_path(PointerRNA *ptr)
        if (particle_id_check(ptr)) {
                ParticleSettings *part = (ParticleSettings *)ptr->id.data;
 
-               if (part->fluid == fluid)
-                       return BLI_sprintfN("fluid");
+               if (part->fluid == fluid) {
+                       return BLI_strdup("fluid");
+               }
        }
        return NULL;
 }
index 7f0ee14..169db8c 100644 (file)
@@ -119,7 +119,7 @@ static void rna_RigidBodyWorld_reset(Main *UNUSED(bmain), Scene *UNUSED(scene),
 
 static char *rna_RigidBodyWorld_path(PointerRNA *UNUSED(ptr))
 {
-       return BLI_sprintfN("rigidbody_world");
+       return BLI_strdup("rigidbody_world");
 }
 
 static void rna_RigidBodyWorld_num_solver_iterations_set(PointerRNA *ptr, int value)
@@ -193,7 +193,7 @@ static void rna_RigidBodyOb_shape_reset(Main *UNUSED(bmain), Scene *scene, Point
 static char *rna_RigidBodyOb_path(PointerRNA *UNUSED(ptr))
 {
        /* NOTE: this hardcoded path should work as long as only Objects have this */
-       return BLI_sprintfN("rigid_body");
+       return BLI_strdup("rigid_body");
 }
 
 static void rna_RigidBodyOb_type_set(PointerRNA *ptr, int value)
@@ -383,7 +383,7 @@ static void rna_RigidBodyOb_angular_damping_set(PointerRNA *ptr, float value)
 static char *rna_RigidBodyCon_path(PointerRNA *UNUSED(ptr))
 {
        /* NOTE: this hardcoded path should work as long as only Objects have this */
-       return BLI_sprintfN("rigid_body_constraint");
+       return BLI_strdup("rigid_body_constraint");
 }
 
 static void rna_RigidBodyCon_type_set(PointerRNA *ptr, int value)
index bdf9686..9bab1bf 100644 (file)
@@ -907,12 +907,12 @@ static void rna_RenderSettings_stereoViews_begin(CollectionPropertyIterator *ite
 
 static char *rna_RenderSettings_path(PointerRNA *UNUSED(ptr))
 {
-       return BLI_sprintfN("render");
+       return BLI_strdup("render");
 }
 
 static char *rna_BakeSettings_path(PointerRNA *UNUSED(ptr))
 {
-       return BLI_sprintfN("render.bake");
+       return BLI_strdup("render.bake");
 }
 
 static char *rna_ImageFormatSettings_path(PointerRNA *ptr)
@@ -926,12 +926,12 @@ static char *rna_ImageFormatSettings_path(PointerRNA *ptr)
                        Scene *scene = (Scene *)id;
 
                        if (&scene->r.im_format == imf) {
-                               return BLI_sprintfN("render.image_settings");
+                               return BLI_strdup("render.image_settings");
                        }
                        else if (&scene->r.bake.im_format == imf) {
-                               return BLI_sprintfN("render.bake.image_settings");
+                               return BLI_strdup("render.bake.image_settings");
                        }
-                       return BLI_sprintfN("..");
+                       return BLI_strdup("..");
                }
                case ID_NT:
                {
@@ -955,10 +955,10 @@ static char *rna_ImageFormatSettings_path(PointerRNA *ptr)
                                        }
                                }
                        }
-                       return BLI_sprintfN("..");
+                       return BLI_strdup("..");
                }
                default:
-                       return BLI_sprintfN("..");
+                       return BLI_strdup("..");
        }
 }
 
@@ -2210,7 +2210,7 @@ static void rna_UnitSettings_system_update(Main *UNUSED(bmain), Scene *scene, Po
 
 static char *rna_UnitSettings_path(PointerRNA *UNUSED(ptr))
 {
-       return BLI_sprintfN("unit_settings");
+       return BLI_strdup("unit_settings");
 }
 
 #else
index f827615..5a95988 100644 (file)
@@ -939,7 +939,7 @@ static int rna_SpaceView3D_icon_from_show_object_viewport_get(PointerRNA *ptr)
 
 static char *rna_View3DShading_path(PointerRNA *UNUSED(ptr))
 {
-    return BLI_sprintfN("shading");
+    return BLI_strdup("shading");
 }
 
 static PointerRNA rna_SpaceView3D_overlay_get(PointerRNA *ptr)
@@ -949,7 +949,7 @@ static PointerRNA rna_SpaceView3D_overlay_get(PointerRNA *ptr)
 
 static char *rna_View3DOverlay_path(PointerRNA *UNUSED(ptr))
 {
-    return BLI_sprintfN("overlay");
+    return BLI_strdup("overlay");
 }
 
 /* Space Image Editor */
index 8df1d31..154388e 100644 (file)
@@ -55,7 +55,7 @@
 
 static char *rna_tracking_path(PointerRNA *UNUSED(ptr))
 {
-       return BLI_sprintfN("tracking");
+       return BLI_strdup("tracking");
 }
 
 static void rna_tracking_defaultSettings_patternUpdate(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
@@ -307,7 +307,7 @@ static void rna_trackingPlaneTrack_name_set(PointerRNA *ptr, const char *value)
 
 static char *rna_trackingCamera_path(PointerRNA *UNUSED(ptr))
 {
-       return BLI_sprintfN("tracking.camera");
+       return BLI_strdup("tracking.camera");
 }
 
 static float rna_trackingCamera_focal_mm_get(PointerRNA *ptr)
@@ -336,7 +336,7 @@ static void rna_trackingCamera_focal_mm_set(PointerRNA *ptr, float value)
 
 static char *rna_trackingStabilization_path(PointerRNA *UNUSED(ptr))
 {
-       return BLI_sprintfN("tracking.stabilization");
+       return BLI_strdup("tracking.stabilization");
 }
 
 static int rna_track_2d_stabilization(CollectionPropertyIterator *UNUSED(iter), void *data)
index 2a084cb..45d664c 100644 (file)
@@ -810,7 +810,7 @@ static StructRNA *rna_GizmoGroup_register(
 
        wmGizmoMapType *gzmap_type = WM_gizmomaptype_ensure(&wmap_params);
        if (gzmap_type == NULL) {
-               BKE_reportf(reports, RPT_ERROR, "Area type does not support gizmos");
+               BKE_report(reports, RPT_ERROR, "Area type does not support gizmos");
                return NULL;
        }