Revert of Silence -Wclobbered in each file that needs it. (patchset #2 id:20001 of https://codereview.chromium.org/2184823009/ )
Reason for revert:
Jpeg strategy seems to be leading to crashes. Gonna go back to warning squelch.
Original issue's description:
> Silence -Wclobbered in each file that needs it.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2184823009
>
> Committed: https://skia.googlesource.com/skia/+/03f704a343d7a82974f977eda8789a8c721c93e5
TBR=msarett@google.com,mtklein@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review-Url: https://codereview.chromium.org/2188313003
diff --git a/src/codec/SkJpegCodec.cpp b/src/codec/SkJpegCodec.cpp
index 6a1636c..f4116e3 100644
--- a/src/codec/SkJpegCodec.cpp
+++ b/src/codec/SkJpegCodec.cpp
@@ -19,12 +19,6 @@
#include <stdio.h>
#include "SkJpegUtility.h"
-// Same as setjmp, but introduces a new empty scope.
-// This way we can avoid GCC's overactive warnings about clobbered locals.
-static int setjmp_no_locals(jmp_buf env) {
- return setjmp(env);
-}
-
extern "C" {
#include "jerror.h"
#include "jpeglib.h"
@@ -196,7 +190,7 @@
SkAutoTDelete<JpegDecoderMgr> decoderMgr(new JpegDecoderMgr(stream));
// libjpeg errors will be caught and reported here
- if (setjmp_no_locals(decoderMgr->getJmpBuf())) {
+ if (setjmp(decoderMgr->getJmpBuf())) {
return decoderMgr->returnFalse("setjmp");
}
@@ -420,7 +414,7 @@
* dimensions if possible
*/
bool SkJpegCodec::onDimensionsSupported(const SkISize& size) {
- if (setjmp_no_locals(fDecoderMgr->getJmpBuf())) {
+ if (setjmp(fDecoderMgr->getJmpBuf())) {
return fDecoderMgr->returnFalse("onDimensionsSupported/setjmp");
}
@@ -472,7 +466,7 @@
jpeg_decompress_struct* dinfo = fDecoderMgr->dinfo();
// Set the jump location for libjpeg errors
- if (setjmp_no_locals(fDecoderMgr->getJmpBuf())) {
+ if (setjmp(fDecoderMgr->getJmpBuf())) {
return fDecoderMgr->returnFailure("setjmp", kInvalidInput);
}
@@ -581,7 +575,7 @@
SkCodec::Result SkJpegCodec::onStartScanlineDecode(const SkImageInfo& dstInfo,
const Options& options, SkPMColor ctable[], int* ctableCount) {
// Set the jump location for libjpeg errors
- if (setjmp_no_locals(fDecoderMgr->getJmpBuf())) {
+ if (setjmp(fDecoderMgr->getJmpBuf())) {
SkCodecPrintf("setjmp: Error from libjpeg\n");
return kInvalidInput;
}
@@ -657,7 +651,7 @@
int SkJpegCodec::onGetScanlines(void* dst, int count, size_t dstRowBytes) {
// Set the jump location for libjpeg errors
- if (setjmp_no_locals(fDecoderMgr->getJmpBuf())) {
+ if (setjmp(fDecoderMgr->getJmpBuf())) {
return fDecoderMgr->returnFailure("setjmp", kInvalidInput);
}
// Read rows one at a time
@@ -694,7 +688,7 @@
bool SkJpegCodec::onSkipScanlines(int count) {
// Set the jump location for libjpeg errors
- if (setjmp_no_locals(fDecoderMgr->getJmpBuf())) {
+ if (setjmp(fDecoderMgr->getJmpBuf())) {
return fDecoderMgr->returnFalse("setjmp");
}
@@ -809,7 +803,7 @@
}
// Set the jump location for libjpeg errors
- if (setjmp_no_locals(fDecoderMgr->getJmpBuf())) {
+ if (setjmp(fDecoderMgr->getJmpBuf())) {
return fDecoderMgr->returnFailure("setjmp", kInvalidInput);
}