aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/load.c14
-rw-r--r--src/parse.c2
-rw-r--r--src/parse.h2
3 files changed, 4 insertions, 14 deletions
diff --git a/src/load.c b/src/load.c
index f6386d6..e5f6836 100644
--- a/src/load.c
+++ b/src/load.c
@@ -15,26 +15,16 @@
// helper functions
-static char *wrap_name_func(const char *name, char *(*fn)(char *))
+static char *dirname_wrapper(const char *name)
{
char *copy = strdup(name);
- char *result = fn(copy);
+ char *result = dirname(copy);
char *result_copy = strdup(result);
free(copy);
return result_copy;
}
-static char *basename_wrapper(const char *name)
-{
- return wrap_name_func(name, &basename);
-}
-
-static char *dirname_wrapper(const char *name)
-{
- return wrap_name_func(name, &dirname);
-}
-
// type definitions
typedef struct
diff --git a/src/parse.c b/src/parse.c
index e8f1d38..66a90a3 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -156,7 +156,7 @@ static bool parse_expression_finish(ParseState *state, char c)
char *buffer_read = buffer_terminate(state);
if (state->expression->type == EX_INTLIT || state->expression->type == EX_ARGNUM) {
- state->expression->value.int_value = atoi(buffer_read);
+ state->expression->value.int_value = atol(buffer_read);
free(buffer_read);
} else {
state->expression->value.str_value = buffer_read;
diff --git a/src/parse.h b/src/parse.h
index 46f4542..7c13dd7 100644
--- a/src/parse.h
+++ b/src/parse.h
@@ -10,7 +10,7 @@ typedef struct ParseExpression
UwUVMExpressionType type;
union
{
- int int_value;
+ long int_value;
char *str_value;
} value;
size_t num_children;