@@ -231,14 +231,14 @@ void kissnet_init (struct misc_config_s *mc)
231
231
* This waits for a client to connect and sets client_sock[n].
232
232
*/
233
233
#if __WIN32__
234
- connect_listen_th = (HANDLE )_beginthreadex (NULL , 0 , connect_listen_thread , (void * )kiss_port , 0 , NULL );
234
+ connect_listen_th = (HANDLE )_beginthreadex (NULL , 0 , connect_listen_thread , (void * )( ptrdiff_t ) kiss_port , 0 , NULL );
235
235
if (connect_listen_th == NULL ) {
236
236
text_color_set (DW_COLOR_ERROR );
237
237
dw_printf ("Could not create KISS socket connect listening thread\n" );
238
238
return ;
239
239
}
240
240
#else
241
- e = pthread_create (& connect_listen_tid , NULL , connect_listen_thread , (void * )(long )kiss_port );
241
+ e = pthread_create (& connect_listen_tid , NULL , connect_listen_thread , (void * )(ptrdiff_t )kiss_port );
242
242
if (e != 0 ) {
243
243
text_color_set (DW_COLOR_ERROR );
244
244
perror ("Could not create KISS socket connect listening thread" );
@@ -254,14 +254,14 @@ void kissnet_init (struct misc_config_s *mc)
254
254
for (client = 0 ; client < MAX_NET_CLIENTS ; client ++ ) {
255
255
256
256
#if __WIN32__
257
- cmd_listen_th [client ] = (HANDLE )_beginthreadex (NULL , 0 , kissnet_listen_thread , (void * )client , 0 , NULL );
257
+ cmd_listen_th [client ] = (HANDLE )_beginthreadex (NULL , 0 , kissnet_listen_thread , (void * )( ptrdiff_t ) client , 0 , NULL );
258
258
if (cmd_listen_th [client ] == NULL ) {
259
259
text_color_set (DW_COLOR_ERROR );
260
260
dw_printf ("Could not create KISS command listening thread for client %d\n" , client );
261
261
return ;
262
262
}
263
263
#else
264
- e = pthread_create (& (cmd_listen_tid [client ]), NULL , kissnet_listen_thread , (void * )(long )client );
264
+ e = pthread_create (& (cmd_listen_tid [client ]), NULL , kissnet_listen_thread , (void * )(ptrdiff_t )client );
265
265
if (e != 0 ) {
266
266
text_color_set (DW_COLOR_ERROR );
267
267
dw_printf ("Could not create KISS command listening thread for client %d\n" , client );
@@ -305,10 +305,10 @@ static THREAD_F connect_listen_thread (void *arg)
305
305
SOCKET listen_sock ;
306
306
WSADATA wsadata ;
307
307
308
- snprintf (kiss_port_str , sizeof (kiss_port_str ), "%d" , (int )(long )arg );
308
+ snprintf (kiss_port_str , sizeof (kiss_port_str ), "%d" , (int )(ptrdiff_t )arg );
309
309
#if DEBUG
310
310
text_color_set (DW_COLOR_DEBUG );
311
- dw_printf ("DEBUG: kissnet port = %d = '%s'\n" , (int )(long )arg , kiss_port_str );
311
+ dw_printf ("DEBUG: kissnet port = %d = '%s'\n" , (int )(ptrdiff_t )arg , kiss_port_str );
312
312
#endif
313
313
err = WSAStartup (MAKEWORD (2 ,2 ), & wsadata );
314
314
if (err != 0 ) {
@@ -425,7 +425,7 @@ static THREAD_F connect_listen_thread (void *arg)
425
425
426
426
struct sockaddr_in sockaddr ; /* Internet socket address stuct */
427
427
socklen_t sockaddr_size = sizeof (struct sockaddr_in );
428
- int kiss_port = (int )(long )arg ;
428
+ int kiss_port = (int )(ptrdiff_t )arg ;
429
429
int listen_sock ;
430
430
int bcopt = 1 ;
431
431
@@ -808,7 +808,7 @@ static THREAD_F kissnet_listen_thread (void *arg)
808
808
unsigned char ch ;
809
809
810
810
811
- int client = (int )(long )arg ;
811
+ int client = (int )(ptrdiff_t )arg ;
812
812
813
813
#if DEBUG
814
814
text_color_set (DW_COLOR_DEBUG );
0 commit comments