mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Specify function pointer signature for scanf implementation
Fix [-Wstrict-prototypes] warnings in standard/scanf.c
This commit is contained in:
parent
e90180d06a
commit
b7356692f6
1 changed files with 8 additions and 6 deletions
|
@ -106,6 +106,8 @@ typedef struct CharSet {
|
||||||
} *ranges;
|
} *ranges;
|
||||||
} CharSet;
|
} CharSet;
|
||||||
|
|
||||||
|
typedef zend_long (*int_string_formater)(const char*, char**, int);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Declarations for functions used only in this file.
|
* Declarations for functions used only in this file.
|
||||||
*/
|
*/
|
||||||
|
@ -583,7 +585,7 @@ PHPAPI int php_sscanf_internal( char *string, char *format,
|
||||||
int base = 0;
|
int base = 0;
|
||||||
int underflow = 0;
|
int underflow = 0;
|
||||||
size_t width;
|
size_t width;
|
||||||
zend_long (*fn)() = NULL;
|
int_string_formater fn = NULL;
|
||||||
char *ch, sch;
|
char *ch, sch;
|
||||||
int flags;
|
int flags;
|
||||||
char buf[64]; /* Temporary buffer to hold scanned number
|
char buf[64]; /* Temporary buffer to hold scanned number
|
||||||
|
@ -740,29 +742,29 @@ literal:
|
||||||
case 'D':
|
case 'D':
|
||||||
op = 'i';
|
op = 'i';
|
||||||
base = 10;
|
base = 10;
|
||||||
fn = (zend_long (*)())ZEND_STRTOL_PTR;
|
fn = (int_string_formater)ZEND_STRTOL_PTR;
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
op = 'i';
|
op = 'i';
|
||||||
base = 0;
|
base = 0;
|
||||||
fn = (zend_long (*)())ZEND_STRTOL_PTR;
|
fn = (int_string_formater)ZEND_STRTOL_PTR;
|
||||||
break;
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
op = 'i';
|
op = 'i';
|
||||||
base = 8;
|
base = 8;
|
||||||
fn = (zend_long (*)())ZEND_STRTOL_PTR;
|
fn = (int_string_formater)ZEND_STRTOL_PTR;
|
||||||
break;
|
break;
|
||||||
case 'x':
|
case 'x':
|
||||||
case 'X':
|
case 'X':
|
||||||
op = 'i';
|
op = 'i';
|
||||||
base = 16;
|
base = 16;
|
||||||
fn = (zend_long (*)())ZEND_STRTOL_PTR;
|
fn = (int_string_formater)ZEND_STRTOL_PTR;
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
op = 'i';
|
op = 'i';
|
||||||
base = 10;
|
base = 10;
|
||||||
flags |= SCAN_UNSIGNED;
|
flags |= SCAN_UNSIGNED;
|
||||||
fn = (zend_long (*)())ZEND_STRTOUL_PTR;
|
fn = (int_string_formater)ZEND_STRTOUL_PTR;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'f':
|
case 'f':
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue