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:
authorCampbell Barton <ideasman42@gmail.com>2011-02-12 19:54:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-12 19:54:24 +0300
commit55f68c36574779ae2fac3652466584628b22c633 (patch)
treee2f55301dda8897bf17f8b8459229d8fa5a67816 /source/blender/render
parent9eee1f962d49f14d92c8da4e677e4ee140f4f440 (diff)
fix for more warnings.
- modifier code was using sizeof() without knowing the sizeof the array when clearing the modifier type array. - use BLI_snprintf rather then sprintf where the size of the string is known. - particle drawing code kept a reference to stack float values (not a problem at the moment but would crash if accessed later).
Diffstat (limited to 'source/blender/render')
-rw-r--r--source/blender/render/intern/source/pipeline.c6
-rw-r--r--source/blender/render/intern/source/volume_precache.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index e9dd3d36596..a3f98318444 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -457,9 +457,9 @@ static void scene_unique_exr_name(Scene *scene, char *str, int sample)
BLI_splitdirstring(di, fi);
if(sample==0)
- sprintf(name, "%s_%s.exr", fi, scene->id.name+2);
+ BLI_snprintf(name, sizeof(name), "%s_%s.exr", fi, scene->id.name+2);
else
- sprintf(name, "%s_%s%d.exr", fi, scene->id.name+2, sample);
+ BLI_snprintf(name, sizeof(name), "%s_%s%d.exr", fi, scene->id.name+2, sample);
BLI_make_file_string("/", str, btempdir, name);
}
@@ -1597,7 +1597,7 @@ static void print_part_stats(Render *re, RenderPart *pa)
{
char str[64];
- sprintf(str, "%s, Part %d-%d", re->scene->id.name+2, pa->nr, re->i.totpart);
+ BLI_snprintf(str, sizeof(str), "%s, Part %d-%d", re->scene->id.name+2, pa->nr, re->i.totpart);
re->i.infostr= str;
re->stats_draw(re->sdh, &re->i);
re->i.infostr= NULL;
diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c
index 609e647637f..ddb3d68fcc7 100644
--- a/source/blender/render/intern/source/volume_precache.c
+++ b/source/blender/render/intern/source/volume_precache.c
@@ -397,7 +397,7 @@ void multiple_scattering_diffusion(Render *re, VolumePrecache *vp, Material *ma)
/* Displays progress every second */
if(time-lasttime>1.0f) {
char str[64];
- sprintf(str, "Simulating multiple scattering: %d%%", (int)(100.0f * (c / total)));
+ BLI_snprintf(str, sizeof(str), "Simulating multiple scattering: %d%%", (int)(100.0f * (c / total)));
re->i.infostr= str;
re->stats_draw(re->sdh, &re->i);
re->i.infostr= NULL;
@@ -742,7 +742,7 @@ void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *obi, Mat
time= PIL_check_seconds_timer();
if(time-lasttime>1.0f) {
char str[64];
- sprintf(str, "Precaching volume: %d%%", (int)(100.0f * ((float)counter / (float)totparts)));
+ BLI_snprintf(str, sizeof(str), "Precaching volume: %d%%", (int)(100.0f * ((float)counter / (float)totparts)));
re->i.infostr= str;
re->stats_draw(re->sdh, &re->i);
re->i.infostr= NULL;