From c7fe0ed637f94077f4ff8f78d404fb0d741024d6 Mon Sep 17 00:00:00 2001 From: Victor Toso Date: Thu, 17 Jan 2019 15:25:58 +0100 Subject: [PATCH] tests: fix compiler warnings on Windows with mingw With commit 3f184c3abc55, the gst_dir variable becomes unusable in windows build. Moving it to linux scope to avoid warning: [433/673] Compiling C object 'tests/check/7d01337@@libs_profile@exe/libs_profile.c.obj'. ../tests/check/libs/profile.c: In function 'profile_suite': ../tests/check/libs/profile.c:688:10: warning: unused variable 'gst_dir' [-Wunused-variable] gchar *gst_dir; ^~~~~~~ Also fix a typo in the comment. --- tests/check/libs/profile.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/check/libs/profile.c b/tests/check/libs/profile.c index 543de2d..b9d5460 100644 --- a/tests/check/libs/profile.c +++ b/tests/check/libs/profile.c @@ -686,13 +686,14 @@ profile_suite (void) TCase *tc_chain = tcase_create ("general"); gboolean can_write; - /* cehck if we can create profiles */ + /* check if we can create profiles */ #ifdef G_OS_UNIX - gchar *gst_dir; - - gst_dir = g_build_filename (g_get_user_data_dir (), "gstreamer-1.0", NULL); - can_write = (g_access (gst_dir, R_OK | W_OK | X_OK) == 0); - g_free (gst_dir); + { + gchar *gst_dir = + g_build_filename (g_get_user_data_dir (), "gstreamer-1.0", NULL); + can_write = (g_access (gst_dir, R_OK | W_OK | X_OK) == 0); + g_free (gst_dir); + } #else can_write = FALSE; /* FIXME: fix can_write test on Windows */ #endif -- 2.7.4