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 04:02:21 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-12 04:02:21 +0300
commit5470a7af5dfd3a3f8070bddfd8dab496c6229720 (patch)
tree4e5bb765140e50edad3cebe11994d3ea4ae4bfbc
parent6554ae1460bc52c2af47e5322fbefeba17c983b4 (diff)
render stats_background() was giving clang warning about unused argument and wasn't checking for buffer overrun (though this would be very unlikely).
write to the stdout directly rather then building a string and writing that. (no functional change).
-rw-r--r--source/blender/render/intern/source/pipeline.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index 26edf99b8e3..e9dd3d36596 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -139,7 +139,6 @@ static int default_break(void *UNUSED(arg)) {return G.afbreek == 1;}
static void stats_background(void *UNUSED(arg), RenderStats *rs)
{
- char str[400], *spos= str;
uintptr_t mem_in_use, mmap_in_use, peak_memory;
float megs_used_memory, mmap_used_memory, megs_peak_memory;
@@ -151,24 +150,24 @@ static void stats_background(void *UNUSED(arg), RenderStats *rs)
mmap_used_memory= (mmap_in_use)/(1024.0*1024.0);
megs_peak_memory = (peak_memory)/(1024.0*1024.0);
- spos+= sprintf(spos, "Fra:%d Mem:%.2fM (%.2fM, peak %.2fM) ", rs->cfra,
+ fprintf(stdout, "Fra:%d Mem:%.2fM (%.2fM, peak %.2fM) ", rs->cfra,
megs_used_memory, mmap_used_memory, megs_peak_memory);
-
+
if(rs->curfield)
- spos+= sprintf(spos, "Field %d ", rs->curfield);
+ fprintf(stdout, "Field %d ", rs->curfield);
if(rs->curblur)
- spos+= sprintf(spos, "Blur %d ", rs->curblur);
-
+ fprintf(stdout, "Blur %d ", rs->curblur);
+
if(rs->infostr) {
- spos+= sprintf(spos, "| %s", rs->infostr);
+ fprintf(stdout, "| %s", rs->infostr);
}
else {
if(rs->tothalo)
- spos+= sprintf(spos, "Sce: %s Ve:%d Fa:%d Ha:%d La:%d", rs->scenename, rs->totvert, rs->totface, rs->tothalo, rs->totlamp);
- else
- spos+= sprintf(spos, "Sce: %s Ve:%d Fa:%d La:%d", rs->scenename, rs->totvert, rs->totface, rs->totlamp);
+ fprintf(stdout, "Sce: %s Ve:%d Fa:%d Ha:%d La:%d", rs->scenename, rs->totvert, rs->totface, rs->tothalo, rs->totlamp);
+ else
+ fprintf(stdout, "Sce: %s Ve:%d Fa:%d La:%d", rs->scenename, rs->totvert, rs->totface, rs->totlamp);
}
- printf("%s\n", str);
+ fflush(stdout);
}
void RE_FreeRenderResult(RenderResult *res)