From 8fda0acad5c6c6bf377684d2c14de56ea2e77adf Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sun, 8 Jul 2007 14:20:44 +0000 Subject: 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 --- crawl-ref/source/util/levcomp.ypp | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'crawl-ref/source/util/levcomp.ypp') 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 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; } ; -- cgit v1.2.3-54-g00ecf