Skip to content

Commit 8b01911

Browse files
committed
Fix [-Wstrict-prototypes] in Standard extension .c files
1 parent 238353a commit 8b01911

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

ext/standard/base64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ typedef zend_string *(*base64_decode_func_t)(const unsigned char *, size_t, zend
388388

389389
ZEND_NO_SANITIZE_ADDRESS
390390
ZEND_ATTRIBUTE_UNUSED /* clang mistakenly warns about this */
391-
static base64_encode_func_t resolve_base64_encode() {
391+
static base64_encode_func_t resolve_base64_encode(void) {
392392
# if ZEND_INTRIN_AVX2_FUNC_PROTO
393393
if (zend_cpu_supports_avx2()) {
394394
return php_base64_encode_avx2;
@@ -404,7 +404,7 @@ static base64_encode_func_t resolve_base64_encode() {
404404

405405
ZEND_NO_SANITIZE_ADDRESS
406406
ZEND_ATTRIBUTE_UNUSED /* clang mistakenly warns about this */
407-
static base64_decode_func_t resolve_base64_decode() {
407+
static base64_decode_func_t resolve_base64_decode(void) {
408408
# if ZEND_INTRIN_AVX2_FUNC_PROTO
409409
if (zend_cpu_supports_avx2()) {
410410
return php_base64_decode_ex_avx2;

ext/standard/hrtime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static mach_timebase_info_data_t _timerlib_info;
5454
#define NANO_IN_SEC 1000000000
5555
/* }}} */
5656

57-
static int _timer_init()
57+
static int _timer_init(void)
5858
{/*{{{*/
5959
#if PHP_HRTIME_PLATFORM_WINDOWS
6060

ext/standard/scanf.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ PHPAPI int php_sscanf_internal( char *string, char *format,
583583
int base = 0;
584584
int underflow = 0;
585585
size_t width;
586-
zend_long (*fn)() = NULL;
586+
zend_long (*fn)(const char*, char**, int) = NULL;
587587
char *ch, sch;
588588
int flags;
589589
char buf[64]; /* Temporary buffer to hold scanned number
@@ -740,29 +740,29 @@ PHPAPI int php_sscanf_internal( char *string, char *format,
740740
case 'D':
741741
op = 'i';
742742
base = 10;
743-
fn = (zend_long (*)())ZEND_STRTOL_PTR;
743+
fn = (zend_long (*)(const char*, char**, int))ZEND_STRTOL_PTR;
744744
break;
745745
case 'i':
746746
op = 'i';
747747
base = 0;
748-
fn = (zend_long (*)())ZEND_STRTOL_PTR;
748+
fn = (zend_long (*)(const char*, char**, int))ZEND_STRTOL_PTR;
749749
break;
750750
case 'o':
751751
op = 'i';
752752
base = 8;
753-
fn = (zend_long (*)())ZEND_STRTOL_PTR;
753+
fn = (zend_long (*)(const char*, char**, int))ZEND_STRTOL_PTR;
754754
break;
755755
case 'x':
756756
case 'X':
757757
op = 'i';
758758
base = 16;
759-
fn = (zend_long (*)())ZEND_STRTOL_PTR;
759+
fn = (zend_long (*)(const char*, char**, int))ZEND_STRTOL_PTR;
760760
break;
761761
case 'u':
762762
op = 'i';
763763
base = 10;
764764
flags |= SCAN_UNSIGNED;
765-
fn = (zend_long (*)())ZEND_STRTOUL_PTR;
765+
fn = (zend_long (*)(const char*, char**, int))ZEND_STRTOUL_PTR;
766766
break;
767767

768768
case 'f':

ext/standard/string.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3621,7 +3621,7 @@ typedef void (*php_stripslashes_func_t)(zend_string *);
36213621

36223622
ZEND_NO_SANITIZE_ADDRESS
36233623
ZEND_ATTRIBUTE_UNUSED /* clang mistakenly warns about this */
3624-
static php_addslashes_func_t resolve_addslashes() {
3624+
static php_addslashes_func_t resolve_addslashes(void) {
36253625
if (zend_cpu_supports_sse42()) {
36263626
return php_addslashes_sse42;
36273627
}
@@ -3630,7 +3630,7 @@ static php_addslashes_func_t resolve_addslashes() {
36303630

36313631
ZEND_NO_SANITIZE_ADDRESS
36323632
ZEND_ATTRIBUTE_UNUSED /* clang mistakenly warns about this */
3633-
static php_stripslashes_func_t resolve_stripslashes() {
3633+
static php_stripslashes_func_t resolve_stripslashes(void) {
36343634
if (zend_cpu_supports_sse42()) {
36353635
return php_stripslashes_sse42;
36363636
}

0 commit comments

Comments
 (0)