diff --git a/src/Platform.c b/src/Platform.c index d34171e..458fd98 100644 --- a/src/Platform.c +++ b/src/Platform.c @@ -73,6 +73,9 @@ DWORD WINAPI ThreadProc(LPVOID lpParameter) { #elif defined(__WIIU__) int ThreadProc(int argc, const char** argv) { struct thread_context* ctx = (struct thread_context*)argv; +#elif defined (__3DS__) +void ThreadProc(void* context) { + struct thread_context* ctx = (struct thread_context*)context; #else void* ThreadProc(void* context) { struct thread_context* ctx = (struct thread_context*)context; @@ -90,8 +93,10 @@ void* ThreadProc(void* context) { free(ctx); -#if defined(LC_WINDOWS) || defined(__vita__) || defined(__WIIU__) || defined(__3DS__) +#if defined(LC_WINDOWS) || defined(__vita__) || defined(__WIIU__) return 0; +#elif defined(__3DS__) + return; #else return NULL; #endif diff --git a/src/PlatformSockets.c b/src/PlatformSockets.c index bd4789c..cec96f3 100644 --- a/src/PlatformSockets.c +++ b/src/PlatformSockets.c @@ -151,7 +151,8 @@ int pollSockets(struct pollfd* pollFds, int pollFdsCount, int timeoutMs) { #elif defined(__3DS__) int err; u64 poll_start = osGetTime(); - for (u64 i = poll_start; (i - poll_start) < timeoutMs; i = osGetTime()) { + // seems like timeoutMs is never negative + for (u64 i = poll_start; (i - poll_start) < (u64)timeoutMs; i = osGetTime()) { err = poll(pollFds, pollFdsCount, 0); // This is running for 14ms if (err) { break; @@ -471,18 +472,17 @@ SOCKET connectTcpSocket(struct sockaddr_storage* dstaddr, SOCKADDR_LEN addrlen, // We still must split our own sends into smaller chunks with TCP_NODELAY enabled to // avoid MTU issues on the way out to to the target. #if defined(LC_WINDOWS) && !defined(NXDK) - int val; // Windows doesn't support setting TCP_MAXSEG but IP_PMTUDISC_DONT forces the MSS to the protocol // minimum which is what we want here. Linux doesn't do this (disabling PMTUD just avoids setting DF). if (dstaddr->ss_family == AF_INET) { - val = IP_PMTUDISC_DONT; + int val = IP_PMTUDISC_DONT; if (setsockopt(s, IPPROTO_IP, IP_MTU_DISCOVER, (char*)&val, sizeof(val)) < 0) { Limelog("setsockopt(IP_MTU_DISCOVER, IP_PMTUDISC_DONT) failed: %d\n", val, (int)LastSocketError()); } } else { - val = IP_PMTUDISC_DONT; + int val = IP_PMTUDISC_DONT; if (setsockopt(s, IPPROTO_IPV6, IPV6_MTU_DISCOVER, (char*)&val, sizeof(val)) < 0) { Limelog("setsockopt(IPV6_MTU_DISCOVER, IP_PMTUDISC_DONT) failed: %d\n", val, (int)LastSocketError()); } diff --git a/src/RtspConnection.c b/src/RtspConnection.c index 3669bdc..e958101 100644 --- a/src/RtspConnection.c +++ b/src/RtspConnection.c @@ -902,7 +902,7 @@ static bool parseUrlAddrFromRtspUrlString(const char* rtspUrlString, char* desti // SDP attributes are in the form: // a=x-nv-bwe.bwuSafeZoneLowLimit:70\r\n -bool parseSdpAttributeToUInt(const char* payload, const char* name, unsigned int* val) { +bool parseSdpAttributeToUInt(const char* payload, const char* name, uint32_t* val) { // Find the entry for the specified attribute name char* attribute = strstr(payload, name); if (!attribute) { diff --git a/src/SdpGenerator.c b/src/SdpGenerator.c index a2f9789..22467c0 100644 --- a/src/SdpGenerator.c +++ b/src/SdpGenerator.c @@ -1,4 +1,5 @@ #include "Limelight-internal.h" +#include #define MAX_OPTION_NAME_LEN 128 @@ -269,7 +270,7 @@ static PSDP_OPTION getAttributesList(char*urlSafeAddr) { if (IS_SUNSHINE()) { // Send client feature flags to Sunshine hosts uint32_t moonlightFeatureFlags = ML_FF_FEC_STATUS | ML_FF_SESSION_ID_V1; - snprintf(payloadStr, sizeof(payloadStr), "%u", moonlightFeatureFlags); + snprintf(payloadStr, sizeof(payloadStr), "%" PRIu32, moonlightFeatureFlags); err |= addAttributeString(&optionHead, "x-ml-general.featureFlags", payloadStr); // New-style control stream encryption is low overhead, so we enable it any time it is supported @@ -299,7 +300,7 @@ static PSDP_OPTION getAttributesList(char*urlSafeAddr) { EncryptionFeaturesEnabled |= SS_ENC_AUDIO; } - snprintf(payloadStr, sizeof(payloadStr), "%u", EncryptionFeaturesEnabled); + snprintf(payloadStr, sizeof(payloadStr), "%" PRIu32, EncryptionFeaturesEnabled); err |= addAttributeString(&optionHead, "x-ss-general.encryptionEnabled", payloadStr); // Enable YUV444 if requested