Skip to content

Commit

Permalink
Compiler warnings again
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph2 committed Oct 6, 2020
1 parent ec2d638 commit c75c521
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 40 deletions.
8 changes: 0 additions & 8 deletions flsemu/win/flsemu.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ typedef enum tagFlsEmu_OpenCreateType {
*/
static FlsEmu_OpenCreateResultType FlsEmu_OpenCreatePersitentArray(char const * fileName, DWORD size, FlsEmu_PersistentArrayType * persistentArray);
static bool FlsEmu_Flush(uint8_t segmentIdx);
static void FlsEmu_CloseFileView(FlsEmu_HwFileViewType * fileView);
static void FlsEmu_ClosePersitentArray(FlsEmu_PersistentArrayType const * persistentArray);
static bool FlsEmu_MapView(FlsEmu_SegmentType * config, uint32_t offset, uint32_t length);
static void MemoryInfo(void * address);
Expand Down Expand Up @@ -377,13 +376,6 @@ static void MemoryInfo(void * address)
VirtualQuery(address, &info, sizeof(MEMORY_BASIC_INFORMATION));
}


static void FlsEmu_CloseFileView(FlsEmu_HwFileViewType * fileView)
{
CloseHandle(fileView->mappingHandle);
}


#if defined(_WIN32)
void FlsEmu_Info(void)
{
Expand Down
40 changes: 8 additions & 32 deletions src/tl/eth/wineth_iocp.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,10 @@ static DWORD WINAPI AcceptorThread(LPVOID lpParameter);
void XcpTl_PostQuitMessage(void);
static void XcpTl_TriggerRecv(DWORD numBytes);
static void XcpTl_Feed(DWORD numBytesReceived);

static boolean Xcp_EnableSocketOption(SOCKET sock, int option);
static boolean Xcp_DisableSocketOption(SOCKET sock, int option);
static boolean Xcp_SetSocketOptionInt(SOCKET sock, int option, int value);

static boolean Xcp_EnableSocketOption(SOCKET sock, int option)

static boolean Xcp_EnableSocketOption(SOCKET sock, int option)
{
#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
const char enable = 1;
Expand All @@ -132,32 +130,6 @@ static boolean Xcp_EnableSocketOption(SOCKET sock, int option)
return XCP_TRUE;
}


static boolean Xcp_DisableSocketOption(SOCKET sock, int option)
{
#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
const char enable = 0;

if (setsockopt(sock, SOL_SOCKET, option, &enable, sizeof(int)) < 0) {
return XCP_FALSE;
}
#else
if (setsockopt(sock, SOL_SOCKET, option, &(const char){0}, sizeof(int)) < 0) {
return XCP_FALSE;
}
#endif
return XCP_TRUE;
}

static boolean Xcp_SetSocketOptionInt(SOCKET sock, int option, int value)
{
if (setsockopt(sock, SOL_SOCKET, option, (const char*)&value, sizeof(int)) < 0) {
return XCP_FALSE;
}
return XCP_TRUE;
}


#define TL_WORKER_THREAD (0)
#define TL_ACCEPTOR_THREAD (1)
#define NUM_TL_THREADS (2)
Expand Down Expand Up @@ -307,6 +279,8 @@ static DWORD WINAPI AcceptorThread(LPVOID lpParameter)
DWORD error;
int one = 1;

XCP_UNREFERENCED_PARAMETER(lpParameter);

XCP_FOREVER {
if (!XcpTl_Connection.xcpConnected) {
fromLen = sizeof(From);
Expand Down Expand Up @@ -343,7 +317,7 @@ void XcpTl_Send(uint8_t const * buf, uint16_t len)
DWORD bytesWritten;
int addrLen;

sendOlap.wsabuf.buf = buf;
sendOlap.wsabuf.buf = (char*)buf;
sendOlap.wsabuf.len = len;
sendOlap.opcode = IoWrite;

Expand Down Expand Up @@ -517,6 +491,8 @@ static void XcpTl_TriggerRecv(DWORD numBytes)
DWORD err = 0;
int addrLen;

XCP_UNREFERENCED_PARAMETER(numBytes);

SecureZeroMemory(&recvOlap.overlapped, sizeof(OVERLAPPED));

if (XcpTl_Connection.socketType == SOCK_STREAM) {
Expand Down Expand Up @@ -567,7 +543,7 @@ static void XcpTl_Feed(DWORD numBytesReceived)
#endif // XCP_TRANSPORT_LAYER_LENGTH_SIZE
if (!XcpTl_Connection.xcpConnected || (XcpTl_VerifyConnection())) {
Xcp_PduIn.len = dlc;
Xcp_PduIn.data = recvOlap.wsabuf.buf + XCP_TRANSPORT_LAYER_BUFFER_OFFSET;
Xcp_PduIn.data = (uint8_t *)(recvOlap.wsabuf.buf + XCP_TRANSPORT_LAYER_BUFFER_OFFSET);
Xcp_DispatchCommand(&Xcp_PduIn);
}
if (numBytesReceived < 5) {
Expand Down

0 comments on commit c75c521

Please sign in to comment.