]> granicus.if.org Git - graphviz/commitdiff
smyrma: push the scope of 'package_*' variables inwards
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 26 Sep 2021 00:15:50 +0000 (17:15 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 28 Sep 2021 02:17:05 +0000 (19:17 -0700)
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
cmd/smyrna/support.h

index f7353b72ccf34a37236bd73f34f2e12dd148de64..c0636b1bd9701d7a1a97d9ccdaed26856c0182fb 100644 (file)
 
 #include <getopt.h>
 
-#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
index e01977e0187212b44722920e127ad0fe66030891..30b25f6179d585348f7ca6a828a2e1d156bb086a 100644 (file)
@@ -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;