mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-17 16:53:13 +00:00
Fixed compiler warnings on MacOS
This commit is contained in:
@@ -828,20 +828,22 @@ ILibProcessPipe_Process ILibProcessPipe_Manager_SpawnProcessEx3(ILibProcessPipe_
|
||||
#endif
|
||||
if (spawnType == ILibProcessPipe_SpawnTypes_TERM)
|
||||
{
|
||||
#ifndef __APPLE__
|
||||
int pipe;
|
||||
struct winsize w;
|
||||
w.ws_row = CONSOLE_SCREEN_HEIGHT;
|
||||
w.ws_col = CONSOLE_SCREEN_WIDTH;
|
||||
w.ws_xpixel = 0;
|
||||
w.ws_ypixel = 0;
|
||||
#ifndef __APPLE__
|
||||
pid = forkpty(&pipe, NULL, NULL, &w);
|
||||
#endif
|
||||
retVal->stdIn = ILibProcessPipe_Pipe_CreateFromExistingWithExtraMemory(pipeManager, pipe, extraMemorySize);
|
||||
retVal->stdIn->mProcess = retVal;
|
||||
retVal->stdOut = ILibProcessPipe_Pipe_CreateFromExistingWithExtraMemory(pipeManager, pipe, extraMemorySize);
|
||||
ILibProcessPipe_Pipe_SetBrokenPipeHandler(retVal->stdOut, ILibProcessPipe_Process_BrokenPipeSink);
|
||||
retVal->stdOut->mProcess = retVal;
|
||||
#else
|
||||
pid = 0; // Apple LLVM is being dumb, and throws a warning if I don't do this, even tho it'll never run
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1451,7 +1451,7 @@ int ILibWebClient_ProcessWebSocketData(char* buffer, int offset, int length, ILi
|
||||
case WEBSOCKET_OPCODE_PING:
|
||||
if (state->pingHandler == NULL || state->pingHandler(wcdo, state->pingPongUser) == ILibWebClient_WebSocket_PingResponse_Respond)
|
||||
{
|
||||
ILibWebClient_WebSocket_Send(wcdo, (ILibWebClient_WebSocket_DataTypes)WEBSOCKET_OPCODE_PONG, NULL, 0, ILibAsyncSocket_MemoryOwnership_STATIC, ILibWebServer_WebSocket_FragmentFlag_Complete);
|
||||
ILibWebClient_WebSocket_Send(wcdo, (ILibWebClient_WebSocket_DataTypes)WEBSOCKET_OPCODE_PONG, NULL, 0, ILibAsyncSocket_MemoryOwnership_STATIC, ILibWebClient_WebSocket_FragmentFlag_Complete);
|
||||
}
|
||||
break;
|
||||
case WEBSOCKET_OPCODE_PONG:
|
||||
@@ -3288,13 +3288,13 @@ ILibTransport_DoneState ILibWebClient_StreamRequestBody(
|
||||
if (body != NULL && bodyLength > 0)
|
||||
{
|
||||
hexLen = sprintf_s(hex, 16, "%X\r\n", bodyLength);
|
||||
result = ILibAsyncSocket_Send(t->wcdo->SOCK, hex, hexLen, ILibAsyncSocket_MemoryOwnership_USER);
|
||||
result = (ILibTransport_DoneState)ILibAsyncSocket_Send(t->wcdo->SOCK, hex, hexLen, ILibAsyncSocket_MemoryOwnership_USER);
|
||||
if (result != ILibTransport_DoneState_ERROR)
|
||||
{
|
||||
result = ILibAsyncSocket_Send(t->wcdo->SOCK, body ,bodyLength, MemoryOwnership);
|
||||
result = (ILibTransport_DoneState)ILibAsyncSocket_Send(t->wcdo->SOCK, body ,bodyLength, MemoryOwnership);
|
||||
if (result != ILibTransport_DoneState_ERROR)
|
||||
{
|
||||
result = ILibAsyncSocket_Send(t->wcdo->SOCK, "\r\n", 2, ILibAsyncSocket_MemoryOwnership_STATIC);
|
||||
result = (ILibTransport_DoneState)ILibAsyncSocket_Send(t->wcdo->SOCK, "\r\n", 2, ILibAsyncSocket_MemoryOwnership_STATIC);
|
||||
}
|
||||
}
|
||||
else if (MemoryOwnership == ILibAsyncSocket_MemoryOwnership_CHAIN)
|
||||
@@ -3304,7 +3304,7 @@ ILibTransport_DoneState ILibWebClient_StreamRequestBody(
|
||||
}
|
||||
if (result != ILibTransport_DoneState_ERROR && done != 0)
|
||||
{
|
||||
result = ILibAsyncSocket_Send(t->wcdo->SOCK, "0\r\n\r\n", 5, ILibAsyncSocket_MemoryOwnership_STATIC);
|
||||
result = (ILibTransport_DoneState)ILibAsyncSocket_Send(t->wcdo->SOCK, "0\r\n\r\n", 5, ILibAsyncSocket_MemoryOwnership_STATIC);
|
||||
}
|
||||
if (result == ILibTransport_DoneState_COMPLETE && wr != NULL && wr->streamedState != NULL && wr->streamedState->OnSendOK != NULL && done == 0)
|
||||
{
|
||||
|
||||
@@ -291,8 +291,8 @@ typedef void(*ILibWebClient_WebSocket_PongHandler)(ILibWebClient_StateObject sta
|
||||
void ILibWebClient_AddWebSocketRequestHeaders(ILibHTTPPacket *packet, int FragmentReassemblyMaxBufferSize, ILibWebClient_OnSendOK OnSendOK);
|
||||
ILibAsyncSocket_SendStatus ILibWebClient_WebSocket_Send(ILibWebClient_StateObject state, ILibWebClient_WebSocket_DataTypes bufferType, char* buffer, int bufferLen, ILibAsyncSocket_MemoryOwnership userFree, ILibWebClient_WebSocket_FragmentFlags bufferFragment);
|
||||
void ILibWebClient_WebSocket_SetPingPongHandler(ILibWebClient_StateObject state, ILibWebClient_WebSocket_PingHandler pingHandler, ILibWebClient_WebSocket_PongHandler pongHandler, void *user);
|
||||
#define ILibWebClient_WebSocket_Ping(stateObject) ILibWebClient_WebSocket_Send((stateObject), (ILibWebClient_WebSocket_DataTypes)WEBSOCKET_OPCODE_PING, NULL, 0, ILibAsyncSocket_MemoryOwnership_STATIC, ILibWebServer_WebSocket_FragmentFlag_Complete)
|
||||
#define ILibWebClient_WebSocket_Pong(stateObject) ILibWebClient_WebSocket_Send((stateObject), (ILibWebClient_WebSocket_DataTypes)WEBSOCKET_OPCODE_PONG, NULL, 0, ILibAsyncSocket_MemoryOwnership_STATIC, ILibWebServer_WebSocket_FragmentFlag_Complete)
|
||||
#define ILibWebClient_WebSocket_Ping(stateObject) ILibWebClient_WebSocket_Send((stateObject), (ILibWebClient_WebSocket_DataTypes)WEBSOCKET_OPCODE_PING, NULL, 0, ILibAsyncSocket_MemoryOwnership_STATIC, ILibWebClient_WebSocket_FragmentFlag_Complete)
|
||||
#define ILibWebClient_WebSocket_Pong(stateObject) ILibWebClient_WebSocket_Send((stateObject), (ILibWebClient_WebSocket_DataTypes)WEBSOCKET_OPCODE_PONG, NULL, 0, ILibAsyncSocket_MemoryOwnership_STATIC, ILibWebClient_WebSocket_FragmentFlag_Complete)
|
||||
|
||||
typedef void(*ILibWebClient_TimeoutHandler)(ILibWebClient_StateObject state, void *user);
|
||||
void ILibWebClient_SetTimeout(ILibWebClient_StateObject state, int timeoutSeconds, ILibWebClient_TimeoutHandler handler, void *user);
|
||||
|
||||
Reference in New Issue
Block a user