mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-25 17:55:42 +01:00
Fix harmless warnings with mingw in timing.c
This commit is contained in:
parent
38433535e3
commit
dda5213982
@ -9,6 +9,7 @@ Features
|
|||||||
Bugfix
|
Bugfix
|
||||||
* Fix hardclock() (only used in the benchmarking program) with some
|
* Fix hardclock() (only used in the benchmarking program) with some
|
||||||
versions of mingw64 (found by kxjhlele).
|
versions of mingw64 (found by kxjhlele).
|
||||||
|
* Fix warnings from mingw64 in timing.c (found by kxjklele).
|
||||||
|
|
||||||
Changes
|
Changes
|
||||||
* Move from SHA-1 to SHA-256 in example programs using signatures
|
* Move from SHA-1 to SHA-256 in example programs using signatures
|
||||||
|
@ -65,6 +65,10 @@ unsigned long get_timer( struct hr_time *val, int reset );
|
|||||||
* \brief Setup an alarm clock
|
* \brief Setup an alarm clock
|
||||||
*
|
*
|
||||||
* \param seconds delay before the "alarmed" flag is set
|
* \param seconds delay before the "alarmed" flag is set
|
||||||
|
*
|
||||||
|
* \warning Only one alarm at a time is supported. In a threaded
|
||||||
|
* context, this means one for the whole process, not one per
|
||||||
|
* thread.
|
||||||
*/
|
*/
|
||||||
void set_alarm( int seconds );
|
void set_alarm( int seconds );
|
||||||
|
|
||||||
|
@ -251,9 +251,13 @@ unsigned long get_timer( struct hr_time *val, int reset )
|
|||||||
return( delta );
|
return( delta );
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD WINAPI TimerProc( LPVOID uElapse )
|
/* It's OK to use a global because alarm() is supposed to be global anyway */
|
||||||
|
static DWORD alarmMs;
|
||||||
|
|
||||||
|
DWORD WINAPI TimerProc( LPVOID TimerContext )
|
||||||
{
|
{
|
||||||
Sleep( (DWORD) uElapse );
|
((void) TimerContext);
|
||||||
|
Sleep( alarmMs );
|
||||||
alarmed = 1;
|
alarmed = 1;
|
||||||
return( TRUE );
|
return( TRUE );
|
||||||
}
|
}
|
||||||
@ -263,8 +267,8 @@ void set_alarm( int seconds )
|
|||||||
DWORD ThreadId;
|
DWORD ThreadId;
|
||||||
|
|
||||||
alarmed = 0;
|
alarmed = 0;
|
||||||
CloseHandle( CreateThread( NULL, 0, TimerProc,
|
alarmMs = seconds * 1000;
|
||||||
(LPVOID) ( seconds * 1000 ), 0, &ThreadId ) );
|
CloseHandle( CreateThread( NULL, 0, TimerProc, NULL, 0, &ThreadId ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void m_sleep( int milliseconds )
|
void m_sleep( int milliseconds )
|
||||||
|
Loading…
Reference in New Issue
Block a user