OSSP CVS Repository

ossp - Difference in ossp-pkg/str/str_format.c versions 1.27 and 1.28
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/str/str_format.c 1.27 -> 1.28

--- str_format.c 2002/04/01 08:32:54     1.27
+++ str_format.c 2003/01/06 19:13:47     1.28
@@ -1,9 +1,9 @@
 /*
 **  OSSP str - String Handling
-**  Copyright (c) 1999-2002 Ralf S. Engelschall <rse@engelschall.com>
-**  Copyright (c) 1999-2002 The OSSP Project <http://www.ossp.org/>
+**  Copyright (c) 1999-2003 Ralf S. Engelschall <rse@engelschall.com>
+**  Copyright (c) 1999-2003 The OSSP Project <http://www.ossp.org/>
 **
-**  This file is part of OSSP str, a string handling and manipulation 
+**  This file is part of OSSP str, a string handling and manipulation
 **  library which can be found at http://www.ossp.org/pkg/lib/str/.
 **
 **  Permission to use, copy, modify, and distribute this software for
@@ -35,7 +35,7 @@
  *  are met:
  *
  *  1. Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
+ *     notice, this list of conditions and the following disclaimer.
  *
  *  2. Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in
@@ -108,7 +108,7 @@
 #define FLOAT_DIGITS    6
 #define EXPONENT_LENGTH 10
 
-/* NUM_BUF_SIZE is the size of the buffer used for arithmetic 
+/* NUM_BUF_SIZE is the size of the buffer used for arithmetic
    conversions. This is a magic number; do NOT decrease it! */
 #define NUM_BUF_SIZE    512
 #define NDIG            80
@@ -121,7 +121,7 @@
 #define isinf(d) (0)
 #endif
 
-/* 
+/*
  * Convert decimal number to its string representation. The number of
  * digits is specified by ndigit decpt is set to the position of the
  * decimal point sign is set to 0 for positive, 1 for negative. buf must
@@ -136,10 +136,10 @@
 
 static char *
 str_cvt(
-    double arg, 
-    int ndigits, 
-    int *decpt, 
-    BOOL *sign, 
+    double arg,
+    int ndigits,
+    int *decpt,
+    BOOL *sign,
     int eflag,
     char *buf)
 {
@@ -215,9 +215,9 @@
 
 static char *
 str_gcvt(
-    double number, 
-    int ndigit, 
-    char *buf, 
+    double number,
+    int ndigit,
+    char *buf,
     BOOL altform)
 {
     BOOL sign;
@@ -299,7 +299,7 @@
 }
 
 /*
- * Convert a string to decimal value 
+ * Convert a string to decimal value
  */
 #define NUM(c) ((c) - '0')
 #define STR_TO_DEC(str, num) {    \
@@ -309,7 +309,7 @@
         num += NUM(*str++) ;      \
     }                             \
 }
-     
+
 /*
  * This macro does zero padding so that the precision requirement is
  * satisfied. The padding is done by adding '0's to the left of the
@@ -324,7 +324,7 @@
     }
 
 /*
- * This macro does padding. 
+ * This macro does padding.
  * The padding is done by printing the character ch.
  */
 #define PAD(width, len, ch) \
@@ -358,9 +358,9 @@
  */
 static char *
 conv_10(
-    register long_int num, 
+    register long_int num,
     register BOOL is_unsigned,
-    register BOOL *is_negative, 
+    register BOOL *is_negative,
     char *buf_end,
     register int *len)
 {
@@ -373,7 +373,7 @@
     }
     else {
         *is_negative = (num < 0);
-        /* On a 2's complement machine, negating the most negative integer 
+        /* On a 2's complement machine, negating the most negative integer
            results in a number that cannot be represented as a signed integer.
            Here is what we do to obtain the number's magnitude:
                 a. add 1 to the number
@@ -400,9 +400,9 @@
 
 static char *
 conv_10_quad(
-    quad_int num, 
+    quad_int num,
     register BOOL is_unsigned,
-    register BOOL *is_negative, 
+    register BOOL *is_negative,
     char *buf_end,
     register int *len)
 {
@@ -415,7 +415,7 @@
     }
     else {
         *is_negative = (num < 0);
-        /* On a 2's complement machine, negating the most negative integer 
+        /* On a 2's complement machine, negating the most negative integer
            result in a number that cannot be represented as a signed integer.
            Here is what we do to obtain the number's magnitude:
                 a. add 1 to the number
@@ -447,12 +447,12 @@
  */
 static char *
 conv_fp(
-    register char format, 
+    register char format,
     register double num,
-    BOOL add_dp, 
-    int precision, 
+    BOOL add_dp,
+    int precision,
     BOOL *is_negative,
-    char *buf, 
+    char *buf,
     int *len)
 {
     register char *s = buf;
@@ -508,7 +508,7 @@
         *s++ = format;          /* either e or E */
         decimal_point--;
         if (decimal_point != 0) {
-            p = conv_10((long_int) decimal_point, FALSE, &exponent_is_negative, 
+            p = conv_10((long_int) decimal_point, FALSE, &exponent_is_negative,
                         &temp[EXPONENT_LENGTH], &t_len);
             *s++ = exponent_is_negative ? '-' : '+';
             /* Make sure the exponent has at least 2 digits */
@@ -545,10 +545,10 @@
 
 static char *
 conv_p2(
-    register u_long_int num, 
+    register u_long_int num,
     register int nbits,
-    char format, 
-    char *buf_end, 
+    char format,
+    char *buf_end,
     register int *len)
 {
     register int mask = (1 << nbits) - 1;
@@ -565,10 +565,10 @@
 
 static char *
 conv_p2_quad(
-    u_quad_int num, 
+    u_quad_int num,
     register int nbits,
-    char format, 
-    char *buf_end, 
+    char format,
+    char *buf_end,
     register int *len)
 {
     register int mask = (1 << nbits) - 1;
@@ -583,14 +583,14 @@
     return p;
 }
 
-/* 
+/*
  * str_vformat(), the generic printf-style formatting routine
  * and heart of this piece of source.
  */
-int 
+int
 str_vformat(
-    str_vformat_t *vbuff, 
-    const char *fmt, 
+    str_vformat_t *vbuff,
+    const char *fmt,
     va_list ap)
 {
     register char *sp;
@@ -884,7 +884,7 @@
                     else {
                         /* use &num_buf[1], so that we have room for the sign */
                         s = conv_fp(*fmt, fp_num, alternate_form,
-                                    (adjust_precision == FALSE) ? FLOAT_DIGITS : precision, 
+                                    (adjust_precision == FALSE) ? FLOAT_DIGITS : precision,
                                     &is_negative, &num_buf[1], &s_len);
                         if (is_negative)
                             prefix_char = '-';
@@ -959,7 +959,7 @@
                     break;
 
                 /*
-                 * Pointer argument type. 
+                 * Pointer argument type.
                  */
                 case 'p':
 #if defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == SIZEOF_VOID_P)
@@ -992,8 +992,8 @@
                 default:
                     s = NULL;
                     if (vbuff->format != NULL) {
-                        s = vbuff->format(vbuff, 
-                            &prefix_char, &pad_char, &s_len, 
+                        s = vbuff->format(vbuff,
+                            &prefix_char, &pad_char, &s_len,
                             num_buf, NUM_BUF_SIZE, extinfo, *fmt, ap);
                     }
                     if (s == NULL) {
@@ -1022,7 +1022,7 @@
             }
 
             /*
-             * Print the string s. 
+             * Print the string s.
              */
             for (i = s_len; i != 0; i--) {
                 INS_CHAR(*s, sp, bep, cc);
@@ -1128,5 +1128,5 @@
         return NULL;
     return s;
 }
-#endif 
+#endif
 

CVSTrac 2.0.1