From b2d5164a0fcf71766cdb6a081f23995ae8c84e2c Mon Sep 17 00:00:00 2001 From: Nicolas Hake Date: Thu, 21 Jul 2016 19:47:46 +0200 Subject: [PATCH] Remove re namespace alias This alias is a legacy from when we were using Boost.Regexp to workaround a broken implementation in GCC's libstdc++ earlier than 4.9. --- src/C4Include.h | 5 +---- src/c4group/C4Language.cpp | 4 ++-- src/landscape/C4Texture.cpp | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/C4Include.h b/src/C4Include.h index a616b39d2..c1377b5ae 100644 --- a/src/C4Include.h +++ b/src/C4Include.h @@ -44,7 +44,6 @@ don't need to include this file or any of the files it includes. */ #include #include #include - #include #include #include @@ -56,6 +55,7 @@ don't need to include this file or any of the files it includes. */ #include #include #include +#include #include #include #include @@ -63,9 +63,6 @@ don't need to include this file or any of the files it includes. */ #include #include -#include -namespace re = std; - #include "lib/Standard.h" #include "C4Prototypes.h" #include "lib/C4Real.h" diff --git a/src/c4group/C4Language.cpp b/src/c4group/C4Language.cpp index 0dec2eb67..42f4817f7 100644 --- a/src/c4group/C4Language.cpp +++ b/src/c4group/C4Language.cpp @@ -257,7 +257,7 @@ namespace // the beginning or end of a line, respectively, and it seems // like in some implementations they only match the beginning // or end of the whole string. See also #1127. - static re::regex line_pattern("(?:\n|^)([^=]+)=(.*?)\r?(?=\n|$)", static_cast(re::regex_constants::optimize | re::regex_constants::ECMAScript)); + static std::regex line_pattern("(?:\n|^)([^=]+)=(.*?)\r?(?=\n|$)", static_cast(std::regex_constants::optimize | std::regex_constants::ECMAScript)); assert(stringtbl); if (!stringtbl) @@ -269,7 +269,7 @@ namespace const char *begin = stringtbl; const char *end = begin + std::char_traits::length(begin); - for (auto it = re::cregex_iterator(begin, end, line_pattern); it != re::cregex_iterator(); ++it) + for (auto it = std::cregex_iterator(begin, end, line_pattern); it != std::cregex_iterator(); ++it) { assert(it->size() == 3); if (it->size() != 3) diff --git a/src/landscape/C4Texture.cpp b/src/landscape/C4Texture.cpp index e74d66074..363d31fa7 100644 --- a/src/landscape/C4Texture.cpp +++ b/src/landscape/C4Texture.cpp @@ -218,7 +218,7 @@ bool C4TextureMap::LoadFlags(C4Group &hGroup, const char *szEntryName, bool *pOv int32_t C4TextureMap::LoadMap(C4Group &hGroup, const char *szEntryName, bool *pOverloadMaterials, bool *pOverloadTextures) { - static re::regex line_terminator("\r?\n", static_cast(re::regex_constants::optimize | re::regex_constants::ECMAScript)); + static std::regex line_terminator("\r?\n", static_cast(std::regex_constants::optimize | std::regex_constants::ECMAScript)); char *bpMap; size_t map_size; @@ -230,7 +230,7 @@ int32_t C4TextureMap::LoadMap(C4Group &hGroup, const char *szEntryName, bool *pO char *end = begin + map_size; size_t line = 1; // Counter for error messages - for (auto it = re::cregex_token_iterator(begin, end, line_terminator, -1); it != re::cregex_token_iterator(); ++it, ++line) + for (auto it = std::cregex_token_iterator(begin, end, line_terminator, -1); it != std::cregex_token_iterator(); ++it, ++line) { if (it->compare("OverloadMaterials") == 0) {