From bc838ba7c3d3bba74d4e933e6e58bfc2aa779f74 Mon Sep 17 00:00:00 2001 From: "olafvdspek@gmail.com" Date: Fri, 23 Mar 2012 14:41:17 +0000 Subject: [PATCH] Fix G++ 4.7 issues --- src/template.cc | 4 ++-- src/template_dictionary.cc | 4 ++-- src/template_modifiers.cc | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/template.cc b/src/template.cc index acd9b18..fd63052 100644 --- a/src/template.cc +++ b/src/template.cc @@ -97,8 +97,8 @@ static bool ascii_isspace(char c) { } #define strsuffix(str, suffix) \ - ( strlen(str) > (sizeof(""suffix"")-1) && \ - strcmp(str + strlen(str) - (sizeof(suffix)-1), suffix) == 0 ) + ( strlen(str) > (sizeof("" suffix "") - 1) && \ + strcmp(str + strlen(str) - (sizeof(suffix) - 1), suffix) == 0 ) using std::endl; using std::string; diff --git a/src/template_dictionary.cc b/src/template_dictionary.cc index c96d245..517395a 100644 --- a/src/template_dictionary.cc +++ b/src/template_dictionary.cc @@ -554,7 +554,7 @@ void TemplateDictionary::SetTemplateGlobalValueWithoutCopy( const TemplateString& dict_name, const TemplateString& sub_name, size_t index, const char* suffix) { char index_str[64]; - snprintf(index_str, sizeof(index_str), "%"PRIuS, index); + snprintf(index_str, sizeof(index_str), "%" PRIuS, index); return (PrintableTemplateString(dict_name) + "/" + PrintableTemplateString(sub_name) + "#" + index_str + suffix); } @@ -861,7 +861,7 @@ class TemplateDictionary::DictionaryPrinter { string GetDictNum(size_t index, size_t size) const { char buf[64]; // big enough for two ints - snprintf(buf, sizeof(buf), "%"PRIuS" of %"PRIuS, index, size); + snprintf(buf, sizeof(buf), "%" PRIuS" of %" PRIuS, index, size); return buf; } diff --git a/src/template_modifiers.cc b/src/template_modifiers.cc index a02a986..1af6640 100644 --- a/src/template_modifiers.cc +++ b/src/template_modifiers.cc @@ -93,8 +93,8 @@ using HTMLPARSER_NAMESPACE::HtmlParser; // Check whether the string of length len is identical to the literal. // The ""s ensure literal is actually a string literal #define STR_IS(str, len, literal) \ - ((len) == sizeof(""literal"")-1 && \ - memcmp(str, literal, sizeof(""literal"")-1) == 0) + ((len) == sizeof("" literal "") - 1 && \ + memcmp(str, literal, sizeof("" literal "") - 1) == 0) TemplateModifier::~TemplateModifier() {}