Skip to content

Fix unused variable / function warnings. #27

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

Merged
merged 2 commits into from
Dec 22, 2015
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
10 changes: 1 addition & 9 deletions src/asm2wasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ extern int debug; // wasm::debug is set in main(), typically from an env var

// Utilities

static void abort_on(std::string why) {
std::cerr << why << '\n';
abort();
}
static void abort_on(std::string why, int x) {
std::cerr << why << ' ' << x << '\n';
abort();
}
static void abort_on(std::string why, Ref element) {
std::cerr << why << ' ';
element->stringify(std::cerr);
Expand Down Expand Up @@ -665,7 +657,7 @@ void Asm2WasmBuilder::processAsm(Ref ast) {
} else if (curr[0] == RETURN) {
// exports
Ref object = curr[1];
Ref contents = curr[1][1];
Ref contents = object[1];
for (unsigned k = 0; k < contents->size(); k++) {
Ref pair = contents[k];
IString key = pair[0]->getIString();
Expand Down
4 changes: 2 additions & 2 deletions src/s2wasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ class S2WasmBuilder {
}

void parseGlobl() {
Name name = getStr();
(void)getStr();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getStr() modifies global state. can just remove the assignment to name.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah thanks, I hadn't noticed.

skipWhitespace();
}

Expand Down Expand Up @@ -432,7 +432,7 @@ class S2WasmBuilder {
if (assign.isNull() || assign.str[1] == 'd') { // discard
bstack.back()->list.push_back(curr);
} else if (assign.str[1] == 'p') { // push
estack.push_back(curr);
push(curr);
} else { // set to a local
auto set = allocator.alloc<SetLocal>();
set->name = assign;
Expand Down
3 changes: 1 addition & 2 deletions src/wasm-s-parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,13 @@ class Element {
//

class SExpressionParser {
char *beginning;
char* input;

MixedArena allocator;

public:
// Assumes control of and modifies the input.
SExpressionParser(char* input) : beginning(input), input(input) {
SExpressionParser(char* input) : input(input) {
root = nullptr;
while (!root) { // keep parsing until we pass an initial comment
root = parseInnerList();
Expand Down