summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/util/levcomp.ypp
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-08 14:20:44 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-08 14:20:44 +0000
commit8fda0acad5c6c6bf377684d2c14de56ea2e77adf (patch)
treeca6f9ca80d911f17e3ac9543230bb25d1f9fe225 /crawl-ref/source/util/levcomp.ypp
parentcb8c16f0c7b880d19b9e6f38b8ac697d8c2f885d (diff)
downloadcrawl-ref-8fda0acad5c6c6bf377684d2c14de56ea2e77adf.tar.gz
crawl-ref-8fda0acad5c6c6bf377684d2c14de56ea2e77adf.zip
Fixed level-compiler not warning of maps with the same name consistently.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1799 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/util/levcomp.ypp')
-rw-r--r--crawl-ref/source/util/levcomp.ypp23
1 files changed, 5 insertions, 18 deletions
diff --git a/crawl-ref/source/util/levcomp.ypp b/crawl-ref/source/util/levcomp.ypp
index d3470e7baf..0da88b1ce1 100644
--- a/crawl-ref/source/util/levcomp.ypp
+++ b/crawl-ref/source/util/levcomp.ypp
@@ -15,21 +15,6 @@ int yylex();
extern int yylineno;
-struct map_file_place
-{
- std::string filename;
- int lineno;
-
- map_file_place(const std::string &s = "", int line = 0)
- : filename(s), lineno(line)
- {
- }
-};
-
-typedef std::map<std::string, map_file_place> map_load_info_t;
-
-static map_load_info_t loaded_maps;
-
void yyerror(const char *e)
{
if (strstr(e, lc_desfile.c_str()) == e)
@@ -143,9 +128,9 @@ name : NAME STRING
lc_map.name = $2;
map_load_info_t::const_iterator i =
- loaded_maps.find($2);
+ lc_loaded_maps.find($2);
- if (i != loaded_maps.end())
+ if (i != lc_loaded_maps.end())
{
yyerror(
make_stringf(
@@ -155,7 +140,9 @@ name : NAME STRING
i->second.lineno).c_str() );
}
- loaded_maps[$2] = map_file_place(lc_desfile, yylineno);
+ lc_map.place_loaded_from =
+ map_file_place(lc_desfile, yylineno);
+ lc_loaded_maps[$2] = lc_map.place_loaded_from;
}
;