From 4222e19aeaf72ccfb61f83f4fe41010750161c74 Mon Sep 17 00:00:00 2001 From: kkinnunen Date: Thu, 19 Nov 2015 08:45:30 -0800 Subject: Fix maybe unintialized warning for GrAutoLocaleSetter In function void test_GLPrograms(skiatest::Reporter*, GrContextFactory*): ../../../src/gpu/GrAutoLocaleSetter.h:47:35: error: als.GrAutoLocaleSetter::fOldLocale may be used uninitialized in this function [-Werror=maybe-uninitialized] From Build-Ubuntu-GCC-x86_64-Release-Trybot Review URL: https://codereview.chromium.org/1456383002 --- src/gpu/GrAutoLocaleSetter.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/gpu') diff --git a/src/gpu/GrAutoLocaleSetter.h b/src/gpu/GrAutoLocaleSetter.h index 3aa50c9d4d..bcb23cfb29 100644 --- a/src/gpu/GrAutoLocaleSetter.h +++ b/src/gpu/GrAutoLocaleSetter.h @@ -22,7 +22,7 @@ * Helper class for ensuring that we don't use the wrong locale when building shaders. Android * doesn't support locale in the NDK, so this is a no-op there. */ -class GrAutoLocaleSetter { +class GrAutoLocaleSetter : public SkNoncopyable { public: GrAutoLocaleSetter (const char* name) { #if defined(SK_BUILD_FOR_WIN) @@ -32,6 +32,8 @@ public: fLocale = newlocale(LC_ALL, name, 0); if (fLocale) { fOldLocale = uselocale(fLocale); + } else { + fOldLocale = static_cast(0); } #else (void) name; // suppress unused param warning. -- cgit v1.2.3