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
This commit is contained in:
parent
ff53af85f6
commit
4222e19aea
@ -22,7 +22,7 @@
|
|||||||
* Helper class for ensuring that we don't use the wrong locale when building shaders. Android
|
* 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.
|
* doesn't support locale in the NDK, so this is a no-op there.
|
||||||
*/
|
*/
|
||||||
class GrAutoLocaleSetter {
|
class GrAutoLocaleSetter : public SkNoncopyable {
|
||||||
public:
|
public:
|
||||||
GrAutoLocaleSetter (const char* name) {
|
GrAutoLocaleSetter (const char* name) {
|
||||||
#if defined(SK_BUILD_FOR_WIN)
|
#if defined(SK_BUILD_FOR_WIN)
|
||||||
@ -32,6 +32,8 @@ public:
|
|||||||
fLocale = newlocale(LC_ALL, name, 0);
|
fLocale = newlocale(LC_ALL, name, 0);
|
||||||
if (fLocale) {
|
if (fLocale) {
|
||||||
fOldLocale = uselocale(fLocale);
|
fOldLocale = uselocale(fLocale);
|
||||||
|
} else {
|
||||||
|
fOldLocale = static_cast<locale_t>(0);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
(void) name; // suppress unused param warning.
|
(void) name; // suppress unused param warning.
|
||||||
|
Loading…
Reference in New Issue
Block a user