- removed some warnings in windows HAL code

pull/487/head v1.5.3
Michael Zillgith 2 years ago
parent c83bad2531
commit 6f557c490f

@ -21,6 +21,8 @@
* See COPYING file for the complete license text. * See COPYING file for the complete license text.
*/ */
#define _CRT_SECURE_NO_WARNINGS
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
@ -62,13 +64,13 @@ FileSystem_openFile(char* fileName, bool readWrite)
int int
FileSystem_readFile(FileHandle handle, uint8_t* buffer, int maxSize) FileSystem_readFile(FileHandle handle, uint8_t* buffer, int maxSize)
{ {
return fread(buffer, 1, maxSize, (FILE*) handle); return (int)fread(buffer, 1, maxSize, (FILE*) handle);
} }
int int
FileSystem_writeFile(FileHandle handle, uint8_t* buffer, int size) FileSystem_writeFile(FileHandle handle, uint8_t* buffer, int size)
{ {
return fwrite(buffer, 1, size, (FILE*) handle); return (int)fwrite(buffer, 1, size, (FILE*) handle);
} }
void void

@ -105,7 +105,7 @@ Handleset_waitReady(HandleSet self, unsigned int timeoutMs)
memcpy((void*)&handles, &(self->handles), sizeof(fd_set)); memcpy((void*)&handles, &(self->handles), sizeof(fd_set));
result = select(self->maxHandle + 1, &handles, NULL, NULL, &timeout); result = select(0, &handles, NULL, NULL, &timeout);
} else { } else {
result = -1; result = -1;
} }
@ -436,7 +436,7 @@ Socket_checkAsyncConnectState(Socket self)
FD_ZERO(&fdSet); FD_ZERO(&fdSet);
FD_SET(self->fd, &fdSet); FD_SET(self->fd, &fdSet);
int selectVal = select(self->fd + 1, NULL, &fdSet , NULL, &timeout); int selectVal = select(0, NULL, &fdSet , NULL, &timeout);
if (selectVal == 1) { if (selectVal == 1) {
@ -489,7 +489,7 @@ Socket_connect(Socket self, const char* address, int port)
FD_ZERO(&fdSet); FD_ZERO(&fdSet);
FD_SET(self->fd, &fdSet); FD_SET(self->fd, &fdSet);
if (select(self->fd + 1, NULL, &fdSet , NULL, &timeout) == 1) { if (select(0, NULL, &fdSet , NULL, &timeout) == 1) {
/* Check if connection is established */ /* Check if connection is established */

@ -7,6 +7,8 @@
* for libiec61850, libmms, and lib60870. * for libiec61850, libmms, and lib60870.
*/ */
#define _CRT_SECURE_NO_WARNINGS
#include <windows.h> #include <windows.h>
#include "lib_memory.h" #include "lib_memory.h"
#include "hal_thread.h" #include "hal_thread.h"
@ -38,7 +40,9 @@ threadRunner(LPVOID parameter)
{ {
Thread thread = (Thread) parameter; Thread thread = (Thread) parameter;
return (UINT) thread->function(thread->parameter); thread->function(thread->parameter);
return (DWORD)0;
} }
Thread Thread

Loading…
Cancel
Save