Skip to content

Commit

Permalink
update rcheevos version; address compile warnings (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamiras authored Jan 24, 2024
1 parent dc70088 commit a836da3
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 22 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ OBJS=\
src/miniz/miniz_tinfl.o \
src/miniz/miniz_zip.o \
src/rcheevos/src/rcheevos/consoleinfo.o \
src/rcheevos/src/rcheevos/rc_libretro.o \
src/rcheevos/src/rc_libretro.o \
src/rcheevos/src/rhash/aes.o \
src/rcheevos/src/rhash/cdreader.o \
src/rcheevos/src/rhash/md5.o \
src/rcheevos/src/rhash/hash.o \
Expand All @@ -99,7 +100,7 @@ ifdef HAVE_CHD
src/HashCHD.o
endif

src/rcheevos/src/rcheevos/rc_libretro.o: CFLAGS += -I./src/libretro
src/rcheevos/src/rc_libretro.o: CFLAGS += -I./src/libretro

src/components/Config.o: CFLAGS += -I./src/libretro

Expand Down
1 change: 1 addition & 0 deletions Makefile.RAHasher
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ OBJS=\
src/miniz/miniz_tdef.o \
src/miniz/miniz_tinfl.o \
src/miniz/miniz_zip.o \
src/rcheevos/src/rhash/aes.o \
src/rcheevos/src/rhash/cdreader.o \
src/rcheevos/src/rhash/hash.o \
src/rcheevos/src/rhash/md5.o \
Expand Down
2 changes: 1 addition & 1 deletion src/Hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ along with RALibretro. If not, see <http://www.gnu.org/licenses/>.

#include <RA_Interface.h>
#include <rc_hash.h>
#include <rcheevos/src/rcheevos/rc_libretro.h>
#include <rcheevos/src/rc_libretro.h>

#include <memory.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion src/KeyBinds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,7 @@ class InputDialog : public Dialog
ud.dialog = this;
ud.hwnd = hwnd;

jsonsax_result_t res = jsonsax_parse((char*)json.c_str(), &ud, [](void* udata, jsonsax_event_t event, const char* str, size_t num)
jsonsax_parse((char*)json.c_str(), &ud, [](void* udata, jsonsax_event_t event, const char* str, size_t num)
{
auto* ud = (Deserialize*)udata;

Expand Down
2 changes: 1 addition & 1 deletion src/Memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ along with RALibretro. If not, see <http://www.gnu.org/licenses/>.

#include <RA_Interface.h>
#include <rcheevos.h>
#include <rcheevos/src/rcheevos/rc_libretro.h>
#include <rcheevos/src/rc_libretro.h>

#include <time.h>

Expand Down
2 changes: 1 addition & 1 deletion src/RAHasher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ static int process_files(int consoleId, const std::string& pattern)
WIN32_FIND_DATAA fileData;
HANDLE hFind;

if (path == pattern) /* no backslash found.scan is in current directory */
if (path == pattern) /* no backslash found. scan is in current directory */
path = ".";

hFind = FindFirstFileA(pattern.c_str(), &fileData);
Expand Down
1 change: 1 addition & 0 deletions src/RAHasher.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
<ClCompile Include="miniz\miniz_tinfl.c" />
<ClCompile Include="miniz\miniz_zip.c" />
<ClCompile Include="RAHasher.cpp" />
<ClCompile Include="rcheevos\src\rhash\aes.c" />
<ClCompile Include="rcheevos\src\rhash\cdreader.c" />
<ClCompile Include="rcheevos\src\rhash\hash.c">
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)rhash</ObjectFileName>
Expand Down
3 changes: 3 additions & 0 deletions src/RAHasher.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
<ClCompile Include="HashCHD.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rcheevos\src\rhash\aes.c">
<Filter>Source Files\rhash</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="rcheevos\include\rhash.h">
Expand Down
3 changes: 2 additions & 1 deletion src/RALibretro.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,10 @@ $(ProjectDir)RAInterface\CopyOverlay.bat $(SolutionDir)\bin64</Command>
<ClCompile Include="RAInterface\RA_Interface.cpp" />
<ClCompile Include="RA_Implementation.cpp" />
<ClCompile Include="rcheevos\src\rcheevos\consoleinfo.c" />
<ClCompile Include="rcheevos\src\rcheevos\rc_libretro.c">
<ClCompile Include="rcheevos\src\rc_libretro.c">
<AdditionalIncludeDirectories>$(SolutionDir)src\libretro;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<ClCompile Include="rcheevos\src\rhash\aes.c" />
<ClCompile Include="rcheevos\src\rhash\cdreader.c" />
<ClCompile Include="rcheevos\src\rhash\hash.c">
<ObjectFileName>$(IntDir)rhash</ObjectFileName>
Expand Down
9 changes: 6 additions & 3 deletions src/RALibretro.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,18 @@
<ClCompile Include="States.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rcheevos\src\rcheevos\rc_libretro.c">
<Filter>Source Files\rcheevos</Filter>
</ClCompile>
<ClCompile Include="HashCHD.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="components\Microphone.cpp">
<Filter>Source Files\components</Filter>
</ClCompile>
<ClCompile Include="rcheevos\src\rc_libretro.c">
<Filter>Source Files\rcheevos</Filter>
</ClCompile>
<ClCompile Include="rcheevos\src\rhash\aes.c">
<Filter>Source Files\rhash</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="About.h">
Expand Down
7 changes: 6 additions & 1 deletion src/Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ FILE* util::openFile(Logger* logger, const std::string& path, const char* mode)
#endif

if (!file && logger)
log_errno(logger, "opening", path.c_str());
{
if (errno == ENOENT)
logger->warn(TAG "File not found: %s", path.c_str());
else
log_errno(logger, "opening", path.c_str());
}

return file;
}
Expand Down
11 changes: 5 additions & 6 deletions src/components/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ along with RALibretro. If not, see <http://www.gnu.org/licenses/>.
#include "jsonsax/jsonsax.h"
#include "RA_Interface.h"

#include <rcheevos/src/rcheevos/rc_libretro.h>
#include <rcheevos/src/rc_libretro.h>
#include <rcheevos/include/rc_consoles.h>

#ifdef _WINDOWS
Expand Down Expand Up @@ -623,7 +623,7 @@ bool Config::deserializeEmulatorSettings(const char* json)
void Config::ConfigDialog::updateVariables()
{
int id = 0;
for (int i = 0; i < variables.size(); ++i)
for (size_t i = 0; i < variables.size(); ++i)
{
auto& var = variables[i];
if (var->_category != category)
Expand All @@ -637,7 +637,7 @@ void Config::ConfigDialog::updateVariables()
HWND hComboBox = GetDlgItem(hwnd, 51000 + id);
SendMessageW(hComboBox, CB_RESETCONTENT, 0, 0);

for (int j = 0; j < var->_options.size(); ++j)
for (size_t j = 0; j < var->_options.size(); ++j)
{
unicodeString = util::utf8ToUChar(var->_options[j]);
SendMessageW(hComboBox, CB_ADDSTRING, 0, (LPARAM)unicodeString.c_str());
Expand All @@ -662,7 +662,7 @@ void Config::ConfigDialog::updateVariables()
void Config::ConfigDialog::retrieveData(HWND hwnd)
{
int id = 0;
for (int i = 0; i < variables.size(); ++i)
for (size_t i = 0; i < variables.size(); ++i)
{
auto& var = variables[i];
if (var->_category != category)
Expand Down Expand Up @@ -772,7 +772,6 @@ void Config::showDialog(const std::string& coreName, Input& input)
WORD row = 0;
WORD id = 0;
int generalCount = db.variables.size();
int selectedCategoryIndex;

for (auto& category : _categories)
{
Expand Down Expand Up @@ -812,7 +811,7 @@ void Config::showDialog(const std::string& coreName, Input& input)
const WORD columns = ((WORD)db.maxCount + MAX_ROWS - 1) / MAX_ROWS;
const WORD rows = ((WORD)db.maxCount + columns - 1) / columns;

for (unsigned i = 0; i < db.maxCount; ++i)
for (int i = 0; i < db.maxCount; ++i)
{
db.addLabel("Label", 50000 + id, x, y + 2, HEADER_WIDTH - 5, 8);
db.addCombobox(51000 + id, x + HEADER_WIDTH + 5, y, VALUE_WIDTH, LINE_HEIGHT, 100,
Expand Down
4 changes: 2 additions & 2 deletions src/components/Input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ int16_t Input::read(unsigned port, unsigned device, unsigned index, unsigned id)
{
case RETRO_DEVICE_JOYPAD:
port_device = _devices[port];
if (port_device > _info[port].size())
if (port_device >(int) _info[port].size())
return 0;

if (id == RETRO_DEVICE_ID_JOYPAD_MASK)
Expand All @@ -560,7 +560,7 @@ int16_t Input::read(unsigned port, unsigned device, unsigned index, unsigned id)

case RETRO_DEVICE_ANALOG:
port_device = _devices[port];
if (port_device > _info[port].size())
if (port_device > (int)_info[port].size())
return 0;

return _info[port][port_device]._axis[index << 1 | id];
Expand Down
2 changes: 1 addition & 1 deletion src/components/Microphone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void Microphone::recordCallback(void* data, Uint8* stream, int len)
size_t output_size;
int16_t* output;

if (sdlData->deviceSpec.freq == sdlData->coreRate)
if (sdlData->deviceSpec.freq == (int)sdlData->coreRate)
{
/* no resampling needed */
output = (int16_t*)samples;
Expand Down
2 changes: 1 addition & 1 deletion src/libretro/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ static bool extensionMatches(const char* extensions, const std::string& extensio
while (*ptr && *ptr != '|')
++ptr;

if ((ptr - start) == extension.length() && strnicmp(start, extension.c_str(), extension.length()) == 0)
if ((size_t)(ptr - start) == extension.length() && strnicmp(start, extension.c_str(), extension.length()) == 0)
return true;

if (*ptr == '|')
Expand Down
2 changes: 1 addition & 1 deletion src/rcheevos
Submodule rcheevos updated 102 files

0 comments on commit a836da3

Please sign in to comment.