Skip to content
Myr

stb_image_write: fix jpeg to work on non-C99 compilers

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sean Barrett · committed by Sean Barrett · parent 4067b6d · Browse files · 1 file+2 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−1 removed

  • other:+2 added−1 removed

1 file+2 added−1 removed

modified:stb_image_write.h+2 added-1 removed
1287 unmodified lines
1288 }1289 // Quantize/descale/zigzag the coefficients1290 for(y = 0, j=0; y < 8; ++y) {1291 for(x = 0; x < 8; ++x,++j) {1292 float v;1293 i = y*du_stride+x;1293 float v = CDU[i]*fdtbl[j];1294 v = CDU[i]*fdtbl[j];1295 // DU[stbiw__jpg_ZigZag[j]] = (int)(v < 0 ? ceilf(v - 0.5f) : floorf(v + 0.5f));1296 // ceilf() and floorf() are C99, not C89, but I /think/ they're not needed here anyway?1297 DU[stbiw__jpg_ZigZag[j]] = (int)(v < 0 ? v - 0.5f : v + 0.5f);1298 }
365 unmodified lines