mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +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;
|
||||
} CharSet;
|
||||
|
||||
typedef zend_long (*int_string_formater)(const char*, char**, int);
|
||||
|
||||
/*
|
||||
* 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 underflow = 0;
|
||||
size_t width;
|
||||
zend_long (*fn)() = NULL;
|
||||
int_string_formater fn = NULL;
|
||||
char *ch, sch;
|
||||
int flags;
|
||||
char buf[64]; /* Temporary buffer to hold scanned number
|
||||
|
@ -740,29 +742,29 @@ literal:
|
|||
case 'D':
|
||||
op = 'i';
|
||||
base = 10;
|
||||
fn = (zend_long (*)())ZEND_STRTOL_PTR;
|
||||
fn = (int_string_formater)ZEND_STRTOL_PTR;
|
||||
break;
|
||||
case 'i':
|
||||
op = 'i';
|
||||
base = 0;
|
||||
fn = (zend_long (*)())ZEND_STRTOL_PTR;
|
||||
fn = (int_string_formater)ZEND_STRTOL_PTR;
|
||||
break;
|
||||
case 'o':
|
||||
op = 'i';
|
||||
base = 8;
|
||||
fn = (zend_long (*)())ZEND_STRTOL_PTR;
|
||||
fn = (int_string_formater)ZEND_STRTOL_PTR;
|
||||
break;
|
||||
case 'x':
|
||||
case 'X':
|
||||
op = 'i';
|
||||
base = 16;
|
||||
fn = (zend_long (*)())ZEND_STRTOL_PTR;
|
||||
fn = (int_string_formater)ZEND_STRTOL_PTR;
|
||||
break;
|
||||
case 'u':
|
||||
op = 'i';
|
||||
base = 10;
|
||||
flags |= SCAN_UNSIGNED;
|
||||
fn = (zend_long (*)())ZEND_STRTOUL_PTR;
|
||||
fn = (int_string_formater)ZEND_STRTOUL_PTR;
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue