pspp-cvs
[Top][All Lists]
Advanced

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

[Pspp-cvs] pspp/src libpspp/str.h libpspp/str.c libpspp/Ch...


From: Ben Pfaff
Subject: [Pspp-cvs] pspp/src libpspp/str.h libpspp/str.c libpspp/Ch...
Date: Mon, 15 May 2006 05:08:25 +0000

CVSROOT:        /cvsroot/pspp
Module name:    pspp
Branch:         
Changes by:     Ben Pfaff <address@hidden>      06/05/15 05:08:25

Modified files:
        src/libpspp    : str.h str.c ChangeLog 
        src/language/dictionary: sys-file-info.c 

Log message:
        Removed nsprintf(), nvsprintf().
        Moved spprintf() definition into str.c.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/libpspp/str.h.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/libpspp/str.c.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/libpspp/ChangeLog.diff?tr1=1.24&tr2=1.25&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/language/dictionary/sys-file-info.c.diff?tr1=1.7&tr2=1.8&r1=text&r2=text

Patches:
Index: pspp/src/language/dictionary/sys-file-info.c
diff -u pspp/src/language/dictionary/sys-file-info.c:1.7 
pspp/src/language/dictionary/sys-file-info.c:1.8
--- pspp/src/language/dictionary/sys-file-info.c:1.7    Fri May  5 04:53:13 2006
+++ pspp/src/language/dictionary/sys-file-info.c        Mon May 15 05:08:25 2006
@@ -482,11 +482,11 @@
           double x, y;
           mv_pop_range (&mv, &x, &y);
           if (x == LOWEST)
-            cp += nsprintf (cp, "LOWEST THRU %g", y);
+            cp += sprintf (cp, "LOWEST THRU %g", y);
           else if (y == HIGHEST)
-            cp += nsprintf (cp, "%g THRU HIGHEST", x);
+            cp += sprintf (cp, "%g THRU HIGHEST", x);
           else
-            cp += nsprintf (cp, "%g THRU %g", x, y);
+            cp += sprintf (cp, "%g THRU %g", x, y);
           cnt++;
         }
       while (mv_has_value (&mv)) 
@@ -494,9 +494,9 @@
           union value value;
           mv_pop_value (&mv, &value);
           if (cnt++ > 0)
-            cp += nsprintf (cp, "; ");
+            cp += sprintf (cp, "; ");
           if (v->type == NUMERIC)
-            cp += nsprintf (cp, "%g", value.f);
+            cp += sprintf (cp, "%g", value.f);
           else 
             {
               *cp++ = '"';
Index: pspp/src/libpspp/ChangeLog
diff -u pspp/src/libpspp/ChangeLog:1.24 pspp/src/libpspp/ChangeLog:1.25
--- pspp/src/libpspp/ChangeLog:1.24     Mon May 15 03:53:33 2006
+++ pspp/src/libpspp/ChangeLog  Mon May 15 05:08:25 2006
@@ -1,3 +1,12 @@
+Sun May 14 22:06:53 2006  Ben Pfaff  <address@hidden>
+
+       * str.c (spprintf): Moved definition of spprintf() here, from
+       str.h.
+
+       * str.h: (nsprintf) Removed.  Changed all users to use sprintf()
+       instead.
+       (nvsprintf) Removed.  Changed all users to use vsprintf() instead.
+
 Sun May 14 20:52:20 2006  Ben Pfaff  <address@hidden>
 
        * str.c (ds_init): Remove `capacity' argument and just initialize
Index: pspp/src/libpspp/str.c
diff -u pspp/src/libpspp/str.c:1.11 pspp/src/libpspp/str.c:1.12
--- pspp/src/libpspp/str.c:1.11 Mon May 15 03:53:33 2006
+++ pspp/src/libpspp/str.c      Mon May 15 05:08:25 2006
@@ -236,6 +236,21 @@
   for (; *s != '\0'; s++)
     *s = tolower ((unsigned char) *s);
 }
+
+/* Formats FORMAT into DST, as with sprintf(), and returns the
+   address of the terminating null written to DST. */
+char *
+spprintf (char *dst, const char *format, ...) 
+{
+  va_list args;
+  int count;
+
+  va_start (args, format);
+  count = vsprintf (dst, format, args);
+  va_end (args);
+
+  return dst + count;
+}
 
 /* Initializes ST with initial contents S. */
 void
Index: pspp/src/libpspp/str.h
diff -u pspp/src/libpspp/str.h:1.8 pspp/src/libpspp/str.h:1.9
--- pspp/src/libpspp/str.h:1.8  Mon May 15 03:53:33 2006
+++ pspp/src/libpspp/str.h      Mon May 15 05:08:25 2006
@@ -61,6 +61,8 @@
 void str_copy_buf_trunc (char *, size_t, const char *, size_t);
 void str_uppercase (char *);
 void str_lowercase (char *);
+
+char *spprintf (char *dst, const char *format, ...);
 
 /* Fixed-length strings. */
 struct fixed_string 
@@ -173,6 +175,7 @@
 void ds_vprintf (struct string *st, const char *, va_list);
 void ds_printf (struct string *, const char *, ...)
      PRINTF_FORMAT (2, 3);
+char *ds_append_uninit (struct string *st, size_t incr);
 
 #if __GNUC__ > 1
 extern inline void
@@ -202,27 +205,4 @@
 }
 #endif
 
-#define nsprintf sprintf
-#define nvsprintf vsprintf
-
-/* Formats FORMAT into DST, as with sprintf(), and returns the
-   address of the terminating null written to DST. */
-static inline char *
-spprintf (char *dst, const char *format, ...) 
-{
-  va_list args;
-  int count;
-
-  va_start (args, format);
-  count = nvsprintf (dst, format, args);
-  va_end (args);
-
-  return dst + count;
-}
-
-
-char * ds_append_uninit(struct string *st, size_t incr);
-
-
-
 #endif /* str_h */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]