]> pd.if.org Git - pdclib/commitdiff
PDCLIB-6: _PDCLIB_status_t: change members from size_t to unsigned or int as appropri...
authorOwen Shepherd <owen.shepherd@e43.eu>
Sat, 25 Aug 2012 14:31:04 +0000 (15:31 +0100)
committerOwen Shepherd <owen.shepherd@e43.eu>
Sat, 25 Aug 2012 14:31:04 +0000 (15:31 +0100)
functions/_PDCLIB/print.c
internals/_PDCLIB_int.h

index f06a532b869bbb8d6f766a21b06e6951bd16901a..439098d69bc604331de9b5e832178fb431c4c32a 100644 (file)
@@ -112,7 +112,7 @@ static void int2base( uintmax_t value, struct _PDCLIB_status_t * status )
     }
 
     // Pad field out to the precision specification
-    while( written < status->prec ) outend[-++written] = '0';
+    while( (long) written < status->prec ) outend[-++written] = '0';
 
     // If a field width specified, and zero padding was requested, then pad to
     // the field width
@@ -178,7 +178,7 @@ const char * _PDCLIB_print( const char * spec, struct _PDCLIB_status_t * status
     status->base  = 0;
     status->current  = 0;
     status->width = 0;
-    status->prec  = 0;
+    status->prec  = EOF;
 
     /* First come 0..n flags */
     do
index af4c03377028477f9213a0bd36abf535acc01ad8..fee45ce130e424843140df021ed94318afff857d 100644 (file)
@@ -360,14 +360,14 @@ struct _PDCLIB_status_t
 {
     int              base;   /* base to which the value shall be converted   */
     _PDCLIB_int_fast32_t flags; /* flags and length modifiers                */
-    _PDCLIB_size_t   n;      /* print: maximum characters to be written      */
+    unsigned         n;      /* print: maximum characters to be written      */
                              /* scan:  number matched conversion specifiers  */
-    _PDCLIB_size_t   i;      /* number of characters read/written            */
-    _PDCLIB_size_t   current;/* chars read/written in the CURRENT conversion */
+    unsigned         i;      /* number of characters read/written            */
+    unsigned         current;/* chars read/written in the CURRENT conversion */
     char *           s;      /* *sprintf(): target buffer                    */
                              /* *sscanf():  source string                    */
-    _PDCLIB_size_t   width;  /* specified field width                        */
-    _PDCLIB_size_t   prec;   /* specified field precision                    */
+    unsigned         width;  /* specified field width                        */
+    int              prec;   /* specified field precision                    */
     struct _PDCLIB_file_t * stream; /* *fprintf() / *fscanf() stream         */
     _PDCLIB_va_list  arg;    /* argument stack                               */
 };