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

Clean up #86

Merged
merged 1 commit into from
Nov 7, 2023
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
20 changes: 10 additions & 10 deletions w2c2/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ char*
basename(
char* s
) {
size_t i;
size_t i;
if (!s || !*s) {
return ".";
}
i = strlen(s)-1;
i = strlen(s)-1;
for (; i && s[i] == PATH_SEPARATOR; i--) {
s[i] = 0;
}
for (; i && s[i - 1] != PATH_SEPARATOR; i--) { }
return s+i;
return s+i;
}

/*
Expand All @@ -31,17 +31,17 @@ char*
dirname(
char* s
) {
size_t i;
if (!s || !*s) {
size_t i;
if (!s || !*s) {
return ".";
}
i = strlen(s)-1;
for (; s[i] == PATH_SEPARATOR; i--) {
i = strlen(s)-1;
for (; s[i] == PATH_SEPARATOR; i--) {
if (!i) {
return PATH_SEPARATOR_STRING;
}
}
for (; s[i] != PATH_SEPARATOR; i--) {
for (; s[i] != PATH_SEPARATOR; i--) {
if (!i) {
return ".";
}
Expand All @@ -51,8 +51,8 @@ dirname(
return PATH_SEPARATOR_STRING;
}
}
s[i+1] = 0;
return s;
s[i+1] = 0;
return s;
}

#endif /* !HAS_LIBGEN */
1 change: 0 additions & 1 deletion w2c2/leb128_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ testReadU32LEB128() {

if (count == 0 || actual != testCase.expected) {
fprintf(stderr, "FAIL testReadU32LEB128: %u != %u\n", actual, testCase.expected);
} else {
}
}

Expand Down
2 changes: 1 addition & 1 deletion w2c2/typestack.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ wasmTypeStackSet(
typeStack->length = newLength;
}

typeStack->valueTypes[index] |= (1 << valueType);
typeStack->valueTypes[index] |= (WasmValueType)(1 << valueType);

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion wasi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ OBJECTS = $(patsubst %.c,%.o,$(filter-out test.c,$(wildcard *.c)))
$(CC) $(CFLAGS) -c $< -o $@

libw2c2wasi.a: $(OBJECTS)
$(AR) rcu $@ $^
$(AR) qc $@ $^
ranlib $@

test: $(OBJECTS) test.c
Expand Down
2 changes: 1 addition & 1 deletion wasi/win32.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ typedef struct DIR DIR;

DIR* opendir(const char*);
struct dirent* readdir(DIR*);
int closedir(DIR*);
int closedir(DIR*);

/* File types for 'd_type' */
#define DT_UNKNOWN 0
Expand Down