diff --git a/dll/local_storage.cpp b/dll/local_storage.cpp index 4f557c7b..e15da3dd 100644 --- a/dll/local_storage.cpp +++ b/dll/local_storage.cpp @@ -578,7 +578,7 @@ int Local_Storage::store_file_data(std::string folder, std::string file, const c myfile.open(std::filesystem::u8path(folder + file), std::ios::binary | std::ios::out); if (!myfile.is_open()) return -1; myfile.write(data, length); - int position = myfile.tellp(); + int position = static_cast(myfile.tellp()); myfile.close(); return position; } @@ -666,7 +666,8 @@ int Local_Storage::get_file_data(const std::string &full_path, char *data, unsig myfile.read (data, max_length); myfile.close(); reset_LastError(); - return myfile.gcount(); + + return static_cast(myfile.gcount()); } int Local_Storage::get_data(std::string folder, std::string file, char *data, unsigned int max_length, unsigned int offset) @@ -700,7 +701,7 @@ int Local_Storage::count_files(std::string folder) folder.append(PATH_SEPARATOR); } - return get_filenames_recursive(save_directory + appid + folder).size(); + return static_cast(get_filenames_recursive(save_directory + appid + folder).size()); } bool Local_Storage::file_exists(std::string folder, std::string file) diff --git a/dll/steam_matchmaking.cpp b/dll/steam_matchmaking.cpp index b3e3a50f..45060f97 100644 --- a/dll/steam_matchmaking.cpp +++ b/dll/steam_matchmaking.cpp @@ -1384,7 +1384,7 @@ void Steam_Matchmaking::RunCallbacks() PRINT_DEBUG("Lobby " "%" PRIu64 " use %u", l.room_id(), use); if (use) PUSH_BACK_IF_NOT_IN(filtered_lobbies, (uint64)l.room_id()); - if (filtered_lobbies.size() >= filter_max_results_copy) { + if (filtered_lobbies.size() >= static_cast(filter_max_results_copy)) { PRINT_DEBUG("returning lobby search results, count=%zu", filtered_lobbies.size()); searching = false; LobbyMatchList_t data{}; diff --git a/dll/steam_user_stats_achievements.cpp b/dll/steam_user_stats_achievements.cpp index 2a0a2c0d..512edb89 100644 --- a/dll/steam_user_stats_achievements.cpp +++ b/dll/steam_user_stats_achievements.cpp @@ -807,7 +807,7 @@ void Steam_User_Stats::load_achievements_icons() auto now1 = std::chrono::high_resolution_clock::now(); #endif - size_t idx = 0; + int idx = 0; for (; idx < settings->paginated_achievements_icons && last_loaded_ach_icon < defined_achievements.size(); ++idx, ++last_loaded_ach_icon) { @@ -819,7 +819,7 @@ void Steam_User_Stats::load_achievements_icons() #ifndef EMU_RELEASE_BUILD auto now2 = std::chrono::high_resolution_clock::now(); auto dd = (unsigned)std::chrono::duration_cast(now2 - now1).count(); - PRINT_DEBUG("attempted to load %zu achievements icons in %u ms", idx * 2, dd); + PRINT_DEBUG("attempted to load %d achievements icons in %u ms", idx * 2, dd); #endif } diff --git a/steamclient/steamclient.cpp b/steamclient/steamclient.cpp index 3f1b8bb4..a185c616 100644 --- a/steamclient/steamclient.cpp +++ b/steamclient/steamclient.cpp @@ -1,18 +1,21 @@ - -//#include "dll.h" #define WIN32_LEAN_AND_MEAN + +// #include "dll.h" #include "Windows.h" + #ifdef _WIN64 #define DLL_NAME "steam_api64.dll" #else #define DLL_NAME "steam_api.dll" #endif -extern "C" __declspec( dllexport ) void *CreateInterface( const char *pName, int *pReturnCode ) +extern "C" __declspec(dllexport) void *CreateInterface(const char *pName, int *pReturnCode) { - //PRINT_DEBUG("%s", pName); + // PRINT_DEBUG("%s", pName); + HMODULE steam_api = LoadLibraryA(DLL_NAME); - void *(__stdcall* create_interface)(const char*) = (void * (__stdcall *)(const char*))GetProcAddress(steam_api, "SteamInternal_CreateInterface"); + + void *(__stdcall * create_interface)(const char *) = reinterpret_cast(GetProcAddress(steam_api, "SteamInternal_CreateInterface")); return create_interface(pName); }