Commit f9964c87 by Aaron Leung

All warnings gone!

parent 2730e08a
......@@ -32,11 +32,15 @@ namespace Sass {
f = std::fopen(path.c_str(), "rb");
if (!f) throw path;
if (std::fseek(f, 0, SEEK_END)) throw path;
int len = std::ftell(f);
if (len < 0) throw path;
int status = std::ftell(f);
if (status < 0) throw path;
size_t len = status;
std::rewind(f);
char* source = new char[len + 1];
std::fread(source, sizeof(char), len, f);
size_t bytes_read = std::fread(source, sizeof(char), len, f);
if (bytes_read != len) {
std::cerr << "Warning: possible error reading from " << path << std::endl;
}
if (std::ferror(f)) throw path;
source[len] = '\0';
char* end = source + len;
......
......@@ -472,7 +472,7 @@ namespace Sass {
if (l1.type() != Node::nil) size += l1.size();
if (l2.type() != Node::nil) size += l2.size();
// figure out the result type in advance
Node::Type rtype;
Node::Type rtype = Node::space_list;
if (has_sep) {
string sep(bindings[parameters[2]].token().unquote());
if (sep == "comma") rtype = Node::comma_list;
......
......@@ -90,8 +90,8 @@ namespace Sass {
Type lhs_type = type();
Type rhs_type = rhs.type();
if (lhs_type == number && rhs_type == number ||
lhs_type == numeric_percentage && rhs_type == numeric_percentage) {
if ((lhs_type == number && rhs_type == number) ||
(lhs_type == numeric_percentage && rhs_type == numeric_percentage)) {
return numeric_value() < rhs.numeric_value();
}
else if (lhs_type == numeric_dimension && rhs_type == numeric_dimension) {
......@@ -243,6 +243,8 @@ namespace Sass {
break;
// throw an exception?
}
// if you reach this point, you've got a logic error somewhere
return 0;
}
extern const char percent_str[] = "%";
......
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