From 73e1ed1fa7098a9bc4d0526f9a915427497e560e Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 25 Sep 2021 17:15:50 -0700 Subject: [PATCH] smyrma: push the scope of 'package_*' variables inwards These do not need to be exposed beyond main.c or even need to be globals. They are not used outside of a single function. --- cmd/smyrna/main.c | 10 +++------- cmd/smyrna/support.h | 5 ----- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/cmd/smyrna/main.c b/cmd/smyrna/main.c index f7353b72c..c0636b1bd 100644 --- a/cmd/smyrna/main.c +++ b/cmd/smyrna/main.c @@ -37,11 +37,6 @@ #include -#ifdef G_OS_WIN32 -gchar *package_prefix; -gchar *package_data_dir; -#endif -gchar *package_locale_dir; static char *smyrnaDir; /* path to directory containin smyrna data files */ char *smyrnaGlade; @@ -227,10 +222,11 @@ int main(int argc, char *argv[]) } load_attributes(); + gchar *package_locale_dir; #ifdef G_OS_WIN32 - package_prefix = + gchar *package_prefix = g_win32_get_package_installation_directory(NULL, NULL); - package_data_dir = g_build_filename(package_prefix, "share", NULL); + gchar *package_data_dir = g_build_filename(package_prefix, "share", NULL); package_locale_dir = g_build_filename(package_prefix, "share", "locale", NULL); #else diff --git a/cmd/smyrna/support.h b/cmd/smyrna/support.h index e01977e01..30b25f617 100644 --- a/cmd/smyrna/support.h +++ b/cmd/smyrna/support.h @@ -29,8 +29,3 @@ # define Q_(String) g_strip_context ((String), (String)) # define N_(String) (String) #endif - -/* These variables define various paths detected at runtime. */ -extern gchar *package_prefix; -extern gchar *package_data_dir; -extern gchar *package_locale_dir; -- 2.40.0