[gimp/gimp-2-10] libgimpbase, plug-ins: fix all warnings to g_stat() calls.



commit 771304d73bcaac10271bf15dea9ea6a8b9335fed
Author: Jehan <jehan girinstud io>
Date:   Sun Sep 22 13:52:37 2019 +0200

    libgimpbase, plug-ins: fix all warnings to g_stat() calls.
    
    The second parameter should be GStatBuf*, which will be defined to be
    the right struct depending on the actual platform. Using `struct stat*`
    was good on Linux but was outputting warnings on other platforms (at
    least on Win32).
    
    (cherry picked from commit 6bc6a07b7e767ac0f68a1f60f0188ddbc0d41821)

 libgimpbase/gimpenv.c              | 10 +++++-----
 plug-ins/common/file-compressor.c  |  2 +-
 plug-ins/common/mail.c             |  2 +-
 plug-ins/file-psd/psd-load.c       |  2 +-
 plug-ins/file-psd/psd-thumb-load.c |  2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/libgimpbase/gimpenv.c b/libgimpbase/gimpenv.c
index 65ea8201d0..d4040c80a7 100644
--- a/libgimpbase/gimpenv.c
+++ b/libgimpbase/gimpenv.c
@@ -1185,11 +1185,11 @@ gimp_path_free (GList *path)
 gchar *
 gimp_path_get_user_writable_dir (GList *path)
 {
-  GList       *list;
-  uid_t        euid;
-  gid_t        egid;
-  struct stat  filestat;
-  gint         err;
+  GList    *list;
+  uid_t     euid;
+  gid_t     egid;
+  GStatBuf  filestat;
+  gint      err;
 
   g_return_val_if_fail (path != NULL, NULL);
 
diff --git a/plug-ins/common/file-compressor.c b/plug-ins/common/file-compressor.c
index a9c00ac905..a51da9bad0 100644
--- a/plug-ins/common/file-compressor.c
+++ b/plug-ins/common/file-compressor.c
@@ -523,7 +523,7 @@ load_image (const Compressor   *compressor,
 static gboolean
 valid_file (const gchar *filename)
 {
-  struct stat buf;
+  GStatBuf buf;
 
   return g_stat (filename, &buf) == 0 && buf.st_size > 0;
 }
diff --git a/plug-ins/common/mail.c b/plug-ins/common/mail.c
index 3068252b45..668c932979 100644
--- a/plug-ins/common/mail.c
+++ b/plug-ins/common/mail.c
@@ -613,7 +613,7 @@ send_dialog (void)
 static gboolean
 valid_file (const gchar *filename)
 {
-  struct stat buf;
+  GStatBuf buf;
 
   return g_stat (filename, &buf) == 0 && buf.st_size > 0;
 }
diff --git a/plug-ins/file-psd/psd-load.c b/plug-ins/file-psd/psd-load.c
index c1a1acce48..46a0c76d9f 100644
--- a/plug-ins/file-psd/psd-load.c
+++ b/plug-ins/file-psd/psd-load.c
@@ -120,7 +120,7 @@ load_image (const gchar  *filename,
             GError      **load_error)
 {
   FILE         *f;
-  struct stat   st;
+  GStatBuf      st;
   PSDimage      img_a;
   PSDlayer    **lyr_a;
   gint32        image_id = -1;
diff --git a/plug-ins/file-psd/psd-thumb-load.c b/plug-ins/file-psd/psd-thumb-load.c
index a4c7c7d5fc..7ce646f9b4 100644
--- a/plug-ins/file-psd/psd-thumb-load.c
+++ b/plug-ins/file-psd/psd-thumb-load.c
@@ -62,7 +62,7 @@ load_thumbnail_image (const gchar  *filename,
                       GError      **load_error)
 {
   FILE        *f;
-  struct stat  st;
+  GStatBuf     st;
   PSDimage     img_a;
   gint32       image_id = -1;
   GError      *error    = NULL;


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