diff options
Diffstat (limited to 'source')
29 files changed, 197 insertions, 186 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 86ec491b43e..28b87d034b1 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -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); diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index 29d9d105d6b..336a4739760 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -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); diff --git a/source/blender/blenkernel/intern/mesh_runtime.c b/source/blender/blenkernel/intern/mesh_runtime.c index 2f845e32ee7..f7c16b763fe 100644 --- a/source/blender/blenkernel/intern/mesh_runtime.c +++ b/source/blender/blenkernel/intern/mesh_runtime.c @@ -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); diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c index 79102742927..28f47cbf067 100644 --- a/source/blender/blenkernel/intern/tracking.c +++ b/source/blender/blenkernel/intern/tracking.c @@ -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]; diff --git a/source/blender/blenloader/intern/blend_validate.c b/source/blender/blenloader/intern/blend_validate.c index cc0ce61ec15..4d4a20adbdf 100644 --- a/source/blender/blenloader/intern/blend_validate.c +++ b/source/blender/blenloader/intern/blend_validate.c @@ -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; } diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index 6b395660401..15b3457874d 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -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); diff --git a/source/blender/draw/engines/eevee/eevee_screen_raytrace.c b/source/blender/draw/engines/eevee/eevee_screen_raytrace.c index fe8d35f1d79..f044d68ddb2 100644 --- a/source/blender/draw/engines/eevee/eevee_screen_raytrace.c +++ b/source/blender/draw/engines/eevee/eevee_screen_raytrace.c @@ -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); diff --git a/source/blender/draw/engines/workbench/workbench_materials.c b/source/blender/draw/engines/workbench/workbench_materials.c index 8ddcbd2e283..2cec691a62f 100644 --- a/source/blender/draw/engines/workbench/workbench_materials.c +++ b/source/blender/draw/engines/workbench/workbench_materials.c @@ -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); diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c index 2c940f9bab8..def425e3c7c 100644 --- a/source/blender/draw/intern/draw_cache_impl_particles.c +++ b/source/blender/draw/intern/draw_cache_impl_particles.c @@ -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); } } diff --git a/source/blender/draw/intern/draw_manager_profiling.c b/source/blender/draw/intern/draw_manager_profiling.c index 1ce0a92c978..03811688982 100644 --- a/source/blender/draw/intern/draw_manager_profiling.c +++ b/source/blender/draw/intern/draw_manager_profiling.c @@ -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) { diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 7fdbed062ac..42c5c2b3576 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -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); diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index f3974b03122..e785268b80a 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -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); diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 433f8b909c2..c94668cf6e9 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -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) { diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c index e2aa26c3b33..5398db82586 100644 --- a/source/blender/gpu/intern/gpu_texture.c +++ b/source/blender/gpu/intern/gpu_texture.c @@ -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; } diff --git a/source/blender/gpu/intern/gpu_uniformbuffer.c b/source/blender/gpu/intern/gpu_uniformbuffer.c index fea23c1ac0f..47539724a26 100644 --- a/source/blender/gpu/intern/gpu_uniformbuffer.c +++ b/source/blender/gpu/intern/gpu_uniformbuffer.c @@ -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; } diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c index 9906fa49dcb..27e4ee639c5 100644 --- a/source/blender/makesrna/intern/rna_boid.c +++ b/source/blender/makesrna/intern/rna_boid.c @@ -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; } diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index 61c2600a021..faf9a99ace1 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -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) diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 0b5269cd5d8..eae9ca2f8f8 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -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; } diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 7c8a79a7563..dcdad5ce314 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -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 diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 994efc36f00..5033ba42570 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -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) diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 158f4535303..ce1f4202f16 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -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"); } } diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index c8e84c07b5c..5e90f1feddf 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -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; } diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index e620a8f6526..337b44a534b 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -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; diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 9d4ef83e8a0..635beed74fb 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -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; } diff --git a/source/blender/makesrna/intern/rna_rigidbody.c b/source/blender/makesrna/intern/rna_rigidbody.c index 7f0ee14ef18..169db8cf246 100644 --- a/source/blender/makesrna/intern/rna_rigidbody.c +++ b/source/blender/makesrna/intern/rna_rigidbody.c @@ -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) diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index bdf9686174b..9bab1bf5d6d 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -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 diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index f827615ab03..5a9598818de 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -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 */ diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c index 8df1d3115cc..154388e4228 100644 --- a/source/blender/makesrna/intern/rna_tracking.c +++ b/source/blender/makesrna/intern/rna_tracking.c @@ -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) diff --git a/source/blender/makesrna/intern/rna_wm_gizmo.c b/source/blender/makesrna/intern/rna_wm_gizmo.c index 2a084cbd526..45d664c4522 100644 --- a/source/blender/makesrna/intern/rna_wm_gizmo.c +++ b/source/blender/makesrna/intern/rna_wm_gizmo.c @@ -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; } |