[gimp] libgimpbase: rename FILE * argument to stream instead of fd.



commit 9e8e321d62e070b11ed77be027ea0d94f788a0a3
Author: Jehan <jehan girinstud io>
Date:   Thu Feb 15 21:32:58 2018 +0100

    libgimpbase: rename FILE * argument to stream instead of fd.
    
    As noted in bug 793494, my naming was unfortunate. A FILE pointer is not
    a file descriptor (which is why we use fileno() on it).

 libgimpbase/gimputils.c |   16 ++++++++--------
 libgimpbase/gimputils.h |    2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/libgimpbase/gimputils.c b/libgimpbase/gimputils.c
index b68c51a..c4b7da1 100644
--- a/libgimpbase/gimputils.c
+++ b/libgimpbase/gimputils.c
@@ -1081,7 +1081,7 @@ gimp_flags_value_get_abbrev (GFlagsClass *flags_class,
 /**
  * gimp_print_stack_trace:
  * @prog_name: the program to attach to.
- * @fd: a #FILE * file descriptor.
+ * @stream: a #FILE * stream.
  * @trace: location to store a newly allocated string of the trace.
  *
  * Attempts to generate a stack trace at current code position in
@@ -1093,7 +1093,7 @@ gimp_flags_value_get_abbrev (GFlagsClass *flags_class,
  * or the stacktrace() API on platforms where it is available. It always
  * fails on Win32.
  *
- * The stack trace, once generated, will either be printed to @fd or
+ * The stack trace, once generated, will either be printed to @stream or
  * returned as a newly allocated string in @trace, if not #NULL.
  *
  * In some error cases (e.g. segmentation fault), trying to allocate
@@ -1108,7 +1108,7 @@ gimp_flags_value_get_abbrev (GFlagsClass *flags_class,
  **/
 gboolean
 gimp_print_stack_trace (const gchar *prog_name,
-                        gpointer     fd,
+                        gpointer     stream,
                         gchar      **trace)
 {
   gboolean stack_printed = FALSE;
@@ -1184,8 +1184,8 @@ gimp_print_stack_trace (const gchar *prog_name,
           stack_printed = TRUE;
 
           buffer[read_n] = '\0';
-          if (fd)
-            g_fprintf (fd, "%s", buffer);
+          if (stream)
+            g_fprintf (stream, "%s", buffer);
           if (trace)
             {
               if (! gtrace)
@@ -1220,8 +1220,8 @@ gimp_print_stack_trace (const gchar *prog_name,
             {
               for (i = 0; i < n_symbols; i++)
                 {
-                  if (fd)
-                    g_fprintf (fd, "%s\n", (const gchar *) symbols[i]);
+                  if (stream)
+                    g_fprintf (stream, "%s\n", (const gchar *) symbols[i]);
                   if (trace)
                     {
                       if (! gtrace)
@@ -1240,7 +1240,7 @@ gimp_print_stack_trace (const gchar *prog_name,
            * In some cases, this is necessary, especially during
            * segfault-type crashes.
            */
-          backtrace_symbols_fd (bt_buf, n_symbols, fileno ((FILE *) fd));
+          backtrace_symbols_fd (bt_buf, n_symbols, fileno ((FILE *) stream));
         }
       stack_printed = (n_symbols > 0);
     }
diff --git a/libgimpbase/gimputils.h b/libgimpbase/gimputils.h
index a4aef9e..2eefa26 100644
--- a/libgimpbase/gimputils.h
+++ b/libgimpbase/gimputils.h
@@ -76,7 +76,7 @@ const gchar   * gimp_flags_value_get_abbrev    (GFlagsClass  *flags_class,
                                                 GFlagsValue  *flags_value);
 
 gboolean        gimp_print_stack_trace         (const gchar  *prog_name,
-                                                gpointer      fd,
+                                                gpointer      stream,
                                                 gchar       **trace);
 void            gimp_on_error_query            (const gchar  *prog_name);
 


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