[gimp/gimp-2-10] plug-ins: fix a few more warnings.



commit 4c4c54af2dffd6d01a8fc456118dd417856f99aa
Author: Jehan <jehan girinstud io>
Date:   Wed Nov 14 15:25:00 2018 +0100

    plug-ins: fix a few more warnings.
    
    There are still a bunch of warnings, especially regarding usage of
    GtkTable, GtkMisc and some unused functions.
    
    (cherry picked from commit 8f49fad3dac9199efe1e5e9c6a66a128bb8c3dbe)

 plug-ins/file-dds/ddswrite.c | 18 +++++++++---------
 plug-ins/file-dds/mipmap.c   | 20 +++++++++-----------
 2 files changed, 18 insertions(+), 20 deletions(-)
---
diff --git a/plug-ins/file-dds/ddswrite.c b/plug-ins/file-dds/ddswrite.c
index f86841dd66..e0ea126a44 100644
--- a/plug-ins/file-dds/ddswrite.c
+++ b/plug-ins/file-dds/ddswrite.c
@@ -1794,11 +1794,11 @@ static gint save_dialog(gint32 image_id, gint32 drawable_id)
 
    basetype = gimp_image_base_type(image_id);
 
-   dlg = gimp_dialog_new("Save as DDS", "dds", NULL, GTK_WIN_POS_MOUSE,
-                         gimp_standard_help_func, SAVE_PROC,
-                         GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-                         GTK_STOCK_OK, GTK_RESPONSE_OK,
-                         NULL);
+   dlg = gimp_dialog_new ("Save as DDS", "dds", NULL, GTK_WIN_POS_MOUSE,
+                          gimp_standard_help_func, SAVE_PROC,
+                         _("Cancel"), GTK_RESPONSE_CANCEL,
+                         _("OK"),     GTK_RESPONSE_OK,
+                          NULL);
 
    g_signal_connect(dlg, "response",
                       G_CALLBACK(save_dialog_response),
@@ -1809,7 +1809,7 @@ static gint save_dialog(gint32 image_id, gint32 drawable_id)
 
    gtk_window_set_resizable(GTK_WINDOW(dlg), 0);
 
-   vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4);
+   vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
    gtk_container_set_border_width(GTK_CONTAINER(vbox), 8);
    gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area (GTK_DIALOG(dlg))),
                       vbox, 1, 1, 0);
@@ -1897,7 +1897,7 @@ static gint save_dialog(gint32 image_id, gint32 drawable_id)
 
    g_signal_connect(opt, "changed",
                       G_CALLBACK(mipmaps_selected), &image_id);
-   
+
    string_value_combo_set_item_sensitive(opt, DDS_MIPMAP_EXISTING,
                                          check_mipmaps(image_id, dds_write_vals.savetype));
 
@@ -1908,7 +1908,7 @@ static gint save_dialog(gint32 image_id, gint32 drawable_id)
                                          is_mipmap_chain_valid);
 
 
-   hbox = gtk_hbox_new(0, 8);
+   hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
    gtk_box_pack_start(GTK_BOX(vbox), hbox, 1, 1, 0);
    gtk_widget_show(hbox);
 
@@ -1960,7 +1960,7 @@ static gint save_dialog(gint32 image_id, gint32 drawable_id)
    gtk_widget_show(expander);
 
 
-   vbox2 = gtk_vbox_new(0, 4);
+   vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
    gtk_container_add(GTK_CONTAINER(expander), vbox2);
    gtk_widget_show(vbox2);
 
diff --git a/plug-ins/file-dds/mipmap.c b/plug-ins/file-dds/mipmap.c
index 34f2d66283..fda90ff1ec 100644
--- a/plug-ins/file-dds/mipmap.c
+++ b/plug-ins/file-dds/mipmap.c
@@ -391,6 +391,7 @@ static void scale_image(unsigned char *dst, int dw, int dh,
    float yscale = MIN(yfactor, 1.0f) / blur;
    float xsupport = support / xscale;
    float ysupport = support / yscale;
+   unsigned char *tmp;
 
    if(xsupport <= 0.5f)
    {
@@ -403,8 +404,6 @@ static void scale_image(unsigned char *dst, int dw, int dh,
       yscale = 1.0f;
    }
 
-   unsigned char *tmp;
-
 #ifdef _OPENMP
    tmp = g_malloc(sw * bpp * omp_get_max_threads());
 #else
@@ -543,13 +542,6 @@ static void scale_volume_image(unsigned char *dst, int dw, int dh, int dd,
                                wrapfunc_t wrap,
                                int gc, float gamma)
 {
-   /* down to a 2D image, use the faster 2D image resampler */
-   if(dd == 1 && sd == 1)
-   {
-      scale_image(dst, dw, dh, src, sw, sh, bpp, filter, support, wrap, gc, gamma);
-      return;
-   }
-
    const float blur = 1.0f;
    const float xfactor = (float)dw / (float)sw;
    const float yfactor = (float)dh / (float)sh;
@@ -568,6 +560,14 @@ static void scale_volume_image(unsigned char *dst, int dw, int dh, int dd,
    float xsupport = support / xscale;
    float ysupport = support / yscale;
    float zsupport = support / zscale;
+   unsigned char *tmp1, *tmp2;
+
+   /* down to a 2D image, use the faster 2D image resampler */
+   if(dd == 1 && sd == 1)
+   {
+      scale_image(dst, dw, dh, src, sw, sh, bpp, filter, support, wrap, gc, gamma);
+      return;
+   }
 
    if(xsupport <= 0.5f)
    {
@@ -585,8 +585,6 @@ static void scale_volume_image(unsigned char *dst, int dw, int dh, int dd,
       zscale = 1.0f;
    }
 
-   unsigned char *tmp1, *tmp2;
-
    tmp1 = g_malloc(sh * sw * bpp);
    tmp2 = g_malloc(dh * sw * bpp);
 


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