Skip to content

Commit befdbf8

Browse files
WelchWelch
Welch
authored and
Welch
committed
Fix unused parameter warnings. Add missing timezone struct declaration.
1 parent 3dfce15 commit befdbf8

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

osal/win32/osal.c

+7-6
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ static double qpc2usec;
1212

1313
#define USECS_PER_SEC 1000000
1414

15-
int osal_getrelativetime(struct timeval *tv, struct timezone *tz)
15+
static int osal_getrelativetime(struct timeval *tv, struct timezone *tz)
1616
{
1717
int64_t wintime, usecs;
18+
(void)tz;
1819
if(!sysfrequency)
1920
{
2021
timeBeginPeriod(1);
@@ -33,7 +34,7 @@ int osal_gettimeofday(struct timeval *tv, struct timezone *tz)
3334
{
3435
FILETIME system_time;
3536
int64 system_time64, usecs;
36-
37+
(void)tz;
3738
/* The offset variable is required to switch from Windows epoch (January 1, 1601) to
3839
* Unix epoch (January 1, 1970). Number of days between both epochs: 134.774
3940
*
@@ -130,23 +131,23 @@ void osal_free(void *ptr)
130131
free(ptr);
131132
}
132133

133-
int osal_thread_create(void **thandle, int stacksize, void *func, void *param)
134+
int osal_thread_create(void *thandle, int stacksize, void *func, void *param)
134135
{
135-
*thandle = CreateThread(NULL, stacksize, func, param, 0, NULL);
136+
*(OSAL_THREAD_HANDLE*)thandle = CreateThread(NULL, stacksize, func, param, 0, NULL);
136137
if(!thandle)
137138
{
138139
return 0;
139140
}
140141
return 1;
141142
}
142143

143-
int osal_thread_create_rt(void **thandle, int stacksize, void *func, void *param)
144+
int osal_thread_create_rt(void *thandle, int stacksize, void *func, void *param)
144145
{
145146
int ret;
146147
ret = osal_thread_create(thandle, stacksize, func, param);
147148
if (ret)
148149
{
149-
ret = SetThreadPriority(*thandle, THREAD_PRIORITY_TIME_CRITICAL);
150+
ret = SetThreadPriority(thandle, THREAD_PRIORITY_TIME_CRITICAL);
150151
}
151152
return ret;
152153
}

osal/win32/osal_win32.h

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
} \
3030
} while (0)
3131

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

3436
#endif

oshw/win32/nicdrv.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,9 @@ static void ecx_clear_rxbufstat(int *rxbufstat)
8989
*/
9090
int ecx_setupnic(ecx_portt *port, const char *ifname, int secondary)
9191
{
92-
int i, rval;
92+
int i;
9393
pcap_t **psock;
9494

95-
rval = 0;
9695
if (secondary)
9796
{
9897
/* secondary port struct available? */

oshw/win32/oshw.c

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ uint16 oshw_ntohs (uint16 network)
3535
ec_adaptert * oshw_find_adapters (void)
3636
{
3737
int i = 0;
38-
int ret = 0;
3938
pcap_if_t *alldevs;
4039
pcap_if_t *d;
4140
ec_adaptert * adapter;

0 commit comments

Comments
 (0)