Skip to content

Commit 0bbcd6d

Browse files
committed
Updating to fix a few minor warnings. [skip ci]
1 parent 1b06fa6 commit 0bbcd6d

File tree

5 files changed

+20
-27
lines changed

5 files changed

+20
-27
lines changed

CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,11 @@ project(
4747
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_SOURCE_DIR}/CMake;${FFMPEG_DIR};${OpenSSL_DIR}")
4848
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_BUILD_TYPE}")
4949

50-
if(EXISTS "${_VCPKG_ROOT_DIR}")
51-
include("${_VCPKG_ROOT_DIR}/scripts/buildsystems/vcpkg.cmake")
50+
if(EXISTS "${_VCPKG_INSTALLED_DIR}")
5251
set(OS_NAME "${CMAKE_SYSTEM_NAME}")
5352
string(TOLOWER "${OS_NAME}" OS_NAME)
5453
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${_VCPKG_ROOT_DIR}/installed/x64-${OS_NAME}/share/ffmpeg")
5554
set(DEBUG_PREFIX "")
56-
cmake_path(GET _VCPKG_INSTALLED_DIR ROOT_PATH ROOT_DRIVE)
57-
set(VCPKG_INSTALLED_DIR "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}")
58-
cmake_path(ABSOLUTE_PATH VCPKG_INSTALLED_DIR BASE_DIRECTORY "${ROOT_DRIVE}" NORMALIZE OUTPUT_VARIABLE VCPKG_INSTALLED_DIR)
59-
set(VCPKG_INCLUDE_DIR "${VCPKG_INSTALLED_DIR}/include")
60-
set(VCPKG_RELEASE_ROOT "${VCPKG_INSTALLED_DIR}/lib")
61-
set(VCPKG_DEBUG_ROOT "${VCPKG_INSTALLED_DIR}/debug/lib")
6255
else()
6356
set(DEBUG_PREFIX "debug/")
6457
if (WIN32)

Include/discordcoreapi/Utilities.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -872,10 +872,10 @@ namespace DiscordCoreAPI {
872872
using std::cout;
873873
using std::endl;
874874

875+
struct DiscordCoreAPI_Dll OnVoiceServerUpdateData;
876+
struct DiscordCoreAPI_Dll OnVoiceStateUpdateData;
875877
struct DiscordCoreAPI_Dll File;
876-
877-
class DiscordCoreAPI_Dll OnVoiceServerUpdateData;
878-
class DiscordCoreAPI_Dll OnVoiceStateUpdateData;
878+
879879
class DiscordCoreAPI_Dll DiscordCoreClient;
880880
class DiscordCoreAPI_Dll VoiceConnection;
881881
class DiscordCoreAPI_Dll GuildMember;

Include/discordcoreapi/WebSocketEntities.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ namespace DiscordCoreInternal {
100100

101101
class DiscordCoreAPI_Dll WebSocketSSLShard : public WebSocketCore {
102102
public:
103-
friend class DiscordCoreAPI::OnVoiceServerUpdateData;
104-
friend class DiscordCoreAPI::OnVoiceStateUpdateData;
103+
friend struct DiscordCoreAPI::OnVoiceServerUpdateData;
104+
friend struct DiscordCoreAPI::OnVoiceStateUpdateData;
105105
friend class DiscordCoreAPI::VoiceConnection;
106106
friend class DiscordCoreAPI::BotUser;
107107
friend class BaseSocketAgent;

Source/SSLClients.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -621,16 +621,16 @@ namespace DiscordCoreInternal {
621621
#else
622622
while ((result == 0 || errno != EWOULDBLOCK) && !token.stop_requested()) {
623623
#endif
624-
result =
625-
sendto(this->socket, connectionString.data(), connectionString.size(), 0, this->address->ai_addr, this->address->ai_addrlen);
624+
result = sendto(this->socket, connectionString.data(), static_cast<int32_t>(connectionString.size()), 0, this->address->ai_addr,
625+
static_cast<int32_t>(this->address->ai_addrlen));
626626
}
627627
result = 0;
628628
#ifdef _WIN32
629629
while ((result == 0 || WSAGetLastError() == WSAEWOULDBLOCK) && !token.stop_requested()) {
630630
#else
631631
while ((result == 0 || errno != EWOULDBLOCK) && !token.stop_requested()) {
632632
#endif
633-
result = recvfrom(this->socket, connectionString.data(), connectionString.size(), 0, this->address->ai_addr,
633+
result = recvfrom(this->socket, connectionString.data(), static_cast<int32_t>(connectionString.size()), 0, this->address->ai_addr,
634634
reinterpret_cast<socklen_t*>(&this->address->ai_addrlen));
635635
}
636636
}
@@ -642,7 +642,7 @@ namespace DiscordCoreInternal {
642642
}
643643
return false;
644644
}
645-
if (auto result = bind(this->socket, this->address->ai_addr, this->address->ai_addrlen); result != 0) {
645+
if (auto result = bind(this->socket, this->address->ai_addr, static_cast<int32_t>(this->address->ai_addrlen)); result != 0) {
646646
if (this->doWePrintErrors) {
647647
cout << reportError("DatagramSocketClient::connect::bind(), to: " + baseUrlNew) << endl;
648648
}
@@ -657,7 +657,7 @@ namespace DiscordCoreInternal {
657657
#else
658658
while ((result == 0 || errno != EWOULDBLOCK) && !token.stop_requested()) {
659659
#endif
660-
result = recvfrom(this->socket, connectionString.data(), connectionString.size(), 0, this->address->ai_addr,
660+
result = recvfrom(this->socket, connectionString.data(), static_cast<int32_t>(connectionString.size()), 0, this->address->ai_addr,
661661
reinterpret_cast<socklen_t*>(&this->address->ai_addrlen));
662662
}
663663
connectionString = "connected1";
@@ -667,8 +667,8 @@ namespace DiscordCoreInternal {
667667
#else
668668
while ((result == 0 || errno != EWOULDBLOCK) && !token.stop_requested()) {
669669
#endif
670-
result =
671-
sendto(this->socket, connectionString.data(), connectionString.size(), 0, this->address->ai_addr, this->address->ai_addrlen);
670+
result = sendto(this->socket, connectionString.data(), static_cast<int32_t>(connectionString.size()), 0, this->address->ai_addr,
671+
static_cast<int32_t>(this->address->ai_addrlen));
672672
}
673673
}
674674
}
@@ -775,7 +775,7 @@ namespace DiscordCoreInternal {
775775
if (this->outputBuffer.getUsedSpace() > 0) {
776776
auto bytesToWrite{ this->outputBuffer.getCurrentTail()->getUsedSpace() };
777777
auto writtenBytes{ sendto(this->socket, this->outputBuffer.getCurrentTail()->getCurrentTail(), static_cast<int32_t>(bytesToWrite), 0,
778-
this->address->ai_addr, this->address->ai_addrlen) };
778+
this->address->ai_addr, static_cast<int32_t>(this->address->ai_addrlen)) };
779779
#ifdef _WIN32
780780
if (writtenBytes < 0 && WSAGetLastError() != WSAEWOULDBLOCK) {
781781
#else

Source/VoiceConnection.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ namespace DiscordCoreAPI {
154154
this->clientPtr->getSongAPI(this->guildId)->audioDataBuffer.send(std::move(frame));
155155
} else {
156156
AudioFrameData newFrame{};
157-
newFrame.data.push_back(0xf8);
158-
newFrame.data.push_back(0xff);
159-
newFrame.data.push_back(0xfe);
157+
newFrame.data.push_back(static_cast<char>(0xf8));
158+
newFrame.data.push_back(static_cast<char>(0xff));
159+
newFrame.data.push_back(static_cast<char>(0xfe));
160160
newFrame.type = AudioFrameType::Encoded;
161161
this->clientPtr->getSongAPI(this->guildId)->audioDataBuffer.send(std::move(newFrame));
162162
}
@@ -838,9 +838,9 @@ namespace DiscordCoreAPI {
838838
std::vector<std::string> frames{};
839839
for (size_t x = 0; x < 5; ++x) {
840840
AudioFrameData newFrame{};
841-
newFrame.data.push_back(0xf8);
842-
newFrame.data.push_back(0xff);
843-
newFrame.data.push_back(0xfe);
841+
newFrame.data.push_back(static_cast<char>(0xf8));
842+
newFrame.data.push_back(static_cast<char>(0xff));
843+
newFrame.data.push_back(static_cast<char>(0xfe));
844844
auto packetNew = this->packetEncrypter.encryptPacket(newFrame);
845845
frames.push_back(std::string{ packetNew.data(), packetNew.size() });
846846
}

0 commit comments

Comments
 (0)