Removed debug loggings

This commit is contained in:
retropikzel 2025-03-12 08:26:40 +02:00
parent 65dcf0cf44
commit ac75c7d2e7
3 changed files with 1 additions and 53 deletions

View File

@ -183,12 +183,6 @@
(if (equal? return-type 'void) (if (equal? return-type 'void)
0 0
(size-of-type return-type))))) (size-of-type return-type)))))
(display "Calling function: ")
(display c-name)
(newline)
(display "With arguments: ")
(display arguments)
(newline)
(internal-ffi-call (length argument-types) (internal-ffi-call (length argument-types)
(pffi-type->libffi-type return-type) (pffi-type->libffi-type return-type)
(map pffi-type->libffi-type argument-types) (map pffi-type->libffi-type argument-types)
@ -198,12 +192,6 @@
arguments arguments
argument-types)) argument-types))
(cond ((not (equal? return-type 'void)) (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)))))))) (pffi-pointer-get return-value return-type 0))))))))
(define-syntax pffi-define (define-syntax pffi-define

View File

@ -148,8 +148,7 @@
(define argument->pointer (define argument->pointer
(lambda (value type) (lambda (value type)
(cond ;((pffi-pointer? value) value) (cond ((procedure? value) (scheme-procedure-to-pointer value))
((procedure? value) (scheme-procedure-to-pointer value))
(else (let ((pointer (pffi-pointer-allocate (size-of-type type)))) (else (let ((pointer (pffi-pointer-allocate (size-of-type type))))
(pffi-pointer-set! pointer type 0 value) (pffi-pointer-set! pointer type 0 value)
pointer))))) pointer)))))
@ -166,23 +165,6 @@
(if (equal? return-type 'void) (if (equal? return-type 'void)
0 0
(size-of-type return-type))))) (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) (internal-ffi-call (length argument-types)
(pffi-type->libffi-type return-type) (pffi-type->libffi-type return-type)
(map pffi-type->libffi-type argument-types) (map pffi-type->libffi-type argument-types)
@ -191,13 +173,7 @@
(map argument->pointer (map argument->pointer
arguments arguments
argument-types)) argument-types))
(display "Return value pointer: ")
(write return-value)
(newline)
(cond ((not (equal? return-type 'void)) (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)))))))) (pffi-pointer-get return-value return-type 0))))))))
(define-syntax pffi-define (define-syntax pffi-define

View File

@ -507,7 +507,6 @@ ScmObj pointer_to_string(ScmObj pointer) {
if(SCM_FOREIGN_POINTER_P(pointer)) { if(SCM_FOREIGN_POINTER_P(pointer)) {
void* p = SCM_FOREIGN_POINTER_REF(void*, pointer); void* p = SCM_FOREIGN_POINTER_REF(void*, pointer);
void* string = (char*)p; void* string = (char*)p;
printf("Pointer to string: %s\n", string);
return Scm_MakeString(string, -1, -1, 0); return Scm_MakeString(string, -1, -1, 0);
} else { } else {
Scm_Error("Not a pointer: %S", pointer); 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++) { for(int i = 0; i < avalues_length; i++) {
ScmObj item = Scm_ListRef(avalues, i, SCM_UNDEFINED); ScmObj item = Scm_ListRef(avalues, i, SCM_UNDEFINED);
void* pp = SCM_FOREIGN_POINTER_REF(void*, item); void* pp = SCM_FOREIGN_POINTER_REF(void*, item);
printf("DEBUG1: %i\n", i);
char* list_p = (char*)c_avalues + (sizeof(void) * 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; 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); ffi_call(&cif, FFI_FN(c_fn), c_rvalue, c_avalues);
printf("DEBUG3.2: %i\n", &c_rvalue);
printf("HERE3\n");
return SCM_UNDEFINED; return SCM_UNDEFINED;
} }