mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-17 17:05:50 +00:00
Fix build errors and warnings on Windows
This commit is contained in:
parent
678afd9c30
commit
97a499fc50
@ -210,7 +210,7 @@ int PltCreateThread(ThreadEntry entry, void* context, PLT_THREAD *thread) {
|
||||
PltUnlockMutex(&thread_list_lock);
|
||||
|
||||
// Make a callback to managed code to ask for a thread to grab this
|
||||
platformCallbacks.threadStart();
|
||||
PlatformCallbacks.threadStart();
|
||||
|
||||
err = 0;
|
||||
}
|
||||
|
@ -17,11 +17,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
# if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
||||
# define LC_WINDOWS_PHONE
|
||||
# elif WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP
|
||||
# define LC_WINDOWS
|
||||
# endif
|
||||
# define LC_WINDOWS
|
||||
#else
|
||||
# define LC_POSIX
|
||||
# if defined(__APPLE__)
|
||||
@ -33,10 +29,10 @@
|
||||
#include "Limelight.h"
|
||||
#if defined(LC_WINDOWS_PHONE) || defined(LC_WINDOWS)
|
||||
extern char DbgBuf[512];
|
||||
extern PLATFORM_CALLBACKS platformCallbacks;
|
||||
extern PLATFORM_CALLBACKS PlatformCallbacks;
|
||||
#define Limelog(s, ...) \
|
||||
sprintf(DbgBuf, s, ##__VA_ARGS__); \
|
||||
platformCallbacks.debugPrint(DbgBuf)
|
||||
PlatformCallbacks.debugPrint(DbgBuf)
|
||||
#else
|
||||
#define Limelog(s, ...) \
|
||||
fprintf(stderr, s, ##__VA_ARGS__)
|
||||
|
@ -3,8 +3,9 @@
|
||||
|
||||
void addrToUrlSafeString(struct sockaddr_storage *addr, char* string)
|
||||
{
|
||||
char addrstr[INET6_ADDRSTRLEN];
|
||||
|
||||
if (addr->ss_family == AF_INET6) {
|
||||
char addrstr[INET6_ADDRSTRLEN];
|
||||
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)addr;
|
||||
inet_ntop(addr->ss_family, &sin6->sin6_addr, addrstr, sizeof(addrstr));
|
||||
|
||||
@ -13,7 +14,7 @@ void addrToUrlSafeString(struct sockaddr_storage *addr, char* string)
|
||||
}
|
||||
else {
|
||||
struct sockaddr_in *sin = (struct sockaddr_in *)addr;
|
||||
char *addrstr = inet_ntoa(sin->sin_addr);
|
||||
inet_ntop(addr->ss_family, &sin->sin_addr, addrstr, sizeof(addrstr));
|
||||
|
||||
// IPv4 addresses are returned without changes
|
||||
sprintf(string, "%s", addrstr);
|
||||
|
@ -15,7 +15,7 @@ static int getMessageLength(PRTSP_MESSAGE msg){
|
||||
POPTION_ITEM current;
|
||||
|
||||
/* Initialize to 1 for null terminator */
|
||||
int count = 1;
|
||||
size_t count = 1;
|
||||
/* Add the length of the protocol */
|
||||
count += strlen(msg->protocol);
|
||||
|
||||
@ -50,7 +50,7 @@ static int getMessageLength(PRTSP_MESSAGE msg){
|
||||
/* Add the length of the payload, if any */
|
||||
count += msg->payloadLength;
|
||||
|
||||
return count;
|
||||
return (int)count;
|
||||
}
|
||||
|
||||
/* Given an RTSP message string rtspMessage, parse it into an RTSP_MESSAGE struct msg */
|
||||
|
@ -25,7 +25,7 @@ static void freeAttributeList(PSDP_OPTION head) {
|
||||
/* Get the size of the attribute list */
|
||||
static int getSerializedAttributeListSize(PSDP_OPTION head) {
|
||||
PSDP_OPTION currentEntry = head;
|
||||
int size = 0;
|
||||
size_t size = 0;
|
||||
while (currentEntry != NULL) {
|
||||
size += strlen("a=");
|
||||
size += strlen(currentEntry->name);
|
||||
@ -35,7 +35,7 @@ static int getSerializedAttributeListSize(PSDP_OPTION head) {
|
||||
|
||||
currentEntry = currentEntry->next;
|
||||
}
|
||||
return size;
|
||||
return (int)size;
|
||||
}
|
||||
|
||||
/* Populate the serialized attribute list into a string */
|
||||
|
Loading…
x
Reference in New Issue
Block a user