diff --git a/include/discord-rpc.h b/include/discord-rpc.h index 519740e..3be1f9b 100644 --- a/include/discord-rpc.h +++ b/include/discord-rpc.h @@ -32,7 +32,9 @@ typedef struct DiscordEventHandlers { void (*spectateGame)(const char* spectateSecret); } DiscordEventHandlers; -void Discord_Initialize(const char* applicationId, DiscordEventHandlers* handlers, int autoRegister); +void Discord_Initialize(const char* applicationId, + DiscordEventHandlers* handlers, + int autoRegister); void Discord_Shutdown(); /* checks for incoming messages, dispatches callbacks */ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a4bc465..3316346 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,6 +10,7 @@ set(BASE_RPC_SRC ${PROJECT_SOURCE_DIR}/include/discord-rpc.h discord-rpc.cpp dis if(WIN32) add_library(discord-rpc STATIC ${BASE_RPC_SRC} connection_win.cpp) + target_compile_options(discord-rpc PRIVATE /W4) endif(WIN32) if(UNIX) diff --git a/src/discord-register.h b/src/discord-register.h index 631631f..1ad943b 100644 --- a/src/discord-register.h +++ b/src/discord-register.h @@ -1,4 +1,3 @@ #pragma once void Discord_Register(const char* applicationId); - diff --git a/src/discord-rpc.cpp b/src/discord-rpc.cpp index 5f7303a..74271bf 100644 --- a/src/discord-rpc.cpp +++ b/src/discord-rpc.cpp @@ -22,7 +22,6 @@ struct QueuedMessage { }; static RpcConnection* Connection{nullptr}; -static char ApplicationId[64]{}; static DiscordEventHandlers Handlers{}; static std::atomic_bool WasJustConnected{false}; static std::atomic_bool WasJustDisconnected{false}; @@ -180,7 +179,9 @@ bool RegisterForEvent(const char* evtName) return false; } -extern "C" void Discord_Initialize(const char* applicationId, DiscordEventHandlers* handlers, int autoRegister) +extern "C" void Discord_Initialize(const char* applicationId, + DiscordEventHandlers* handlers, + int autoRegister) { if (autoRegister) { Discord_Register(applicationId); diff --git a/src/serialization.h b/src/serialization.h index 470a426..f155b66 100644 --- a/src/serialization.h +++ b/src/serialization.h @@ -11,7 +11,7 @@ template inline size_t StringCopy(char (&dest)[Len], const char* src) { - if (!dest || !src || !Len) { + if (!src || !Len) { return 0; } size_t copied; @@ -71,7 +71,11 @@ public: assert(!originalPtr && !originalSize); return Malloc(newSize); } - static void Free(void* ptr) { /* shrug */} + static void Free(void* ptr) + { + /* shrug */ + (void)ptr; + } }; template