[gtk+/gtk-3-22] gtk/gtkfilechoosernativewin32.c: Declare variables at top-of-block



commit 7f065b379c9cda2ec67fe1a0a82943619aec19ee
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Tue Aug 8 17:13:34 2017 +0800

    gtk/gtkfilechoosernativewin32.c: Declare variables at top-of-block
    
    Since GTK+-3.22.x is not advertised to use C99, make sure that the build
    works on pre-C99 compilers such as pre-2013 Visual Studio.

 gtk/gtkfilechoosernativewin32.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkfilechoosernativewin32.c b/gtk/gtkfilechoosernativewin32.c
index cb9c42e..4090bb6 100644
--- a/gtk/gtkfilechoosernativewin32.c
+++ b/gtk/gtkfilechoosernativewin32.c
@@ -239,13 +239,16 @@ ifiledialogevents_OnTypeChange (IFileDialogEvents * self,
   FileDialogEvents *events = (FileDialogEvents *) self;
   UINT fileType;
   HRESULT hr = IFileDialog_GetFileTypeIndex (pfd, &fileType);
+  GSList *filters;
+
   if (FAILED (hr))
     {
       g_warning_hr ("Can't get current file type", hr);
       return S_OK;
     }
+
   fileType--; // fileTypeIndex starts at 1 
-  GSList *filters = gtk_file_chooser_list_filters (GTK_FILE_CHOOSER (events->data->self));
+  filters = gtk_file_chooser_list_filters (GTK_FILE_CHOOSER (events->data->self));
   events->data->self->current_filter = g_slist_nth_data (filters, fileType);
   g_slist_free (filters);
   g_object_notify (G_OBJECT (events->data->self), "filter");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]