From b60a4ec4d1cf4a9331329e28275d916213ab7492 Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Wed, 9 Feb 2022 22:06:14 -0800 Subject: [PATCH] Mend compile-time warnings in locale_to_closest_locale Also, not currently used except for macOS, so wrapping in #ifdef to avoid "defined but not used" warning. --- src/i18n.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/i18n.c b/src/i18n.c index 98a499ffd..9dbffb3e3 100644 --- a/src/i18n.c +++ b/src/i18n.c @@ -4,7 +4,7 @@ For Tux Paint Language-related functions - Copyright (c) 2002-2020 by Bill Kendrick and others + Copyright (c) 2002-2022 by Bill Kendrick and others bill@newbreedsoftware.com http://www.tuxpaint.org/ @@ -25,7 +25,7 @@ $Id$ - June 14, 2002 - October 25, 2021 + June 14, 2002 - February 9, 2022 */ #include @@ -818,6 +818,9 @@ static const char *language_to_locale(const char *langstr) return NULL; } + +#if defined(__APPLE__) + /** * For a given locale, return the known locale that matches it closest, or exit * with a usage error. @@ -834,11 +837,11 @@ static const char *locale_to_closest_locale(const char *inlocale) int j = 0; /* find the locale with the longest string match */ - for (i=0; i