summaryrefslogtreecommitdiff
path: root/games/trigger-rally/hiscore1.h.patch
diff options
context:
space:
mode:
authorLarry Hajali <larryhaja@gmail.com>2016-08-09 09:19:16 -0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2016-08-13 07:22:36 +0700
commit13da4faba855a7c6709c976e45794be8ab7cf30c (patch)
treece40faa0e8710b138dacefc680ccd89d0f8306ef /games/trigger-rally/hiscore1.h.patch
parent708e5cf9ccdf16662912d636b05bf6ff3a11dfdd (diff)
downloadslackbuilds-13da4faba855a7c6709c976e45794be8ab7cf30c.tar.gz
games/trigger-rally: Updated for version 0.6.4.
Signed-off-by: Larry Hajali <larryhaja[at]gmail[dot]com>
Diffstat (limited to 'games/trigger-rally/hiscore1.h.patch')
-rw-r--r--games/trigger-rally/hiscore1.h.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/games/trigger-rally/hiscore1.h.patch b/games/trigger-rally/hiscore1.h.patch
new file mode 100644
index 0000000000..4441ae2437
--- /dev/null
+++ b/games/trigger-rally/hiscore1.h.patch
@@ -0,0 +1,44 @@
+diff -rupN src/include/hiscore1.h src_patched/include/hiscore1.h
+--- src/include/hiscore1.h 2016-04-08 20:58:38.000000000 +0200
++++ src_patched/include/hiscore1.h 2016-04-28 15:27:43.763427992 +0200
+@@ -41,6 +41,17 @@
+ return InputStream; \
+ } else (void)0
+
++
++// TODO: remove duplicate code
++#define GETLINE_SKIP_EMPTY_LINES_B(InputStream, String) if (true) { \
++ while (std::getline(InputStream, String)) { \
++ if (!String.empty()) \
++ break; \
++ } \
++ if (String.empty()) \
++ return static_cast<bool> (InputStream); \
++} else (void)0
++
+ ///
+ /// @brief Basic structure to load and save race results.
+ ///
+@@ -724,19 +735,19 @@ private:
+ std::istringstream sspdata(decrypt(pdata));
+ #undef decrypt
+
+- GETLINE_SKIP_EMPTY_LINES(sspdata, ts);
++ GETLINE_SKIP_EMPTY_LINES_B(sspdata, ts);
+ nu = std::stoul(ts);
+
+ while (nu-- != 0)
+ {
+- GETLINE_SKIP_EMPTY_LINES(sspdata, ts);
++ GETLINE_SKIP_EMPTY_LINES_B(sspdata, ts);
+ allunlocks[pname].insert(ts);
+ }
+
+ while (sspdata >> rd)
+ alltimes.insert({rd.mapname, rd});
+
+- return sspdata;
++ return static_cast<bool> (sspdata);
+ }
+
+ ///