change return value of pic_get_args
This commit is contained in:
parent
54b318f3e1
commit
5080294472
|
@ -540,7 +540,7 @@ pic_number_log(pic_state *pic)
|
|||
int argc;
|
||||
|
||||
argc = pic_get_args(pic, "f|f", &f, &g);
|
||||
if (argc == 2) {
|
||||
if (argc == 1) {
|
||||
return pic_float_value(log(f));
|
||||
}
|
||||
else {
|
||||
|
@ -605,7 +605,7 @@ pic_number_atan(pic_state *pic)
|
|||
int argc;
|
||||
|
||||
argc = pic_get_args(pic, "f|f", &f, &g);
|
||||
if (argc == 2) {
|
||||
if (argc == 1) {
|
||||
f = atan(f);
|
||||
return pic_float_value(f);
|
||||
}
|
||||
|
|
|
@ -80,11 +80,11 @@ var_call(pic_state *pic)
|
|||
proc = pic_get_proc(pic);
|
||||
|
||||
c = pic_get_args(pic, "|o", &v);
|
||||
if (c == 1) {
|
||||
if (c == 0) {
|
||||
var = pic_var_ptr(proc->env->values[0]);
|
||||
return pic_var_ref(pic, var);
|
||||
}
|
||||
else if (c == 2) {
|
||||
else if (c == 1) {
|
||||
var = pic_var_ptr(proc->env->values[0]);
|
||||
|
||||
pic_var_set(pic, var, v);
|
||||
|
|
|
@ -70,7 +70,7 @@ pic_vec_make_vector(pic_state *pic)
|
|||
n = pic_get_args(pic, "i|o", &k, &v);
|
||||
|
||||
vec = pic_vec_new(pic, k);
|
||||
if (n == 3) {
|
||||
if (n == 2) {
|
||||
for (i = 0; i < (size_t)k; ++i) {
|
||||
vec->data[i] = v;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue