Skip to content

Commit

Permalink
clang-format moment
Browse files Browse the repository at this point in the history
  • Loading branch information
p0358 committed Nov 2, 2023
1 parent 57bf005 commit ae35306
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
12 changes: 6 additions & 6 deletions examples/send-presence/send-presence.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ static void updateDiscordPresence()
discordPresence.instance = 0;

DiscordButton buttons[] = {
{.label = "Test", .url = "https://example.com"},
{.label = "Test 2", .url = "https://discord.gg/fortnite"},
{0, 0},
{.label = "Test", .url = "https://example.com"},
{.label = "Test 2", .url = "https://discord.gg/fortnite"},
{0, 0},
};

if (SendButtons) {
Expand Down Expand Up @@ -196,20 +196,20 @@ static void gameLoop()
updateDiscordPresence();
continue;
}

if (line[0] == 'i' && line[1]) {
if (line[1] == 'a') {
printf("Opening activity invite (type 1).\n");
Discord_OpenActivityInvite(1);
continue;
}

if (line[1] == '2') { // does not seem to work
printf("Opening activity invite (type 2).\n");
Discord_OpenActivityInvite(2);
continue;
}

if (line[1] == '0') { // does not seem to work either...
printf("Opening activity invite (type 0).\n");
Discord_OpenActivityInvite(0);
Expand Down
7 changes: 5 additions & 2 deletions src/connection_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,11 @@ bool BaseConnection::Open()

for (const auto& basePath : basePaths) {
for (int pipeNum = 0; pipeNum < 10; ++pipeNum) {
snprintf(
PipeAddr.sun_path, sizeof(PipeAddr.sun_path), "%s/discord-ipc-%d", basePath.c_str(), pipeNum);
snprintf(PipeAddr.sun_path,
sizeof(PipeAddr.sun_path),
"%s/discord-ipc-%d",
basePath.c_str(),
pipeNum);
int err = connect(self->sock, (const sockaddr*)&PipeAddr, sizeof(PipeAddr));
if (err == 0) {
self->isOpen = true;
Expand Down
12 changes: 6 additions & 6 deletions src/discord_register_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ extern "C" DISCORD_EXPORT void Discord_Register(const char* applicationId, const
}

const char* desktopFileFormat = "[Desktop Entry]\n"
"Name=Game %s\n"
"Exec=%s %%u\n" // note: it really wants that %u in there
"Type=Application\n"
"NoDisplay=true\n"
"Categories=Discord;Games;\n"
"MimeType=x-scheme-handler/discord-%s;\n";
"Name=Game %s\n"
"Exec=%s %%u\n" // note: it really wants that %u in there
"Type=Application\n"
"NoDisplay=true\n"
"Categories=Discord;Games;\n"
"MimeType=x-scheme-handler/discord-%s;\n";
char desktopFile[2048];
int fileLen = snprintf(
desktopFile, sizeof(desktopFile), desktopFileFormat, applicationId, command, applicationId);
Expand Down
4 changes: 2 additions & 2 deletions src/discord_rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,8 @@ extern "C" DISCORD_EXPORT void Discord_OpenGuildInvite(const char* code)
}
auto qmessage = SendQueue.GetNextAddMessage();
if (qmessage) {
qmessage->length =
JsonWriteOpenOverlayGuildInvite(qmessage->buffer, sizeof(qmessage->buffer), code, Nonce++, Pid);
qmessage->length = JsonWriteOpenOverlayGuildInvite(
qmessage->buffer, sizeof(qmessage->buffer), code, Nonce++, Pid);
SendQueue.CommitAdd();
SignalIOActivity();
}
Expand Down

0 comments on commit ae35306

Please sign in to comment.