Commit 1825d0b3 by Lars Immisch

Misc. warning causes removed.

- more signed/unsigned
- unused variables
- suggest braces around assignment
parent b1c20103
......@@ -477,7 +477,7 @@ namespace Sass {
block.has_statements = true;
}
else {
for (int i = 0; i < imported_tree.size(); ++i) {
for (size_t i = 0; i < imported_tree.size(); ++i) {
if (imported_tree[i].type == Node::comment ||
imported_tree[i].type == Node::rule) {
block[0].has_statements = true;
......@@ -512,7 +512,7 @@ namespace Sass {
// block << parse_ruleset();
// block.has_blocks = true;
// }
else if (const char* p = lookahead_for_selector(position)) {
else if (lookahead_for_selector(position)) {
block << parse_ruleset(definition);
block[0].has_blocks = true;
}
......@@ -852,7 +852,8 @@ namespace Sass {
Node schema(Node::string_schema, context.registry, line_number, 1);
while (i < str.end) {
if (p = find_first_in_interval< sequence< negate< exactly<'\\'> >, exactly<hash_lbrace> > >(i, str.end)) {
p = find_first_in_interval< sequence< negate< exactly<'\\'> >, exactly<hash_lbrace> > >(i, str.end);
if (p) {
if (i < p) schema << Node(Node::identifier, line_number, Token::make(i, p)); // accumulate the preceding segment if it's nonempty
const char* j = find_first_in_interval< exactly<rbrace> >(p, str.end); // find the closing brace
if (j) {
......@@ -1122,4 +1123,4 @@ namespace Sass {
//
// return p;
// }
// }
\ No newline at end of file
// }
......@@ -400,7 +400,7 @@ namespace Sass {
}
}
// plug the holes with default arguments if any
for (int i = 0; i < params.size(); ++i) {
for (size_t i = 0; i < params.size(); ++i) {
if (params[i].type == Node::assignment) {
Node param(params[i]);
Token name(param[0].content.token);
......@@ -411,7 +411,7 @@ namespace Sass {
}
// lexically link the new environment and eval the mixin's body
bindings.link(env.global ? *env.global : env);
for (int i = 0; i < body.size(); ++i) {
for (size_t i = 0; i < body.size(); ++i) {
body[i] = eval(body[i], bindings, f_env, registry);
}
return body;
......
......@@ -60,11 +60,9 @@ namespace Sass {
// result += at(0).to_string(t == backref ? prefix : "");
// }
Node::Type t = at(0).type;
result += at(0).to_string(at(0).has_backref ? prefix : "");
for (size_t i = 1; i < size(); ++i) {
Node::Type t = at(i).type;
result += " ";
result += at(i).to_string(at(i).has_backref ? prefix : "");
}
......
......@@ -388,8 +388,8 @@ namespace Sass {
template<prelexer mx>
const char* find_first_in_interval(const char* beg, const char* end) {
while ((beg < end) && *beg) {
const char* p;
if (p = mx(beg)) return p;
const char* p = mx(beg);
if (p) return p;
++beg;
}
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment