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

fix a few compiler warnings. #1066

Merged
merged 1 commit into from
Apr 22, 2018
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
4 changes: 2 additions & 2 deletions src/host/criteria_matches.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int criteria_compile(lua_State* L)
lua_setmetatable(L, -2);

/* create array to hold the incoming list of patterns */
n = lua_rawlen(L, 1);
n = (int)lua_rawlen(L, 1);
patterns->n = n;
patterns->pattern = (struct Pattern*)malloc(sizeof(struct Pattern) * n);

Expand Down Expand Up @@ -82,7 +82,7 @@ int criteria_compilePattern(lua_State* L, struct Pattern* pattern)
int i, n;

/* create array to hold the incoming list of words */
n = lua_rawlen(L, -1);
n = (int)lua_rawlen(L, -1);
pattern->n = n;
pattern->word = (struct Word*)malloc(sizeof(struct Word) * n);
pattern->matchesFiles = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/host/path_getabsolute.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void do_getabsolute(char* result, const char* value, const char* relative_to)
while (ch) {
/* remove ".." where I can */
if (strcmp(ch, "..") == 0 && (prev == NULL || (prev[0] != '$' && prev[0] != '%' && strcmp(prev, "..") != 0))) {
i = strlen(result) - 2;
i = (int)strlen(result) - 2;
while (i >= 0 && result[i] != '/') {
--i;
}
Expand All @@ -62,7 +62,7 @@ void do_getabsolute(char* result, const char* value, const char* relative_to)
}

/* remove trailing slash */
i = strlen(result) - 1;
i = (int)strlen(result) - 1;
if (result[i] == '/') {
result[i] = '\0';
}
Expand Down
4 changes: 2 additions & 2 deletions src/host/string_endswith.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ int string_endswith(lua_State* L)

if (haystack && needle)
{
int hlen = strlen(haystack);
int nlen = strlen(needle);
size_t hlen = strlen(haystack);
size_t nlen = strlen(needle);
if (hlen >= nlen)
{
lua_pushboolean(L, strcmp(haystack + hlen - nlen, needle) == 0);
Expand Down
2 changes: 1 addition & 1 deletion src/host/string_startswith.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int string_startswith(lua_State* L)

if (haystack && needle)
{
int nlen = strlen(needle);
size_t nlen = strlen(needle);
lua_pushboolean(L, strncmp(haystack, needle, nlen) == 0);
return 1;
}
Expand Down