fix some warnings, format
This commit is contained in:
parent
f617f3b78d
commit
bfcfd10baa
5 changed files with 13 additions and 6 deletions
|
@ -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 */
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#pragma once
|
||||
|
||||
void Discord_Register(const char* applicationId);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
template <size_t Len>
|
||||
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 <size_t Size>
|
||||
|
|
Loading…
Reference in a new issue