From f3ffb7433fe346d55132499a7f46afaf1b417e72 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sat, 29 May 2010 12:31:13 +0000 Subject: [PATCH] fix warnings --- Common/CreateFile.cpp | 2 +- Common/DefaultOptions.h | 2 +- benchmarks/boolean/cube1.lua | 2 +- contrib/mpeg_encode/block.cpp | 4 ++-- contrib/mpeg_encode/iframe.cpp | 3 ++- contrib/mpeg_encode/jrevdct.cpp | 2 +- contrib/mpeg_encode/libpnmrw.cpp | 4 ++-- contrib/mpeg_encode/opts.cpp | 2 +- contrib/mpeg_encode/rate.cpp | 12 ++++++------ doc/VERSIONS.txt | 11 ++++++----- 10 files changed, 23 insertions(+), 21 deletions(-) diff --git a/Common/CreateFile.cpp b/Common/CreateFile.cpp index 1be61dcd71..be21f3a1f5 100644 --- a/Common/CreateFile.cpp +++ b/Common/CreateFile.cpp @@ -455,7 +455,7 @@ void CreateOutputFile(std::string fileName, int format) if(repeat < 1) repeat = 1; std::string pattern("I"); // including P frames would lead to smaller files, but the - // quality degradation is perceptible... + // quality degradation is perceptible: // for(int i = 1; i < repeat; i++) pattern += "P"; fprintf(fp, "PATTERN %s\nBASE_FILE_FORMAT PPM\nGOP_SIZE %d\n" "SLICES_PER_FRAME 1\nPIXEL FULL\nRANGE 10\n" diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 15f9bf8f19..8f0433905a 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -1305,7 +1305,7 @@ StringXNumber SolverOptions_Number[] = { } ; StringXNumber PostProcessingOptions_Number[] = { - { F|O, "AnimationDelay" , opt_post_anim_delay , 0.25 , + { F|O, "AnimationDelay" , opt_post_anim_delay , 0.1 , "Delay (in seconds) between frames in automatic animation mode" }, { F|O, "AnimationCycle" , opt_post_anim_cycle , 0. , "Cycle through time steps (0) or views (1) for animations" }, diff --git a/benchmarks/boolean/cube1.lua b/benchmarks/boolean/cube1.lua index 32bb7d8eea..72effd501f 100644 --- a/benchmarks/boolean/cube1.lua +++ b/benchmarks/boolean/cube1.lua @@ -8,6 +8,6 @@ f1 = g:extrude(e1, {0,0,0}, {0,1,0}) r1 = g:extrude(f1, {0,0,0}, {0,0,1}) r1 = g:revolve(f1, {-.1,0,0}, {-.1,1,0}, 3.1415 / 2) -g:mesh(3) +--g:mesh(3) print('number of mesh vertices in volume ', r1, ' = ', r1:getNumMeshVertices()) diff --git a/contrib/mpeg_encode/block.cpp b/contrib/mpeg_encode/block.cpp index 8a2f4ee4f2..f977a93fd0 100644 --- a/contrib/mpeg_encode/block.cpp +++ b/contrib/mpeg_encode/block.cpp @@ -618,8 +618,8 @@ LumMotionError(LumBlock currentBlock, distortion += tmp*tmp; }} distortion /= 256; - distortion *= LocalDCTDistortScale; - datarate *= LocalDCTRateScale; + distortion *= (int)LocalDCTDistortScale; + datarate *= (int)LocalDCTRateScale; diff = (int) sqrt((double)(distortion*distortion + datarate*datarate)); break; } diff --git a/contrib/mpeg_encode/iframe.cpp b/contrib/mpeg_encode/iframe.cpp index 7ef85fee27..c8d80c7be6 100644 --- a/contrib/mpeg_encode/iframe.cpp +++ b/contrib/mpeg_encode/iframe.cpp @@ -846,7 +846,8 @@ BlockComputeSNR(MpegFrame *current, needs_init = FALSE; for (y=0; y<3; y++) { - varDiff[y] = ratio[y] = total[y] = 0.0; + varDiff[y] = 0; + ratio[y] = total[y] = 0.0; } ySize[0]=Fsize_y; xSize[0]=Fsize_x; ySize[1]=Fsize_y>>1; xSize[1]=Fsize_x>>1; diff --git a/contrib/mpeg_encode/jrevdct.cpp b/contrib/mpeg_encode/jrevdct.cpp index 8f9564d15d..d26b6354d7 100644 --- a/contrib/mpeg_encode/jrevdct.cpp +++ b/contrib/mpeg_encode/jrevdct.cpp @@ -1269,7 +1269,7 @@ void reference_rev_dct(int16 *block) for (k=0; k<8; k++) partial_product+= itrans_coef[k][i]*tmp[8*k+j]; - v = floor(partial_product+0.5); + v = (int)floor(partial_product+0.5); block[8*i+j] = (v<-256) ? -256 : ((v>255) ? 255 : v); } } diff --git a/contrib/mpeg_encode/libpnmrw.cpp b/contrib/mpeg_encode/libpnmrw.cpp index bcbd6922ef..d279607d0c 100644 --- a/contrib/mpeg_encode/libpnmrw.cpp +++ b/contrib/mpeg_encode/libpnmrw.cpp @@ -241,7 +241,7 @@ pbm_getbit(FILE* file) { ich = pbm_getc( file ); if ( ich == EOF ) - return -1; + return (bit)-1; } while ( ich == ' ' || ich == '\t' || ich == '\n' || ich == '\r' ); @@ -249,7 +249,7 @@ pbm_getbit(FILE* file) { (void) fprintf( stderr, "%s: junk in file where bits should be\n", progname ); - return -1; + return (bit)-1; } return ( ich == '1' ) ? 1 : 0; diff --git a/contrib/mpeg_encode/opts.cpp b/contrib/mpeg_encode/opts.cpp index 11567289cb..4aa5c1e416 100644 --- a/contrib/mpeg_encode/opts.cpp +++ b/contrib/mpeg_encode/opts.cpp @@ -439,7 +439,7 @@ Mpost_UnQuantZigBlockLaplace(FlatBlock in, } if (level<0) {mid = -mid;} /*printf("(%2.1lf-%2.1lf): old: %d vs %d\n",low,high,coeff,(int) mid);*/ - coeff = mid; + coeff = (int)mid; if ( (coeff & 1) == 0 ) { if ( coeff < 0 ) { coeff++; diff --git a/contrib/mpeg_encode/rate.cpp b/contrib/mpeg_encode/rate.cpp index 7ef7ffd0d4..e465e81ed2 100644 --- a/contrib/mpeg_encode/rate.cpp +++ b/contrib/mpeg_encode/rate.cpp @@ -272,8 +272,8 @@ initRateControl() /* init virtual buffers */ reactionParameter = (2 * bit_rate / frameRateRounded); d0_i = (10 * reactionParameter / 31); - d0_p = (Kp * d0_i); - d0_b = (Kb * d0_i); + d0_p = (int)(Kp * d0_i); + d0_b = (int)(Kb * d0_i); lastFrameVirtBuf = d0_i; /* start with I Frame */ rc_Q = lastFrameVirtBuf * 31 / reactionParameter; @@ -282,7 +282,7 @@ initRateControl() avg_act = 400; /* Suggested initial value */ N_act = 1; - mquant = rc_Q * N_act; + mquant = (int)(rc_Q * N_act); frameDelayIncrement = (90000 / frameRateRounded); /* num of "delay" units per frame */ bufferFillRate = bit_rate / frameRateRounded; /* VBV buf fills at constant rate */ @@ -402,7 +402,7 @@ targetRateControl(MpegFrame *frame) N_act = 1; rc_Q = lastFrameVirtBuf * 31 / reactionParameter; - mquant = rc_Q * N_act; + mquant = (int)(rc_Q * N_act); Qscale = (mquant > 31 ? 31 : mquant); Qscale = (Qscale < 1 ? 1 : Qscale); @@ -460,7 +460,7 @@ updateRateControl(int type) totalBits = rc_totalFrameBits; avgQuant = ((float) rc_totalQuant / (float) rc_numBlocks); - frameComplexity = totalBits * avgQuant; + frameComplexity = (int)(totalBits * avgQuant); pctAllocUsed = (totalBits *100 / current_Tx); rc_R -= totalBits; pctGOPUsed = (rc_R *100/ rc_G); @@ -633,7 +633,7 @@ int needQScaleChange(int oldQScale, checkSpatialActivity(blk0, blk1, blk2, blk3); - mquant = rc_Q * N_act; + mquant = (int)(rc_Q * N_act); Qscale = (mquant > 31 ? 31 : mquant); Qscale = (Qscale < 1 ? 1 : Qscale); rc_totalQuant += Qscale; diff --git a/doc/VERSIONS.txt b/doc/VERSIONS.txt index 3f8bcc48d5..a1f0953f2d 100644 --- a/doc/VERSIONS.txt +++ b/doc/VERSIONS.txt @@ -1,10 +1,11 @@ 2.5.0 (?): new client/server visualization mode; new compound geometrical entities (useful for remeshing); improved mesh -reclassification tool; new option to force the type of views -dynamically; bumped mesh version format to 2.2 (change in the meaning -of the partion tags; this only affects partioned meshes); renamed -several post-processing plugins (as well as plugin options) to make -them easier to understand; many small bug fixes and usability +reclassification tool; new ability to watch a pattern of files to +merge; new integrated MPEG export; new option to force the type of +views dynamically; bumped mesh version format to 2.2 (change in the +meaning of the partion tags; this only affects partioned meshes); +renamed several post-processing plugins (as well as plugin options) to +make them easier to understand; many small bug fixes and usability improvements. 2.4.2 (Sep 21, 2009): solver code refactoring + better IDE -- GitLab