double* data = malloc(sizeof(double));
*data = gens[i + 1]->number;
ptr = data;
+ } else if(strcmp(info->argtypes[i + 1], "float") == 0) {
+ float* data = malloc(sizeof(float));
+ *data = gens[i + 1]->number;
+ ptr = data;
} else if(strcmp(info->argtypes[i + 1], "byte") == 0) {
char* data = malloc(sizeof(char));
*data = gens[i + 1]->number;
} else if(strcmp(info->argtypes[0], "double") == 0) {
gen->type = SN_TYPE_DOUBLE;
gen->number = *(double*)&result;
+ } else if(strcmp(info->argtypes[0], "float") == 0) {
+ gen->type = SN_TYPE_DOUBLE;
+ gen->number = *(float*)&result;
} else if(strcmp(info->argtypes[0], "integer") == 0) {
gen->type = SN_TYPE_DOUBLE;
gen->number = *(int*)&result;
gen->string_length = strlen(gen->string);
}
+ for(i = 0; fargs[i] != NULL; i++) {
+ if(strcmp(info->argtypes[i + 1], "string") == 0) {
+ free(*((void**)fargs[i]));
+ free(fargs[i]);
+ }
+ }
if(fargs != NULL) free(fargs);
return gen;
}
assign = &ffi_type_pointer;
} else if(strcmp(typ, "byte") == 0) {
assign = &ffi_type_schar;
+ } else if(strcmp(typ, "float") == 0) {
+ assign = &ffi_type_float;
}
info->argtypes[i - 2] = typ;