]> git.proxmox.com Git - qemu.git/commitdiff
slirp: Remove unused code for bad sprintf
authorStefan Weil <weil@mail.berlios.de>
Mon, 15 Nov 2010 20:15:26 +0000 (21:15 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Sun, 21 Nov 2010 15:16:57 +0000 (09:16 -0600)
Neither DECLARE_SPRINTF nor BAD_SPRINTF are needed for QEMU.

QEMU won't support systems with missing or bad declarations
for sprintf. The unused code was detected while looking for
functions with missing format checking. Instead of adding
GCC_FMT_ATTR, the unused code was removed.

Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
slirp/misc.c
slirp/slirp.h
slirp/slirp_config.h

index 1aeb401082d5955f11692787c2f198dd9276b3c6..19dbec491f032a5e2eb9144241d6c34ac21d41cc 100644 (file)
@@ -264,48 +264,6 @@ void lprint(const char *format, ...)
     va_end(args);
 }
 
-#ifdef BAD_SPRINTF
-
-#undef vsprintf
-#undef sprintf
-
-/*
- * Some BSD-derived systems have a sprintf which returns char *
- */
-
-int
-vsprintf_len(string, format, args)
-       char *string;
-       const char *format;
-       va_list args;
-{
-       vsprintf(string, format, args);
-       return strlen(string);
-}
-
-int
-#ifdef __STDC__
-sprintf_len(char *string, const char *format, ...)
-#else
-sprintf_len(va_alist) va_dcl
-#endif
-{
-       va_list args;
-#ifdef __STDC__
-       va_start(args, format);
-#else
-       char *string;
-       char *format;
-       va_start(args);
-       string = va_arg(args, char *);
-       format = va_arg(args, char *);
-#endif
-       vsprintf(string, format, args);
-       return strlen(string);
-}
-
-#endif
-
 void
 u_sleep(int usec)
 {
index 462292d57748388461301741307955b3eb09a983..dfd977aa0c1672fd97cb4fed5fb12961c0d3afd3 100644 (file)
@@ -237,20 +237,6 @@ void if_start(Slirp *);
 void if_start(struct ttys *);
 #endif
 
-#ifdef BAD_SPRINTF
-# define vsprintf vsprintf_len
-# define sprintf sprintf_len
- extern int vsprintf_len(char *, const char *, va_list);
- extern int sprintf_len(char *, const char *, ...);
-#endif
-
-#ifdef DECLARE_SPRINTF
-# ifndef BAD_SPRINTF
- extern int vsprintf(char *, const char *, va_list);
-# endif
- extern int vfprintf(FILE *, const char *, va_list);
-#endif
-
 #ifndef HAVE_STRERROR
  extern char *strerror(int error);
 #endif
index f19c7034caea47bc2fbdd95819a2b6bbe39417fb..18db45c8e42eb57d84bf47991890c36fc913975e 100644 (file)
@@ -85,9 +85,6 @@
 /* Define if the machine is big endian */
 //#undef HOST_WORDS_BIGENDIAN
 
-/* Define if your sprintf returns char * instead of int */
-#undef BAD_SPRINTF
-
 /* Define if you have readv */
 #undef HAVE_READV
 
@@ -97,9 +94,6 @@
 #define DECLARE_IOVEC
 #endif
 
-/* Define if a declaration of sprintf/fprintf is needed */
-#undef DECLARE_SPRINTF
-
 /* Define if you have a POSIX.1 sys/wait.h */
 #undef HAVE_SYS_WAIT_H