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