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 { ...@@ -477,7 +477,7 @@ namespace Sass {
block.has_statements = true; block.has_statements = true;
} }
else { 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 || if (imported_tree[i].type == Node::comment ||
imported_tree[i].type == Node::rule) { imported_tree[i].type == Node::rule) {
block[0].has_statements = true; block[0].has_statements = true;
...@@ -512,7 +512,7 @@ namespace Sass { ...@@ -512,7 +512,7 @@ namespace Sass {
// block << parse_ruleset(); // block << parse_ruleset();
// block.has_blocks = true; // block.has_blocks = true;
// } // }
else if (const char* p = lookahead_for_selector(position)) { else if (lookahead_for_selector(position)) {
block << parse_ruleset(definition); block << parse_ruleset(definition);
block[0].has_blocks = true; block[0].has_blocks = true;
} }
...@@ -852,7 +852,8 @@ namespace Sass { ...@@ -852,7 +852,8 @@ namespace Sass {
Node schema(Node::string_schema, context.registry, line_number, 1); Node schema(Node::string_schema, context.registry, line_number, 1);
while (i < str.end) { 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 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 const char* j = find_first_in_interval< exactly<rbrace> >(p, str.end); // find the closing brace
if (j) { if (j) {
......
...@@ -400,7 +400,7 @@ namespace Sass { ...@@ -400,7 +400,7 @@ namespace Sass {
} }
} }
// plug the holes with default arguments if any // 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) { if (params[i].type == Node::assignment) {
Node param(params[i]); Node param(params[i]);
Token name(param[0].content.token); Token name(param[0].content.token);
...@@ -411,7 +411,7 @@ namespace Sass { ...@@ -411,7 +411,7 @@ namespace Sass {
} }
// lexically link the new environment and eval the mixin's body // lexically link the new environment and eval the mixin's body
bindings.link(env.global ? *env.global : env); 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); body[i] = eval(body[i], bindings, f_env, registry);
} }
return body; return body;
......
...@@ -60,11 +60,9 @@ namespace Sass { ...@@ -60,11 +60,9 @@ namespace Sass {
// result += at(0).to_string(t == backref ? prefix : ""); // result += at(0).to_string(t == backref ? prefix : "");
// } // }
Node::Type t = at(0).type;
result += at(0).to_string(at(0).has_backref ? prefix : ""); result += at(0).to_string(at(0).has_backref ? prefix : "");
for (size_t i = 1; i < size(); ++i) { for (size_t i = 1; i < size(); ++i) {
Node::Type t = at(i).type;
result += " "; result += " ";
result += at(i).to_string(at(i).has_backref ? prefix : ""); result += at(i).to_string(at(i).has_backref ? prefix : "");
} }
......
...@@ -388,8 +388,8 @@ namespace Sass { ...@@ -388,8 +388,8 @@ namespace Sass {
template<prelexer mx> template<prelexer mx>
const char* find_first_in_interval(const char* beg, const char* end) { const char* find_first_in_interval(const char* beg, const char* end) {
while ((beg < end) && *beg) { while ((beg < end) && *beg) {
const char* p; const char* p = mx(beg);
if (p = mx(beg)) return p; if (p) return p;
++beg; ++beg;
} }
return 0; 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