Skip to content

Commit

Permalink
Fix unused parameter warnings. Add missing timezone struct declaration.
Browse files Browse the repository at this point in the history
  • Loading branch information
Welch authored and Welch committed Nov 27, 2024
1 parent 3dfce15 commit befdbf8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
13 changes: 7 additions & 6 deletions osal/win32/osal.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ static double qpc2usec;

#define USECS_PER_SEC 1000000

int osal_getrelativetime(struct timeval *tv, struct timezone *tz)
static int osal_getrelativetime(struct timeval *tv, struct timezone *tz)
{
int64_t wintime, usecs;
(void)tz;
if(!sysfrequency)
{
timeBeginPeriod(1);
Expand All @@ -33,7 +34,7 @@ int osal_gettimeofday(struct timeval *tv, struct timezone *tz)
{
FILETIME system_time;
int64 system_time64, usecs;

(void)tz;
/* The offset variable is required to switch from Windows epoch (January 1, 1601) to
* Unix epoch (January 1, 1970). Number of days between both epochs: 134.774
*
Expand Down Expand Up @@ -130,23 +131,23 @@ void osal_free(void *ptr)
free(ptr);
}

int osal_thread_create(void **thandle, int stacksize, void *func, void *param)
int osal_thread_create(void *thandle, int stacksize, void *func, void *param)
{
*thandle = CreateThread(NULL, stacksize, func, param, 0, NULL);
*(OSAL_THREAD_HANDLE*)thandle = CreateThread(NULL, stacksize, func, param, 0, NULL);
if(!thandle)
{
return 0;
}
return 1;
}

int osal_thread_create_rt(void **thandle, int stacksize, void *func, void *param)
int osal_thread_create_rt(void *thandle, int stacksize, void *func, void *param)
{
int ret;
ret = osal_thread_create(thandle, stacksize, func, param);
if (ret)
{
ret = SetThreadPriority(*thandle, THREAD_PRIORITY_TIME_CRITICAL);
ret = SetThreadPriority(thandle, THREAD_PRIORITY_TIME_CRITICAL);
}
return ret;
}
2 changes: 2 additions & 0 deletions osal/win32/osal_win32.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
} \
} while (0)

struct timezone;
// currently the tz parameter is ignored in the win32 implmentation.
int osal_gettimeofday (struct timeval *tv, struct timezone *tz);

#endif
3 changes: 1 addition & 2 deletions oshw/win32/nicdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,9 @@ static void ecx_clear_rxbufstat(int *rxbufstat)
*/
int ecx_setupnic(ecx_portt *port, const char *ifname, int secondary)
{
int i, rval;
int i;
pcap_t **psock;

rval = 0;
if (secondary)
{
/* secondary port struct available? */
Expand Down
1 change: 0 additions & 1 deletion oshw/win32/oshw.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ uint16 oshw_ntohs (uint16 network)
ec_adaptert * oshw_find_adapters (void)
{
int i = 0;
int ret = 0;
pcap_if_t *alldevs;
pcap_if_t *d;
ec_adaptert * adapter;
Expand Down

0 comments on commit befdbf8

Please sign in to comment.