Clean up many strdups
This commit is contained in:
@@ -12,15 +12,15 @@
|
||||
LISP_FUNC_1(ucl_builtin_type, state, arg) {
|
||||
switch (arg->type) {
|
||||
case UCL_TYPE_CELL:
|
||||
return ucl_symbol_create(strdup("list"));
|
||||
return ucl_symbol_create("list");
|
||||
case UCL_TYPE_SYMBOL:
|
||||
return ucl_symbol_create(strdup("symbol"));
|
||||
return ucl_symbol_create("symbol");
|
||||
case UCL_TYPE_INT:
|
||||
return ucl_symbol_create(strdup("int"));
|
||||
return ucl_symbol_create("int");
|
||||
case UCL_TYPE_STRING:
|
||||
return ucl_symbol_create(strdup("string"));
|
||||
return ucl_symbol_create("string");
|
||||
case UCL_TYPE_ERROR:
|
||||
return ucl_symbol_create(strdup("error"));
|
||||
return ucl_symbol_create("error");
|
||||
case UCL_TYPE_COUNT:
|
||||
assert(0);
|
||||
return NULL;
|
||||
@@ -32,7 +32,7 @@ LISP_FUNC_1(ucl_builtin_error, state, arg) {
|
||||
return ucl_error_create("Expected type string passed to 'error'");
|
||||
}
|
||||
|
||||
return ucl_error_create(strdup(arg->error));
|
||||
return ucl_error_create(arg->error);
|
||||
}
|
||||
|
||||
LISP_FUNC_1(ucl_builtin_symbol_p, state, arg) {
|
||||
@@ -81,7 +81,7 @@ LISP_FUNC_2(ucl_builtin_sub, state, arg0, arg1) {
|
||||
}
|
||||
|
||||
if (arg1->type != UCL_TYPE_INT) {
|
||||
return ucl_error_create("Invalid type of argument 1 to 'sub'");
|
||||
return ucl_error_create(("Invalid type of argument 1 to 'sub'"));
|
||||
}
|
||||
|
||||
return ucl_int_create(arg0->integer - arg1->integer);
|
||||
|
||||
Reference in New Issue
Block a user