Skip to content

Commit ec2655f

Browse files
authored
Voidify getfilesystemtime() (phpGH-15413)
The function always returned 0, and the return values was never used, so we declare it to return void. While we're at it, we also fix the space indentation of the comment.
1 parent 059fe6c commit ec2655f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

win32/time.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
#include <errno.h>
2424
#include "php_win32_globals.h"
2525

26-
static zend_always_inline int getfilesystemtime(struct timeval *tv)
26+
static zend_always_inline void getfilesystemtime(struct timeval *tv)
2727
{/*{{{*/
2828
FILETIME ft;
2929
unsigned __int64 ff = 0;
3030
ULARGE_INTEGER fft;
3131

3232
GetSystemTimePreciseAsFileTime(&ft);
3333

34-
/*
34+
/*
3535
* Do not cast a pointer to a FILETIME structure to either a
3636
* ULARGE_INTEGER* or __int64* value because it can cause alignment faults on 64-bit Windows.
3737
* via http://technet.microsoft.com/en-us/library/ms724284(v=vs.85).aspx
@@ -45,8 +45,6 @@ static zend_always_inline int getfilesystemtime(struct timeval *tv)
4545

4646
tv->tv_sec = (long)(ff / 1000000Ui64);
4747
tv->tv_usec = (long)(ff % 1000000Ui64);
48-
49-
return 0;
5048
}/*}}}*/
5149

5250
PHPAPI int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Info)

0 commit comments

Comments
 (0)