[beast: 15/24] SFI: internal rename of gstring_format(), which uses Rapicorn's string_format()



commit 73f2837981ef67ff0c93ebc508fa981c39ed3147
Author: Tim Janik <timj gnu org>
Date:   Wed Sep 23 10:00:15 2015 +0200

    SFI: internal rename of gstring_format(), which uses Rapicorn's string_format()

 sfi/sfiserial.cc |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)
---
diff --git a/sfi/sfiserial.cc b/sfi/sfiserial.cc
index a83f4b9..ddef4bd 100644
--- a/sfi/sfiserial.cc
+++ b/sfi/sfiserial.cc
@@ -128,7 +128,7 @@ string_to_cescape (const String &str)   // FIXME: move
 /* --- storage helpers --- */
 #define        gstring_puts(gstring, string)   g_string_append (gstring, string)
 #define        gstring_putc(gstring, vchar)    g_string_append_c (gstring, vchar)
-#define        gstring_printf(gstring, ...)    g_string_append (gstring, Rapicorn::string_format 
(__VA_ARGS__).c_str())
+#define        gstring_format(gstring, ...)    g_string_append (gstring, Rapicorn::string_format 
(__VA_ARGS__).c_str())
 
 static void
 gstring_break (GString  *gstring,
@@ -207,7 +207,7 @@ sfi_serialize_rec_typed (SfiRec  *rec,
        {
          if (i)
            gstring_putc (gstring, ' ');
-         gstring_printf (gstring, "(%s ", rec->field_names[i]);
+         gstring_format (gstring, "(%s ", rec->field_names[i]);
          sfi_value_store_typed (rec->fields + i, gstring);
          gstring_putc (gstring, ')');
        }
@@ -303,9 +303,9 @@ sfi_serialize_primitives (SfiSCategory scat,
          SfiInt iv = sfi_value_get_int (value);
           if (g_option_check (hints, "hex") &&  /* hexadecimal hint */
               iv <= G_MAXINT)
-            gstring_printf (gstring, "0x%08x", iv);
+            gstring_format (gstring, "0x%08x", iv);
           else
-            gstring_printf (gstring, "%d", iv);
+            gstring_format (gstring, "%d", iv);
        }
       else
        {
@@ -320,7 +320,7 @@ sfi_serialize_primitives (SfiSCategory scat,
       if (gstring)
        {
          SfiNum num = sfi_value_get_num (value);
-         gstring_printf (gstring, "%lld", num);
+         gstring_format (gstring, "%lld", num);
        }
       else
        {
@@ -377,7 +377,7 @@ sfi_serialize_primitives (SfiSCategory scat,
          if (!cstring)
            gstring_puts (gstring, SFI_SERIAL_NULL_TOKEN);
          else
-           gstring_printf (gstring, "%s", cstring);
+           gstring_format (gstring, "%s", cstring);
        }
       else
        {
@@ -394,7 +394,7 @@ sfi_serialize_primitives (SfiSCategory scat,
       if (gstring)
        {
          SfiProxy proxy = sfi_value_get_proxy (value);
-         gstring_printf (gstring, "%lu", proxy);
+         gstring_format (gstring, "%lu", proxy);
        }
       else
        {
@@ -416,9 +416,9 @@ sfi_serialize_primitives (SfiSCategory scat,
              guint i;
              gstring_puts (gstring, "(");
              if (bblock->n_bytes)
-               gstring_printf (gstring, "%u", bblock->bytes[0]);
+               gstring_format (gstring, "%u", bblock->bytes[0]);
              for (i = 1; i < bblock->n_bytes; i++)
-               gstring_printf (gstring, " %u", bblock->bytes[i]);
+               gstring_format (gstring, " %u", bblock->bytes[i]);
              gstring_puts (gstring, ")");
            }
        }
@@ -454,9 +454,9 @@ sfi_serialize_primitives (SfiSCategory scat,
              guint i;
              gstring_puts (gstring, "(");
              if (fblock->n_values)
-                gstring_printf (gstring, "%.9g", fblock->values[0]);
+                gstring_format (gstring, "%.9g", fblock->values[0]);
              for (i = 1; i < fblock->n_values; i++)
-                gstring_printf (gstring, " %.9g", fblock->values[i]);
+                gstring_format (gstring, " %.9g", fblock->values[i]);
              gstring_puts (gstring, ")");
            }
        }
@@ -518,7 +518,7 @@ sfi_serialize_primitives (SfiSCategory scat,
       if (gstring)
        {
          gchar *string = sfi_note_to_string (sfi_value_get_int (value));
-         gstring_printf (gstring, "%s", string);
+         gstring_format (gstring, "%s", string);
          g_free (string);
        }
       else
@@ -545,7 +545,7 @@ sfi_serialize_primitives (SfiSCategory scat,
       if (gstring)
        {
          gchar *string = sfi_time_to_string (sfi_time_to_utc (sfi_value_get_num (value)));
-         gstring_printf (gstring, "\"%s\"", string);
+         gstring_format (gstring, "\"%s\"", string);
          g_free (string);
        }
       else
@@ -598,12 +598,12 @@ sfi_value_store_typed (const GValue *value,
     case SFI_SCAT_BBLOCK:
     case SFI_SCAT_FBLOCK:
     case SFI_SCAT_PSPEC:
-      gstring_printf (gstring, "(%c ", scat);
+      gstring_format (gstring, "(%c ", scat);
       sfi_serialize_primitives (scat, (GValue*) value, gstring, NULL, NULL);
       gstring_putc (gstring, ')');
       break;
     case SFI_SCAT_SEQ:
-      gstring_printf (gstring, "(%c", scat);
+      gstring_format (gstring, "(%c", scat);
       seq = sfi_value_get_seq (value);
       if (!seq)
        gstring_puts (gstring, " " SFI_SERIAL_NULL_TOKEN);
@@ -622,7 +622,7 @@ sfi_value_store_typed (const GValue *value,
       gstring_putc (gstring, ')');
       break;
     case SFI_SCAT_REC:
-      gstring_printf (gstring, "(%c ", scat);
+      gstring_format (gstring, "(%c ", scat);
       rec = sfi_value_get_rec (value);
       if (rec)
        sfi_rec_sort (rec);
@@ -793,7 +793,7 @@ value_store_param (const GValue *value,
                    }
                  else
                    gstring_break (gstring, needs_break, indent + 1);
-                 gstring_printf (gstring, "(%s ", fspecs.fields[i]->name); /* open field */
+                 gstring_format (gstring, "(%s ", fspecs.fields[i]->name); /* open field */
                  value_store_param (fvalue, gstring, needs_break, FALSE, fspecs.fields[i], indent + 2 + 1);
                  gstring_putc (gstring, ')'); /* close field */
                }
@@ -823,7 +823,7 @@ sfi_value_store_param (const GValue *value,
   assert_return (G_VALUE_HOLDS (value, G_PARAM_SPEC_VALUE_TYPE (pspec)));
 
   gstring_check_break (gstring, &needs_break, indent);
-  gstring_printf (gstring, "(%s ", pspec->name);
+  gstring_format (gstring, "(%s ", pspec->name);
   value_store_param (value, gstring, &needs_break, TRUE, pspec, indent + 2);
   gstring_putc (gstring, ')');
 }


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