[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pspp-cvs] pspp ./ChangeLog ./acinclude.m4 ./configure.ac ...
From: |
Ben Pfaff |
Subject: |
[Pspp-cvs] pspp ./ChangeLog ./acinclude.m4 ./configure.ac ... |
Date: |
Sat, 04 Mar 2006 20:15:32 +0000 |
CVSROOT: /cvsroot/pspp
Module name: pspp
Branch:
Changes by: Ben Pfaff <address@hidden> 06/03/04 20:15:32
Modified files:
. : ChangeLog acinclude.m4 configure.ac
src : ChangeLog
src/libpspp : ChangeLog str.c str.h
Log message:
Remove BLP_RANDOM. Its results were unused. Remove
BLP_IS_SPRINTF_GOOD. We now assume that the system's sprintf()
returns the correct value.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/ChangeLog.diff?tr1=1.42&tr2=1.43&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/acinclude.m4.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/configure.ac.diff?tr1=1.37&tr2=1.38&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/ChangeLog.diff?tr1=1.263&tr2=1.264&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/libpspp/ChangeLog.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/libpspp/str.c.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/libpspp/str.h.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
Patches:
Index: pspp/ChangeLog
diff -u pspp/ChangeLog:1.42 pspp/ChangeLog:1.43
--- pspp/ChangeLog:1.42 Sat Mar 4 00:28:14 2006
+++ pspp/ChangeLog Sat Mar 4 20:15:32 2006
@@ -1,3 +1,13 @@
+Sat Mar 4 11:53:36 2006 Ben Pfaff <address@hidden>
+
+ * acinclude.m4: Remove BLP_RANDOM. Its results were unused.
+ Remove BLP_IS_SPRINTF_GOOD. We now assume that the system's
+ sprintf() returns the correct value.
+
+ * configure.ac: Don't call those macros.
+
+John Darrington:
+
* Deleted Make.build (inserted its contents into Makefile.am).
* Moved the version number to 0.4.1
Index: pspp/acinclude.m4
diff -u pspp/acinclude.m4:1.3 pspp/acinclude.m4:1.4
--- pspp/acinclude.m4:1.3 Sat Mar 4 00:28:15 2006
+++ pspp/acinclude.m4 Sat Mar 4 20:15:32 2006
@@ -38,51 +38,6 @@
`long's.])
AC_MSG_RESULT($blp_int_digits) ])dnl
-dnl Check quality of this machine's sprintf implementation.
-
-AC_DEFUN([BLP_IS_SPRINTF_GOOD],
-[
-AC_MSG_CHECKING(if sprintf returns a char count)
-AC_CACHE_VAL(blp_is_sprintf_good,
- [AC_TRY_RUN([#include <stdio.h>
- int
- main()
- {
- char s[8];
- exit((int)sprintf(s, "abcdefg")!=7);
- }
- ],
- eval "blp_is_sprintf_good=yes",
- eval "blp_is_sprintf_good=no",
- eval "blp_is_sprintf_good=no")
- ])
-if test "$blp_is_sprintf_good" = yes; then
- AC_DEFINE([HAVE_GOOD_SPRINTF], 1,
- [Define if sprintf() returns the number of characters written
- to the destination string, excluding the null terminator.])
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT(no)
-fi
-])dnl
-
-dnl Check for proper random number generator.
-
-AC_DEFUN([BLP_RANDOM],
-[
-AC_MSG_CHECKING(random number generator)
-AC_CACHE_VAL(blp_random_good,
- AC_TRY_COMPILE([#include <stdlib.h>], [int x=RAND_MAX;],
- blp_random_good=yes, blp_random_good=no))
-if test "$blp_random_good" = yes; then
- AC_DEFINE([HAVE_GOOD_RANDOM], 1,
- [Define if rand() and company work according to ANSI.])
- AC_MSG_RESULT(good)
-else
- AC_MSG_RESULT(bad)
-fi
-])dnl
-
dnl Check for readline and history libraries.
dnl Modified for PSPP by Ben Pfaff, based on readline.m4 serial 3 from
Index: pspp/configure.ac
diff -u pspp/configure.ac:1.37 pspp/configure.ac:1.38
--- pspp/configure.ac:1.37 Sat Mar 4 00:28:15 2006
+++ pspp/configure.ac Sat Mar 4 20:15:32 2006
@@ -103,12 +103,7 @@
AC_C_BIGENDIAN
-
-
-
-BLP_IS_SPRINTF_GOOD
BLP_INT_DIGITS
-BLP_RANDOM
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([strchr strrchr __setfpucw isinf isnan finite getpid
feholdexcept])
Index: pspp/src/ChangeLog
diff -u pspp/src/ChangeLog:1.263 pspp/src/ChangeLog:1.264
--- pspp/src/ChangeLog:1.263 Sat Mar 4 12:38:36 2006
+++ pspp/src/ChangeLog Sat Mar 4 20:15:32 2006
@@ -1,3 +1,5 @@
+John Darrington:
+
* Replaced '_' with '-' in most filenames.
* Renamed files as follows:
Index: pspp/src/libpspp/ChangeLog
diff -u pspp/src/libpspp/ChangeLog:1.1 pspp/src/libpspp/ChangeLog:1.2
--- pspp/src/libpspp/ChangeLog:1.1 Sat Mar 4 01:11:57 2006
+++ pspp/src/libpspp/ChangeLog Sat Mar 4 20:15:32 2006
@@ -1,3 +1,12 @@
+Sat Mar 4 11:55:16 2006 Ben Pfaff <address@hidden>
+
+ * str.h: Now assume that sprintf() returns the correct value.
+ Always implement spprintf as a static inline function. Change
+ nsprintf, nvsprintf to simple macros that call sprintf, vsprintf.
+
+ * str.c: Remove spprintf, nsprintf, nvsprintf conditional
+ definitions.
+
Thu Mar 2 08:40:33 WST 2006 John Darrington <address@hidden>
* Moved files from src directory
Index: pspp/src/libpspp/str.c
diff -u pspp/src/libpspp/str.c:1.1 pspp/src/libpspp/str.c:1.2
--- pspp/src/libpspp/str.c:1.1 Sat Mar 4 01:11:57 2006
+++ pspp/src/libpspp/str.c Sat Mar 4 20:15:32 2006
@@ -26,53 +26,6 @@
#include "alloc.h"
#include "message.h"
-/* sprintf() wrapper functions for convenience. */
-
-#if !__GNUC__
-char *
-spprintf (char *buf, const char *format,...)
-{
-#if HAVE_GOOD_SPRINTF
- int count;
-#endif
- va_list args;
-
- va_start (args, format);
-#if HAVE_GOOD_SPRINTF
- count =
-#endif
- vsprintf (buf, format, args);
- va_end (args);
-
-#if HAVE_GOOD_SPRINTF
- return &buf[count];
-#else
- return strchr (buf, 0);
-#endif
-}
-#endif /* !__GNUC__ */
-
-#if !__GNUC__ && !HAVE_GOOD_SPRINTF
-int
-nsprintf (char *buf, const char *format,...)
-{
- va_list args;
-
- va_start (args, format);
- vsprintf (buf, format, args);
- va_end (args);
-
- return strlen (buf);
-}
-
-int
-nvsprintf (char *buf, const char *format, va_list args)
-{
- vsprintf (buf, format, args);
- return strlen (buf);
-}
-#endif /* Not GNU C and not good sprintf(). */
-
/* Reverses the order of NBYTES bytes at address P, thus converting
between little- and big-endian byte orders. */
void
Index: pspp/src/libpspp/str.h
diff -u pspp/src/libpspp/str.h:1.1 pspp/src/libpspp/str.h:1.2
--- pspp/src/libpspp/str.h:1.1 Sat Mar 4 01:11:57 2006
+++ pspp/src/libpspp/str.h Sat Mar 4 20:15:32 2006
@@ -43,57 +43,6 @@
#define strrchr rindex
#endif
-/* sprintf() wrapper functions for convenience. */
-
-/* spprintf() calls sprintf() and returns the address of the null
- terminator in the resulting string. It should be portable the way
- it's been implemented. */
-#if __GNUC__
- #if HAVE_GOOD_SPRINTF
- #define spprintf(BUF, FORMAT, ARGS...) \
- ((BUF) + sprintf ((BUF), (FORMAT) , ## ARGS))
- #else
- #define spprintf(BUF, FORMAT, ARGS...) \
- ({ sprintf ((BUF), (FORMAT) , ## ARGS); \
- strchr ((BUF), 0); })
- #endif
-#else /* Not GNU C. */
- char *spprintf (char *buf, const char *format, ...);
-#endif /* Not GNU C. */
-
-/* nsprintf() calls sprintf() and returns the strlen() of the
- resulting string. It should be portable the way it's been
- implemented. */
-#if __GNUC__
- #if HAVE_GOOD_SPRINTF
- #define nsprintf(BUF, FORMAT, ARGS...) \
- (sprintf ((BUF), (FORMAT) , ## ARGS))
- #define nvsprintf(BUF, FORMAT, ARGS) \
- (vsprintf ((BUF), (FORMAT), (ARGS)))
- #else /* Not good sprintf(). */
- #define nsprintf(BUF, FORMAT, ARGS...) \
- ({ \
- char *pbuf = BUF; \
- sprintf ((pbuf), (FORMAT) , ## ARGS); \
- strlen (pbuf); \
- })
- #define nvsprintf(BUF, FORMAT, ARGS) \
- ({ \
- char *pbuf = BUF; \
- vsprintf ((pbuf), (FORMAT), (ARGS)); \
- strlen (pbuf); \
- })
- #endif /* Not good sprintf(). */
-#else /* Not GNU C. */
- #if HAVE_GOOD_SPRINTF
- #define nsprintf sprintf
- #define nvsprintf vsprintf
- #else /* Not good sprintf(). */
- int nsprintf (char *buf, const char *format, ...);
- int nvsprintf (char *buf, const char *format, va_list args);
- #endif /* Not good sprintf(). */
-#endif /* Not GNU C. */
-
/* Miscellaneous. */
void buf_reverse (char *, size_t);
@@ -238,4 +187,22 @@
}
#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;
+}
+
#endif /* str_h */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pspp-cvs] pspp ./ChangeLog ./acinclude.m4 ./configure.ac ...,
Ben Pfaff <=