[gimp] libgimpbase, plug-ins: fix all warnings to g_stat() calls.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] libgimpbase, plug-ins: fix all warnings to g_stat() calls.
- Date: Sun, 22 Sep 2019 11:56:47 +0000 (UTC)
commit 6bc6a07b7e767ac0f68a1f60f0188ddbc0d41821
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).
libgimpbase/gimpenv.c | 10 +++++-----
plug-ins/common/file-compressor.c | 6 +++---
plug-ins/common/mail.c | 6 +++---
plug-ins/file-psd/psd-load.c | 14 +++++++-------
plug-ins/file-psd/psd-thumb-load.c | 12 ++++++------
5 files changed, 24 insertions(+), 24 deletions(-)
---
diff --git a/libgimpbase/gimpenv.c b/libgimpbase/gimpenv.c
index 7af87009f2..73dd9d353f 100644
--- a/libgimpbase/gimpenv.c
+++ b/libgimpbase/gimpenv.c
@@ -1134,11 +1134,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 fc8305d8a6..71f4661aac 100644
--- a/plug-ins/common/file-compressor.c
+++ b/plug-ins/common/file-compressor.c
@@ -546,9 +546,9 @@ load_image (const CompressorEntry *compressor,
static gboolean
valid_file (GFile *file)
{
- gchar *filename;
- struct stat buf;
- gboolean valid;
+ gchar *filename;
+ GStatBuf buf;
+ gboolean valid;
filename = g_file_get_path (file);
valid = g_stat (filename, &buf) == 0 && buf.st_size > 0;
diff --git a/plug-ins/common/mail.c b/plug-ins/common/mail.c
index 9adacbbf1f..462dba5ab7 100644
--- a/plug-ins/common/mail.c
+++ b/plug-ins/common/mail.c
@@ -674,9 +674,9 @@ send_dialog (void)
static gboolean
valid_file (GFile *file)
{
- gchar *filename;
- struct stat buf;
- gboolean valid;
+ gchar *filename;
+ GStatBuf buf;
+ gboolean valid;
filename = g_file_get_path (file);
valid = 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 1d9718cbe2..a756282c51 100644
--- a/plug-ins/file-psd/psd-load.c
+++ b/plug-ins/file-psd/psd-load.c
@@ -119,13 +119,13 @@ load_image (GFile *file,
gboolean *profile_loaded,
GError **load_error)
{
- gchar *filename;
- FILE *f;
- struct stat st;
- PSDimage img_a;
- PSDlayer **lyr_a;
- GimpImage *image = NULL;
- GError *error = NULL;
+ gchar *filename;
+ FILE *f;
+ GStatBuf st;
+ PSDimage img_a;
+ PSDlayer **lyr_a;
+ GimpImage *image = NULL;
+ GError *error = NULL;
filename = g_file_get_path (file);
diff --git a/plug-ins/file-psd/psd-thumb-load.c b/plug-ins/file-psd/psd-thumb-load.c
index 5368e4d35a..041f106e28 100644
--- a/plug-ins/file-psd/psd-thumb-load.c
+++ b/plug-ins/file-psd/psd-thumb-load.c
@@ -61,12 +61,12 @@ load_thumbnail_image (GFile *file,
gint *height,
GError **load_error)
{
- gchar *filename;
- FILE *f;
- struct stat st;
- PSDimage img_a;
- GimpImage *image = NULL;
- GError *error = NULL;
+ gchar *filename;
+ FILE *f;
+ GStatBuf st;
+ PSDimage img_a;
+ GimpImage *image = NULL;
+ GError *error = NULL;
filename = g_file_get_path (file);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]