From: Matthew Fernandez Date: Sun, 26 Sep 2021 00:15:50 +0000 (-0700) Subject: smyrma: push the scope of 'package_*' variables inwards X-Git-Tag: 2.49.2~33^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=73e1ed1fa7098a9bc4d0526f9a915427497e560e;p=graphviz 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. --- 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;