pspp-cvs
[Top][All Lists]
Advanced

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

[Pspp-cvs] pspp ./ChangeLog ./Smake ./acinclude.m4 ./confi...


From: Ben Pfaff
Subject: [Pspp-cvs] pspp ./ChangeLog ./Smake ./acinclude.m4 ./confi...
Date: Sat, 04 Mar 2006 20:38:52 +0000

CVSROOT:        /cvsroot/pspp
Module name:    pspp
Branch:         
Changes by:     Ben Pfaff <address@hidden>      06/03/04 20:38:51

Modified files:
        .              : ChangeLog Smake acinclude.m4 configure.ac 
        src            : ChangeLog 
        src/data       : filename.c 
        src/language/control: repeat.c 
        src/language/data-io: list.q 
        src/language/stats: flip.c 
        src/output     : groff-font.c output.c postscript.c 

Log message:
        Remove BLP_INT_DIGITS.  Now we use the intprops.h header file instead.
        
        In many source files, replace INT_DIGITS by INT_STRLEN_BOUND(int) and
        include intprops.h.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/ChangeLog.diff?tr1=1.43&tr2=1.44&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/Smake.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/acinclude.m4.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/configure.ac.diff?tr1=1.38&tr2=1.39&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/ChangeLog.diff?tr1=1.264&tr2=1.265&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/data/filename.c.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/language/control/repeat.c.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/language/data-io/list.q.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/language/stats/flip.c.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/output/groff-font.c.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/output/output.c.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/output/postscript.c.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: pspp/ChangeLog
diff -u pspp/ChangeLog:1.43 pspp/ChangeLog:1.44
--- pspp/ChangeLog:1.43 Sat Mar  4 20:15:32 2006
+++ pspp/ChangeLog      Sat Mar  4 20:38:51 2006
@@ -1,3 +1,12 @@
+Sat Mar  4 12:27:06 2006  Ben Pfaff  <address@hidden>
+
+       * Smake: Require "intprops" gnulib module.
+
+       * acinclude.m4: Remove BLP_INT_DIGITS.  Now we use the intprops.h
+       header file instead.
+
+       * configure.ac: Don't call BLP_INT_DIGITS.
+
 Sat Mar  4 11:53:36 2006  Ben Pfaff  <address@hidden>
 
        * acinclude.m4: Remove BLP_RANDOM.  Its results were unused.
Index: pspp/Smake
diff -u pspp/Smake:1.20 pspp/Smake:1.21
--- pspp/Smake:1.20     Sat Mar  4 00:28:15 2006
+++ pspp/Smake  Sat Mar  4 20:38:51 2006
@@ -4,11 +4,11 @@
 GNULIB_TOOL = $(GNULIB)/gnulib-tool
 
 GNULIB_MODULES = alloca alloca-opt assert full-read full-write         \
-gethostname getline getlogin_r getopt gettext memcasecmp memchr memcmp \
-memmem memmove memset progname readlink restrict snprintf stat-macros  \
-stdbool stpcpy strcase strcspn strerror strftime strstr strtod         \
-strtok_r strtol strtoul vsnprintf xalloc xalloc-die xreadlink          \
-xvasprintf
+gethostname getline getlogin_r getopt gettext intprops memcasecmp      \
+memchr memcmp memmem memmove memset progname readlink restrict         \
+snprintf stat-macros stdbool stpcpy strcase strcspn strerror strftime  \
+strstr strtod strtok_r strtol strtoul vsnprintf xalloc xalloc-die      \
+xreadlink xvasprintf
 
 all: po/POTFILES.in
        test -d m4 || mkdir m4
Index: pspp/acinclude.m4
diff -u pspp/acinclude.m4:1.4 pspp/acinclude.m4:1.5
--- pspp/acinclude.m4:1.4       Sat Mar  4 20:15:32 2006
+++ pspp/acinclude.m4   Sat Mar  4 20:38:51 2006
@@ -3,41 +3,6 @@
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-dnl Check longest integer in digits.
-
-AC_DEFUN([BLP_INT_DIGITS],
-[
-AC_MSG_CHECKING(number of digits in LONG_MIN (incl. sign))
-AC_CACHE_VAL(blp_int_digits,
-            [AC_TRY_RUN([#include <stdio.h>
-                          #include <limits.h>
-                         int
-                         main()
-                         {
-                           int len;
-                           char s[80];
-                           sprintf(s, "%ld", LONG_MAX);
-                           len = strlen(s);
-                           sprintf(s, "%ld", LONG_MIN);
-                           if(strlen(s)>len) len=strlen(s);
-                           sprintf(s, "%lu", ULONG_MAX);
-                           if(strlen(s)>len) len=strlen(s);
-                           exit(len);
-                         }
-                        ],
-                        eval "blp_int_digits=19",
-                        eval "blp_int_digits=$?"
-                        if test "$blp_int_digits" -lt 11; then
-                          blp_int_digits=11
-                        fi,
-                        eval "blp_int_digits=19")
-            ])
-AC_DEFINE_UNQUOTED([INT_DIGITS], $blp_int_digits,
-       [Number of digits in longest `long' value, including sign.
-         This is usually 11, for 32-bit `long's, or 19, for 64-bit
-         `long's.])
-AC_MSG_RESULT($blp_int_digits) ])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.38 pspp/configure.ac:1.39
--- pspp/configure.ac:1.38      Sat Mar  4 20:15:32 2006
+++ pspp/configure.ac   Sat Mar  4 20:38:51 2006
@@ -103,8 +103,6 @@
 
 AC_C_BIGENDIAN
 
-BLP_INT_DIGITS
-
 AC_FUNC_VPRINTF
 AC_CHECK_FUNCS([strchr strrchr __setfpucw isinf isnan finite getpid 
feholdexcept])
 
Index: pspp/src/ChangeLog
diff -u pspp/src/ChangeLog:1.264 pspp/src/ChangeLog:1.265
--- pspp/src/ChangeLog:1.264    Sat Mar  4 20:15:32 2006
+++ pspp/src/ChangeLog  Sat Mar  4 20:38:51 2006
@@ -1,3 +1,8 @@
+Sat Mar  4 12:28:09 2006  Ben Pfaff  <address@hidden>
+
+       * In many source files, replace INT_DIGITS by
+       INT_STRLEN_BOUND(int) and include intprops.h.
+
 John Darrington:
        
        * Replaced '_' with '-' in most filenames.
Index: pspp/src/data/filename.c
diff -u pspp/src/data/filename.c:1.1 pspp/src/data/filename.c:1.2
--- pspp/src/data/filename.c:1.1        Sat Mar  4 01:11:57 2006
+++ pspp/src/data/filename.c    Sat Mar  4 20:38:51 2006
@@ -25,6 +25,7 @@
 #include <ctype.h>
 #include <errno.h>
 #include "alloc.h"
+#include "intprops.h"
 #include "message.h"
 #include "str.h"
 #include "settings.h"
@@ -770,7 +771,8 @@
   p = strstr (f->filename, "%d");
   if (p)
     {
-      char *s = local_alloc (strlen (f->filename) + INT_DIGITS - 1);
+      char *s = local_alloc (strlen (f->filename)
+                             + INT_STRLEN_BOUND (int) - 1);
       char *cp;
 
       memcpy (s, f->filename, p - f->filename);
Index: pspp/src/language/control/repeat.c
diff -u pspp/src/language/control/repeat.c:1.1 
pspp/src/language/control/repeat.c:1.2
--- pspp/src/language/control/repeat.c:1.1      Sat Mar  4 01:11:57 2006
+++ pspp/src/language/control/repeat.c  Sat Mar  4 20:38:51 2006
@@ -26,6 +26,7 @@
 #include "alloc.h"
 #include "command.h"
 #include "dictionary.h"
+#include "intprops.h"
 #include "message.h"
 #include "line-buffer.h"
 #include "lexer.h"
@@ -363,7 +364,7 @@
 static inline void
 store_numeric (char **repl, long value)
 {
-  *repl = xmalloc (INT_DIGITS + 1);
+  *repl = xmalloc (INT_STRLEN_BOUND (value) + 1);
   sprintf (*repl, "%ld", value);
 }
 
Index: pspp/src/language/data-io/list.q
diff -u pspp/src/language/data-io/list.q:1.1 
pspp/src/language/data-io/list.q:1.2
--- pspp/src/language/data-io/list.q:1.1        Sat Mar  4 01:11:57 2006
+++ pspp/src/language/data-io/list.q    Sat Mar  4 20:38:51 2006
@@ -25,6 +25,7 @@
 #include "case.h"
 #include "command.h"
 #include "dictionary.h"
+#include "intprops.h"
 #include "lexer.h"
 #include "message.h"
 #include "magic.h"
@@ -434,7 +435,8 @@
   int line_number = 0;
 
   const char *Line = _("Line");
-  char *leader = local_alloc (strlen (Line) + INT_DIGITS + 1 + 1);
+  char *leader = local_alloc (strlen (Line)
+                              + INT_STRLEN_BOUND (line_number) + 1 + 1);
       
   while (index < cmd.n_variables)
     {
Index: pspp/src/language/stats/flip.c
diff -u pspp/src/language/stats/flip.c:1.1 pspp/src/language/stats/flip.c:1.2
--- pspp/src/language/stats/flip.c:1.1  Sat Mar  4 01:11:57 2006
+++ pspp/src/language/stats/flip.c      Sat Mar  4 20:38:51 2006
@@ -30,6 +30,7 @@
 #include "command.h"
 #include "dictionary.h"
 #include "message.h"
+#include "intprops.h"
 #include "lexer.h"
 #include "misc.h"
 #include "pool.h"
@@ -332,7 +333,7 @@
             strcpy (v->name, "VPOSINF");
           else 
             {
-              char name[INT_DIGITS + 2];
+              char name[INT_STRLEN_BOUND (int) + 2];
               sprintf (name, "V%d", (int) f);
               str_copy_trunc (v->name, sizeof v->name, name);
             }
Index: pspp/src/output/groff-font.c
diff -u pspp/src/output/groff-font.c:1.1 pspp/src/output/groff-font.c:1.2
--- pspp/src/output/groff-font.c:1.1    Sat Mar  4 01:11:58 2006
+++ pspp/src/output/groff-font.c        Sat Mar  4 20:38:51 2006
@@ -30,6 +30,7 @@
 #include "filename.h"
 #include "getline.h"
 #include "hash.h"
+#include "intprops.h"
 #include "pool.h"
 #include "str.h"
 #include "version.h"
@@ -539,7 +540,7 @@
 int
 font_number_to_index (int x)
 {
-  char name[INT_DIGITS + 2];
+  char name[INT_STRLEN_BOUND (x) + 2];
 
   /* Note that space is the only character that can't appear in a
      character name.  That makes it an excellent choice for a name
Index: pspp/src/output/output.c
diff -u pspp/src/output/output.c:1.1 pspp/src/output/output.c:1.2
--- pspp/src/output/output.c:1.1        Sat Mar  4 01:11:58 2006
+++ pspp/src/output/output.c    Sat Mar  4 20:38:51 2006
@@ -28,6 +28,7 @@
 #include "message.h"
 #include "filename.h"
 #include "htmlP.h"
+#include "intprops.h"
 #include "misc.h"
 #include "settings.h"
 #include "str.h"
@@ -194,7 +195,7 @@
 static const char *
 find_defn_value (const char *key)
 {
-  static char buf[INT_DIGITS + 1];
+  static char buf[INT_STRLEN_BOUND (int) + 1];
   struct outp_defn *d;
 
   for (d = outp_macros; d; d = d->next)
Index: pspp/src/output/postscript.c
diff -u pspp/src/output/postscript.c:1.1 pspp/src/output/postscript.c:1.2
--- pspp/src/output/postscript.c:1.1    Sat Mar  4 01:11:58 2006
+++ pspp/src/output/postscript.c        Sat Mar  4 20:38:51 2006
@@ -41,6 +41,7 @@
 #include "font.h"
 #include "getline.h"
 #include "hash.h"
+#include "intprops.h"
 #include "misc.h"
 #include "output.h"
 #include "manager.h"
@@ -1190,20 +1191,20 @@
     {"title", 0},
     {0, 0},
   };
-  char boundbox[INT_DIGITS * 4 + 4];
+  char boundbox[INT_STRLEN_BOUND (int) * 4 + 4];
 #if HAVE_UNISTD_H
   char host[128];
 #endif
-  char scaling[INT_DIGITS + 5];
+  char scaling[INT_STRLEN_BOUND (int) + 5];
   time_t curtime;
   struct tm *loctime;
   char *p, *cp;
-  char paper_width[INT_DIGITS + 1];
-  char paper_length[INT_DIGITS + 1];
-  char left_margin[INT_DIGITS + 1];
-  char top_margin[INT_DIGITS + 1];
-  char line_width[INT_DIGITS + 1];
-  char line_width_thick[INT_DIGITS + 1];
+  char paper_width[INT_STRLEN_BOUND (int) + 1];
+  char paper_length[INT_STRLEN_BOUND (int) + 1];
+  char left_margin[INT_STRLEN_BOUND (int) + 1];
+  char top_margin[INT_STRLEN_BOUND (int) + 1];
+  char line_width[INT_STRLEN_BOUND (int) + 1];
+  char line_width_thick[INT_STRLEN_BOUND (int) + 1];
 
   struct outp_driver *this = f->param;
   struct ps_driver_ext *x = this->ext;
@@ -2402,7 +2403,7 @@
 
   int last_y;
 
-  char number[INT_DIGITS + 1];
+  char number[INT_STRLEN_BOUND (int) + 1];
   char line[80];
   char *lp;
 




reply via email to

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