From: Doug Coleman Date: Mon, 25 Oct 2010 18:22:50 +0000 (-0500) Subject: Remove usages of and *void* X-Git-Tag: 0.97~4429^2~11 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=4ca9bd0bba5a269d48788449daca6d6142c90946 Remove usages of and *void* --- diff --git a/basis/alien/c-types/c-types-docs.factor b/basis/alien/c-types/c-types-docs.factor index 8643ae8072..5970f701fb 100644 --- a/basis/alien/c-types/c-types-docs.factor +++ b/basis/alien/c-types/c-types-docs.factor @@ -124,8 +124,7 @@ $nl "To wrap Factor data for consumption by the FFI, we use a utility word that constructs a byte array of the correct size and converts the Factor object to a C value stored into that byte array:" { $subsections } "You call the out parameter constructor with the required initial value, then pass the byte array to the C function, which receives a pointer to the start of the byte array's data area. The C function then returns, leaving the result in the byte array; you read it back using this word:" -{ $subsections deref } -"Note that while structure and union types do not get these words defined for them, there is no loss of generality since " { $link } " and " { $link *void* } " may be used." ; +{ $subsections deref } ; ARTICLE: "c-types.primitives" "Primitive C types" "The following numerical types are defined in the " { $vocab-link "alien.c-types" } " vocabulary; a " { $snippet "u" } " prefix denotes an unsigned type:" diff --git a/basis/compiler/tests/intrinsics.factor b/basis/compiler/tests/intrinsics.factor index b217d1b57e..3cc7447fb2 100644 --- a/basis/compiler/tests/intrinsics.factor +++ b/basis/compiler/tests/intrinsics.factor @@ -430,15 +430,15 @@ ERROR: bug-in-fixnum* x y a b ; [ ] [ "hello world" ascii malloc-string "s" set ] unit-test "s" get [ - [ "hello world" ] [ "s" get [ { byte-array } declare *void* ] compile-call ascii alien>string ] unit-test - [ "hello world" ] [ "s" get [ { c-ptr } declare *void* ] compile-call ascii alien>string ] unit-test + [ "hello world" ] [ "s" get [ { byte-array } declare void* deref ] compile-call ascii alien>string ] unit-test + [ "hello world" ] [ "s" get [ { c-ptr } declare void* deref ] compile-call ascii alien>string ] unit-test [ ] [ "s" get free ] unit-test ] when -[ ALIEN: 1234 ] [ ALIEN: 1234 [ { alien } declare ] compile-call *void* ] unit-test -[ ALIEN: 1234 ] [ ALIEN: 1234 [ { c-ptr } declare ] compile-call *void* ] unit-test -[ f ] [ f [ { POSTPONE: f } declare ] compile-call *void* ] unit-test +[ ALIEN: 1234 ] [ ALIEN: 1234 [ { alien } declare ] compile-call void* deref ] unit-test +[ ALIEN: 1234 ] [ ALIEN: 1234 [ { c-ptr } declare ] compile-call void* deref ] unit-test +[ f ] [ f [ { POSTPONE: f } declare void* ] compile-call void* deref ] unit-test [ 252 ] [ B{ 1 2 3 -4 5 } 3 [ { byte-array fixnum } declare alien-unsigned-1 ] compile-call ] unit-test [ -4 ] [ B{ 1 2 3 -4 5 } 3 [ { byte-array fixnum } declare alien-signed-1 ] compile-call ] unit-test @@ -446,20 +446,20 @@ ERROR: bug-in-fixnum* x y a b ; [ -100 ] [ -100 char [ { byte-array } declare char deref ] compile-call ] unit-test [ 156 ] [ -100 uchar [ { byte-array } declare uchar deref ] compile-call ] unit-test -[ -100 ] [ -100 \ def>> [ { fixnum } declare ] prepend compile-call char deref ] unit-test -[ 156 ] [ -100 \ def>> [ { fixnum } declare ] prepend compile-call uchar deref ] unit-test +[ -100 ] [ -100 [ char ] [ { fixnum } declare ] prepend compile-call char deref ] unit-test +[ 156 ] [ -100 [ uchar ] [ { fixnum } declare ] prepend compile-call uchar deref ] unit-test [ -1000 ] [ -1000 short [ { byte-array } declare short deref ] compile-call ] unit-test [ 64536 ] [ -1000 ushort [ { byte-array } declare ushort deref ] compile-call ] unit-test -[ -1000 ] [ -1000 \ def>> [ { fixnum } declare ] prepend compile-call short deref ] unit-test -[ 64536 ] [ -1000 \ def>> [ { fixnum } declare ] prepend compile-call ushort deref ] unit-test +[ -1000 ] [ -1000 [ short ] [ { fixnum } declare ] prepend compile-call short deref ] unit-test +[ 64536 ] [ -1000 [ ushort ] [ { fixnum } declare ] prepend compile-call ushort deref ] unit-test [ -100000 ] [ -100000 int [ { byte-array } declare int deref ] compile-call ] unit-test [ 4294867296 ] [ -100000 uint [ { byte-array } declare uint deref ] compile-call ] unit-test -[ -100000 ] [ -100000 \ def>> [ { fixnum } declare ] prepend compile-call int deref ] unit-test -[ 4294867296 ] [ -100000 \ def>> [ { fixnum } declare ] prepend compile-call uint deref ] unit-test +[ -100000 ] [ -100000 [ int ] [ { fixnum } declare ] prepend compile-call int deref ] unit-test +[ 4294867296 ] [ -100000 [ uint ] [ { fixnum } declare ] prepend compile-call uint deref ] unit-test [ t ] [ pi pi double double deref = ] unit-test diff --git a/basis/environment/unix/unix.factor b/basis/environment/unix/unix.factor index ec41e919d8..abfa15b5ed 100644 --- a/basis/environment/unix/unix.factor +++ b/basis/environment/unix/unix.factor @@ -17,7 +17,7 @@ M: unix set-os-env ( value key -- ) swap 1 setenv io-error ; M: unix unset-os-env ( key -- ) unsetenv io-error ; M: unix (os-envs) ( -- seq ) - environ *void* utf8 alien>strings ; + environ void* deref utf8 alien>strings ; : set-void* ( value alien -- ) 0 set-alien-cell ; diff --git a/basis/game/input/dinput/dinput.factor b/basis/game/input/dinput/dinput.factor index 61216fb317..26076c8a7e 100755 --- a/basis/game/input/dinput/dinput.factor +++ b/basis/game/input/dinput/dinput.factor @@ -23,15 +23,15 @@ SYMBOLS: +dinput+ +keyboard-device+ +keyboard-state+ : create-dinput ( -- ) f GetModuleHandle DIRECTINPUT_VERSION IDirectInput8W-iid - f [ f DirectInput8Create ole32-error ] keep *void* + f void* [ f DirectInput8Create ole32-error ] keep void* deref +dinput+ set-global ; : delete-dinput ( -- ) +dinput+ [ com-release f ] change-global ; : device-for-guid ( guid -- device ) - +dinput+ get-global swap f - [ f IDirectInput8W::CreateDevice ole32-error ] keep *void* ; + +dinput+ get-global swap f void* + [ f IDirectInput8W::CreateDevice ole32-error ] keep void* deref ; : set-coop-level ( device -- ) +device-change-window+ get-global DISCL_BACKGROUND DISCL_NONEXCLUSIVE bitor diff --git a/basis/io/directories/unix/linux/linux.factor b/basis/io/directories/unix/linux/linux.factor index 3d69c5f890..a4d96c5b70 100644 --- a/basis/io/directories/unix/linux/linux.factor +++ b/basis/io/directories/unix/linux/linux.factor @@ -6,6 +6,6 @@ IN: io.directories.unix.linux M: linux find-next-file ( DIR* -- dirent ) dirent - f + f void* [ [ readdir64_r ] unix-system-call 0 = [ (io-error) ] unless ] 2keep - *void* [ drop f ] unless ; + void* deref [ drop f ] unless ; diff --git a/basis/io/directories/unix/unix.factor b/basis/io/directories/unix/unix.factor index 0cc8aaa0e4..a175599e01 100644 --- a/basis/io/directories/unix/unix.factor +++ b/basis/io/directories/unix/unix.factor @@ -37,9 +37,9 @@ HOOK: find-next-file os ( DIR* -- byte-array ) M: unix find-next-file ( DIR* -- byte-array ) dirent - f + f void* [ readdir_r 0 = [ (io-error) ] unless ] 2keep - *void* [ drop f ] unless ; + void* deref [ drop f ] unless ; : dirent-type>file-type ( ch -- type ) { diff --git a/basis/io/files/info/unix/macosx/macosx.factor b/basis/io/files/info/unix/macosx/macosx.factor index ac5f8c23b1..445f164564 100644 --- a/basis/io/files/info/unix/macosx/macosx.factor +++ b/basis/io/files/info/unix/macosx/macosx.factor @@ -13,8 +13,8 @@ TUPLE: macosx-file-system-info < unix-file-system-info io-size owner type-id filesystem-subtype ; M: macosx file-systems ( -- array ) - f dup 0 getmntinfo64 dup io-error - [ *void* ] dip + f void* dup 0 getmntinfo64 dup io-error + [ void* deref ] dip [ f_mntonname>> utf8 alien>string file-system-info ] { } map-as ; M: macosx new-file-system-info macosx-file-system-info new ; diff --git a/basis/io/launcher/windows/windows.factor b/basis/io/launcher/windows/windows.factor index 0b58df2e43..4a84064c33 100755 --- a/basis/io/launcher/windows/windows.factor +++ b/basis/io/launcher/windows/windows.factor @@ -180,12 +180,12 @@ M: windows wait-for-processes ( -- ? ) GetCurrentProcess ! source process swap handle>> ! handle GetCurrentProcess ! target process - f [ ! target handle + f void* [ ! target handle DUPLICATE_SAME_ACCESS ! desired access TRUE ! inherit handle 0 ! options DuplicateHandle win32-error=0/f - ] keep *void* &dispose ; + ] keep void* deref &dispose ; ! /dev/null simulation : null-input ( -- pipe ) diff --git a/basis/io/sockets/sockets.factor b/basis/io/sockets/sockets.factor index a1bfd4c6aa..fcdc00d127 100644 --- a/basis/io/sockets/sockets.factor +++ b/basis/io/sockets/sockets.factor @@ -368,8 +368,8 @@ M: inet present C: inet M: string resolve-host - f prepare-addrinfo f - [ getaddrinfo addrinfo-error ] keep *void* addrinfo memory>struct + f prepare-addrinfo f void* + [ getaddrinfo addrinfo-error ] keep void* deref addrinfo memory>struct [ parse-addrinfo-list ] keep freeaddrinfo ; M: string with-port ; diff --git a/basis/io/sockets/windows/windows.factor b/basis/io/sockets/windows/windows.factor index ec82631f70..ec00626b51 100755 --- a/basis/io/sockets/windows/windows.factor +++ b/basis/io/sockets/windows/windows.factor @@ -181,7 +181,8 @@ TUPLE: AcceptEx-args port } cleave AcceptEx drop winsock-error ; inline : (extract-remote-address) ( lpOutputBuffer dwReceiveDataLength dwLocalAddressLength dwRemoteAddressLength -- sockaddr ) - f 0 int f [ 0 int GetAcceptExSockaddrs ] keep *void* ; + f void* 0 int f void* + [ 0 int GetAcceptExSockaddrs ] keep void* deref ; : extract-remote-address ( AcceptEx -- sockaddr ) [ diff --git a/basis/iokit/iokit.factor b/basis/iokit/iokit.factor index 4dc4932222..c9de6f8035 100644 --- a/basis/iokit/iokit.factor +++ b/basis/iokit/iokit.factor @@ -156,9 +156,9 @@ TUPLE: mach-error error-code error-string ; io-objects-from-iterator* [ release-io-object ] dip ; : properties-from-io-object ( o -- o nsdictionary ) - dup f [ + dup f void* [ kCFAllocatorDefault kNilOptions IORegistryEntryCreateCFProperties mach-error ] - keep *void* ; + keep void* deref ; diff --git a/basis/unix/groups/groups.factor b/basis/unix/groups/groups.factor index 117b60d8f5..10564a85a6 100644 --- a/basis/unix/groups/groups.factor +++ b/basis/unix/groups/groups.factor @@ -22,10 +22,10 @@ GENERIC: group-struct ( obj -- group/f ) : (group-struct) ( id -- group-struct id group-struct byte-array length void* ) [ \ unix.ffi:group ] dip over 4096 - [ ] keep f ; + [ ] keep f void* ; : check-group-struct ( group-struct ptr -- group-struct/f ) - *void* [ drop f ] unless ; + void* deref [ drop f ] unless ; M: integer group-struct ( id -- group/f ) (group-struct) diff --git a/basis/unix/utilities/utilities.factor b/basis/unix/utilities/utilities.factor index 919b2ae8a2..cd32c91d3c 100644 --- a/basis/unix/utilities/utilities.factor +++ b/basis/unix/utilities/utilities.factor @@ -8,14 +8,14 @@ IN: unix.utilities SPECIALIZED-ARRAY: void* : more? ( alien -- ? ) - { [ ] [ *void* ] } 1&& ; + { [ ] [ void* deref ] } 1&& ; : advance ( void* -- void* ) cell swap ; : alien>strings ( alien encoding -- strings ) [ [ dup more? ] ] dip - '[ [ advance ] [ *void* _ alien>string ] bi ] + '[ [ advance ] [ void* deref _ alien>string ] bi ] produce nip ; : strings>alien ( strings encoding -- array ) diff --git a/basis/windows/com/syntax/syntax.factor b/basis/windows/com/syntax/syntax.factor index dc6a0604fb..f6380cbf51 100644 --- a/basis/windows/com/syntax/syntax.factor +++ b/basis/windows/com/syntax/syntax.factor @@ -11,7 +11,7 @@ IN: windows.com.syntax MACRO: com-invoke ( n return parameters -- ) [ 2nip length ] 3keep '[ - _ npick *void* _ cell * alien-cell _ _ + _ npick void* deref _ cell * alien-cell _ _ stdcall alien-indirect ] ; diff --git a/basis/windows/uniscribe/uniscribe.factor b/basis/windows/uniscribe/uniscribe.factor index cde6c11efb..4c6593f921 100755 --- a/basis/windows/uniscribe/uniscribe.factor +++ b/basis/windows/uniscribe/uniscribe.factor @@ -42,9 +42,9 @@ TUPLE: script-string < disposable font string metrics ssa size image ; f ! piDx f ! pTabdef f ! pbInClass - f ! pssa + f void* ! pssa [ ScriptStringAnalyse ] keep - [ ole32-error ] [ |ScriptStringFree *void* ] bi* ; + [ ole32-error ] [ |ScriptStringFree void* deref ] bi* ; : set-dc-colors ( dc font -- ) [ background>> color>RGB SetBkColor drop ] @@ -103,7 +103,7 @@ TUPLE: script-string < disposable font string metrics ssa size image ; PRIVATE> M: script-string dispose* - ssa>> ScriptStringFree ole32-error ; + ssa>> void* ScriptStringFree ole32-error ; SYMBOL: cached-script-strings diff --git a/basis/x11/clipboard/clipboard.factor b/basis/x11/clipboard/clipboard.factor index 290c3e6aa3..a711da5580 100644 --- a/basis/x11/clipboard/clipboard.factor +++ b/basis/x11/clipboard/clipboard.factor @@ -28,11 +28,11 @@ TUPLE: x-clipboard atom contents ; CurrentTime XConvertSelection drop ; : snarf-property ( prop-return -- string ) - dup *void* [ *void* utf8 alien>string ] [ drop f ] if ; + dup void* deref [ void* deref utf8 alien>string ] [ drop f ] if ; : window-property ( win prop delete? -- string ) [ [ dpy get ] 2dip 0 -1 ] dip AnyPropertyType - 0 0 int 0 0 f + 0 0 int 0 ulong 0 ulong f void* [ XGetWindowProperty drop ] keep snarf-property ; : selection-from-event ( event window -- string ) diff --git a/extra/audio/vorbis/vorbis.factor b/extra/audio/vorbis/vorbis.factor index e67c7b7934..7e69aea7b4 100644 --- a/extra/audio/vorbis/vorbis.factor +++ b/extra/audio/vorbis/vorbis.factor @@ -157,7 +157,7 @@ ERROR: no-vorbis-in-ogg ; [ init-vorbis-codec ] if ; : get-pending-decoded-audio ( vorbis-stream -- pcm len ) - dsp-state>> f [ vorbis_synthesis_pcmout ] keep *void* swap ; + dsp-state>> f void* [ vorbis_synthesis_pcmout ] keep void* deref swap ; : float>short-sample ( float -- short ) -32767.5 * 0.5 - >integer -32768 32767 clamp ; inline diff --git a/extra/cuda/contexts/contexts.factor b/extra/cuda/contexts/contexts.factor index 0ba01cc453..714eaab94c 100644 --- a/extra/cuda/contexts/contexts.factor +++ b/extra/cuda/contexts/contexts.factor @@ -10,7 +10,7 @@ IN: cuda.contexts : create-context ( device flags -- context ) swap [ CUcontext ] 2dip - [ cuCtxCreate cuda-error ] 3keep 2drop *void* ; inline + [ cuCtxCreate cuda-error ] 3keep 2drop void* deref ; inline : sync-context ( -- ) cuCtxSynchronize cuda-error ; inline diff --git a/extra/cuda/gl/gl.factor b/extra/cuda/gl/gl.factor index 6ebee377aa..78e108ae7a 100644 --- a/extra/cuda/gl/gl.factor +++ b/extra/cuda/gl/gl.factor @@ -7,7 +7,7 @@ IN: cuda.gl : create-gl-cuda-context ( device flags -- context ) swap [ CUcontext ] 2dip - [ cuGLCtxCreate cuda-error ] 3keep 2drop *void* ; inline + [ cuGLCtxCreate cuda-error ] 3keep 2drop void* deref ; inline : with-gl-cuda-context ( device flags quot -- ) [ set-up-cuda-context create-gl-cuda-context ] dip (with-cuda-context) ; inline @@ -15,20 +15,20 @@ IN: cuda.gl : gl-buffer>resource ( gl-buffer flags -- resource ) enum>number [ CUgraphicsResource ] 2dip - [ cuGraphicsGLRegisterBuffer cuda-error ] 3keep 2drop *void* ; inline + [ cuGraphicsGLRegisterBuffer cuda-error ] 3keep 2drop void* deref ; inline : buffer>resource ( buffer flags -- resource ) [ handle>> ] dip gl-buffer>resource ; inline : map-resource ( resource -- device-ptr size ) - [ 1 swap f cuGraphicsMapResources cuda-error ] [ + [ 1 swap void* f cuGraphicsMapResources cuda-error ] [ [ CUdeviceptr uint ] dip [ cuGraphicsResourceGetMappedPointer cuda-error ] 3keep drop [ uint deref ] [ uint deref ] bi* ] bi ; inline : unmap-resource ( resource -- ) - 1 swap f cuGraphicsUnmapResources cuda-error ; inline + 1 swap void* f cuGraphicsUnmapResources cuda-error ; inline DESTRUCTOR: unmap-resource diff --git a/extra/cuda/libraries/libraries.factor b/extra/cuda/libraries/libraries.factor index e930745a17..0dc404c1cf 100644 --- a/extra/cuda/libraries/libraries.factor +++ b/extra/cuda/libraries/libraries.factor @@ -75,7 +75,7 @@ PRIVATE> : load-module ( path -- module ) [ CUmodule ] dip - [ cuModuleLoad cuda-error ] 2keep drop c:*void* ; + [ cuModuleLoad cuda-error ] 2keep drop c:void* c:deref ; : unload-module ( module -- ) cuModuleUnload cuda-error ; @@ -152,7 +152,7 @@ MACRO: cuda-arguments ( c-types abi -- quot: ( args... function -- ) ) : get-function-ptr ( module string -- function ) [ CUfunction ] 2dip - [ cuModuleGetFunction cuda-error ] 3keep 2drop c:*void* ; + [ cuModuleGetFunction cuda-error ] 3keep 2drop c:void* c:deref ; : cached-module ( module-name -- alien ) lookup-cuda-library diff --git a/extra/javascriptcore/javascriptcore.factor b/extra/javascriptcore/javascriptcore.factor index 738f1749bc..6dff17a433 100644 --- a/extra/javascriptcore/javascriptcore.factor +++ b/extra/javascriptcore/javascriptcore.factor @@ -38,7 +38,7 @@ SYMBOL: js-context : eval-js ( string -- result-string ) [ js-context get dup ] dip JSStringCreateWithUTF8CString f f 0 JSValueRef - [ JSEvaluateScript ] keep *void* + [ JSEvaluateScript ] keep void* deref dup [ nip JSValueRef>string javascriptcore-error ] [ drop JSValueRef>string ] if ; : eval-js-standalone ( string -- result-string ) diff --git a/extra/llvm/jit/jit.factor b/extra/llvm/jit/jit.factor index fc755fd00f..2c4c0a509f 100644 --- a/extra/llvm/jit/jit.factor +++ b/extra/llvm/jit/jit.factor @@ -25,9 +25,9 @@ TUPLE: jit ee mps ; LLVMGetFirstFunction dup ALIEN: 0 = [ drop ] [ (remove-functions) ] if ; : remove-provider ( provider -- ) - current-jit ee>> value>> swap value>> f f - [ LLVMRemoveModuleProvider drop ] 2keep *void* [ llvm-throw ] when* - *void* module new swap >>value + current-jit ee>> value>> swap value>> f void* f void* + [ LLVMRemoveModuleProvider drop ] 2keep void* deref [ llvm-throw ] when* + void* deref module new swap >>value [ value>> remove-functions ] with-disposal ; : remove-module ( name -- ) @@ -44,5 +44,5 @@ TUPLE: jit ee mps ; : function-pointer ( name -- alien ) current-jit ee>> value>> dup - rot f [ LLVMFindFunction drop ] keep - *void* LLVMGetPointerToGlobal ; \ No newline at end of file + rot f void* [ LLVMFindFunction drop ] keep + void* deref LLVMGetPointerToGlobal ; diff --git a/extra/llvm/reader/reader.factor b/extra/llvm/reader/reader.factor index 8c324b41e4..176e89b994 100644 --- a/extra/llvm/reader/reader.factor +++ b/extra/llvm/reader/reader.factor @@ -7,9 +7,9 @@ IN: llvm.reader : buffer>module ( buffer -- module ) [ - value>> f f + value>> f void* f void* [ LLVMParseBitcode drop ] 2keep - *void* [ llvm-throw ] when* *void* + void* deref [ llvm-throw ] when* void* deref module new swap >>value ] with-disposal ; @@ -17,4 +17,4 @@ IN: llvm.reader buffer>module ; : load-into-jit ( path name -- ) - [ load-module ] dip add-module ; \ No newline at end of file + [ load-module ] dip add-module ; diff --git a/extra/llvm/wrappers/wrappers.factor b/extra/llvm/wrappers/wrappers.factor index 05aafce973..24df1d5a12 100644 --- a/extra/llvm/wrappers/wrappers.factor +++ b/extra/llvm/wrappers/wrappers.factor @@ -33,9 +33,9 @@ M: engine dispose* value>> LLVMDisposeExecutionEngine ; : (engine) ( provider -- engine ) [ - value>> f f + value>> f void* f void* [ swapd 0 swap LLVMCreateJITCompiler drop ] 2keep - *void* [ llvm-throw ] when* *void* + void* deref [ llvm-throw ] when* void* deref ] [ t >>disposed drop ] bi engine ; @@ -57,6 +57,6 @@ TUPLE: buffer value disposed ; M: buffer dispose* value>> LLVMDisposeMemoryBuffer ; : ( path -- module ) - f f + f void* f void* [ LLVMCreateMemoryBufferWithContentsOfFile drop ] 2keep - *void* [ llvm-throw ] when* *void* buffer ; \ No newline at end of file + void* deref [ llvm-throw ] when* void* deref buffer ; diff --git a/extra/openal/alut/macosx/macosx.factor b/extra/openal/alut/macosx/macosx.factor index e6e8898b93..5380930dd1 100755 --- a/extra/openal/alut/macosx/macosx.factor +++ b/extra/openal/alut/macosx/macosx.factor @@ -9,6 +9,6 @@ LIBRARY: alut FUNCTION: void alutLoadWAVFile ( c-string fileName, ALenum* format, void** data, ALsizei* size, ALsizei* frequency ) ; M: macosx load-wav-file ( path -- format data size frequency ) - 0 int f 0 int 0 int + 0 int f void* 0 int 0 int [ alutLoadWAVFile ] 4 nkeep - [ [ [ int deref ] dip *void* ] dip int deref ] dip int deref ; + [ [ [ int deref ] dip void* deref ] dip int deref ] dip int deref ; diff --git a/extra/openal/alut/other/other.factor b/extra/openal/alut/other/other.factor index 73b1aca86e..42e6172c9f 100755 --- a/extra/openal/alut/other/other.factor +++ b/extra/openal/alut/other/other.factor @@ -10,8 +10,8 @@ FUNCTION: void alutLoadWAVFile ( c-string fileName, ALenum* format, void** data, M: object load-wav-file ( filename -- format data size frequency ) 0 int - f + f void* 0 int 0 int [ 0 char alutLoadWAVFile ] 4 nkeep - { [ int deref ] [ *void* ] [ int deref ] [ int deref ] } spread ; + { [ int deref ] [ void* deref ] [ int deref ] [ int deref ] } spread ; diff --git a/extra/opencl/ffi/ffi-tests.factor b/extra/opencl/ffi/ffi-tests.factor index ab84c07d49..60083a0b0a 100644 --- a/extra/opencl/ffi/ffi-tests.factor +++ b/extra/opencl/ffi/ffi-tests.factor @@ -31,12 +31,12 @@ ERROR: cl-error err ; :: opencl-square ( in -- out ) 0 f 0 uint [ clGetPlatformIDs cl-success ] keep uint deref dup [ f clGetPlatformIDs cl-success ] keep first - CL_DEVICE_TYPE_DEFAULT 1 f [ f clGetDeviceIDs cl-success ] keep *void* :> device-id - f 1 device-id f f 0 int [ clCreateContext ] keep int deref cl-success :> context + CL_DEVICE_TYPE_DEFAULT 1 f void* [ f clGetDeviceIDs cl-success ] keep void* deref :> device-id + f 1 device-id void* f f 0 int [ clCreateContext ] keep int deref cl-success :> context context device-id 0 0 int [ clCreateCommandQueue ] keep int deref cl-success :> queue [ - context 1 kernel-source cl-string-array + context 1 kernel-source cl-string-array void* f 0 int [ clCreateProgramWithSource ] keep int deref cl-success [ 0 f f f f clBuildProgram cl-success ] [ "square" cl-string-array 0 int [ clCreateKernel ] keep int deref cl-success ] @@ -51,8 +51,8 @@ ERROR: cl-error err ; queue input CL_TRUE 0 in byte-length in 0 f f clEnqueueWriteBuffer cl-success - kernel 0 cl_mem heap-size input clSetKernelArg cl-success - kernel 1 cl_mem heap-size output clSetKernelArg cl-success + kernel 0 cl_mem heap-size input void* clSetKernelArg cl-success + kernel 1 cl_mem heap-size output void* clSetKernelArg cl-success kernel 2 uint heap-size in length uint clSetKernelArg cl-success queue kernel 1 f in length ulonglong f diff --git a/extra/opencl/opencl.factor b/extra/opencl/opencl.factor index 78e96e2ff1..0fa5db9784 100644 --- a/extra/opencl/opencl.factor +++ b/extra/opencl/opencl.factor @@ -403,7 +403,7 @@ M: cl-filter-linear filter-mode-constant drop CL_FILTER_LINEAR ; [ clGetEventProfilingInfo ] info-ulong ; : bind-kernel-arg-buffer ( kernel index buffer -- ) - [ handle>> ] [ cl_mem heap-size ] [ handle>> ] tri* + [ handle>> ] [ cl_mem heap-size ] [ handle>> void* deref ] tri* clSetKernelArg cl-success ; inline : bind-kernel-arg-data ( kernel index byte-array -- ) @@ -488,7 +488,7 @@ PRIVATE> [ [ buffer>> handle>> ] [ offset>> ] bi ] tri* swapd ] 2dip [ length ] keep [ f ] [ [ handle>> ] void*-array{ } map-as ] if-empty - f [ clEnqueueCopyBuffer cl-success ] keep *void* cl-event + f void* [ clEnqueueCopyBuffer cl-success ] keep void* deref cl-event new-disposable swap >>handle ; : cl-queue-read-buffer ( buffer-range alien dependent-events -- event ) @@ -496,7 +496,7 @@ PRIVATE> [ (current-cl-queue) handle>> ] dip [ buffer>> handle>> CL_FALSE ] [ offset>> ] [ size>> ] tri ] 2dip [ length ] keep [ f ] [ [ handle>> ] void*-array{ } map-as ] if-empty - f [ clEnqueueReadBuffer cl-success ] keep *void* cl-event + f void* [ clEnqueueReadBuffer cl-success ] keep void* cl-event new-disposable swap >>handle ; : cl-queue-write-buffer ( buffer-range alien dependent-events -- event ) @@ -504,7 +504,7 @@ PRIVATE> [ (current-cl-queue) handle>> ] dip [ buffer>> handle>> CL_FALSE ] [ offset>> ] [ size>> ] tri ] 2dip [ length ] keep [ f ] [ [ handle>> ] void*-array{ } map-as ] if-empty - f [ clEnqueueWriteBuffer cl-success ] keep *void* cl-event + f void* [ clEnqueueWriteBuffer cl-success ] keep void* deref cl-event new-disposable swap >>handle ; : ( normalized-coords? addressing-mode filter-mode -- sampler ) @@ -549,7 +549,7 @@ PRIVATE> kernel handle>> sizes [ length f ] [ [ ] size_t-array{ } map-as f ] bi dependent-events [ length ] [ [ f ] [ [ handle>> ] void*-array{ } map-as ] if-empty ] bi - f [ clEnqueueNDRangeKernel cl-success ] keep *void* + f void* [ clEnqueueNDRangeKernel cl-success ] keep void* deref cl-event new-disposable swap >>handle ; : cl-event-type ( event -- command-type ) @@ -573,7 +573,7 @@ PRIVATE> : cl-marker ( -- event ) (current-cl-queue) - f [ clEnqueueMarker cl-success ] keep *void* cl-event new-disposable + f void* [ clEnqueueMarker cl-success ] keep void* deref cl-event new-disposable swap >>handle ; inline : cl-barrier ( -- )