From b8f94b37b35337562cb34c5fe9e7987a6566ee39 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 4 Sep 2008 17:54:06 +0000 Subject: [PATCH] app/base/base-utils.h The return type of get_pid() should be gint, not 2008-09-04 Tor Lillqvist * app/base/base-utils.h * app/base/base-utils.c: The return type of get_pid() should be gint, not GPid. This matches also the C library on Windows, in which the return type of getpid() is int, not a pointer or intptr_t. The use for GPid in the GLib API is as a "handle" to a descendant processes, returned by the g_spawn_*() functions, and passed to the g_child_watch_*() functions, not as a "process identifier". svn path=/trunk/; revision=26866 --- ChangeLog | 9 +++++++++ app/base/base-utils.c | 4 ++-- app/base/base-utils.h | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6f4f5d8c97..f899f41e40 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2008-09-04 Tor Lillqvist + * app/base/base-utils.h + * app/base/base-utils.c: The return type of get_pid() should be + gint, not GPid. This matches also the C library on Windows, in + which the return type of getpid() is int, not a pointer or + intptr_t. The use for GPid in the GLib API is as a "handle" to a + descendant processes, returned by the g_spawn_*() functions, and + passed to the g_child_watch_*() functions, not as a "process + identifier". + * tools/gimptool.c: Make it compile without warnings also with gcc -Wwrite-strings. Use cmd.exe instead of command.com to execute the COPY and DEL commands on Windows. diff --git a/app/base/base-utils.c b/app/base/base-utils.c index 5ed2774d94..f1d50b0a1d 100644 --- a/app/base/base-utils.c +++ b/app/base/base-utils.c @@ -38,10 +38,10 @@ /* public functions */ -GPid +gint get_pid (void) { - return getpid (); + return (gint) getpid (); } gint diff --git a/app/base/base-utils.h b/app/base/base-utils.h index 71da944818..7abe0785c2 100644 --- a/app/base/base-utils.h +++ b/app/base/base-utils.h @@ -20,7 +20,7 @@ #define __BASE_H__ -GPid get_pid (void); +gint get_pid (void); gint get_number_of_processors (void); guint64 get_physical_memory_size (void);