Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove signed/unsigned warnings #12

Merged
merged 2 commits into from
Apr 25, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ namespace Sass {

Context::~Context()
{
int i;
for (i = 0; i < source_refs.size(); ++i) {
for (size_t i = 0; i < source_refs.size(); ++i) {
delete[] source_refs[i];
}
// cerr << "Deallocated " << i << " source string(s)." << endl;
Expand Down Expand Up @@ -117,4 +116,4 @@ namespace Sass {
register_function(not_descriptor, not_impl);
}

}
}
6 changes: 3 additions & 3 deletions context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ namespace Sass {
};

struct Context {
string sass_path;
string css_path;
vector<string> include_paths;
Environment global_env;
map<pair<string, size_t>, Function> function_env;
vector<char*> source_refs; // all the source c-strings
vector<vector<Node>*> registry; // all the child vectors
vector<string> include_paths;
size_t ref_count;
string sass_path;
string css_path;

void collect_include_paths(const char* paths_str);
Context(const char* paths_str = 0);
Expand Down
20 changes: 10 additions & 10 deletions eval_apply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace Sass {
} break;

case Node::root: {
for (int i = 0; i < expr.size(); ++i) {
for (size_t i = 0; i < expr.size(); ++i) {
eval(expr[i], env, f_env, registry);
}
return expr;
Expand All @@ -54,7 +54,7 @@ namespace Sass {
case Node::block: {
Environment current;
current.link(env);
for (int i = 0; i < expr.size(); ++i) {
for (size_t i = 0; i < expr.size(); ++i) {
eval(expr[i], current, f_env, registry);
}
return expr;
Expand All @@ -63,7 +63,7 @@ namespace Sass {
case Node::assignment: {
Node val(expr[1]);
if (val.type == Node::comma_list || val.type == Node::space_list) {
for (int i = 0; i < val.size(); ++i) {
for (size_t i = 0; i < val.size(); ++i) {
if (val[i].eval_me) val[i] = eval(val[i], env, f_env, registry);
}
}
Expand All @@ -83,7 +83,7 @@ namespace Sass {
case Node::rule: {
Node rhs(expr[1]);
if (rhs.type == Node::comma_list || rhs.type == Node::space_list) {
for (int i = 0; i < rhs.size(); ++i) {
for (size_t i = 0; i < rhs.size(); ++i) {
if (rhs[i].eval_me) rhs[i] = eval(rhs[i], env, f_env, registry);
}
}
Expand All @@ -104,7 +104,7 @@ namespace Sass {

case Node::disjunction: {
Node result;
for (int i = 0; i < expr.size(); ++i) {
for (size_t i = 0; i < expr.size(); ++i) {
// if (expr[i].type == Node::relation ||
// expr[i].type == Node::function_call && expr[0].content.token.to_string() == "not") {
result = eval(expr[i], env, f_env, registry);
Expand All @@ -116,7 +116,7 @@ namespace Sass {

case Node::conjunction: {
Node result;
for (int i = 0; i < expr.size(); ++i) {
for (size_t i = 0; i < expr.size(); ++i) {
result = eval(expr[i], env, f_env, registry);
if (result.type == Node::boolean && result.content.boolean_value == false) return result;
}
Expand Down Expand Up @@ -367,13 +367,13 @@ namespace Sass {
Node body(mixin[2].clone(registry));
Environment bindings;
// bind arguments
for (int i = 0, j = 0; i < args.size(); ++i) {
for (size_t i = 0, j = 0; i < args.size(); ++i) {
if (args[i].type == Node::assignment) {
Node arg(args[i]);
Token name(arg[0].content.token);
// check that the keyword arg actually names a formal parameter
bool valid_param = false;
for (int k = 0; k < params.size(); ++k) {
for (size_t k = 0; k < params.size(); ++k) {
Node param_k = params[k];
if (param_k.type == Node::assignment) param_k = param_k[0];
if (arg[0] == param_k) {
Expand Down Expand Up @@ -421,7 +421,7 @@ namespace Sass {
{
map<Token, Node> bindings;
// bind arguments
for (int i = 0, j = 0; i < args.size(); ++i) {
for (size_t i = 0, j = 0; i < args.size(); ++i) {
if (args[i].type == Node::assignment) {
Node arg(args[i]);
Token name(arg[0].content.token);
Expand All @@ -436,4 +436,4 @@ namespace Sass {
return f(bindings, registry);
}

}
}
2 changes: 1 addition & 1 deletion functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace Sass {
while (d[len+1]) ++len;

parameters.reserve(len);
for (int i = 0; i < len; ++i) {
for (size_t i = 0; i < len; ++i) {
const char* p = d[i+1];
Token name(Token::make(p, p + std::strlen(p)));
parameters.push_back(name);
Expand Down
Loading