Viewing Issue Advanced Details
[ Jump to Notes ]
[ Wiki ]
|
[ View Simple ]
[ Issue History ]
[ Print ]
|
ID |
Category |
Severity |
Reproducibility |
Date Submitted |
Last Update |
0008419 |
[DCSS] Patches |
tweak |
have not tried |
2014-04-23 05:44 |
2014-07-19 04:41 |
|
Reporter |
floatingatoll |
View Status |
public |
|
Assigned To |
neil |
Priority |
normal |
Resolution |
done |
Local or Remote |
Both |
Status |
resolved |
|
Operating System |
All |
Projection |
none |
|
Console or Tiles |
Both |
ETA |
none |
Fixed in Branch |
0.15 ancient branch |
Product Branch |
0.15 ancient branch |
|
Product Version |
0.15-a0-205-g67e6867 |
|
Summary |
0008419: files.cc: save_ghost() do_diagnostics redefined twice when BONES_DIAGNOSTIC and WIZARD |
Description |
In certain circumstances, save_ghost() in files.cc overwrites the value of bool do_diagnostics twice, immediately after declaring it.
#ifdef BONES_DIAGNOSTICS
2170
2171 bool do_diagnostics = false;
2172 #ifdef WIZARD
2173 do_diagnostics = you.wizard;
2174 #endif
2175 #if defined(DEBUG_BONES) || defined(DEBUG_DIAGNOSTICS)
2176 do_diagnostics = true;
2177 #endif
This produces a static analysis warning about do_diagnostics line 2173 being overwritten immediately at line 2176. Which isn't strictly harmful or anything.
Attached patch fixes the warning in any case. |
Steps To Reproduce |
|
Additional Information |
|
Tags |
No tags attached. |
|
Attached Files |
save_ghost.patch [^] (1,391 bytes) 2014-04-23 05:44 [Show Content] [Hide Content]From 7be4ea81e1609bfba207e0375733fa53f864272e Mon Sep 17 00:00:00 2001
From: Richard Soderberg <rsoderberg@gmail.com>
Date: Tue, 22 Apr 2014 20:44:28 -0700
Subject: [PATCH] files.cc: save_ghost() do_diagnostics redefined twice when
BONES_DIAGNOSTIC and WIZARD
---
crawl-ref/source/files.cc | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc
index 4061669..5d97285 100644
--- a/crawl-ref/source/files.cc
+++ b/crawl-ref/source/files.cc
@@ -1677,11 +1677,12 @@ bool load_ghost(bool creating_level)
#ifdef BONES_DIAGNOSTICS
bool do_diagnostics = false;
-#ifdef WIZARD
+#if defined(DEBUG_BONES) || defined(DEBUG_DIAGNOSTICS)
+ do_diagnostics = true;
+#else
+# ifdef WIZARD
do_diagnostics = !creating_level;
-#endif
-#if defined(DEBUG_BONES) || defined(DEBUG_DIAGNOSTICS)
- do_diagnostics = true;
+# endif
#endif
#endif // BONES_DIAGNOSTICS
@@ -2169,11 +2170,12 @@ void save_ghost(bool force)
#ifdef BONES_DIAGNOSTICS
bool do_diagnostics = false;
-#ifdef WIZARD
+#if defined(DEBUG_BONES) || defined(DEBUG_DIAGNOSTICS)
+ do_diagnostics = true;
+#else
+# ifdef WIZARD
do_diagnostics = you.wizard;
-#endif
-#if defined(DEBUG_BONES) || defined(DEBUG_DIAGNOSTICS)
- do_diagnostics = true;
+# endif
#endif
#endif // BONES_DIAGNOSTICS
--
1.8.5.2 (Apple Git-48)
|
|