Removed debug loggings
This commit is contained in:
parent
65dcf0cf44
commit
ac75c7d2e7
|
|
@ -183,12 +183,6 @@
|
|||
(if (equal? return-type 'void)
|
||||
0
|
||||
(size-of-type return-type)))))
|
||||
(display "Calling function: ")
|
||||
(display c-name)
|
||||
(newline)
|
||||
(display "With arguments: ")
|
||||
(display arguments)
|
||||
(newline)
|
||||
(internal-ffi-call (length argument-types)
|
||||
(pffi-type->libffi-type return-type)
|
||||
(map pffi-type->libffi-type argument-types)
|
||||
|
|
@ -198,12 +192,6 @@
|
|||
arguments
|
||||
argument-types))
|
||||
(cond ((not (equal? return-type 'void))
|
||||
(display "Return value pointer: ")
|
||||
(write return-value)
|
||||
(newline)
|
||||
(display "Return value: ")
|
||||
(write (pffi-pointer-get return-value return-type 0))
|
||||
(newline)
|
||||
(pffi-pointer-get return-value return-type 0))))))))
|
||||
|
||||
(define-syntax pffi-define
|
||||
|
|
|
|||
|
|
@ -148,8 +148,7 @@
|
|||
|
||||
(define argument->pointer
|
||||
(lambda (value type)
|
||||
(cond ;((pffi-pointer? value) value)
|
||||
((procedure? value) (scheme-procedure-to-pointer value))
|
||||
(cond ((procedure? value) (scheme-procedure-to-pointer value))
|
||||
(else (let ((pointer (pffi-pointer-allocate (size-of-type type))))
|
||||
(pffi-pointer-set! pointer type 0 value)
|
||||
pointer)))))
|
||||
|
|
@ -166,23 +165,6 @@
|
|||
(if (equal? return-type 'void)
|
||||
0
|
||||
(size-of-type return-type)))))
|
||||
(display "Calling function: ")
|
||||
(display c-name)
|
||||
(newline)
|
||||
(display "Return type: ")
|
||||
(write (pffi-type->libffi-type return-type))
|
||||
(newline)
|
||||
(display "Argument types: ")
|
||||
(write (map pffi-type->libffi-type argument-types))
|
||||
(newline)
|
||||
(display "Size of return type: ")
|
||||
(write (size-of-type return-type))
|
||||
(newline)
|
||||
(display "Argument pointers: ")
|
||||
(write (map argument->pointer
|
||||
arguments
|
||||
argument-types))
|
||||
(newline)
|
||||
(internal-ffi-call (length argument-types)
|
||||
(pffi-type->libffi-type return-type)
|
||||
(map pffi-type->libffi-type argument-types)
|
||||
|
|
@ -191,13 +173,7 @@
|
|||
(map argument->pointer
|
||||
arguments
|
||||
argument-types))
|
||||
(display "Return value pointer: ")
|
||||
(write return-value)
|
||||
(newline)
|
||||
(cond ((not (equal? return-type 'void))
|
||||
(display "Return value: ")
|
||||
(write (pffi-pointer-get return-value return-type 0))
|
||||
(newline)
|
||||
(pffi-pointer-get return-value return-type 0))))))))
|
||||
|
||||
(define-syntax pffi-define
|
||||
|
|
|
|||
|
|
@ -507,7 +507,6 @@ ScmObj pointer_to_string(ScmObj pointer) {
|
|||
if(SCM_FOREIGN_POINTER_P(pointer)) {
|
||||
void* p = SCM_FOREIGN_POINTER_REF(void*, pointer);
|
||||
void* string = (char*)p;
|
||||
printf("Pointer to string: %s\n", string);
|
||||
return Scm_MakeString(string, -1, -1, 0);
|
||||
} else {
|
||||
Scm_Error("Not a pointer: %S", pointer);
|
||||
|
|
@ -666,25 +665,10 @@ ScmObj internal_ffi_call(ScmObj nargs, ScmObj rtype, ScmObj atypes, ScmObj fn, S
|
|||
for(int i = 0; i < avalues_length; i++) {
|
||||
ScmObj item = Scm_ListRef(avalues, i, SCM_UNDEFINED);
|
||||
void* pp = SCM_FOREIGN_POINTER_REF(void*, item);
|
||||
printf("DEBUG1: %i\n", i);
|
||||
char* list_p = (char*)c_avalues + (sizeof(void) * i);
|
||||
/*
|
||||
if(c_atypes[i] == &ffi_type_pointer) {
|
||||
c_avalues[i] = &pp;
|
||||
printf("DEBUG2: %i\n", &c_avalues[i]);
|
||||
printf("DEBUG2.1: %i\n", &pp);
|
||||
} else {
|
||||
printf("DEBUG2: %i\n", *(int*)pp);
|
||||
c_avalues[i] = pp;
|
||||
}
|
||||
*/
|
||||
c_avalues[i] = pp;
|
||||
}
|
||||
printf("HERE2\n");
|
||||
printf("DEBUG3.1: %i\n", &c_rvalue);
|
||||
ffi_call(&cif, FFI_FN(c_fn), c_rvalue, c_avalues);
|
||||
printf("DEBUG3.2: %i\n", &c_rvalue);
|
||||
printf("HERE3\n");
|
||||
|
||||
return SCM_UNDEFINED;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue