From a0d88f723f8177de1845008d880fc25674ccb8ff Mon Sep 17 00:00:00 2001 From: "jat%princeton.edu" Date: Wed, 20 Jun 2001 23:25:34 +0000 Subject: [PATCH] Fixes bug 78649: so libimg/libpr0n do not print to console on opt builds. r=cls, sr=tor, a=drivers(dbaron) git-svn-id: svn://10.0.0.236/trunk@97638 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/modules/libimg/png/pnggccrd.c | 4 ++++ mozilla/modules/libimg/pngcom/ipng.cpp | 4 ++++ mozilla/modules/libimg/src/if.cpp | 5 ++++- mozilla/modules/libpr0n/decoders/jpeg/nsJPEGDecoder.cpp | 6 +++++- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/mozilla/modules/libimg/png/pnggccrd.c b/mozilla/modules/libimg/png/pnggccrd.c index fb34abc0145..11ab0becae8 100644 --- a/mozilla/modules/libimg/png/pnggccrd.c +++ b/mozilla/modules/libimg/png/pnggccrd.c @@ -1283,10 +1283,12 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask) default: // png_ptr->row_info.pixel_depth != 1,2,4,8,16,24,32,48,64 { // this should never happen +#ifdef DEBUG fprintf(stderr, "libpng internal error: png_ptr->row_info.pixel_depth = %d\n", png_ptr->row_info.pixel_depth); fflush(stderr); +#endif break; } } /* end switch (png_ptr->row_info.pixel_depth) */ @@ -3030,8 +3032,10 @@ png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row, { // GRR: PRINT ERROR HERE: SHOULD NEVER BE REACHED +#ifdef DEBUG fprintf(stderr, "libpng: internal logic error (png_read_filter_row_mmx_avg())\n"); +#endif #if 0 __asm__ __volatile__ ( diff --git a/mozilla/modules/libimg/pngcom/ipng.cpp b/mozilla/modules/libimg/pngcom/ipng.cpp index c32e715b449..9afbb71018f 100644 --- a/mozilla/modules/libimg/pngcom/ipng.cpp +++ b/mozilla/modules/libimg/pngcom/ipng.cpp @@ -429,13 +429,17 @@ il_png_error_handler(png_structp png_ptr, png_const_charp msg) * been defined. Adapted from readpng2_error_handler() in "PNG: The * Definitive Guide" (O'Reilly, 1999). */ +#ifdef DEBUG fprintf(stderr, "nspng libpng error: %s\n", msg); fflush(stderr); +#endif ipng_p = (ipng_structp)png_get_error_ptr(png_ptr); if (ipng_p == NULL) { /* we are completely hosed now */ +#ifdef DEBUG fprintf(stderr, "nspng severe error: jmpbuf not recoverable.\n"); fflush(stderr); +#endif PR_ASSERT(ipng_p != NULL); /* instead of exit(99); */ } diff --git a/mozilla/modules/libimg/src/if.cpp b/mozilla/modules/libimg/src/if.cpp index 3a7c48f92c9..8b5edc2c3e3 100644 --- a/mozilla/modules/libimg/src/if.cpp +++ b/mozilla/modules/libimg/src/if.cpp @@ -1278,6 +1278,7 @@ IL_ChromeAlphaAbuseCheck(il_container *ic) else if (alpha[x] == 255) num255++; } +#ifdef DEBUG if (num000+num255 == header->width*header->height) { fprintf(stderr, "CHROME ALPHA ABUSE\n"); fprintf(stderr, "\tusing an 8-bit alpha channel to represent binary alpha\n"); @@ -1285,6 +1286,7 @@ IL_ChromeAlphaAbuseCheck(il_container *ic) fprintf(stderr, "\tnum000=%d num255=%d sum=%d w*h=%d\n", num000, num255, num000+num255, header->width*header->height); } +#endif } else if (ic->image->header.alpha_bits == 1) { PRBool constAlpha=PR_TRUE; @@ -1309,12 +1311,13 @@ IL_ChromeAlphaAbuseCheck(il_container *ic) constAlpha = PR_FALSE; break; } - +#ifdef DEBUG if (constAlpha) { fprintf(stderr, "CHROME ALPHA ABUSE\n"); fprintf(stderr, "\tfully opaque 1-bit alpha mask\n"); fprintf(stderr, "\t%s\n", ic->url_address); } +#endif } } diff --git a/mozilla/modules/libpr0n/decoders/jpeg/nsJPEGDecoder.cpp b/mozilla/modules/libpr0n/decoders/jpeg/nsJPEGDecoder.cpp index 716aaf913f3..d300cd0ade8 100644 --- a/mozilla/modules/libpr0n/decoders/jpeg/nsJPEGDecoder.cpp +++ b/mozilla/modules/libpr0n/decoders/jpeg/nsJPEGDecoder.cpp @@ -431,7 +431,11 @@ NS_IMETHODIMP nsJPEGDecoder::WriteFrom(nsIInputStream *inStr, PRUint32 count, PR return NS_OK; /* I/O suspension */ default: - printf("got someo other state!?\n"); + { +#ifdef DEBUG + printf("got someo other state!?\n"); +#endif + } } } }