X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2F_PDCLIB%2Fscan.c;h=ce1dac7b307a0d66b86974b8d54ff6b7f4536543;hp=8aaabfb54696aaf4b6f28786ccd45c1ada2764af;hb=6089d8ab77f6f7bacbfa6354e8cfecab1b00c8bc;hpb=de813f064004aa2d9c13256af1b075e3b8942b02 diff --git a/functions/_PDCLIB/scan.c b/functions/_PDCLIB/scan.c index 8aaabfb..ce1dac7 100644 --- a/functions/_PDCLIB/scan.c +++ b/functions/_PDCLIB/scan.c @@ -63,7 +63,7 @@ static int GET( struct _PDCLIB_status_t * status ) if ( rc != EOF ) { ++(status->i); - ++(status->this); + ++(status->current); } return rc; } @@ -83,7 +83,7 @@ static void UNGET( int c, struct _PDCLIB_status_t * status ) --(status->s); } --(status->i); - --(status->this); + --(status->current); } @@ -153,7 +153,7 @@ const char * _PDCLIB_scan( const char * spec, struct _PDCLIB_status_t * status ) /* Initializing status structure */ status->flags = 0; status->base = -1; - status->this = 0; + status->current = 0; status->width = 0; status->prec = 0; @@ -272,7 +272,7 @@ const char * _PDCLIB_scan( const char * spec, struct _PDCLIB_status_t * status ) status->width = 1; } /* reading until width reached or input exhausted */ - while ( ( status->this < status->width ) && + while ( ( status->current < status->width ) && ( ( rc = GET( status ) ) != EOF ) ) { *(c++) = rc; @@ -297,7 +297,7 @@ const char * _PDCLIB_scan( const char * spec, struct _PDCLIB_status_t * status ) case 's': { char * c = va_arg( status->arg, char * ); - while ( ( status->this < status->width ) && + while ( ( status->current < status->width ) && ( ( rc = GET( status ) ) != EOF ) ) { if ( isspace( rc ) ) @@ -357,7 +357,7 @@ const char * _PDCLIB_scan( const char * spec, struct _PDCLIB_status_t * status ) } while ( *endspec != ']' ); // read according to scanlist, equiv. to %s above char * c = va_arg( status->arg, char * ); - while ( ( status->this < status->width ) && + while ( ( status->current < status->width ) && ( ( rc = GET( status ) ) != EOF ) ) { if ( negative_scanlist ) @@ -415,7 +415,7 @@ const char * _PDCLIB_scan( const char * spec, struct _PDCLIB_status_t * status ) uintmax_t value = 0; /* absolute value read */ bool prefix_parsed = false; int sign = 0; - while ( ( status->this < status->width ) && + while ( ( status->current < status->width ) && ( ( rc = GET( status ) ) != EOF ) ) { if ( isspace( rc ) ) @@ -429,7 +429,7 @@ const char * _PDCLIB_scan( const char * spec, struct _PDCLIB_status_t * status ) else { /* leading whitespace not counted against width */ - status->this--; + status->current--; } } else if ( ! sign ) @@ -467,7 +467,7 @@ const char * _PDCLIB_scan( const char * spec, struct _PDCLIB_status_t * status ) { /* starts with zero, so it might be a prefix. */ /* check what follows next (might be 0x...) */ - if ( ( status->this < status->width ) && + if ( ( status->current < status->width ) && ( ( rc = GET( status ) ) != EOF ) ) { if ( tolower( rc ) == 'x' )