Moved spprintf() definition into str.c.
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))
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++ = '"';
+Sun May 14 22:06:53 2006 Ben Pfaff <blp@gnu.org>
+
+ * 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 <blp@gnu.org>
* str.c (ds_init): Remove `capacity' argument and just initialize
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;
+}
\f
/* Initializes ST with initial contents S. */
void
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, ...);
\f
/* Fixed-length strings. */
struct fixed_string
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
}
#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 */