Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Commit

Permalink
remove unused includes and small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pizzabelly committed Jul 18, 2018
1 parent 91015e3 commit 7df8e7b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
1 change: 0 additions & 1 deletion config.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "config.hpp"
#include <algorithm>
#include <fstream>
#include <iostream>
#include <limits.h>
#include <sstream>

Expand Down
14 changes: 5 additions & 9 deletions discord.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#include "config.hpp"
#include <cstring>
#include <ctime>
#include <iostream>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <string>

Expand All @@ -18,17 +15,17 @@ void Shutdown(int sig) {
}

// handle discord ready event
static void handleDiscordReady(const DiscordUser *u) {
void handleDiscordReady(const DiscordUser *u) {
printf("\nDisplaying Presence for %s#%s\n", u->username, u->discriminator);
}

// handle discord disconnected event
static void handleDiscordDisconnected(int errcode, const char *message) {
void handleDiscordDisconnected(int errcode, const char *message) {
printf("\nDiscord: disconnected (%d: %s)\n", errcode, message);
}

// handle discord error event
static void handleDiscordError(int errcode, const char *message) {
void handleDiscordError(int errcode, const char *message) {
printf("\nDiscord: error (%d: %s)\n", errcode, message);
Shutdown(1);
}
Expand Down Expand Up @@ -72,8 +69,7 @@ void updatePresence(config_t *c) {
if (c->end_time >= 0 && c->end_time != 0LL)
discordPresence.endTimestamp = (int64_t)c->end_time;

// make sure not to set the optional variables if they are not defined in
// the config
// dont set optional variables if they are not defined in the config
if (c->small_img.key.length() >= 1)
discordPresence.smallImageKey = c->small_img.key.c_str();
if (c->small_img.text.length() >= 1)
Expand All @@ -89,7 +85,7 @@ void refreshDiscord() {
// manually handle this
Discord_UpdateConnection();

// handle callbacks
// callbacks
Discord_RunCallbacks();
}

Expand Down
3 changes: 0 additions & 3 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
#include "discord.hpp"
#include <chrono>
#include <csignal>
#include <iostream>
#include <thread>

#define CONFIG_PATH "config.ini"

int main(void) {
// define when to shutdown
signal(SIGINT, Shutdown);
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project('EasyRP', 'cpp',
version : '3.0',
default_options : ['warning_level=3'])
default_options : ['warning_level=3', 'cpp_std=c++14', 'b_ndebug=if-release'])

compiler = meson.get_compiler('cpp')

Expand Down

0 comments on commit 7df8e7b

Please sign in to comment.