From: Slava Pestov Date: Fri, 16 Jul 2010 21:32:05 +0000 (-0400) Subject: alien.data: remove second quotation parameter from with-out-parameters, now all value... X-Git-Tag: 0.97~4617 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=446ee6896db8452b8d0d2eb462c935d4c8af7296 alien.data: remove second quotation parameter from with-out-parameters, now all values are copied properly and calling 'clone' on structs in this quotation is not necessary --- diff --git a/basis/alien/arrays/arrays.factor b/basis/alien/arrays/arrays.factor index 42e40483f6..c020feaa76 100644 --- a/basis/alien/arrays/arrays.factor +++ b/basis/alien/arrays/arrays.factor @@ -56,6 +56,9 @@ M: string-type c-type-unboxer-quot M: string-type c-type-getter drop [ alien-cell ] ; +M: string-type c-type-copier + drop [ ] ; + M: string-type c-type-setter drop [ set-alien-cell ] ; diff --git a/basis/alien/c-types/c-types.factor b/basis/alien/c-types/c-types.factor index 412bf9259a..389883535f 100644 --- a/basis/alien/c-types/c-types.factor +++ b/basis/alien/c-types/c-types.factor @@ -89,6 +89,10 @@ GENERIC: c-type-getter ( name -- quot ) M: c-type c-type-getter getter>> ; +GENERIC: c-type-copier ( name -- quot ) + +M: c-type c-type-copier drop [ ] ; + GENERIC: c-type-setter ( name -- quot ) M: c-type c-type-setter setter>> ; @@ -118,6 +122,9 @@ MIXIN: value-type MACRO: alien-value ( c-type -- quot: ( c-ptr offset -- value ) ) [ c-type-getter ] [ c-type-boxer-quot ] bi append ; +MACRO: alien-copy-value ( c-type -- quot: ( c-ptr offset -- value ) ) + [ c-type-getter ] [ c-type-copier ] [ c-type-boxer-quot ] tri 3append ; + MACRO: set-alien-value ( c-type -- quot: ( value c-ptr offset -- ) ) [ c-type-unboxer-quot [ [ ] ] [ '[ _ 2dip ] ] if-empty ] [ c-type-setter ] @@ -139,6 +146,7 @@ PROTOCOL: c-type-protocol c-type-unboxer-quot c-type-rep c-type-getter + c-type-copier c-type-setter c-type-align c-type-align-first diff --git a/basis/alien/data/data-docs.factor b/basis/alien/data/data-docs.factor index 930232b86c..02a31976c7 100644 --- a/basis/alien/data/data-docs.factor +++ b/basis/alien/data/data-docs.factor @@ -76,7 +76,7 @@ scoped-allocation-test ." } ; HELP: with-out-parameters -{ $values { "c-types" "a list of scoped allocation specifiers" } { "quot" quotation } { "finish" quotation } { "values..." "zero or more values" } } +{ $values { "c-types" "a list of scoped allocation specifiers" } { "quot" quotation } { "values..." "zero or more values" } } { $description "Allocates values on the call stack, calls the quotation, then copies all stack allocated values to the data heap after the quotation returns." $nl "A scoped allocation specifier is either:" diff --git a/basis/alien/data/data.factor b/basis/alien/data/data.factor index ab5824bfd2..d755ac387b 100644 --- a/basis/alien/data/data.factor +++ b/basis/alien/data/data.factor @@ -70,7 +70,10 @@ M: value-type c-type-rep drop int-rep ; M: value-type c-type-getter drop [ swap ] ; -M: value-type c-type-setter ( type -- quot ) +M: value-type c-type-copier + heap-size '[ _ memory>byte-array ] ; + +M: value-type c-type-setter [ c-type-getter ] [ heap-size ] bi '[ @ swap _ memcpy ] ; M: array c-type-boxer-quot @@ -117,7 +120,7 @@ MACRO: box-values ( c-types -- quot ) MACRO: out-parameters ( c-types -- quot ) [ dup hairy-local-allot? [ first ] when ] map - [ length ] [ [ '[ 0 _ alien-value ] ] map ] bi + [ length ] [ [ '[ 0 _ alien-copy-value ] ] map ] bi '[ _ nkeep _ spread ] ; PRIVATE> @@ -126,8 +129,8 @@ PRIVATE> [ [ (local-allots) ] [ box-values ] bi ] dip call (cleanup-allot) ; inline -: with-out-parameters ( c-types quot finish -- values... ) - [ [ drop (local-allots) ] [ swap out-parameters ] 2bi ] dip call +: with-out-parameters ( c-types quot -- values... ) + [ drop (local-allots) ] [ swap out-parameters ] 2bi (cleanup-allot) ; inline GENERIC: binary-zero? ( value -- ? ) @@ -137,4 +140,3 @@ M: f binary-zero? drop t ; inline M: integer binary-zero? zero? ; inline M: math:float binary-zero? double>bits zero? ; inline M: complex binary-zero? >rect [ binary-zero? ] both? ; inline - diff --git a/basis/checksums/openssl/openssl.factor b/basis/checksums/openssl/openssl.factor index 1fec109d5f..41c8537d45 100644 --- a/basis/checksums/openssl/openssl.factor +++ b/basis/checksums/openssl/openssl.factor @@ -48,9 +48,8 @@ M: evp-md-context dispose* : digest-value ( ctx -- value ) handle>> { { int EVP_MAX_MD_SIZE } int } - [ EVP_DigestFinal_ex ssl-error ] - [ memory>byte-array ] - with-out-parameters ; + [ EVP_DigestFinal_ex ssl-error ] with-out-parameters + memory>byte-array ; PRIVATE> diff --git a/basis/cocoa/messages/messages.factor b/basis/cocoa/messages/messages.factor index 029b3f46e6..4d786aaf72 100644 --- a/basis/cocoa/messages/messages.factor +++ b/basis/cocoa/messages/messages.factor @@ -216,7 +216,7 @@ ERROR: no-objc-type name ; objc-methods get set-at ; : each-method-in-class ( class quot -- ) - [ { uint } [ class_copyMethodList ] [ ] with-out-parameters ] dip + [ { uint } [ class_copyMethodList ] with-out-parameters ] dip over 0 = [ 3drop ] [ [ ] dip [ each ] [ drop (free) ] 2bi diff --git a/basis/cocoa/nibs/nibs.factor b/basis/cocoa/nibs/nibs.factor index d4a11cc9d5..320b4783a5 100644 --- a/basis/cocoa/nibs/nibs.factor +++ b/basis/cocoa/nibs/nibs.factor @@ -16,6 +16,6 @@ IN: cocoa.nibs : nib-objects ( anNSNib -- objects/f ) f - { void* } [ -> instantiateNibWithOwner:topLevelObjects: ] [ ] + { void* } [ -> instantiateNibWithOwner:topLevelObjects: ] with-out-parameters swap [ CF>array ] [ drop f ] if ; \ No newline at end of file diff --git a/basis/cocoa/plists/plists.factor b/basis/cocoa/plists/plists.factor index 80d58e6340..e8d28b0004 100644 --- a/basis/cocoa/plists/plists.factor +++ b/basis/cocoa/plists/plists.factor @@ -38,7 +38,7 @@ DEFER: plist> : (read-plist) ( NSData -- id ) NSPropertyListSerialization swap kCFPropertyListImmutable f { void* } - [ -> propertyListFromData:mutabilityOption:format:errorDescription: ] [ ] + [ -> propertyListFromData:mutabilityOption:format:errorDescription: ] with-out-parameters [ -> release "read-plist failed" throw ] when* ; diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index 47d9b4b337..f263e1e0f8 100755 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -777,18 +777,18 @@ mingw? [ [ 3 ] [ blah ] unit-test : out-param-test-1 ( -- b ) - { int } [ [ 12 ] dip 0 int set-alien-value ] [ ] with-out-parameters ; + { int } [ [ 12 ] dip 0 int set-alien-value ] with-out-parameters ; [ 12 ] [ out-param-test-1 ] unit-test : out-param-test-2 ( -- b ) - { { int initial: 12 } } [ drop ] [ ] with-out-parameters ; + { { int initial: 12 } } [ drop ] with-out-parameters ; [ 12 ] [ out-param-test-2 ] unit-test : out-param-test-3 ( -- x y ) { { RECT initial: S{ RECT { x 3 } { y 4 } } } } [ drop ] - [ clone ] with-out-parameters + with-out-parameters [ x>> ] [ y>> ] bi ; [ 3.0 4.0 ] [ out-param-test-3 ] unit-test @@ -801,6 +801,6 @@ mingw? [ { int } [ swap void { int pointer: int } cdecl alien-indirect - ] [ ] with-out-parameters ; + ] with-out-parameters ; [ 12 ] [ 6 out-param-callback out-param-indirect ] unit-test diff --git a/basis/compiler/tests/optimizer.factor b/basis/compiler/tests/optimizer.factor index 0d08c592a9..23b615f1ae 100644 --- a/basis/compiler/tests/optimizer.factor +++ b/basis/compiler/tests/optimizer.factor @@ -454,7 +454,6 @@ STRUCT: BitmapData { Scan0 void* } ; [ { BitmapData } [ BitmapData memory>struct ALIEN: 123 >>Scan0 drop ] - [ clone ] with-out-parameters Scan0>> ] compile-call ] unit-test diff --git a/basis/core-foundation/strings/strings.factor b/basis/core-foundation/strings/strings.factor index b78e1046fe..24bb38e09c 100644 --- a/basis/core-foundation/strings/strings.factor +++ b/basis/core-foundation/strings/strings.factor @@ -78,8 +78,7 @@ FUNCTION: CFStringRef CFStringCreateWithCString ( [ 0 swap kCFStringEncodingUTF8 0 f ] keep 4 * 1 + [ dup length - { CFIndex } [ CFStringGetBytes drop ] [ ] - with-out-parameters + { CFIndex } [ CFStringGetBytes drop ] with-out-parameters ] keep swap head-slice utf8 decode ; diff --git a/basis/core-text/core-text.factor b/basis/core-text/core-text.factor index 4de8b2c06a..014956aba2 100644 --- a/basis/core-text/core-text.factor +++ b/basis/core-text/core-text.factor @@ -51,7 +51,7 @@ TUPLE: line < disposable line metrics image loc dim ; : typographic-bounds ( line -- width ascent descent leading ) { CGFloat CGFloat CGFloat } - [ CTLineGetTypographicBounds ] [ ] with-out-parameters ; inline + [ CTLineGetTypographicBounds ] with-out-parameters ; inline : store-typographic-bounds ( metrics width ascent descent leading -- metrics ) { diff --git a/basis/db/postgresql/lib/lib.factor b/basis/db/postgresql/lib/lib.factor index 7fe40a73d6..11218d21ff 100644 --- a/basis/db/postgresql/lib/lib.factor +++ b/basis/db/postgresql/lib/lib.factor @@ -146,7 +146,7 @@ M: postgresql-malloc-destructor dispose ( obj -- ) ] [ &postgresql-free ] if - ] [ ] with-out-parameters memory>byte-array + ] with-out-parameters memory>byte-array ] with-destructors ] [ drop pq-get-is-null nip [ f ] [ B{ } clone ] if diff --git a/basis/db/sqlite/lib/lib.factor b/basis/db/sqlite/lib/lib.factor index 58033a281e..0935fb6c91 100644 --- a/basis/db/sqlite/lib/lib.factor +++ b/basis/db/sqlite/lib/lib.factor @@ -27,7 +27,7 @@ ERROR: sqlite-sql-error < sql-error n string ; : sqlite-open ( path -- db ) normalize-path - { void* } [ sqlite3_open sqlite-check-result ] [ ] + { void* } [ sqlite3_open sqlite-check-result ] with-out-parameters ; : sqlite-close ( db -- ) @@ -36,8 +36,8 @@ ERROR: sqlite-sql-error < sql-error n string ; : sqlite-prepare ( db sql -- handle ) utf8 encode dup length { void* void* } - [ sqlite3_prepare_v2 sqlite-check-result ] [ drop ] - with-out-parameters ; + [ sqlite3_prepare_v2 sqlite-check-result ] + with-out-parameters drop ; : sqlite-bind-parameter-index ( handle name -- index ) sqlite3_bind_parameter_index ; diff --git a/basis/game/input/x11/x11.factor b/basis/game/input/x11/x11.factor index ecdbee8284..cc3e4cd531 100644 --- a/basis/game/input/x11/x11.factor +++ b/basis/game/input/x11/x11.factor @@ -89,7 +89,7 @@ M: x11-game-input-backend read-keyboard : query-pointer ( -- x y buttons ) dpy get dup XDefaultRootWindow { int int int int int int int } - [ XQueryPointer drop ] [ ] with-out-parameters + [ XQueryPointer drop ] with-out-parameters [ 4 ndrop ] 3dip ; SYMBOL: mouse-reset? diff --git a/basis/io/backend/windows/nt/nt.factor b/basis/io/backend/windows/nt/nt.factor index c0a6ee807d..69a86c7ec3 100755 --- a/basis/io/backend/windows/nt/nt.factor +++ b/basis/io/backend/windows/nt/nt.factor @@ -56,7 +56,7 @@ M: winnt add-completion ( win32-handle -- ) nanos [ 1,000,000 /i ] [ INFINITE ] if* :> timeout master-completion-port get-global { int void* pointer: OVERLAPPED } - [ timeout GetQueuedCompletionStatus zero? ] [ ] with-out-parameters + [ timeout GetQueuedCompletionStatus zero? ] with-out-parameters :> ( error? bytes key overlapped ) bytes overlapped error? ; diff --git a/basis/io/backend/windows/nt/privileges/privileges.factor b/basis/io/backend/windows/nt/privileges/privileges.factor index 27687df9d5..896785b048 100644 --- a/basis/io/backend/windows/nt/privileges/privileges.factor +++ b/basis/io/backend/windows/nt/privileges/privileges.factor @@ -15,7 +15,7 @@ TYPEDEF: TOKEN_PRIVILEGES* PTOKEN_PRIVILEGES : (open-process-token) ( handle -- handle ) flags{ TOKEN_ADJUST_PRIVILEGES TOKEN_QUERY } { PHANDLE } - [ OpenProcessToken win32-error=0/f ] [ ] + [ OpenProcessToken win32-error=0/f ] with-out-parameters ; : open-process-token ( -- handle ) diff --git a/basis/io/files/info/windows/windows.factor b/basis/io/files/info/windows/windows.factor index 96e302860d..2971a15b4b 100755 --- a/basis/io/files/info/windows/windows.factor +++ b/basis/io/files/info/windows/windows.factor @@ -21,7 +21,7 @@ IN: io.files.info.windows TUPLE: windows-file-info < file-info attributes ; : get-compressed-file-size ( path -- n ) - { DWORD } [ GetCompressedFileSize ] [ ] with-out-parameters + { DWORD } [ GetCompressedFileSize ] with-out-parameters over INVALID_FILE_SIZE = [ win32-error-string throw ] [ >64bit ] if ; : set-windows-size-on-disk ( file-info path -- file-info ) @@ -100,12 +100,12 @@ CONSTANT: path-length $[ MAX_PATH 1 + ] : volume-information ( normalized-path -- volume-name volume-serial max-component flags type ) { { ushort path-length } DWORD DWORD DWORD { ushort path-length } } [ [ path-length ] 4dip path-length GetVolumeInformation win32-error=0/f ] - [ [ utf16n alien>string ] 4dip utf16n alien>string ] - with-out-parameters ; + with-out-parameters + [ utf16n alien>string ] 4dip utf16n alien>string ; : file-system-space ( normalized-path -- available-space total-space free-space ) { ULARGE_INTEGER ULARGE_INTEGER ULARGE_INTEGER } - [ GetDiskFreeSpaceEx win32-error=0/f ] [ ] + [ GetDiskFreeSpaceEx win32-error=0/f ] with-out-parameters ; : calculate-file-system-info ( file-system-info -- file-system-info' ) @@ -149,24 +149,21 @@ CONSTANT: names-buf-length 16384 : volume>paths ( string -- array ) { { ushort names-buf-length } uint } [ [ names-buf-length ] dip GetVolumePathNamesForVolumeName win32-error=0/f ] - [ head utf16n alien>string { CHAR: \0 } split ] - with-out-parameters ; + with-out-parameters + head utf16n alien>string { CHAR: \0 } split ; : find-first-volume ( -- string handle ) { { ushort path-length } } [ path-length FindFirstVolume dup win32-error=0/f ] - [ utf16n alien>string ] - with-out-parameters swap ; + with-out-parameters utf16n alien>string swap ; : find-next-volume ( handle -- string/f ) { { ushort path-length } } - [ path-length FindNextVolume ] - [ - swap 0 = [ - GetLastError ERROR_NO_MORE_FILES = - [ drop f ] [ win32-error-string throw ] if - ] [ utf16n alien>string ] if - ] with-out-parameters ; + [ path-length FindNextVolume ] with-out-parameters + swap 0 = [ + GetLastError ERROR_NO_MORE_FILES = + [ drop f ] [ win32-error-string throw ] if + ] [ utf16n alien>string ] if ; : find-volumes ( -- array ) find-first-volume @@ -189,8 +186,8 @@ M: winnt file-systems ( -- array ) normalize-path open-read &dispose handle>> { FILETIME FILETIME FILETIME } [ GetFileTime win32-error=0/f ] - [ [ FILETIME>timestamp >local-time ] tri@ ] with-out-parameters + [ FILETIME>timestamp >local-time ] tri@ ] with-destructors ; : set-file-times ( path timestamp/f timestamp/f timestamp/f -- ) diff --git a/basis/io/launcher/unix/unix.factor b/basis/io/launcher/unix/unix.factor index e036f34cc6..1eed2eb75e 100644 --- a/basis/io/launcher/unix/unix.factor +++ b/basis/io/launcher/unix/unix.factor @@ -95,7 +95,7 @@ TUPLE: signal n ; dup WIFSIGNALED [ WTERMSIG signal boa ] [ WEXITSTATUS ] if ; M: unix wait-for-processes ( -- ? ) - { int } [ -1 swap WNOHANG waitpid ] [ ] with-out-parameters + { int } [ -1 swap WNOHANG waitpid ] with-out-parameters swap dup 0 <= [ 2drop t ] [ diff --git a/basis/io/launcher/windows/windows.factor b/basis/io/launcher/windows/windows.factor index cc9e52a189..ecf730716a 100755 --- a/basis/io/launcher/windows/windows.factor +++ b/basis/io/launcher/windows/windows.factor @@ -159,7 +159,7 @@ M: windows kill-process* ( handle -- ) : exit-code ( process -- n ) hProcess>> - { DWORD } [ GetExitCodeProcess ] [ ] with-out-parameters + { DWORD } [ GetExitCodeProcess ] with-out-parameters swap win32-error=0/f ; : process-exited ( process -- ) diff --git a/basis/io/sockets/windows/nt/nt.factor b/basis/io/sockets/windows/nt/nt.factor index 17e92b9b9f..13f399697e 100644 --- a/basis/io/sockets/windows/nt/nt.factor +++ b/basis/io/sockets/windows/nt/nt.factor @@ -26,7 +26,7 @@ M: winnt WSASocket-flags ( -- DWORD ) WSAIoctl SOCKET_ERROR = [ winsock-error-string throw ] when - ] [ ] with-out-parameters ; + ] with-out-parameters ; TUPLE: ConnectEx-args port s name namelen lpSendBuffer dwSendDataLength diff --git a/basis/iokit/iokit.factor b/basis/iokit/iokit.factor index 5720fc5997..4dc4932222 100644 --- a/basis/iokit/iokit.factor +++ b/basis/iokit/iokit.factor @@ -131,11 +131,11 @@ TUPLE: mach-error error-code error-string ; dup KERN_SUCCESS = [ drop ] [ throw ] if ; : master-port ( -- port ) - MACH_PORT_NULL { uint } [ IOMasterPort mach-error ] [ ] with-out-parameters ; + MACH_PORT_NULL { uint } [ IOMasterPort mach-error ] with-out-parameters ; : io-services-matching-dictionary ( nsdictionary -- iterator ) master-port swap - { uint } [ IOServiceGetMatchingServices mach-error ] [ ] with-out-parameters ; + { uint } [ IOServiceGetMatchingServices mach-error ] with-out-parameters ; : io-services-matching-service ( service -- iterator ) IOServiceMatching io-services-matching-dictionary ; diff --git a/basis/math/vectors/simd/simd-tests.factor b/basis/math/vectors/simd/simd-tests.factor index 9bc90cbf7e..3b8ae7d2b4 100644 --- a/basis/math/vectors/simd/simd-tests.factor +++ b/basis/math/vectors/simd/simd-tests.factor @@ -684,7 +684,7 @@ USE: alien { c:int float-4 } [ [ 123 swap 0 c:int c:set-alien-value ] [ float-4{ 1 2 3 4 } swap 0 float-4 c:set-alien-value ] bi* - ] [ ] with-out-parameters ; + ] with-out-parameters ; [ 123 float-4{ 1 2 3 4 } ] [ simd-stack-test ] unit-test @@ -696,7 +696,7 @@ USE: alien { c:int } [ 123 swap 0 c:int c:set-alien-value >float (simd-stack-spill-test) float-4-with swap cos v*n - ] [ ] with-out-parameters ; + ] with-out-parameters ; [ ] [ 1.047197551196598 simd-stack-spill-test diff --git a/basis/opengl/framebuffers/framebuffers.factor b/basis/opengl/framebuffers/framebuffers.factor index ce19a2ec89..5d28d1852c 100644 --- a/basis/opengl/framebuffers/framebuffers.factor +++ b/basis/opengl/framebuffers/framebuffers.factor @@ -51,4 +51,4 @@ IN: opengl.framebuffers : framebuffer-attachment ( attachment -- id ) GL_FRAMEBUFFER swap GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME - { uint } [ glGetFramebufferAttachmentParameteriv ] [ ] with-out-parameters ; + { uint } [ glGetFramebufferAttachmentParameteriv ] with-out-parameters ; diff --git a/basis/opengl/opengl.factor b/basis/opengl/opengl.factor index 893a8dfbd6..fda840b281 100644 --- a/basis/opengl/opengl.factor +++ b/basis/opengl/opengl.factor @@ -139,7 +139,7 @@ MACRO: all-enabled-client-state ( seq quot -- ) swap glPushAttrib call glPopAttrib ; inline : (gen-gl-object) ( quot -- id ) - [ 1 { uint } ] dip [ ] with-out-parameters ; inline + [ 1 { uint } ] dip with-out-parameters ; inline : (delete-gl-object) ( id quot -- ) [ 1 swap ] dip call ; inline diff --git a/basis/opengl/shaders/shaders.factor b/basis/opengl/shaders/shaders.factor index 4e17a01624..720665a1b8 100644 --- a/basis/opengl/shaders/shaders.factor +++ b/basis/opengl/shaders/shaders.factor @@ -20,7 +20,7 @@ IN: opengl.shaders dup integer? [ glIsShader c-bool> ] [ drop f ] if ; : gl-shader-get-int ( shader enum -- value ) - { int } [ glGetShaderiv ] [ ] with-out-parameters ; + { int } [ glGetShaderiv ] with-out-parameters ; : gl-shader-ok? ( shader -- ? ) GL_COMPILE_STATUS gl-shader-get-int c-bool> ; @@ -79,7 +79,7 @@ PREDICATE: fragment-shader < gl-shader (fragment-shader?) ; dup integer? [ glIsProgram c-bool> ] [ drop f ] if ; : gl-program-get-int ( program enum -- value ) - { int } [ glGetProgramiv ] [ ] with-out-parameters ; + { int } [ glGetProgramiv ] with-out-parameters ; : gl-program-ok? ( program -- ? ) GL_LINK_STATUS gl-program-get-int c-bool> ; diff --git a/basis/opengl/textures/textures.factor b/basis/opengl/textures/textures.factor index dacea0888a..f33ea9e47d 100644 --- a/basis/opengl/textures/textures.factor +++ b/basis/opengl/textures/textures.factor @@ -406,7 +406,7 @@ PRIVATE> [ [ max-texture-size tesselate ] dip ] if ; : get-texture-float ( target level enum -- value ) - { float } [ glGetTexLevelParameterfv ] [ ] with-out-parameters ; inline + { float } [ glGetTexLevelParameterfv ] with-out-parameters ; inline : get-texture-int ( target level enum -- value ) - { int } [ glGetTexLevelParameteriv ] [ ] with-out-parameters ; inline + { int } [ glGetTexLevelParameteriv ] with-out-parameters ; inline diff --git a/basis/pango/cairo/cairo.factor b/basis/pango/cairo/cairo.factor index 68a9f2f6df..891a353281 100644 --- a/basis/pango/cairo/cairo.factor +++ b/basis/pango/cairo/cairo.factor @@ -137,7 +137,7 @@ SYMBOL: dpi : line-offset>x ( layout n -- x ) #! n is an index into the UTF8 encoding of the text [ drop first-line ] [ swap string>> >utf8-index ] 2bi - 0 { int } [ pango_layout_line_index_to_x ] [ ] with-out-parameters + 0 { int } [ pango_layout_line_index_to_x ] with-out-parameters pango>float ; : x>line-offset ( layout x -- n ) @@ -146,7 +146,7 @@ SYMBOL: dpi [ first-line ] dip float>pango { int int } - [ pango_layout_line_x_to_index drop ] [ ] with-out-parameters + [ pango_layout_line_x_to_index drop ] with-out-parameters swap ] [ drop string>> ] 2bi utf8-index> + ; diff --git a/basis/random/windows/windows.factor b/basis/random/windows/windows.factor index 0629481a1b..5c7026bcc8 100755 --- a/basis/random/windows/windows.factor +++ b/basis/random/windows/windows.factor @@ -23,7 +23,7 @@ CONSTANT: factor-crypto-container "FactorCryptoContainer" type flags CryptAcquireContextW - ] [ ] with-out-parameters ; + ] with-out-parameters ; : acquire-crypto-context ( provider type -- handle ) CRYPT_MACHINE_KEYSET diff --git a/basis/ui/backend/cocoa/cocoa.factor b/basis/ui/backend/cocoa/cocoa.factor index 13f07b9d41..48647df92d 100644 --- a/basis/ui/backend/cocoa/cocoa.factor +++ b/basis/ui/backend/cocoa/cocoa.factor @@ -57,7 +57,7 @@ M: cocoa-ui-backend (pixel-format-attribute) [ drop f ] [ first - { int } [ swap 0 -> getValues:forAttribute:forVirtualScreen: ] [ ] + { int } [ swap 0 -> getValues:forAttribute:forVirtualScreen: ] with-out-parameters ] if-empty ; diff --git a/basis/ui/backend/windows/windows.factor b/basis/ui/backend/windows/windows.factor index 06ea870196..dba6184c58 100755 --- a/basis/ui/backend/windows/windows.factor +++ b/basis/ui/backend/windows/windows.factor @@ -60,14 +60,14 @@ PIXEL-FORMAT-ATTRIBUTE-TABLE: WGL_ARB { $ WGL_SUPPORT_OPENGL_ARB 1 } H{ : arb-make-pixel-format ( world attributes -- pf ) [ handle>> hDC>> ] dip >WGL_ARB-int-array f 1 { int int } - [ wglChoosePixelFormatARB win32-error=0/f ] [ ] with-out-parameters drop ; + [ wglChoosePixelFormatARB win32-error=0/f ] with-out-parameters drop ; : arb-pixel-format-attribute ( pixel-format attribute -- value ) >WGL_ARB [ drop f ] [ [ [ world>> handle>> hDC>> ] [ handle>> ] bi 0 1 ] dip first { int } - [ wglGetPixelFormatAttribivARB win32-error=0/f ] [ ] + [ wglGetPixelFormatAttribivARB win32-error=0/f ] with-out-parameters ] if-empty ; diff --git a/basis/ui/backend/x11/x11.factor b/basis/ui/backend/x11/x11.factor index f3d603ddd8..e2ba7ab4e5 100644 --- a/basis/ui/backend/x11/x11.factor +++ b/basis/ui/backend/x11/x11.factor @@ -39,11 +39,11 @@ SINGLETON: x11-ui-backend XGetWindowProperty Success assert= ] + with-out-parameters [| type format n-atoms bytes-after atoms | atoms n-atoms >array atoms XFree - ] - with-out-parameters ; + ] call ; : net-wm-hint-supported? ( atom -- ? ) supported-net-wm-hints member? ; @@ -93,7 +93,7 @@ M: x11-ui-backend (pixel-format-attribute) [ handle>> ] [ >glx-visual ] bi* [ 2drop f ] [ first - { int } [ glXGetConfig drop ] [ ] with-out-parameters + { int } [ glXGetConfig drop ] with-out-parameters ] if-empty ; CONSTANT: modifiers diff --git a/basis/windows/dwmapi/dwmapi.factor b/basis/windows/dwmapi/dwmapi.factor index b9830a5347..0da98eaf14 100755 --- a/basis/windows/dwmapi/dwmapi.factor +++ b/basis/windows/dwmapi/dwmapi.factor @@ -34,5 +34,5 @@ CONSTANT: WM_DWMCOMPOSITIONCHANGED HEX: 31E : composition-enabled? ( -- ? ) windows-major 6 >= - [ { bool } [ DwmIsCompositionEnabled drop ] [ ] with-out-parameters ] + [ { bool } [ DwmIsCompositionEnabled drop ] with-out-parameters ] [ f ] if ; diff --git a/basis/windows/offscreen/offscreen.factor b/basis/windows/offscreen/offscreen.factor index c2587698d0..02b72388a7 100644 --- a/basis/windows/offscreen/offscreen.factor +++ b/basis/windows/offscreen/offscreen.factor @@ -27,7 +27,7 @@ IN: windows.offscreen [ nip ] [ swap (bitmap-info) DIB_RGB_COLORS { void* } - [ f 0 CreateDIBSection ] [ ] with-out-parameters + [ f 0 CreateDIBSection ] with-out-parameters ] 2bi [ [ SelectObject drop ] keep ] dip ; diff --git a/basis/windows/uniscribe/uniscribe.factor b/basis/windows/uniscribe/uniscribe.factor index 92fec0a677..cde6c11efb 100755 --- a/basis/windows/uniscribe/uniscribe.factor +++ b/basis/windows/uniscribe/uniscribe.factor @@ -20,12 +20,12 @@ TUPLE: script-string < disposable font string metrics ssa size image ; swap ! icp FALSE ! fTrailing ] if - { int } [ ScriptStringCPtoX ole32-error ] [ ] with-out-parameters ; + { int } [ ScriptStringCPtoX ole32-error ] with-out-parameters ; : x>line-offset ( x script-string -- n trailing ) ssa>> ! ssa swap ! iX - { int int } [ ScriptStringXtoCP ole32-error ] [ ] with-out-parameters ; + { int int } [ ScriptStringXtoCP ole32-error ] with-out-parameters ;