OSSP CVS Repository

ossp - Difference in ossp-pkg/cfg/cfg_fmt.c versions 1.2 and 1.3
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/cfg/cfg_fmt.c 1.2 -> 1.3

--- cfg_fmt.c    2002/07/17 15:04:08     1.2
+++ cfg_fmt.c    2002/11/10 12:12:23     1.3
@@ -129,7 +129,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
@@ -149,7 +149,7 @@
 #define cfg_fmt_islower(c)  (islower(((unsigned char)(c))))
 #define cfg_fmt_tolower(c)  (tolower((unsigned char)(c)))
 
-/* 
+/*
  * 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
@@ -164,10 +164,10 @@
 
 static char *
 cfg_fmt_cvt(
-    double arg, 
-    int ndigits, 
-    int *decpt, 
-    int *sign, 
+    double arg,
+    int ndigits,
+    int *decpt,
+    int *sign,
     int eflag,
     char *buf)
 {
@@ -243,9 +243,9 @@
 
 static char *
 cfg_fmt_gcvt(
-    double number, 
-    int ndigit, 
-    char *buf, 
+    double number,
+    int ndigit,
+    char *buf,
     int altform)
 {
     int sign;
@@ -327,7 +327,7 @@
 }
 
 /*
- * Convert a string to decimal value 
+ * Convert a string to decimal value
  */
 #define NUM(c) ((c) - '0')
 #define STR_TO_DEC(str, num) {    \
@@ -337,7 +337,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
@@ -352,7 +352,7 @@
     }
 
 /*
- * This macro does padding. 
+ * This macro does padding.
  * The padding is done by printing the character ch.
  */
 #define PAD(width, len, ch) \
@@ -386,9 +386,9 @@
  */
 static char *
 conv_10(
-    register long_int num, 
+    register long_int num,
     register int is_unsigned,
-    register int *is_negative, 
+    register int *is_negative,
     char *buf_end,
     register size_t *len)
 {
@@ -401,7 +401,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
@@ -428,9 +428,9 @@
 
 static char *
 conv_10_quad(
-    quad_int num, 
+    quad_int num,
     register int is_unsigned,
-    register int *is_negative, 
+    register int *is_negative,
     char *buf_end,
     register size_t *len)
 {
@@ -443,7 +443,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
@@ -475,12 +475,12 @@
  */
 static char *
 conv_fp(
-    register char format, 
+    register char format,
     register double num,
-    int add_dp, 
-    int precision, 
+    int add_dp,
+    int precision,
     int *is_negative,
-    char *buf, 
+    char *buf,
     size_t *len)
 {
     register char *s = buf;
@@ -536,7 +536,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 */
@@ -573,10 +573,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 size_t *len)
 {
     register int mask = (1 << nbits) - 1;
@@ -593,10 +593,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 size_t *len)
 {
     register int mask = (1 << nbits) - 1;
@@ -611,14 +611,14 @@
     return p;
 }
 
-/* 
+/*
  * cfg_fmt_format(), the generic printf-style formatting routine
  * and heart of this piece of source.
  */
-int 
+int
 cfg_fmt_format(
-    cfg_fmt_format_t *vbuff, 
-    const char *fmt, 
+    cfg_fmt_format_t *vbuff,
+    const char *fmt,
     va_list ap)
 {
     register char *sp;
@@ -912,7 +912,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 = '-';
@@ -987,7 +987,7 @@
                     break;
 
                 /*
-                 * Pointer argument type. 
+                 * Pointer argument type.
                  */
                 case 'p':
 #if defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == SIZEOF_VOID_P)
@@ -1021,7 +1021,7 @@
                     s = NULL;
                     if (vbuff->format != NULL) {
                         vbuff->format(vbuff,
-                                      &prefix_char, &pad_char, &s, &s_len, 
+                                      &prefix_char, &pad_char, &s, &s_len,
                                       num_buf, NUM_BUF_SIZE, extinfo, *fmt, &ap);
                         if (s == NULL)
                             return -1;
@@ -1052,7 +1052,7 @@
             }
 
             /*
-             * Print the string s. 
+             * Print the string s.
              */
             for (i = s_len; i != 0; i--) {
                 INS_CHAR(*s, sp, bep, cc);

CVSTrac 2.0.1