mirror of
https://github.com/OlafvdSpek/ctemplate.git
synced 2025-09-28 19:05:49 +08:00
Fix G++ 4.7 issues
This commit is contained in:
parent
ac6fce4caf
commit
b44faf9896
|
@ -360,20 +360,20 @@ class small_map {
|
|||
if (size_ >= 0) {
|
||||
for (int i = 0; i < size_; i++) {
|
||||
if (compare(array_[i]->first, x.first)) {
|
||||
return make_pair(iterator(array_ + i), false);
|
||||
return std::make_pair(iterator(array_ + i), false);
|
||||
}
|
||||
}
|
||||
if (size_ == kArraySize) {
|
||||
ConvertToRealMap(); // Invalidates all iterators!
|
||||
std::pair<typename NormalMap::iterator, bool> ret = map_->insert(x);
|
||||
return make_pair(iterator(ret.first), ret.second);
|
||||
return std::make_pair(iterator(ret.first), ret.second);
|
||||
} else {
|
||||
array_[size_].Init(x);
|
||||
return make_pair(iterator(array_ + size_++), true);
|
||||
return std::make_pair(iterator(array_ + size_++), true);
|
||||
}
|
||||
} else {
|
||||
std::pair<typename NormalMap::iterator, bool> ret = map_->insert(x);
|
||||
return make_pair(iterator(ret.first), ret.second);
|
||||
return std::make_pair(iterator(ret.first), ret.second);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -991,12 +991,9 @@ int htmlparser_value_index(htmlparser_ctx *ctx)
|
|||
*/
|
||||
int htmlparser_is_url_start(htmlparser_ctx *ctx)
|
||||
{
|
||||
const char *tag;
|
||||
const char *attr;
|
||||
|
||||
if (htmlparser_attr_type(ctx) == HTMLPARSER_ATTR_URI) {
|
||||
tag = htmlparser_tag(ctx);
|
||||
attr = htmlparser_attr(ctx);
|
||||
const char* tag = htmlparser_tag(ctx);
|
||||
/*const char* attr =*/ htmlparser_attr(ctx);
|
||||
|
||||
if ((tag && strcmp(tag, "meta") == 0 &&
|
||||
meta_redirect_type(htmlparser_value(ctx)) ==
|
||||
|
@ -1012,11 +1009,6 @@ int htmlparser_is_url_start(htmlparser_ctx *ctx)
|
|||
*/
|
||||
int htmlparser_attr_type(htmlparser_ctx *ctx)
|
||||
{
|
||||
const char *tag;
|
||||
const char *attr;
|
||||
const char *value;
|
||||
enum meta_redirect_type_enum redirect_type;
|
||||
|
||||
if (!htmlparser_in_attr(ctx))
|
||||
return HTMLPARSER_ATTR_NONE;
|
||||
|
||||
|
@ -1029,15 +1021,15 @@ int htmlparser_attr_type(htmlparser_ctx *ctx)
|
|||
if (is_style_attribute(ctx->attr))
|
||||
return HTMLPARSER_ATTR_STYLE;
|
||||
|
||||
tag = htmlparser_tag(ctx);
|
||||
attr = htmlparser_attr(ctx);
|
||||
const char* tag = htmlparser_tag(ctx);
|
||||
const char* attr = htmlparser_attr(ctx);
|
||||
|
||||
/* Special logic to handle meta redirect type tags. */
|
||||
if (tag && strcmp(tag, "meta") == 0 &&
|
||||
attr && strcmp(attr, "content") == 0) {
|
||||
|
||||
value = htmlparser_value(ctx);
|
||||
redirect_type = meta_redirect_type(value);
|
||||
const char* value = htmlparser_value(ctx);
|
||||
meta_redirect_type_enum redirect_type = meta_redirect_type(value);
|
||||
|
||||
if (redirect_type == META_REDIRECT_TYPE_URL ||
|
||||
redirect_type == META_REDIRECT_TYPE_URL_START)
|
||||
|
|
Loading…
Reference in New Issue
Block a user