Skip to content

Commit

Permalink
fix more bugs and crap
Browse files Browse the repository at this point in the history
  • Loading branch information
Arisotura committed Jun 15, 2024
1 parent 890dc4f commit 649462f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/fatfs/ff.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ extern "C" {
#include <windows.h>
typedef unsigned __int64 QWORD;
#include <float.h>
#define isnan(v) _isnan(v)
#define isinf(v) (!_finite(v))
//#define isnan(v) _isnan(v)
//#define isinf(v) (!_finite(v))

#elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__cplusplus) /* C99 or later */
#define FF_INTDEF 2
Expand Down
33 changes: 31 additions & 2 deletions src/frontend/qt_sdl/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,37 @@ LegacyEntry LegacyFile[] =

static std::string GetDefaultKey(std::string path)
{
std::regex re("(Instance|Window)(\\d+)\\.");
return std::regex_replace(path, re, "$1*.");
std::string tables[] = {"Instance", "Window", "Camera"};

std::string ret = "";
int plen = path.length();
for (int i = 0; i < plen;)
{
bool found = false;

for (auto& tbl : tables)
{
int tlen = tbl.length();
if ((plen-i) <= tlen) continue;
if (path.substr(i, tlen) != tbl) continue;
if (path[i+tlen] < '0' || path[i+tlen] > '9') continue;

ret += tbl + "*";
i = path.find('.', i+tlen);
if (i == std::string::npos) return ret;

found = true;
break;
}

if (!found)
{
ret += path[i];
i++;
}
}

return ret;
}


Expand Down
7 changes: 1 addition & 6 deletions src/frontend/qt_sdl/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@
#include <unordered_map>
#include <tuple>

#ifndef TOML11_VALUE_HPP
namespace toml
{
class value;
}
#endif
#include "toml/value.hpp"

namespace Config
{
Expand Down

0 comments on commit 649462f

Please sign in to comment.