From 565e3383abf5a62232847828fbe8ad4127d5bade Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 31 Mar 2010 19:17:06 -0700 Subject: [PATCH 001/157] add singletons for stdcall, cdecl, mingw abis --- core/alien/alien.factor | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/alien/alien.factor b/core/alien/alien.factor index a44d703fbc..7a539d4dd5 100644 --- a/core/alien/alien.factor +++ b/core/alien/alien.factor @@ -5,6 +5,10 @@ kernel.private byte-arrays byte-vectors arrays init continuations.private ; IN: alien +SINGLETONS: stdcall cdecl mingw ; + +UNION: abi stdcall cdecl mingw ; + PREDICATE: pinned-alien < alien underlying>> not ; UNION: pinned-c-ptr pinned-alien POSTPONE: f ; From 65c32597614224e6857832565cab037ee33fee36 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 31 Mar 2010 19:20:35 -0700 Subject: [PATCH 002/157] "cdecl" -> cdecl --- basis/alien/fortran/fortran.factor | 14 ++--- basis/alien/libraries/libraries-docs.factor | 4 +- basis/alien/libraries/libraries.factor | 2 +- .../remote-control/remote-control.factor | 6 +- basis/cairo/ffi/ffi.factor | 10 ++-- basis/cocoa/subclassing/subclassing.factor | 2 +- .../compiler/cfg/builder/builder-tests.factor | 4 +- basis/compiler/tests/alien.factor | 56 +++++++++---------- basis/compiler/tests/redefine24.factor | 4 +- basis/compression/zlib/ffi/ffi.factor | 2 +- .../core-foundation/run-loop/run-loop.factor | 2 +- basis/cpu/x86/32/32-tests.factor | 2 +- basis/cpu/x86/64/64-tests.factor | 4 +- basis/cpu/x86/features/features.factor | 6 +- basis/db/postgresql/ffi/ffi.factor | 2 +- basis/db/sqlite/ffi/ffi.factor | 2 +- basis/glib/glib.factor | 8 +-- .../multiplexers/run-loop/run-loop.factor | 2 +- .../io/sockets/secure/openssl/openssl.factor | 2 +- basis/math/floats/env/x86/32/32.factor | 8 +-- basis/math/floats/env/x86/64/64.factor | 8 +-- basis/opengl/gl/macosx/macosx.factor | 2 +- basis/opengl/gl/unix/unix.factor | 2 +- basis/openssl/libcrypto/libcrypto.factor | 6 +- basis/openssl/libssl/libssl.factor | 6 +- basis/pango/cairo/cairo.factor | 4 +- basis/pango/pango.factor | 4 +- basis/tools/deploy/test/9/9.factor | 4 +- basis/tools/disassembler/udis/udis.factor | 2 +- basis/tools/profiler/profiler-tests.factor | 4 +- basis/unix/ffi/ffi.factor | 2 +- basis/windows/nt/nt.factor | 4 +- extra/benchmark/fib6/fib6.factor | 4 +- extra/chipmunk/ffi/ffi.factor | 2 +- extra/curses/ffi/ffi.factor | 2 +- extra/cursors/cursors-tests.factor | 6 +- extra/freetype/freetype.factor | 4 +- extra/libusb/libusb.factor | 2 +- extra/llvm/core/core.factor | 2 +- extra/llvm/invoker/invoker.factor | 2 +- extra/ogg/ogg.factor | 2 +- extra/ogg/theora/theora.factor | 4 +- extra/ogg/vorbis/vorbis.factor | 2 +- extra/openal/alut/alut.factor | 2 +- extra/openal/openal.factor | 2 +- extra/opengl/glu/glu.factor | 2 +- extra/tokyo/alien/tcrdb/tcrdb.factor | 2 +- extra/tokyo/alien/tcutil/tcutil.factor | 2 +- unmaintained/alien/inline/inline.factor | 2 +- unmaintained/cryptlib/libcl/libcl.factor | 4 +- unmaintained/db/mysql/ffi/ffi.factor | 4 +- unmaintained/jni/jni-internals.factor | 24 ++++---- unmaintained/ldap/libldap/libldap.factor | 4 +- unmaintained/lint/lint.factor | 2 +- unmaintained/oracle/liboci/liboci.factor | 4 +- unmaintained/pdf/libhpdf/libhpdf.factor | 4 +- 56 files changed, 142 insertions(+), 138 deletions(-) diff --git a/basis/alien/fortran/fortran.factor b/basis/alien/fortran/fortran.factor index 9255c66c9f..8c74aa102a 100644 --- a/basis/alien/fortran/fortran.factor +++ b/basis/alien/fortran/fortran.factor @@ -13,8 +13,8 @@ SINGLETONS: f2c-abi g95-abi gfortran-abi intel-unix-abi intel-windows-abi ; << : add-f2c-libraries ( -- ) - "I77" "libI77.so" "cdecl" add-library - "F77" "libF77.so" "cdecl" add-library ; + "I77" "libI77.so" cdecl add-library + "F77" "libF77.so" cdecl add-library ; os netbsd? [ add-f2c-libraries ] when >> @@ -42,11 +42,11 @@ library-fortran-abis [ H{ } clone ] initialize [ "__" append ] [ "_" append ] if ; HOOK: fortran-c-abi fortran-abi ( -- abi ) -M: f2c-abi fortran-c-abi "cdecl" ; -M: g95-abi fortran-c-abi "cdecl" ; -M: gfortran-abi fortran-c-abi "cdecl" ; -M: intel-unix-abi fortran-c-abi "cdecl" ; -M: intel-windows-abi fortran-c-abi "cdecl" ; +M: f2c-abi fortran-c-abi cdecl ; +M: g95-abi fortran-c-abi cdecl ; +M: gfortran-abi fortran-c-abi cdecl ; +M: intel-unix-abi fortran-c-abi cdecl ; +M: intel-windows-abi fortran-c-abi cdecl ; HOOK: real-functions-return-double? fortran-abi ( -- ? ) M: f2c-abi real-functions-return-double? t ; diff --git a/basis/alien/libraries/libraries-docs.factor b/basis/alien/libraries/libraries-docs.factor index 59142733b9..be1a7c7ad6 100644 --- a/basis/alien/libraries/libraries-docs.factor +++ b/basis/alien/libraries/libraries-docs.factor @@ -6,7 +6,7 @@ IN: alien.libraries HELP: { $values - { "path" "a pathname string" } { "abi" "the ABI used by the library, either " { $snippet "cdecl" } " or " { $snippet "stdcall" } } + { "path" "a pathname string" } { "abi" "the ABI used by the library, either " { $snippet cdecl } " or " { $snippet "stdcall" } } { "library" library } } { $description "Opens a C library using the path and ABI parameters and outputs a library tuple." } { $notes "User code should use " { $link add-library } " so that the opened library is added to a global hashtable, " { $link libraries } "." } ; @@ -19,7 +19,7 @@ HELP: library { $description "Looks up a library by its logical name. The library object is a hashtable with the following keys:" { $list { { $snippet "name" } " - the full path of the C library binary" } - { { $snippet "abi" } " - the ABI used by the library, either " { $snippet "cdecl" } " or " { $snippet "stdcall" } } + { { $snippet "abi" } " - the ABI used by the library, either " { $snippet cdecl } " or " { $snippet "stdcall" } } { { $snippet "dll" } " - an instance of the " { $link dll } " class; only set if the library is loaded" } } } ; diff --git a/basis/alien/libraries/libraries.factor b/basis/alien/libraries/libraries.factor index 47e34fe5ff..5a042fd436 100644 --- a/basis/alien/libraries/libraries.factor +++ b/basis/alien/libraries/libraries.factor @@ -36,7 +36,7 @@ M: library dispose dll>> [ dispose ] when* ; [ swap libraries get set-at ] 3bi ; : library-abi ( library -- abi ) - library [ abi>> ] [ "cdecl" ] if* ; + library [ abi>> ] [ cdecl ] if* ; SYMBOL: deploy-libraries diff --git a/basis/alien/remote-control/remote-control.factor b/basis/alien/remote-control/remote-control.factor index c305d720f0..5090280945 100644 --- a/basis/alien/remote-control/remote-control.factor +++ b/basis/alien/remote-control/remote-control.factor @@ -6,14 +6,14 @@ eval ; IN: alien.remote-control : eval-callback ( -- callback ) - void* { c-string } "cdecl" + void* { c-string } cdecl [ eval>string utf8 malloc-string ] alien-callback ; : yield-callback ( -- callback ) - void { } "cdecl" [ yield ] alien-callback ; + void { } cdecl [ yield ] alien-callback ; : sleep-callback ( -- callback ) - void { long } "cdecl" [ sleep ] alien-callback ; + void { long } cdecl [ sleep ] alien-callback ; : ?callback ( word -- alien ) dup optimized? [ execute ] [ drop f ] if ; inline diff --git a/basis/cairo/ffi/ffi.factor b/basis/cairo/ffi/ffi.factor index c4700d2dad..2ff688c456 100644 --- a/basis/cairo/ffi/ffi.factor +++ b/basis/cairo/ffi/ffi.factor @@ -10,8 +10,8 @@ alien.libraries classes.struct ; IN: cairo.ffi << { - { [ os winnt? ] [ "cairo" "libcairo-2.dll" "cdecl" add-library ] } - { [ os macosx? ] [ "cairo" "/opt/local/lib/libcairo.dylib" "cdecl" add-library ] } + { [ os winnt? ] [ "cairo" "libcairo-2.dll" cdecl add-library ] } + { [ os macosx? ] [ "cairo" "/opt/local/lib/libcairo.dylib" cdecl add-library ] } { [ os unix? ] [ ] } } cond >> @@ -38,7 +38,7 @@ TYPEDEF: void* cairo_pattern_t TYPEDEF: void* cairo_destroy_func_t : cairo-destroy-func ( quot -- callback ) - [ void { pointer: void } "cdecl" ] dip alien-callback ; inline + [ void { pointer: void } cdecl ] dip alien-callback ; inline ! See cairo.h for details STRUCT: cairo_user_data_key_t @@ -79,11 +79,11 @@ CONSTANT: CAIRO_CONTENT_COLOR_ALPHA HEX: 3000 TYPEDEF: void* cairo_write_func_t : cairo-write-func ( quot -- callback ) - [ cairo_status_t { pointer: void c-string int } "cdecl" ] dip alien-callback ; inline + [ cairo_status_t { pointer: void c-string int } cdecl ] dip alien-callback ; inline TYPEDEF: void* cairo_read_func_t : cairo-read-func ( quot -- callback ) - [ cairo_status_t { pointer: void c-string int } "cdecl" ] dip alien-callback ; inline + [ cairo_status_t { pointer: void c-string int } cdecl ] dip alien-callback ; inline ! Functions for manipulating state objects FUNCTION: cairo_t* diff --git a/basis/cocoa/subclassing/subclassing.factor b/basis/cocoa/subclassing/subclassing.factor index e4db56221f..1accb1e8dc 100644 --- a/basis/cocoa/subclassing/subclassing.factor +++ b/basis/cocoa/subclassing/subclassing.factor @@ -40,7 +40,7 @@ IN: cocoa.subclassing : prepare-method ( ret types quot -- type imp ) [ [ encode-types ] 2keep ] dip - '[ _ _ "cdecl" _ alien-callback ] + '[ _ _ cdecl _ alien-callback ] (( -- callback )) define-temp ; : prepare-methods ( methods -- methods ) diff --git a/basis/compiler/cfg/builder/builder-tests.factor b/basis/compiler/cfg/builder/builder-tests.factor index 7f1b6aa6f2..b2c05edf73 100644 --- a/basis/compiler/cfg/builder/builder-tests.factor +++ b/basis/compiler/cfg/builder/builder-tests.factor @@ -68,8 +68,8 @@ IN: compiler.cfg.builder.tests [ [ dup ] loop ] [ [ 2 ] [ 3 throw ] if 4 ] [ int f "malloc" { int } alien-invoke ] - [ int { int } "cdecl" alien-indirect ] - [ int { int } "cdecl" [ ] alien-callback ] + [ int { int } cdecl alien-indirect ] + [ int { int } cdecl [ ] alien-callback ] [ swap - + * ] [ swap slot ] [ blahblah ] diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index 692dbee4c5..a813c530f7 100755 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -19,7 +19,7 @@ IN: compiler.tests.alien { [ os unix? ] [ "libfactor-ffi-test.so" ] } } cond append-path ; -"f-cdecl" libfactor-ffi-tests-path "cdecl" add-library +"f-cdecl" libfactor-ffi-tests-path cdecl add-library "f-stdcall" libfactor-ffi-tests-path "stdcall" add-library >> @@ -90,7 +90,7 @@ FUNCTION: TINY ffi_test_17 int x ; [ [ alien-indirect ] infer ] [ inference-error? ] must-fail-with : indirect-test-1 ( ptr -- result ) - int { } "cdecl" alien-indirect ; + int { } cdecl alien-indirect ; { 1 1 } [ indirect-test-1 ] must-infer-as @@ -99,7 +99,7 @@ FUNCTION: TINY ffi_test_17 int x ; [ 3 ] [ &: ffi_test_1 indirect-test-1 ] unit-test : indirect-test-1' ( ptr -- ) - int { } "cdecl" alien-indirect drop ; + int { } cdecl alien-indirect drop ; { 1 0 } [ indirect-test-1' ] must-infer-as @@ -108,7 +108,7 @@ FUNCTION: TINY ffi_test_17 int x ; [ -1 indirect-test-1 ] must-fail : indirect-test-2 ( x y ptr -- result ) - int { int int } "cdecl" alien-indirect gc ; + int { int int } cdecl alien-indirect gc ; { 3 1 } [ indirect-test-2 ] must-infer-as @@ -314,21 +314,21 @@ FUNCTION: ulonglong ffi_test_38 ( ulonglong x, ulonglong y ) ; ! Test callbacks -: callback-1 ( -- callback ) void { } "cdecl" [ ] alien-callback ; +: callback-1 ( -- callback ) void { } cdecl [ ] alien-callback ; [ 0 1 ] [ [ callback-1 ] infer [ in>> length ] [ out>> length ] bi ] unit-test [ t ] [ callback-1 alien? ] unit-test -: callback_test_1 ( ptr -- ) void { } "cdecl" alien-indirect ; +: callback_test_1 ( ptr -- ) void { } cdecl alien-indirect ; [ ] [ callback-1 callback_test_1 ] unit-test -: callback-2 ( -- callback ) void { } "cdecl" [ [ 5 throw ] ignore-errors ] alien-callback ; +: callback-2 ( -- callback ) void { } cdecl [ [ 5 throw ] ignore-errors ] alien-callback ; [ ] [ callback-2 callback_test_1 ] unit-test -: callback-3 ( -- callback ) void { } "cdecl" [ 5 "x" set ] alien-callback ; +: callback-3 ( -- callback ) void { } cdecl [ 5 "x" set ] alien-callback ; [ t 3 5 ] [ [ @@ -340,38 +340,38 @@ FUNCTION: ulonglong ffi_test_38 ( ulonglong x, ulonglong y ) ; ] unit-test : callback-5 ( -- callback ) - void { } "cdecl" [ gc ] alien-callback ; + void { } cdecl [ gc ] alien-callback ; [ "testing" ] [ "testing" callback-5 callback_test_1 ] unit-test : callback-5b ( -- callback ) - void { } "cdecl" [ compact-gc ] alien-callback ; + void { } cdecl [ compact-gc ] alien-callback ; [ "testing" ] [ "testing" callback-5b callback_test_1 ] unit-test : callback-6 ( -- callback ) - void { } "cdecl" [ [ continue ] callcc0 ] alien-callback ; + void { } cdecl [ [ continue ] callcc0 ] alien-callback ; [ 1 2 3 ] [ callback-6 callback_test_1 1 2 3 ] unit-test : callback-7 ( -- callback ) - void { } "cdecl" [ 1000000 sleep ] alien-callback ; + void { } cdecl [ 1000000 sleep ] alien-callback ; [ 1 2 3 ] [ callback-7 callback_test_1 1 2 3 ] unit-test [ f ] [ namespace global eq? ] unit-test : callback-8 ( -- callback ) - void { } "cdecl" [ [ ] in-thread yield ] alien-callback ; + void { } cdecl [ [ ] in-thread yield ] alien-callback ; [ ] [ callback-8 callback_test_1 ] unit-test : callback-9 ( -- callback ) - int { int int int } "cdecl" [ + int { int int int } cdecl [ + + 1 + ] alien-callback ; @@ -429,13 +429,13 @@ STRUCT: double-rect } cleave ; : double-rect-callback ( -- alien ) - void { void* void* double-rect } "cdecl" + void { void* void* double-rect } cdecl [ "example" set-global 2drop ] alien-callback ; : double-rect-test ( arg -- arg' ) f f rot double-rect-callback - void { void* void* double-rect } "cdecl" alien-indirect + void { void* void* double-rect } cdecl alien-indirect "example" get-global ; [ 1.0 2.0 3.0 4.0 ] @@ -452,7 +452,7 @@ FUNCTION: test_struct_14 ffi_test_40 ( double x1, double x2 ) ; ] unit-test : callback-10 ( -- callback ) - test_struct_14 { double double } "cdecl" + test_struct_14 { double double } cdecl [ test_struct_14 swap >>x2 @@ -460,7 +460,7 @@ FUNCTION: test_struct_14 ffi_test_40 ( double x1, double x2 ) ; ] alien-callback ; : callback-10-test ( x1 x2 callback -- result ) - test_struct_14 { double double } "cdecl" alien-indirect ; + test_struct_14 { double double } cdecl alien-indirect ; [ 1.0 2.0 ] [ 1.0 2.0 callback-10 callback-10-test @@ -475,7 +475,7 @@ FUNCTION: test-struct-12 ffi_test_41 ( int a, double x ) ; ] unit-test : callback-11 ( -- callback ) - test-struct-12 { int double } "cdecl" + test-struct-12 { int double } cdecl [ test-struct-12 swap >>x @@ -483,7 +483,7 @@ FUNCTION: test-struct-12 ffi_test_41 ( int a, double x ) ; ] alien-callback ; : callback-11-test ( x1 x2 callback -- result ) - test-struct-12 { int double } "cdecl" alien-indirect ; + test-struct-12 { int double } cdecl alien-indirect ; [ 1 2.0 ] [ 1 2.0 callback-11 callback-11-test @@ -499,7 +499,7 @@ FUNCTION: test_struct_15 ffi_test_42 ( float x, float y ) ; [ 1.0 2.0 ] [ 1.0 2.0 ffi_test_42 [ x>> ] [ y>> ] bi ] unit-test : callback-12 ( -- callback ) - test_struct_15 { float float } "cdecl" + test_struct_15 { float float } cdecl [ test_struct_15 swap >>y @@ -507,7 +507,7 @@ FUNCTION: test_struct_15 ffi_test_42 ( float x, float y ) ; ] alien-callback ; : callback-12-test ( x1 x2 callback -- result ) - test_struct_15 { float float } "cdecl" alien-indirect ; + test_struct_15 { float float } cdecl alien-indirect ; [ 1.0 2.0 ] [ 1.0 2.0 callback-12 callback-12-test [ x>> ] [ y>> ] bi @@ -522,7 +522,7 @@ FUNCTION: test_struct_16 ffi_test_43 ( float x, int a ) ; [ 1.0 2 ] [ 1.0 2 ffi_test_43 [ x>> ] [ a>> ] bi ] unit-test : callback-13 ( -- callback ) - test_struct_16 { float int } "cdecl" + test_struct_16 { float int } cdecl [ test_struct_16 swap >>a @@ -530,7 +530,7 @@ FUNCTION: test_struct_16 ffi_test_43 ( float x, int a ) ; ] alien-callback ; : callback-13-test ( x1 x2 callback -- result ) - test_struct_16 { float int } "cdecl" alien-indirect ; + test_struct_16 { float int } cdecl alien-indirect ; [ 1.0 2 ] [ 1.0 2 callback-13 callback-13-test @@ -581,13 +581,13 @@ FUNCTION: short ffi_test_48 ( bool-field-test x ) ; ! Test interaction between threads and callbacks : thread-callback-1 ( -- callback ) - int { } "cdecl" [ yield 100 ] alien-callback ; + int { } cdecl [ yield 100 ] alien-callback ; : thread-callback-2 ( -- callback ) - int { } "cdecl" [ yield 200 ] alien-callback ; + int { } cdecl [ yield 200 ] alien-callback ; : thread-callback-invoker ( callback -- n ) - int { } "cdecl" alien-indirect ; + int { } cdecl alien-indirect ; "p" set [ thread-callback-1 thread-callback-invoker "p" get fulfill ] in-thread @@ -600,6 +600,6 @@ FUNCTION: void this_does_not_exist ( ) ; [ this_does_not_exist ] [ { "kernel-error" 9 f f } = ] must-fail-with ! More alien-assembly tests are in cpu.* vocabs -: assembly-test-1 ( -- ) void { } "cdecl" [ ] alien-assembly ; +: assembly-test-1 ( -- ) void { } cdecl [ ] alien-assembly ; [ ] [ assembly-test-1 ] unit-test diff --git a/basis/compiler/tests/redefine24.factor b/basis/compiler/tests/redefine24.factor index 391102102e..90c4e9943d 100644 --- a/basis/compiler/tests/redefine24.factor +++ b/basis/compiler/tests/redefine24.factor @@ -7,12 +7,12 @@ TYPEDEF: alien.c-types:int type-1 TYPEDEF: alien.c-types:int type-3 : callback ( -- ptr ) - type-3 { type-1 type-1 } "cdecl" [ + >integer ] alien-callback ; + type-3 { type-1 type-1 } cdecl [ + >integer ] alien-callback ; TYPEDEF: alien.c-types:float type-2 : indirect ( x y ptr -- z ) - type-3 { type-2 type-2 } "cdecl" alien-indirect ; + type-3 { type-2 type-2 } cdecl alien-indirect ; [ ] [ "USING: alien.c-types alien.syntax ; diff --git a/basis/compression/zlib/ffi/ffi.factor b/basis/compression/zlib/ffi/ffi.factor index 553b55cf6e..aede6d5621 100644 --- a/basis/compression/zlib/ffi/ffi.factor +++ b/basis/compression/zlib/ffi/ffi.factor @@ -8,7 +8,7 @@ IN: compression.zlib.ffi { [ os winnt? ] [ "zlib1.dll" ] } { [ os macosx? ] [ "libz.dylib" ] } { [ os unix? ] [ "libz.so" ] } -} cond "cdecl" add-library >> +} cond cdecl add-library >> LIBRARY: zlib diff --git a/basis/core-foundation/run-loop/run-loop.factor b/basis/core-foundation/run-loop/run-loop.factor index 14d701ba17..793efefbe8 100644 --- a/basis/core-foundation/run-loop/run-loop.factor +++ b/basis/core-foundation/run-loop/run-loop.factor @@ -120,7 +120,7 @@ PRIVATE> [ fds>> [ enable-all-callbacks ] each ] bi ; : timer-callback ( -- callback ) - void { CFRunLoopTimerRef void* } "cdecl" + void { CFRunLoopTimerRef void* } cdecl [ 2drop reset-run-loop yield ] alien-callback ; : init-thread-timer ( -- ) diff --git a/basis/cpu/x86/32/32-tests.factor b/basis/cpu/x86/32/32-tests.factor index bc07e3a25b..375374806f 100644 --- a/basis/cpu/x86/32/32-tests.factor +++ b/basis/cpu/x86/32/32-tests.factor @@ -2,6 +2,6 @@ IN: cpu.x86.32.tests USING: alien alien.c-types tools.test cpu.x86.assembler cpu.x86.assembler.operands ; -: assembly-test-1 ( -- x ) int { } "cdecl" [ EAX 3 MOV ] alien-assembly ; +: assembly-test-1 ( -- x ) int { } cdecl [ EAX 3 MOV ] alien-assembly ; [ 3 ] [ assembly-test-1 ] unit-test diff --git a/basis/cpu/x86/64/64-tests.factor b/basis/cpu/x86/64/64-tests.factor index 6d171af7ea..2d2c89441c 100644 --- a/basis/cpu/x86/64/64-tests.factor +++ b/basis/cpu/x86/64/64-tests.factor @@ -2,12 +2,12 @@ USING: alien alien.c-types cpu.architecture cpu.x86.64 cpu.x86.assembler cpu.x86.assembler.operands tools.test ; IN: cpu.x86.64.tests -: assembly-test-1 ( -- x ) int { } "cdecl" [ RAX 3 MOV ] alien-assembly ; +: assembly-test-1 ( -- x ) int { } cdecl [ RAX 3 MOV ] alien-assembly ; [ 3 ] [ assembly-test-1 ] unit-test : assembly-test-2 ( a b -- x ) - int { int int } "cdecl" [ + int { int int } cdecl [ param-reg-0 param-reg-1 ADD int-regs return-reg param-reg-0 MOV ] alien-assembly ; diff --git a/basis/cpu/x86/features/features.factor b/basis/cpu/x86/features/features.factor index 30b2ce3b57..7913489178 100644 --- a/basis/cpu/x86/features/features.factor +++ b/basis/cpu/x86/features/features.factor @@ -9,7 +9,7 @@ IN: cpu.x86.features > +} cond cdecl add-library >> ! ConnSatusType CONSTANT: CONNECTION_OK HEX: 0 diff --git a/basis/db/sqlite/ffi/ffi.factor b/basis/db/sqlite/ffi/ffi.factor index f93b961799..d9da317c89 100644 --- a/basis/db/sqlite/ffi/ffi.factor +++ b/basis/db/sqlite/ffi/ffi.factor @@ -10,7 +10,7 @@ IN: db.sqlite.ffi { [ os winnt? ] [ "sqlite3.dll" ] } { [ os macosx? ] [ "/usr/lib/libsqlite3.dylib" ] } { [ os unix? ] [ "libsqlite3.so" ] } - } cond "cdecl" add-library >> + } cond cdecl add-library >> ! Return values from sqlite functions CONSTANT: SQLITE_OK 0 ! Successful result diff --git a/basis/glib/glib.factor b/basis/glib/glib.factor index 157a426e19..7447f24151 100644 --- a/basis/glib/glib.factor +++ b/basis/glib/glib.factor @@ -8,14 +8,14 @@ IN: glib << { - { [ os winnt? ] [ "glib" "libglib-2.0-0.dll" "cdecl" add-library ] } - { [ os macosx? ] [ "glib" "/opt/local/lib/libglib-2.0.0.dylib" "cdecl" add-library ] } + { [ os winnt? ] [ "glib" "libglib-2.0-0.dll" cdecl add-library ] } + { [ os macosx? ] [ "glib" "/opt/local/lib/libglib-2.0.0.dylib" cdecl add-library ] } { [ os unix? ] [ ] } } cond { - { [ os winnt? ] [ "gobject" "libgobject-2.0-0.dll" "cdecl" add-library ] } - { [ os macosx? ] [ "gobject" "/opt/local/lib/libgobject-2.0.0.dylib" "cdecl" add-library ] } + { [ os winnt? ] [ "gobject" "libgobject-2.0-0.dll" cdecl add-library ] } + { [ os macosx? ] [ "gobject" "/opt/local/lib/libgobject-2.0.0.dylib" cdecl add-library ] } { [ os unix? ] [ ] } } cond diff --git a/basis/io/backend/unix/multiplexers/run-loop/run-loop.factor b/basis/io/backend/unix/multiplexers/run-loop/run-loop.factor index 05328b48dc..ea31292c06 100644 --- a/basis/io/backend/unix/multiplexers/run-loop/run-loop.factor +++ b/basis/io/backend/unix/multiplexers/run-loop/run-loop.factor @@ -11,7 +11,7 @@ TUPLE: run-loop-mx kqueue-mx ; : file-descriptor-callback ( -- callback ) void { CFFileDescriptorRef CFOptionFlags void* } - "cdecl" [ + cdecl [ 3drop 0 mx get kqueue-mx>> wait-for-events reset-run-loop diff --git a/basis/io/sockets/secure/openssl/openssl.factor b/basis/io/sockets/secure/openssl/openssl.factor index b3cf28a497..ca7ba0cd49 100644 --- a/basis/io/sockets/secure/openssl/openssl.factor +++ b/basis/io/sockets/secure/openssl/openssl.factor @@ -31,7 +31,7 @@ TUPLE: openssl-context < secure-context aliens sessions ; ] [ drop ] if ; : password-callback ( -- alien ) - int { void* int bool void* } "cdecl" + int { void* int bool void* } cdecl [| buf size rwflag password! | password [ B{ 0 } password! ] unless diff --git a/basis/math/floats/env/x86/32/32.factor b/basis/math/floats/env/x86/32/32.factor index ea3bee424f..7d45f01337 100644 --- a/basis/math/floats/env/x86/32/32.factor +++ b/basis/math/floats/env/x86/32/32.factor @@ -3,26 +3,26 @@ cpu.x86.assembler.operands math.floats.env.x86 system ; IN: math.floats.env.x86.32 M: x86.32 get-sse-env - void { void* } "cdecl" [ + void { void* } cdecl [ EAX ESP [] MOV EAX [] STMXCSR ] alien-assembly ; M: x86.32 set-sse-env - void { void* } "cdecl" [ + void { void* } cdecl [ EAX ESP [] MOV EAX [] LDMXCSR ] alien-assembly ; M: x86.32 get-x87-env - void { void* } "cdecl" [ + void { void* } cdecl [ EAX ESP [] MOV EAX [] FNSTSW EAX 2 [+] FNSTCW ] alien-assembly ; M: x86.32 set-x87-env - void { void* } "cdecl" [ + void { void* } cdecl [ EAX ESP [] MOV FNCLEX EAX 2 [+] FLDCW diff --git a/basis/math/floats/env/x86/64/64.factor b/basis/math/floats/env/x86/64/64.factor index b6f8ee151f..c20eed1cab 100644 --- a/basis/math/floats/env/x86/64/64.factor +++ b/basis/math/floats/env/x86/64/64.factor @@ -3,23 +3,23 @@ cpu.x86.assembler.operands math.floats.env.x86 sequences system ; IN: math.floats.env.x86.64 M: x86.64 get-sse-env - void { void* } "cdecl" [ + void { void* } cdecl [ int-regs param-regs first [] STMXCSR ] alien-assembly ; M: x86.64 set-sse-env - void { void* } "cdecl" [ + void { void* } cdecl [ int-regs param-regs first [] LDMXCSR ] alien-assembly ; M: x86.64 get-x87-env - void { void* } "cdecl" [ + void { void* } cdecl [ int-regs param-regs first [] FNSTSW int-regs param-regs first 2 [+] FNSTCW ] alien-assembly ; M: x86.64 set-x87-env - void { void* } "cdecl" [ + void { void* } cdecl [ FNCLEX int-regs param-regs first 2 [+] FLDCW ] alien-assembly ; diff --git a/basis/opengl/gl/macosx/macosx.factor b/basis/opengl/gl/macosx/macosx.factor index 9e095a62e6..aeaa5da4eb 100644 --- a/basis/opengl/gl/macosx/macosx.factor +++ b/basis/opengl/gl/macosx/macosx.factor @@ -3,4 +3,4 @@ IN: opengl.gl.macosx : gl-function-context ( -- context ) 0 ; inline : gl-function-address ( name -- address ) f dlsym ; inline -: gl-function-calling-convention ( -- str ) "cdecl" ; inline +: gl-function-calling-convention ( -- str ) cdecl ; inline diff --git a/basis/opengl/gl/unix/unix.factor b/basis/opengl/gl/unix/unix.factor index 3352b18350..a9d3b42b53 100644 --- a/basis/opengl/gl/unix/unix.factor +++ b/basis/opengl/gl/unix/unix.factor @@ -3,4 +3,4 @@ IN: opengl.gl.unix : gl-function-context ( -- context ) glXGetCurrentContext ; inline : gl-function-address ( name -- address ) glXGetProcAddressARB ; inline -: gl-function-calling-convention ( -- str ) "cdecl" ; inline +: gl-function-calling-convention ( -- str ) cdecl ; inline diff --git a/basis/openssl/libcrypto/libcrypto.factor b/basis/openssl/libcrypto/libcrypto.factor index f9983d7813..fb39a8e51b 100644 --- a/basis/openssl/libcrypto/libcrypto.factor +++ b/basis/openssl/libcrypto/libcrypto.factor @@ -14,9 +14,9 @@ IN: openssl.libcrypto { { [ os openbsd? ] [ ] } ! VM is linked with it { [ os netbsd? ] [ ] } - { [ os winnt? ] [ "libcrypto" "libeay32.dll" "cdecl" add-library ] } - { [ os macosx? ] [ "libcrypto" "libcrypto.dylib" "cdecl" add-library ] } - { [ os unix? ] [ "libcrypto" "libcrypto.so" "cdecl" add-library ] } + { [ os winnt? ] [ "libcrypto" "libeay32.dll" cdecl add-library ] } + { [ os macosx? ] [ "libcrypto" "libcrypto.dylib" cdecl add-library ] } + { [ os unix? ] [ "libcrypto" "libcrypto.so" cdecl add-library ] } } cond >> diff --git a/basis/openssl/libssl/libssl.factor b/basis/openssl/libssl/libssl.factor index bfd59cde25..341b35eb15 100644 --- a/basis/openssl/libssl/libssl.factor +++ b/basis/openssl/libssl/libssl.factor @@ -10,9 +10,9 @@ IN: openssl.libssl << { { [ os openbsd? ] [ ] } ! VM is linked with it { [ os netbsd? ] [ ] } - { [ os winnt? ] [ "libssl" "ssleay32.dll" "cdecl" add-library ] } - { [ os macosx? ] [ "libssl" "libssl.dylib" "cdecl" add-library ] } - { [ os unix? ] [ "libssl" "libssl.so" "cdecl" add-library ] } + { [ os winnt? ] [ "libssl" "ssleay32.dll" cdecl add-library ] } + { [ os macosx? ] [ "libssl" "libssl.dylib" cdecl add-library ] } + { [ os unix? ] [ "libssl" "libssl.so" cdecl add-library ] } } cond >> CONSTANT: X509_FILETYPE_PEM 1 diff --git a/basis/pango/cairo/cairo.factor b/basis/pango/cairo/cairo.factor index d6baaffe2e..85d4cef424 100644 --- a/basis/pango/cairo/cairo.factor +++ b/basis/pango/cairo/cairo.factor @@ -12,8 +12,8 @@ classes.struct cairo cairo.ffi ; IN: pango.cairo << { - { [ os winnt? ] [ "pangocairo" "libpangocairo-1.0-0.dll" "cdecl" add-library ] } - { [ os macosx? ] [ "pangocairo" "/opt/local/lib/libpangocairo-1.0.0.dylib" "cdecl" add-library ] } + { [ os winnt? ] [ "pangocairo" "libpangocairo-1.0-0.dll" cdecl add-library ] } + { [ os macosx? ] [ "pangocairo" "/opt/local/lib/libpangocairo-1.0.0.dylib" cdecl add-library ] } { [ os unix? ] [ ] } } cond >> diff --git a/basis/pango/pango.factor b/basis/pango/pango.factor index 6dc48e39fe..3a249c664c 100644 --- a/basis/pango/pango.factor +++ b/basis/pango/pango.factor @@ -11,8 +11,8 @@ IN: pango ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! << { - { [ os winnt? ] [ "pango" "libpango-1.0-0.dll" "cdecl" add-library ] } - { [ os macosx? ] [ "pango" "/opt/local/lib/libpango-1.0.0.dylib" "cdecl" add-library ] } + { [ os winnt? ] [ "pango" "libpango-1.0-0.dll" cdecl add-library ] } + { [ os macosx? ] [ "pango" "/opt/local/lib/libpango-1.0.0.dylib" cdecl add-library ] } { [ os unix? ] [ ] } } cond >> diff --git a/basis/tools/deploy/test/9/9.factor b/basis/tools/deploy/test/9/9.factor index 642ee48e67..73dade6657 100644 --- a/basis/tools/deploy/test/9/9.factor +++ b/basis/tools/deploy/test/9/9.factor @@ -2,9 +2,9 @@ USING: alien alien.c-types kernel math ; IN: tools.deploy.test.9 : callback-test ( -- callback ) - int { int } "cdecl" [ 1 + ] alien-callback ; + int { int } cdecl [ 1 + ] alien-callback ; : indirect-test ( -- ) - 10 callback-test int { int } "cdecl" alien-indirect 11 assert= ; + 10 callback-test int { int } cdecl alien-indirect 11 assert= ; MAIN: indirect-test diff --git a/basis/tools/disassembler/udis/udis.factor b/basis/tools/disassembler/udis/udis.factor index 5e46a34682..e998a5cfdb 100644 --- a/basis/tools/disassembler/udis/udis.factor +++ b/basis/tools/disassembler/udis/udis.factor @@ -12,7 +12,7 @@ IN: tools.disassembler.udis { [ os macosx? ] [ "libudis86.0.dylib" ] } { [ os unix? ] [ "libudis86.so.0" ] } { [ os winnt? ] [ "libudis86.dll" ] } -} cond "cdecl" add-library +} cond cdecl add-library >> LIBRARY: libudis86 diff --git a/basis/tools/profiler/profiler-tests.factor b/basis/tools/profiler/profiler-tests.factor index 5c31cdaeb4..b02b800463 100644 --- a/basis/tools/profiler/profiler-tests.factor +++ b/basis/tools/profiler/profiler-tests.factor @@ -21,9 +21,9 @@ IN: tools.profiler.tests [ ] [ \ + usage-profile. ] unit-test -: callback-test ( -- callback ) void { } "cdecl" [ ] alien-callback ; +: callback-test ( -- callback ) void { } cdecl [ ] alien-callback ; -: indirect-test ( callback -- ) void { } "cdecl" alien-indirect ; +: indirect-test ( callback -- ) void { } cdecl alien-indirect ; : foobar ( -- ) ; diff --git a/basis/unix/ffi/ffi.factor b/basis/unix/ffi/ffi.factor index 555bab32e4..1809ee4b68 100644 --- a/basis/unix/ffi/ffi.factor +++ b/basis/unix/ffi/ffi.factor @@ -156,4 +156,4 @@ FUNCTION: int unlink ( c-string path ) ; FUNCTION: int utimes ( c-string path, timeval[2] times ) ; FUNCTION: ssize_t write ( int fd, void* buf, size_t nbytes ) ; -"librt" "librt.so" "cdecl" add-library +"librt" "librt.so" cdecl add-library diff --git a/basis/windows/nt/nt.factor b/basis/windows/nt/nt.factor index 8e831e153e..2de60e524d 100644 --- a/basis/windows/nt/nt.factor +++ b/basis/windows/nt/nt.factor @@ -8,8 +8,8 @@ USING: alien sequences alien.libraries ; { "winsock" "ws2_32.dll" "stdcall" } { "mswsock" "mswsock.dll" "stdcall" } { "shell32" "shell32.dll" "stdcall" } - { "libc" "msvcrt.dll" "cdecl" } - { "libm" "msvcrt.dll" "cdecl" } + { "libc" "msvcrt.dll" cdecl } + { "libm" "msvcrt.dll" cdecl } { "gl" "opengl32.dll" "stdcall" } { "glu" "glu32.dll" "stdcall" } { "ole32" "ole32.dll" "stdcall" } diff --git a/extra/benchmark/fib6/fib6.factor b/extra/benchmark/fib6/fib6.factor index 561110d941..1ae1c6a34d 100644 --- a/extra/benchmark/fib6/fib6.factor +++ b/extra/benchmark/fib6/fib6.factor @@ -2,12 +2,12 @@ USING: math kernel alien alien.c-types ; IN: benchmark.fib6 : fib ( x -- y ) - int { int } "cdecl" [ + int { int } cdecl [ dup 1 <= [ drop 1 ] [ 1 - dup fib swap 1 - fib + ] if ] alien-callback - int { int } "cdecl" alien-indirect ; + int { int } cdecl alien-indirect ; : fib-main ( -- ) 32 fib drop ; diff --git a/extra/chipmunk/ffi/ffi.factor b/extra/chipmunk/ffi/ffi.factor index 0142b57a77..b00f64339f 100644 --- a/extra/chipmunk/ffi/ffi.factor +++ b/extra/chipmunk/ffi/ffi.factor @@ -11,7 +11,7 @@ IN: chipmunk.ffi { [ os windows? ] [ "chipmunk.dll" ] } { [ os macosx? ] [ "libchipmunk.dylib" ] } { [ os unix? ] [ "libchipmunk.so" ] } -} cond "cdecl" add-library +} cond cdecl add-library "chipmunk" deploy-library >> diff --git a/extra/curses/ffi/ffi.factor b/extra/curses/ffi/ffi.factor index 222885b72c..2b52d0ec56 100644 --- a/extra/curses/ffi/ffi.factor +++ b/extra/curses/ffi/ffi.factor @@ -8,7 +8,7 @@ IN: curses.ffi { [ os winnt? ] [ "libcurses.dll" ] } { [ os macosx? ] [ "libcurses.dylib" ] } { [ os unix? ] [ "libcurses.so" ] } -} cond "cdecl" add-library >> +} cond cdecl add-library >> C-TYPE: WINDOW C-TYPE: SCREEN diff --git a/extra/cursors/cursors-tests.factor b/extra/cursors/cursors-tests.factor index d71999ab87..770fd01ffd 100644 --- a/extra/cursors/cursors-tests.factor +++ b/extra/cursors/cursors-tests.factor @@ -1,5 +1,5 @@ ! (c)2010 Joe Groff bsd license -USING: accessors cursors make math sequences sorting tools.test ; +USING: accessors cursors kernel make math sequences sorting tools.test ; FROM: cursors => each map assoc-each assoc>map ; IN: cursors.tests @@ -12,6 +12,10 @@ IN: cursors.tests T{ linear-cursor f 1 1 } T{ linear-cursor f 5 1 } [ value>> 3 mod zero? ] -find ] unit-test +[ T{ linear-cursor f 5 1 } ] [ + T{ linear-cursor f 1 1 } T{ linear-cursor f 5 1 } [ value>> 6 = ] -find +] unit-test + [ { 1 3 } ] [ [ T{ linear-cursor f 1 2 } T{ linear-cursor f 5 2 } [ value>> , ] -each ] { } make diff --git a/extra/freetype/freetype.factor b/extra/freetype/freetype.factor index d131d2eb35..cd215ea463 100644 --- a/extra/freetype/freetype.factor +++ b/extra/freetype/freetype.factor @@ -5,8 +5,8 @@ alien.libraries classes.struct ; IN: freetype << "freetype" { - { [ os macosx? ] [ "/usr/X11R6/lib/libfreetype.6.dylib" "cdecl" add-library ] } - { [ os windows? ] [ "freetype6.dll" "cdecl" add-library ] } + { [ os macosx? ] [ "/usr/X11R6/lib/libfreetype.6.dylib" cdecl add-library ] } + { [ os windows? ] [ "freetype6.dll" cdecl add-library ] } { [ t ] [ drop ] } } cond >> diff --git a/extra/libusb/libusb.factor b/extra/libusb/libusb.factor index d521015d6f..5cae45ff95 100644 --- a/extra/libusb/libusb.factor +++ b/extra/libusb/libusb.factor @@ -11,7 +11,7 @@ IN: libusb { [ os windows? ] [ "libusb-1.0.dll" ] } { [ os macosx? ] [ "libusb-1.0.dylib" ] } { [ os unix? ] [ "libusb-1.0.so" ] } - } cond "cdecl" add-library >> + } cond cdecl add-library >> LIBRARY: libusb : libusb_cpu_to_le16 ( x -- y ) diff --git a/extra/llvm/core/core.factor b/extra/llvm/core/core.factor index f0a3cafe33..f3bf1cbaf0 100644 --- a/extra/llvm/core/core.factor +++ b/extra/llvm/core/core.factor @@ -12,7 +12,7 @@ IN: llvm.core { [ os macosx? ] [ "/usr/local/lib/lib" ".dylib" surround ] } { [ os windows? ] [ ".dll" append ] } { [ os unix? ] [ "lib" ".so" surround ] } - } cond "cdecl" add-library ; + } cond cdecl add-library ; "LLVMSystem" add-llvm-library "LLVMSupport" add-llvm-library diff --git a/extra/llvm/invoker/invoker.factor b/extra/llvm/invoker/invoker.factor index 87f39944d9..cc3480fe49 100644 --- a/extra/llvm/invoker/invoker.factor +++ b/extra/llvm/invoker/invoker.factor @@ -41,7 +41,7 @@ TUPLE: function name alien return params ; dup name>> function-pointer , dup return>> c-type , dup params>> [ second c-type ] map , - "cdecl" , \ alien-indirect , + cdecl , \ alien-indirect , ] [ ] make swap function-effect [ define-declared ] with-compilation-unit ; : install-module ( name -- ) diff --git a/extra/ogg/ogg.factor b/extra/ogg/ogg.factor index d7abece8bc..51e4621476 100644 --- a/extra/ogg/ogg.factor +++ b/extra/ogg/ogg.factor @@ -18,7 +18,7 @@ IN: ogg { [ os winnt? ] [ "ogg.dll" ] } { [ os macosx? ] [ "libogg.0.dylib" ] } { [ os unix? ] [ "libogg.so" ] } -} cond "cdecl" add-library +} cond cdecl add-library "ogg" deploy-library >> diff --git a/extra/ogg/theora/theora.factor b/extra/ogg/theora/theora.factor index eb79613496..82f4a7db51 100644 --- a/extra/ogg/theora/theora.factor +++ b/extra/ogg/theora/theora.factor @@ -19,13 +19,13 @@ IN: ogg.theora { [ os winnt? ] [ "theoradec.dll" ] } { [ os macosx? ] [ "libtheoradec.0.dylib" ] } { [ os unix? ] [ "libtheoradec.so" ] } -} cond "cdecl" add-library +} cond cdecl add-library "theoraenc" { { [ os winnt? ] [ "theoraenc.dll" ] } { [ os macosx? ] [ "libtheoraenc.0.dylib" ] } { [ os unix? ] [ "libtheoraenc.so" ] } -} cond "cdecl" add-library +} cond cdecl add-library >> CONSTANT: TH-EFAULT -1 diff --git a/extra/ogg/vorbis/vorbis.factor b/extra/ogg/vorbis/vorbis.factor index ad43750e27..3cefbeebec 100644 --- a/extra/ogg/vorbis/vorbis.factor +++ b/extra/ogg/vorbis/vorbis.factor @@ -19,7 +19,7 @@ IN: ogg.vorbis { [ os winnt? ] [ "vorbis.dll" ] } { [ os macosx? ] [ "libvorbis.0.dylib" ] } { [ os unix? ] [ "libvorbis.so" ] } -} cond "cdecl" add-library +} cond cdecl add-library "vorbis" deploy-library >> diff --git a/extra/openal/alut/alut.factor b/extra/openal/alut/alut.factor index 0bf8511647..07b2e4c2b6 100755 --- a/extra/openal/alut/alut.factor +++ b/extra/openal/alut/alut.factor @@ -14,7 +14,7 @@ IN: openal.alut "/System/Library/Frameworks/OpenAL.framework/OpenAL" ] } { [ os unix? ] [ "libalut.so" ] } - } cond "cdecl" add-library >> + } cond cdecl add-library >> << os macosx? [ "alut" deploy-library ] unless >> diff --git a/extra/openal/openal.factor b/extra/openal/openal.factor index bbe61f9dc3..853b33b386 100755 --- a/extra/openal/openal.factor +++ b/extra/openal/openal.factor @@ -14,7 +14,7 @@ IN: openal "/System/Library/Frameworks/OpenAL.framework/OpenAL" ] } { [ os unix? ] [ "libopenal.so" ] } - } cond "cdecl" add-library >> + } cond cdecl add-library >> << os macosx? [ "openal" deploy-library ] unless >> diff --git a/extra/opengl/glu/glu.factor b/extra/opengl/glu/glu.factor index 86936fdd65..856740d229 100644 --- a/extra/opengl/glu/glu.factor +++ b/extra/opengl/glu/glu.factor @@ -9,7 +9,7 @@ IN: opengl.glu os { { [ dup macosx? ] [ drop ] } { [ dup windows? ] [ drop ] } - { [ dup unix? ] [ drop "glu" "libGLU.so.1" "cdecl" add-library ] } + { [ dup unix? ] [ drop "glu" "libGLU.so.1" cdecl add-library ] } } cond >> diff --git a/extra/tokyo/alien/tcrdb/tcrdb.factor b/extra/tokyo/alien/tcrdb/tcrdb.factor index da4a750444..07c5eabeea 100644 --- a/extra/tokyo/alien/tcrdb/tcrdb.factor +++ b/extra/tokyo/alien/tcrdb/tcrdb.factor @@ -9,7 +9,7 @@ IN: tokyo.alien.tcrdb { [ os macosx? ] [ "/opt/local/lib/libtokyotyrant.dylib" ] } { [ os unix? ] [ "libtokyotyrant.so" ] } { [ os windows? ] [ "tokyotyrant.dll" ] } -} cond "cdecl" add-library >> +} cond cdecl add-library >> LIBRARY: tokyotyrant diff --git a/extra/tokyo/alien/tcutil/tcutil.factor b/extra/tokyo/alien/tcutil/tcutil.factor index afb78dba22..ee92348bb4 100644 --- a/extra/tokyo/alien/tcutil/tcutil.factor +++ b/extra/tokyo/alien/tcutil/tcutil.factor @@ -8,7 +8,7 @@ IN: tokyo.alien.tcutil { [ os macosx? ] [ "/opt/local/lib/libtokyocabinet.dylib" ] } { [ os unix? ] [ "libtokyocabinet.so" ] } { [ os windows? ] [ "tokyocabinet.dll" ] } -} cond "cdecl" add-library >> +} cond cdecl add-library >> LIBRARY: tokyocabinet diff --git a/unmaintained/alien/inline/inline.factor b/unmaintained/alien/inline/inline.factor index ee69d954ea..6428bead75 100644 --- a/unmaintained/alien/inline/inline.factor +++ b/unmaintained/alien/inline/inline.factor @@ -76,7 +76,7 @@ PRIVATE> : compile-c-library ( -- ) compile-library? [ compile-library ] when - c-library get dup library-path "cdecl" add-library ; + c-library get dup library-path cdecl add-library ; : define-c-function ( function types effect body -- ) [ diff --git a/unmaintained/cryptlib/libcl/libcl.factor b/unmaintained/cryptlib/libcl/libcl.factor index 38e6817f6c..f38ee856a1 100644 --- a/unmaintained/cryptlib/libcl/libcl.factor +++ b/unmaintained/cryptlib/libcl/libcl.factor @@ -14,8 +14,8 @@ IN: cryptlib.libcl << "libcl" { { [ win32? ] [ "cl32.dll" "stdcall" ] } - { [ macosx? ] [ "libcl.dylib" "cdecl" ] } - { [ unix? ] [ "libcl.so" "cdecl" ] } + { [ macosx? ] [ "libcl.dylib" cdecl ] } + { [ unix? ] [ "libcl.so" cdecl ] } } cond add-library >> ! =============================================== diff --git a/unmaintained/db/mysql/ffi/ffi.factor b/unmaintained/db/mysql/ffi/ffi.factor index c047393c99..1f50035a81 100644 --- a/unmaintained/db/mysql/ffi/ffi.factor +++ b/unmaintained/db/mysql/ffi/ffi.factor @@ -7,8 +7,8 @@ IN: db.mysql.ffi << "mysql" { { [ os winnt? ] [ "libmySQL.dll" "stdcall" ] } - { [ os macosx? ] [ "libmysqlclient.14.dylib" "cdecl" ] } - { [ os unix? ] [ "libmysqlclient.so.14" "cdecl" ] } + { [ os macosx? ] [ "libmysqlclient.14.dylib" cdecl ] } + { [ os unix? ] [ "libmysqlclient.so.14" cdecl ] } } cond add-library >> LIBRARY: mysql diff --git a/unmaintained/jni/jni-internals.factor b/unmaintained/jni/jni-internals.factor index 49bc57b108..d809d899de 100644 --- a/unmaintained/jni/jni-internals.factor +++ b/unmaintained/jni/jni-internals.factor @@ -296,61 +296,61 @@ FUNCTION: jint JNI_CreateJavaVM ( void** pvm, void** penv, void* args ) ; ] when ; : (destroy-java-vm) - "int" { "void*" } "cdecl" alien-indirect ; + "int" { "void*" } cdecl alien-indirect ; : (attach-current-thread) - "int" { "void*" "void*" "void*" } "cdecl" alien-indirect ; + "int" { "void*" "void*" "void*" } cdecl alien-indirect ; : (detach-current-thread) - "int" { "void*" } "cdecl" alien-indirect ; + "int" { "void*" } cdecl alien-indirect ; : (get-env) - "int" { "void*" "void*" "int" } "cdecl" alien-indirect ; + "int" { "void*" "void*" "int" } cdecl alien-indirect ; : (attach-current-thread-as-daemon) - "int" { "void*" "void*" "void*" } "cdecl" alien-indirect ; + "int" { "void*" "void*" "void*" } cdecl alien-indirect ; : destroy-java-vm ( javavm -- int ) dup JavaVM-functions JNIInvokeInterface-DestroyJavaVM (destroy-java-vm) ; : (get-version) - "jint" { "JNIEnv*" } "cdecl" alien-indirect ; + "jint" { "JNIEnv*" } cdecl alien-indirect ; : get-version ( jnienv -- int ) dup JNIEnv-functions JNINativeInterface-GetVersion (get-version) ; : (find-class) - "void*" { "JNINativeInterface*" "char*" } "cdecl" alien-indirect ; + "void*" { "JNINativeInterface*" "char*" } cdecl alien-indirect ; : find-class ( name jnienv -- int ) dup swapd JNIEnv-functions JNINativeInterface-FindClass (find-class) ; : (get-static-field-id) - "void*" { "JNINativeInterface*" "void*" "char*" "char*" } "cdecl" alien-indirect ; + "void*" { "JNINativeInterface*" "void*" "char*" "char*" } cdecl alien-indirect ; : get-static-field-id ( class name sig jnienv -- int ) dup >r >r 3array r> swap first3 r> JNIEnv-functions JNINativeInterface-GetStaticFieldID (get-static-field-id) ; : (get-static-object-field) - "void*" { "JNINativeInterface*" "void*" "void*" } "cdecl" alien-indirect ; + "void*" { "JNINativeInterface*" "void*" "void*" } cdecl alien-indirect ; : get-static-object-field ( class id jnienv -- int ) dup >r >r 2array r> swap first2 r> JNIEnv-functions JNINativeInterface-GetStaticObjectField (get-static-object-field) ; : (get-method-id) - "void*" { "JNINativeInterface*" "void*" "char*" "char*" } "cdecl" alien-indirect ; + "void*" { "JNINativeInterface*" "void*" "char*" "char*" } cdecl alien-indirect ; : get-method-id ( class name sig jnienv -- int ) dup >r >r 3array r> swap first3 r> JNIEnv-functions JNINativeInterface-GetMethodID (get-method-id) ; : (new-string) - "void*" { "JNINativeInterface*" "char*" "int" } "cdecl" alien-indirect ; + "void*" { "JNINativeInterface*" "char*" "int" } cdecl alien-indirect ; : new-string ( str jnienv -- str ) dup >r >r dup length 2array r> swap first2 r> JNIEnv-functions JNINativeInterface-NewString (new-string) ; : (call1) - "void" { "JNINativeInterface*" "void*" "void*" "int" } "cdecl" alien-indirect ; + "void" { "JNINativeInterface*" "void*" "void*" "int" } cdecl alien-indirect ; : call1 ( obj method-id jstr jnienv -- ) dup >r >r 3array r> swap first3 r> JNIEnv-functions JNINativeInterface-CallObjectMethod (call1) ; diff --git a/unmaintained/ldap/libldap/libldap.factor b/unmaintained/ldap/libldap/libldap.factor index 6db6884071..83d31ed968 100644 --- a/unmaintained/ldap/libldap/libldap.factor +++ b/unmaintained/ldap/libldap/libldap.factor @@ -11,8 +11,8 @@ IN: ldap.libldap << "libldap" { { [ win32? ] [ "libldap.dll" "stdcall" ] } - { [ macosx? ] [ "libldap.dylib" "cdecl" ] } - { [ unix? ] [ "libldap.so" "cdecl" ] } + { [ macosx? ] [ "libldap.dylib" cdecl ] } + { [ unix? ] [ "libldap.so" cdecl ] } } cond add-library >> : LDAP_VERSION1 1 ; inline diff --git a/unmaintained/lint/lint.factor b/unmaintained/lint/lint.factor index 9877c70062..093a110fba 100644 --- a/unmaintained/lint/lint.factor +++ b/unmaintained/lint/lint.factor @@ -52,7 +52,7 @@ SYMBOL: def-hash-keys [ t ] [ f ] [ { } ] [ drop f ] - [ "cdecl" ] + [ cdecl ] [ first ] [ second ] [ third ] [ fourth ] [ ">" write ] [ "/>" write ] } ; diff --git a/unmaintained/oracle/liboci/liboci.factor b/unmaintained/oracle/liboci/liboci.factor index aa04aef39f..71473ea7c8 100644 --- a/unmaintained/oracle/liboci/liboci.factor +++ b/unmaintained/oracle/liboci/liboci.factor @@ -13,8 +13,8 @@ IN: oracle.liboci "oci" { { [ os winnt? ] [ "oci.dll" "stdcall" ] } - { [ os macosx? ] [ "$DYLD_LIBRARY_PATH/libclntsh.dylib" "cdecl" ] } - { [ os unix? ] [ "$DYLD_LIBRARY_PATH/libclntsh.so.10.1" "cdecl" ] } + { [ os macosx? ] [ "$DYLD_LIBRARY_PATH/libclntsh.dylib" cdecl ] } + { [ os unix? ] [ "$DYLD_LIBRARY_PATH/libclntsh.so.10.1" cdecl ] } } cond add-library ! =============================================== diff --git a/unmaintained/pdf/libhpdf/libhpdf.factor b/unmaintained/pdf/libhpdf/libhpdf.factor index a40b7cddee..a3d5dd574f 100644 --- a/unmaintained/pdf/libhpdf/libhpdf.factor +++ b/unmaintained/pdf/libhpdf/libhpdf.factor @@ -11,8 +11,8 @@ IN: pdf.libhpdf << "libhpdf" { { [ win32? ] [ "libhpdf.dll" "stdcall" ] } - { [ macosx? ] [ "libhpdf.dylib" "cdecl" ] } - { [ unix? ] [ "$LD_LIBRARY_PATH/libhpdf.so" "cdecl" ] } + { [ macosx? ] [ "libhpdf.dylib" cdecl ] } + { [ unix? ] [ "$LD_LIBRARY_PATH/libhpdf.so" cdecl ] } } cond add-library >> ! compression mode From a6ee4232bb3752f4c289fd98ac1bc49127c4d40b Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 31 Mar 2010 19:28:11 -0700 Subject: [PATCH 003/157] "mingw" -> mingw --- basis/cpu/x86/32/32.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/cpu/x86/32/32.factor b/basis/cpu/x86/32/32.factor index 09f1ecb32b..38e60cddf9 100755 --- a/basis/cpu/x86/32/32.factor +++ b/basis/cpu/x86/32/32.factor @@ -297,7 +297,7 @@ M:: x86.32 %binary-float-function ( dst src1 src2 func -- ) : funny-large-struct-return? ( params -- ? ) #! MINGW ABI incompatibility disaster [ return>> large-struct? ] - [ abi>> "mingw" = os windows? not or ] + [ abi>> mingw = os windows? not or ] bi and ; M: x86.32 %cleanup ( params -- ) From f3dd625de6c50baefff1977c692f634fb2f0dfa8 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 31 Mar 2010 19:29:04 -0700 Subject: [PATCH 004/157] "stdcall" -> stdcall --- basis/alien/libraries/libraries-docs.factor | 4 +- basis/compiler/codegen/codegen.factor | 2 +- basis/compiler/tests/alien.factor | 6 +-- basis/cpu/x86/32/32.factor | 2 +- basis/io/sockets/windows/nt/nt.factor | 2 +- basis/opengl/gl/windows/windows.factor | 2 +- basis/ui/backend/windows/windows.factor | 2 +- basis/windows/ce/ce.factor | 22 ++++---- basis/windows/com/syntax/syntax.factor | 2 +- basis/windows/com/wrapper/wrapper.factor | 2 +- basis/windows/ddk/hid/hid.factor | 2 +- basis/windows/ddk/setupapi/setupapi.factor | 2 +- basis/windows/ddk/winusb/winusb.factor | 2 +- basis/windows/dwmapi/dwmapi.factor | 2 +- basis/windows/nt/nt.factor | 60 ++++++++++----------- extra/opencl/ffi/ffi.factor | 2 +- unmaintained/cryptlib/libcl/libcl.factor | 2 +- unmaintained/db/mysql/ffi/ffi.factor | 2 +- unmaintained/ldap/libldap/libldap.factor | 2 +- unmaintained/odbc/odbc.factor | 2 +- unmaintained/oracle/liboci/liboci.factor | 2 +- unmaintained/pdf/libhpdf/libhpdf.factor | 2 +- 22 files changed, 64 insertions(+), 64 deletions(-) diff --git a/basis/alien/libraries/libraries-docs.factor b/basis/alien/libraries/libraries-docs.factor index be1a7c7ad6..7ee953581a 100644 --- a/basis/alien/libraries/libraries-docs.factor +++ b/basis/alien/libraries/libraries-docs.factor @@ -6,7 +6,7 @@ IN: alien.libraries HELP: { $values - { "path" "a pathname string" } { "abi" "the ABI used by the library, either " { $snippet cdecl } " or " { $snippet "stdcall" } } + { "path" "a pathname string" } { "abi" "the ABI used by the library, either " { $snippet cdecl } " or " { $snippet stdcall } } { "library" library } } { $description "Opens a C library using the path and ABI parameters and outputs a library tuple." } { $notes "User code should use " { $link add-library } " so that the opened library is added to a global hashtable, " { $link libraries } "." } ; @@ -19,7 +19,7 @@ HELP: library { $description "Looks up a library by its logical name. The library object is a hashtable with the following keys:" { $list { { $snippet "name" } " - the full path of the C library binary" } - { { $snippet "abi" } " - the ABI used by the library, either " { $snippet cdecl } " or " { $snippet "stdcall" } } + { { $snippet "abi" } " - the ABI used by the library, either " { $snippet cdecl } " or " { $snippet stdcall } } { { $snippet "dll" } " - an instance of the " { $link dll } " class; only set if the library is loaded" } } } ; diff --git a/basis/compiler/codegen/codegen.factor b/basis/compiler/codegen/codegen.factor index d82ced8a1d..d8f0823d44 100755 --- a/basis/compiler/codegen/codegen.factor +++ b/basis/compiler/codegen/codegen.factor @@ -412,7 +412,7 @@ M: array dlsym-valid? '[ _ dlsym ] any? ; 3array ; : alien-invoke-dlsym ( params -- symbols dll ) - [ dup abi>> "stdcall" = [ stdcall-mangle ] [ function>> ] if ] + [ dup abi>> stdcall = [ stdcall-mangle ] [ function>> ] if ] [ library>> load-library ] bi 2dup check-dlsym ; diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index a813c530f7..71efe8a929 100755 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -21,7 +21,7 @@ IN: compiler.tests.alien "f-cdecl" libfactor-ffi-tests-path cdecl add-library -"f-stdcall" libfactor-ffi-tests-path "stdcall" add-library +"f-stdcall" libfactor-ffi-tests-path stdcall add-library >> LIBRARY: f-cdecl @@ -117,11 +117,11 @@ FUNCTION: TINY ffi_test_17 int x ; unit-test : indirect-test-3 ( a b c d ptr -- result ) - int { int int int int } "stdcall" alien-indirect + int { int int int int } stdcall alien-indirect gc ; [ f ] [ "f-stdcall" load-library f = ] unit-test -[ "stdcall" ] [ "f-stdcall" library abi>> ] unit-test +[ stdcall ] [ "f-stdcall" library abi>> ] unit-test : ffi_test_18 ( w x y z -- int ) int "f-stdcall" "ffi_test_18" { int int int int } diff --git a/basis/cpu/x86/32/32.factor b/basis/cpu/x86/32/32.factor index 38e60cddf9..c96d961d65 100755 --- a/basis/cpu/x86/32/32.factor +++ b/basis/cpu/x86/32/32.factor @@ -292,7 +292,7 @@ M:: x86.32 %binary-float-function ( dst src1 src2 func -- ) dst float-function-return ; : stdcall? ( params -- ? ) - abi>> "stdcall" = ; + abi>> stdcall = ; : funny-large-struct-return? ( params -- ? ) #! MINGW ABI incompatibility disaster diff --git a/basis/io/sockets/windows/nt/nt.factor b/basis/io/sockets/windows/nt/nt.factor index 8eb2df5b46..7a961518a0 100644 --- a/basis/io/sockets/windows/nt/nt.factor +++ b/basis/io/sockets/windows/nt/nt.factor @@ -57,7 +57,7 @@ TUPLE: ConnectEx-args port } cleave int { SOCKET void* int PVOID DWORD LPDWORD void* } - "stdcall" alien-indirect drop + stdcall alien-indirect drop winsock-error-string [ throw ] when* ; inline M: object establish-connection ( client-out remote -- ) diff --git a/basis/opengl/gl/windows/windows.factor b/basis/opengl/gl/windows/windows.factor index 8bceb865e2..2ac9894b9a 100644 --- a/basis/opengl/gl/windows/windows.factor +++ b/basis/opengl/gl/windows/windows.factor @@ -8,4 +8,4 @@ FUNCTION: void* wglGetProcAddress ( c-string name ) ; : gl-function-context ( -- context ) wglGetCurrentContext ; inline : gl-function-address ( name -- address ) wglGetProcAddress ; inline -: gl-function-calling-convention ( -- str ) "stdcall" ; inline +: gl-function-calling-convention ( -- str ) stdcall ; inline diff --git a/basis/ui/backend/windows/windows.factor b/basis/ui/backend/windows/windows.factor index 8a4ae9853f..626faf4274 100644 --- a/basis/ui/backend/windows/windows.factor +++ b/basis/ui/backend/windows/windows.factor @@ -609,7 +609,7 @@ SYMBOL: trace-messages? ! return 0 if you handle the message, else just let DefWindowProc return its val : ui-wndproc ( -- object ) - uint { void* uint long long } "stdcall" [ + uint { void* uint long long } stdcall [ pick trace-messages? get-global [ dup windows-message-name name>> print flush ] when wm-handlers get-global at* [ call ] [ drop DefWindowProc ] if diff --git a/basis/windows/ce/ce.factor b/basis/windows/ce/ce.factor index ff6a9ad4fc..614a535ea0 100644 --- a/basis/windows/ce/ce.factor +++ b/basis/windows/ce/ce.factor @@ -1,14 +1,14 @@ USING: alien sequences alien.libraries ; { - { "advapi32" "\\windows\\coredll.dll" "stdcall" } - { "gdi32" "\\windows\\coredll.dll" "stdcall" } - { "user32" "\\windows\\coredll.dll" "stdcall" } - { "kernel32" "\\windows\\coredll.dll" "stdcall" } - { "winsock" "\\windows\\ws2.dll" "stdcall" } - { "mswsock" "\\windows\\ws2.dll" "stdcall" } - { "libc" "\\windows\\coredll.dll" "stdcall" } - { "libm" "\\windows\\coredll.dll" "stdcall" } - ! { "gl" "libGLES_CM.dll" "stdcall" } - ! { "glu" "libGLES_CM.dll" "stdcall" } - { "ole32" "ole32.dll" "stdcall" } + { "advapi32" "\\windows\\coredll.dll" stdcall } + { "gdi32" "\\windows\\coredll.dll" stdcall } + { "user32" "\\windows\\coredll.dll" stdcall } + { "kernel32" "\\windows\\coredll.dll" stdcall } + { "winsock" "\\windows\\ws2.dll" stdcall } + { "mswsock" "\\windows\\ws2.dll" stdcall } + { "libc" "\\windows\\coredll.dll" stdcall } + { "libm" "\\windows\\coredll.dll" stdcall } + ! { "gl" "libGLES_CM.dll" stdcall } + ! { "glu" "libGLES_CM.dll" stdcall } + { "ole32" "ole32.dll" stdcall } } [ first3 add-library ] each diff --git a/basis/windows/com/syntax/syntax.factor b/basis/windows/com/syntax/syntax.factor index 78a3c0e6d2..9d74ac49f8 100644 --- a/basis/windows/com/syntax/syntax.factor +++ b/basis/windows/com/syntax/syntax.factor @@ -12,7 +12,7 @@ MACRO: com-invoke ( n return parameters -- ) [ 2nip length ] 3keep '[ _ npick *void* _ cell * alien-cell _ _ - "stdcall" alien-indirect + stdcall alien-indirect ] ; TUPLE: com-interface-definition word parent iid functions ; diff --git a/basis/windows/com/wrapper/wrapper.factor b/basis/windows/com/wrapper/wrapper.factor index 25861659dc..6f92c8b860 100644 --- a/basis/windows/com/wrapper/wrapper.factor +++ b/basis/windows/com/wrapper/wrapper.factor @@ -114,7 +114,7 @@ unless ] [ first2 (finish-thunk) ] bi* - "stdcall" swap compile-alien-callback + stdcall swap compile-alien-callback ] 2map ; : (make-callbacks) ( implementations -- sequence ) diff --git a/basis/windows/ddk/hid/hid.factor b/basis/windows/ddk/hid/hid.factor index 9c8a55ee7c..25c2642e34 100644 --- a/basis/windows/ddk/hid/hid.factor +++ b/basis/windows/ddk/hid/hid.factor @@ -4,7 +4,7 @@ USING: alien.c-types alien.libraries alien.syntax classes.struct kernel math windows.types windows.ole32 ; IN: windows.ddk.hid -<< "hid" "hid.dll" "stdcall" add-library >> +<< "hid" "hid.dll" stdcall add-library >> LIBRARY: hid TYPEDEF: LONG NTSTATUS diff --git a/basis/windows/ddk/setupapi/setupapi.factor b/basis/windows/ddk/setupapi/setupapi.factor index 06d32725f7..45ecebee74 100644 --- a/basis/windows/ddk/setupapi/setupapi.factor +++ b/basis/windows/ddk/setupapi/setupapi.factor @@ -4,7 +4,7 @@ USING: literals windows.kernel32 math alien.syntax windows.types classes.struct alien.c-types windows.errors windows.ole32 windows.advapi32 alien.libraries ; IN: windows.ddk.setupapi -<< "setupapi" "setupapi.dll" "stdcall" add-library >> +<< "setupapi" "setupapi.dll" stdcall add-library >> LIBRARY: setupapi TYPEDEF: DWORDLONG SP_LOG_TOKEN diff --git a/basis/windows/ddk/winusb/winusb.factor b/basis/windows/ddk/winusb/winusb.factor index 3b98e7e8ca..12ce137901 100644 --- a/basis/windows/ddk/winusb/winusb.factor +++ b/basis/windows/ddk/winusb/winusb.factor @@ -4,7 +4,7 @@ USING: alien.c-types alien.syntax classes.struct windows.kernel32 windows.types alien.libraries ; IN: windows.ddk.winusb -<< "winusb" "winusb.dll" "stdcall" add-library >> +<< "winusb" "winusb.dll" stdcall add-library >> LIBRARY: winusb TYPEDEF: PVOID WINUSB_INTERFACE_HANDLE diff --git a/basis/windows/dwmapi/dwmapi.factor b/basis/windows/dwmapi/dwmapi.factor index 998846ebc2..8f68643e0a 100644 --- a/basis/windows/dwmapi/dwmapi.factor +++ b/basis/windows/dwmapi/dwmapi.factor @@ -21,7 +21,7 @@ STRUCT: DWM_BLURBEHIND : full-window-margins ( -- MARGINS ) -1 -1 -1 -1 ; inline -<< "dwmapi" "dwmapi.dll" "stdcall" add-library >> +<< "dwmapi" "dwmapi.dll" stdcall add-library >> LIBRARY: dwmapi diff --git a/basis/windows/nt/nt.factor b/basis/windows/nt/nt.factor index 2de60e524d..4b119ba5fa 100644 --- a/basis/windows/nt/nt.factor +++ b/basis/windows/nt/nt.factor @@ -1,35 +1,35 @@ USING: alien sequences alien.libraries ; { - { "advapi32" "advapi32.dll" "stdcall" } - { "dinput" "dinput8.dll" "stdcall" } - { "gdi32" "gdi32.dll" "stdcall" } - { "user32" "user32.dll" "stdcall" } - { "kernel32" "kernel32.dll" "stdcall" } - { "winsock" "ws2_32.dll" "stdcall" } - { "mswsock" "mswsock.dll" "stdcall" } - { "shell32" "shell32.dll" "stdcall" } + { "advapi32" "advapi32.dll" stdcall } + { "dinput" "dinput8.dll" stdcall } + { "gdi32" "gdi32.dll" stdcall } + { "user32" "user32.dll" stdcall } + { "kernel32" "kernel32.dll" stdcall } + { "winsock" "ws2_32.dll" stdcall } + { "mswsock" "mswsock.dll" stdcall } + { "shell32" "shell32.dll" stdcall } { "libc" "msvcrt.dll" cdecl } { "libm" "msvcrt.dll" cdecl } - { "gl" "opengl32.dll" "stdcall" } - { "glu" "glu32.dll" "stdcall" } - { "ole32" "ole32.dll" "stdcall" } - { "usp10" "usp10.dll" "stdcall" } - { "psapi" "psapi.dll" "stdcall" } - { "xinput" "xinput1_3.dll" "stdcall" } - { "dxgi" "dxgi.dll" "stdcall" } - { "d2d1" "d2d1.dll" "stdcall" } - { "d3d9" "d3d9.dll" "stdcall" } - { "d3d10" "d3d10.dll" "stdcall" } - { "d3d10_1" "d3d10_1.dll" "stdcall" } - { "d3d11" "d3d11.dll" "stdcall" } - { "d3dcompiler" "d3dcompiler_42.dll" "stdcall" } - { "d3dcsx" "d3dcsx_42.dll" "stdcall" } - { "d3dx9" "d3dx9_42.dll" "stdcall" } - { "d3dx10" "d3dx10_42.dll" "stdcall" } - { "d3dx11" "d3dx11_42.dll" "stdcall" } - { "dwrite" "dwrite.dll" "stdcall" } - { "x3daudio" "x3daudio1_6.dll" "stdcall" } - { "xactengine" "xactengine3_5.dll" "stdcall" } - { "xapofx" "xapofx1_3.dll" "stdcall" } - { "xaudio2" "xaudio2_5.dll" "stdcall" } + { "gl" "opengl32.dll" stdcall } + { "glu" "glu32.dll" stdcall } + { "ole32" "ole32.dll" stdcall } + { "usp10" "usp10.dll" stdcall } + { "psapi" "psapi.dll" stdcall } + { "xinput" "xinput1_3.dll" stdcall } + { "dxgi" "dxgi.dll" stdcall } + { "d2d1" "d2d1.dll" stdcall } + { "d3d9" "d3d9.dll" stdcall } + { "d3d10" "d3d10.dll" stdcall } + { "d3d10_1" "d3d10_1.dll" stdcall } + { "d3d11" "d3d11.dll" stdcall } + { "d3dcompiler" "d3dcompiler_42.dll" stdcall } + { "d3dcsx" "d3dcsx_42.dll" stdcall } + { "d3dx9" "d3dx9_42.dll" stdcall } + { "d3dx10" "d3dx10_42.dll" stdcall } + { "d3dx11" "d3dx11_42.dll" stdcall } + { "dwrite" "dwrite.dll" stdcall } + { "x3daudio" "x3daudio1_6.dll" stdcall } + { "xactengine" "xactengine3_5.dll" stdcall } + { "xapofx" "xapofx1_3.dll" stdcall } + { "xaudio2" "xaudio2_5.dll" stdcall } } [ first3 add-library ] each diff --git a/extra/opencl/ffi/ffi.factor b/extra/opencl/ffi/ffi.factor index 8f0400dd20..9ee2135cb6 100644 --- a/extra/opencl/ffi/ffi.factor +++ b/extra/opencl/ffi/ffi.factor @@ -8,7 +8,7 @@ IN: opencl.ffi { [ os windows? ] [ "OpenCL.dll" ] } { [ os macosx? ] [ "/System/Library/Frameworks/OpenCL.framework/OpenCL" ] } { [ os unix? ] [ "libOpenCL.so" ] } - } cond "stdcall" add-library >> + } cond stdcall add-library >> LIBRARY: opencl ! cl_platform.h diff --git a/unmaintained/cryptlib/libcl/libcl.factor b/unmaintained/cryptlib/libcl/libcl.factor index f38ee856a1..8895d0b3a6 100644 --- a/unmaintained/cryptlib/libcl/libcl.factor +++ b/unmaintained/cryptlib/libcl/libcl.factor @@ -13,7 +13,7 @@ USING: alien kernel system combinators alien.syntax ; IN: cryptlib.libcl << "libcl" { - { [ win32? ] [ "cl32.dll" "stdcall" ] } + { [ win32? ] [ "cl32.dll" stdcall ] } { [ macosx? ] [ "libcl.dylib" cdecl ] } { [ unix? ] [ "libcl.so" cdecl ] } } cond add-library >> diff --git a/unmaintained/db/mysql/ffi/ffi.factor b/unmaintained/db/mysql/ffi/ffi.factor index 1f50035a81..98fd0b38cb 100644 --- a/unmaintained/db/mysql/ffi/ffi.factor +++ b/unmaintained/db/mysql/ffi/ffi.factor @@ -6,7 +6,7 @@ USING: alien alien.syntax combinators kernel system ; IN: db.mysql.ffi << "mysql" { - { [ os winnt? ] [ "libmySQL.dll" "stdcall" ] } + { [ os winnt? ] [ "libmySQL.dll" stdcall ] } { [ os macosx? ] [ "libmysqlclient.14.dylib" cdecl ] } { [ os unix? ] [ "libmysqlclient.so.14" cdecl ] } } cond add-library >> diff --git a/unmaintained/ldap/libldap/libldap.factor b/unmaintained/ldap/libldap/libldap.factor index 83d31ed968..9b7dd36a69 100644 --- a/unmaintained/ldap/libldap/libldap.factor +++ b/unmaintained/ldap/libldap/libldap.factor @@ -10,7 +10,7 @@ USING: alien alien.syntax combinators kernel system ; IN: ldap.libldap << "libldap" { - { [ win32? ] [ "libldap.dll" "stdcall" ] } + { [ win32? ] [ "libldap.dll" stdcall ] } { [ macosx? ] [ "libldap.dylib" cdecl ] } { [ unix? ] [ "libldap.so" cdecl ] } } cond add-library >> diff --git a/unmaintained/odbc/odbc.factor b/unmaintained/odbc/odbc.factor index 06d47b8937..6dcddb5bd5 100644 --- a/unmaintained/odbc/odbc.factor +++ b/unmaintained/odbc/odbc.factor @@ -5,7 +5,7 @@ combinators alien.c-types strings sequences namespaces make words math threads io.encodings.ascii ; IN: odbc -<< "odbc" "odbc32.dll" "stdcall" add-library >> +<< "odbc" "odbc32.dll" stdcall add-library >> LIBRARY: odbc diff --git a/unmaintained/oracle/liboci/liboci.factor b/unmaintained/oracle/liboci/liboci.factor index 71473ea7c8..4e8ebfc860 100644 --- a/unmaintained/oracle/liboci/liboci.factor +++ b/unmaintained/oracle/liboci/liboci.factor @@ -12,7 +12,7 @@ USING: alien alien.syntax combinators kernel system ; IN: oracle.liboci "oci" { - { [ os winnt? ] [ "oci.dll" "stdcall" ] } + { [ os winnt? ] [ "oci.dll" stdcall ] } { [ os macosx? ] [ "$DYLD_LIBRARY_PATH/libclntsh.dylib" cdecl ] } { [ os unix? ] [ "$DYLD_LIBRARY_PATH/libclntsh.so.10.1" cdecl ] } } cond add-library diff --git a/unmaintained/pdf/libhpdf/libhpdf.factor b/unmaintained/pdf/libhpdf/libhpdf.factor index a3d5dd574f..c365f6944f 100644 --- a/unmaintained/pdf/libhpdf/libhpdf.factor +++ b/unmaintained/pdf/libhpdf/libhpdf.factor @@ -10,7 +10,7 @@ USING: alien alien.syntax combinators system ; IN: pdf.libhpdf << "libhpdf" { - { [ win32? ] [ "libhpdf.dll" "stdcall" ] } + { [ win32? ] [ "libhpdf.dll" stdcall ] } { [ macosx? ] [ "libhpdf.dylib" cdecl ] } { [ unix? ] [ "$LD_LIBRARY_PATH/libhpdf.so" cdecl ] } } cond add-library >> From 98d1e7d00663d84024e8d31244c28542571ad59d Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 31 Mar 2010 19:57:04 -0700 Subject: [PATCH 005/157] update alien.libraries docs to link cdecl/stdcall symbols --- basis/alien/libraries/libraries-docs.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basis/alien/libraries/libraries-docs.factor b/basis/alien/libraries/libraries-docs.factor index 7ee953581a..d2e510e0e9 100644 --- a/basis/alien/libraries/libraries-docs.factor +++ b/basis/alien/libraries/libraries-docs.factor @@ -6,7 +6,7 @@ IN: alien.libraries HELP: { $values - { "path" "a pathname string" } { "abi" "the ABI used by the library, either " { $snippet cdecl } " or " { $snippet stdcall } } + { "path" "a pathname string" } { "abi" "the ABI used by the library, either " { $link cdecl } " or " { $link stdcall } } { "library" library } } { $description "Opens a C library using the path and ABI parameters and outputs a library tuple." } { $notes "User code should use " { $link add-library } " so that the opened library is added to a global hashtable, " { $link libraries } "." } ; @@ -19,7 +19,7 @@ HELP: library { $description "Looks up a library by its logical name. The library object is a hashtable with the following keys:" { $list { { $snippet "name" } " - the full path of the C library binary" } - { { $snippet "abi" } " - the ABI used by the library, either " { $snippet cdecl } " or " { $snippet stdcall } } + { { $snippet "abi" } " - the ABI used by the library, either " { $link cdecl } " or " { $link stdcall } } { { $snippet "dll" } " - an instance of the " { $link dll } " class; only set if the library is loaded" } } } ; From 6805dc6401490baaef6d83ab7889f3d51a1f3b37 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 31 Mar 2010 19:57:29 -0700 Subject: [PATCH 006/157] =?UTF-8?q?remove=20redundant=20=C2=ABstdcall=3F?= =?UTF-8?q?=C2=BB=20word=20from=20cpu.x86.32?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- basis/cpu/x86/32/32.factor | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/basis/cpu/x86/32/32.factor b/basis/cpu/x86/32/32.factor index c96d961d65..d296b730d2 100755 --- a/basis/cpu/x86/32/32.factor +++ b/basis/cpu/x86/32/32.factor @@ -291,9 +291,6 @@ M:: x86.32 %binary-float-function ( dst src1 src2 func -- ) func "libm" load-library %alien-invoke dst float-function-return ; -: stdcall? ( params -- ? ) - abi>> stdcall = ; - : funny-large-struct-return? ( params -- ? ) #! MINGW ABI incompatibility disaster [ return>> large-struct? ] @@ -307,7 +304,7 @@ M: x86.32 %cleanup ( params -- ) #! b) If we just called a function returning a struct, we #! have to fix ESP. { - { [ dup stdcall? ] [ drop ESP stack-frame get params>> SUB ] } + { [ dup abi>> stdcall? ] [ drop ESP stack-frame get params>> SUB ] } { [ dup funny-large-struct-return? ] [ drop EAX PUSH ] } [ drop ] } cond ; From 9d3326658c8f661c70f39a0fb236d4da6b2a62f9 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 31 Mar 2010 20:30:04 -0700 Subject: [PATCH 007/157] alien: add singletons for thiscall and fastcall --- core/alien/alien.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/alien/alien.factor b/core/alien/alien.factor index 7a539d4dd5..4dab6f8452 100644 --- a/core/alien/alien.factor +++ b/core/alien/alien.factor @@ -5,9 +5,9 @@ kernel.private byte-arrays byte-vectors arrays init continuations.private ; IN: alien -SINGLETONS: stdcall cdecl mingw ; +SINGLETONS: stdcall thiscall fastcall cdecl mingw ; -UNION: abi stdcall cdecl mingw ; +UNION: abi stdcall thiscall fastcall cdecl mingw ; PREDICATE: pinned-alien < alien underlying>> not ; From 116c8850acbe65036672216b103da09d538c2d49 Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Thu, 1 Apr 2010 00:44:32 -0700 Subject: [PATCH 008/157] PPM image loading and saving --- basis/images/ppm/authors.txt | 1 + basis/images/ppm/ppm-tests.factor | 7 + basis/images/ppm/ppm.factor | 59 + basis/images/ppm/summary.txt | 1 + extra/images/testing/ppm/ascii.fig | Bin 0 -> 57660 bytes extra/images/testing/ppm/ascii.ppm | 57604 ++++++++++++++++++++++++++ extra/images/testing/ppm/binary.fig | Bin 0 -> 57660 bytes extra/images/testing/ppm/binary.ppm | Bin 0 -> 57654 bytes 8 files changed, 57672 insertions(+) create mode 100644 basis/images/ppm/authors.txt create mode 100644 basis/images/ppm/ppm-tests.factor create mode 100644 basis/images/ppm/ppm.factor create mode 100644 basis/images/ppm/summary.txt create mode 100644 extra/images/testing/ppm/ascii.fig create mode 100644 extra/images/testing/ppm/ascii.ppm create mode 100644 extra/images/testing/ppm/binary.fig create mode 100644 extra/images/testing/ppm/binary.ppm diff --git a/basis/images/ppm/authors.txt b/basis/images/ppm/authors.txt new file mode 100644 index 0000000000..6f03a12101 --- /dev/null +++ b/basis/images/ppm/authors.txt @@ -0,0 +1 @@ +Erik Charlebois diff --git a/basis/images/ppm/ppm-tests.factor b/basis/images/ppm/ppm-tests.factor new file mode 100644 index 0000000000..208af76dd2 --- /dev/null +++ b/basis/images/ppm/ppm-tests.factor @@ -0,0 +1,7 @@ +! Copyright (C) 2010 Erik Charlebois. +! See http://factorcode.org/license.txt for BSD license. +USING: images.testing ; +IN: images.ppm.tests + +"vocab:images/testing/ppm/binary.ppm" decode-test +"vocab:images/testing/ppm/ascii.ppm" decode-test diff --git a/basis/images/ppm/ppm.factor b/basis/images/ppm/ppm.factor new file mode 100644 index 0000000000..d50d51797d --- /dev/null +++ b/basis/images/ppm/ppm.factor @@ -0,0 +1,59 @@ +! Copyright (C) 2010 Erik Charlebois. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors ascii combinators images images.loader io +io.encodings.ascii io.encodings.string kernel locals make math +math.parser prettyprint sequences ; +IN: images.ppm + +SINGLETON: ppm-image +"ppm" ppm-image register-image-class + +: read-token ( -- token ) + [ read1 dup blank? + [ t ] + [ dup CHAR: # = + [ "\n" read-until 2drop t ] + [ f ] if + ] if + ] [ drop ] while + " \n\r\t" read-until drop swap + prefix ascii decode ; + +: read-number ( -- number ) + read-token string>number ; + +:: read-numbers ( n lim -- ) + n lim = [ + read-number , + n 1 + lim read-numbers + ] unless ; + +:: read-ppm ( -- image ) + read-token :> type + read-number :> width + read-number :> height + read-number :> max + width height 3 * * :> npixels + type { + { "P3" [ [ 0 npixels read-numbers ] B{ } make ] } + { "P6" [ npixels read ] } + } case :> data + + image new + RGB >>component-order + { width height } >>dim + f >>upside-down? + data >>bitmap + ubyte-components >>component-type ; + +M: ppm-image stream>image + drop [ read-ppm ] with-input-stream ; + +M: ppm-image image>stream + drop { + [ drop "P6\n" ascii encode write ] + [ dim>> first number>string " " append ascii encode write ] + [ dim>> second number>string "\n" append ascii encode write ] + [ drop "255\n" ascii encode write ] + [ bitmap>> write ] + } cleave ; diff --git a/basis/images/ppm/summary.txt b/basis/images/ppm/summary.txt new file mode 100644 index 0000000000..f527e2a6de --- /dev/null +++ b/basis/images/ppm/summary.txt @@ -0,0 +1 @@ +Image loading for PPM image files. diff --git a/extra/images/testing/ppm/ascii.fig b/extra/images/testing/ppm/ascii.fig new file mode 100644 index 0000000000000000000000000000000000000000..68a1fa1ac10fd7c8dcdddb7407527bd327f83baf GIT binary patch literal 57660 zcmeHNTZo-k6`sTkSRcGSwWTPuPfA4cAX*9~MTl4nHOAP7f{hZyhh$PFCHUCZ`k*g9 zl|E@7DpZhC>{}}$DEeR~*XEu{(4f>b_X{)0470m-_Bre9voC9}f9-!CPLlO=m|6c? z>-*N)-#2q|&Y5i9J@?Abwr~CEwz*%rZ(Cp4`qIudukT#iJ@@jajZe(JxO?t5FZ}rD zySAvpcr!*flr%;*Je#|2<>$QUz22RX`O`1yli5po;?Qw_M{qx=?EGR4Bl) zmFSs@Gw2c-1qkE%EoJ6wx}gI7I>=#bco?OQ6yP{AnVx91LSn|uZ{U=Wb&lWOB{S{I&J#yFQrA z{5G-dlLX>%k}edJ2+susLk?2RcXc+`UmQd?Owy*BS?&~s5k!erfB?D@4Nq2cX36r& z5&UG0>=VPf;}pHfHRROD_51l8mdML|Bv8bxVrgO?)eLf{@MZ5BCw1VEB!P62aH_8o zy#Q8=n)5r0R5cB54UQc|51s`Bq8Urr%n$l9vB*RBV88f%3B3 zt~{NN>6$sF^w>je$WfJm_fjhE;2L0-%+N}d;EX+b$E3^EOr0~%mrrBgDv z;G|4bdTh%rSrj%0>@i>5!8O1{nL(8(*-3l!jzg7OvZ!qi*jK)|05-tHN~dIS*-1I3 zK#wD5HWO{RB~iUxkOTIT&karHVWP~SN|gAdgdKh<;P*@XI3U5>q>_FTJNpWJa(?Wl zS2`tw*BqQk1IqHnak&N-xhekX^`_2i^u<~i;_PmZk;F4lZvKs-3dkxtDVLg+zGSx{pT z6HEMfOw10zF&*^(`h@f$|r2mN$8IyVlMXh0rdN~xtO5sRO->+PII9dO(cS@ zoIUpEln?TPi2+0MRzRDC^yP1ooK6z9Vu@yGT20CxBxMT(B*|MDbBwC-H)iXUK@*9f z6Jd|dNzLP=Y+}q4XJpJVO6G6OBghc8Vo5;T3nUginUT#(QUysFbByBn8>4#3pov7# z%OC+spmy$7zzmQao1d34$0+qT*2LGDh+`l#LvUh=NmXp)_zOKn9zg@~Yl|fTZ9N1< zrUUUHn$}gtO*7xE{?eyzQAI1`pv5>Qr~1njiqjT53mFcu zU61SpkYL7An>3aA3AfGVI0r~;~hDxeCe0;+&2 zpbDr0s(>n>3aA3AfGVI0r~;~hDxeCe0;+&2pbDr0s=ytsz@8aXe7FPV+VJ>S|6)#T zH2Xeh=09!@e$kxyk-7GFEZV>^jHS9H1EAh=6v(;e=N*rq@ncuL^p@GPHu0n4@8D2= z24a3P0P3wkfu!1whbTeA;jdVyPCjK8kC@eEvwY56{DV3ExPuP9CK>q2F)qCkDUej# zF%czbnE!ryK8=oZSC&#$-Mx;PeZO7z$>c=<- zUO&UXzk5GDGb-Qz`n&%NqhgYQpBxe0QPET#Fu9DAlPD$iUjESf z3$Ls3+Ox)H%qk{qz)z0B?wp&XZpq{X&P2>5O0d|`ubXqPn#H4Lb;+#WG&lB`6W_9K zzW?RX*6_Ow8Te<~x0s(C5%HqMtoi0psvnGC3?Z{7%eurTDAc=ElFwe`d|$ zuiD=Nkm$gJX5sth+TX@jz4c$4-2eIEbMoyXKRL$5ySXuMtvqnQeM)f`e71J*A)CDZ zk3j~0z@QBpZk{!#pRpzQ>aI$-BXNoi7>D1I$zf5ycTfQSQgaZ%!0|D1aJVqnI=llIDGYx>HSf!){uK_%R$(zuBN ztLE@J`=W0CWA>>MUu(fEcr^(AUV7WUty@~KADhE1JjSj{_!yVoG*RHf?+3=gna2v1h%{=W02l=SU-$S110RG6u1dIIqC!*wRX`O`1yli5Kow90Q~_0>UV)DQ DnAHDz literal 0 HcmV?d00001 diff --git a/extra/images/testing/ppm/ascii.ppm b/extra/images/testing/ppm/ascii.ppm new file mode 100644 index 0000000000..326b70ecc0 --- /dev/null +++ b/extra/images/testing/ppm/ascii.ppm @@ -0,0 +1,57604 @@ +P3 +# CREATOR: GIMP PNM Filter Version 1.1 +160 120 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +243 +50 +50 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +50 +86 +243 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +0 +255 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +242 +190 +255 +218 +71 +255 +207 +17 +255 +205 +4 +255 +210 +31 +255 +223 +95 +255 +243 +196 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +239 +174 +255 +204 +2 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +213 +43 +255 +204 +0 +255 +219 +77 +255 +247 +214 +255 +254 +251 +255 +251 +234 +255 +238 +169 +255 +217 +63 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +205 +5 +255 +204 +0 +255 +252 +238 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +210 +32 +255 +204 +0 +255 +230 +132 +255 +251 +237 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +236 +158 +255 +204 +0 +255 +204 +0 +255 +204 +1 +255 +211 +36 +255 +221 +87 +255 +237 +164 +255 +254 +250 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +242 +190 +255 +219 +77 +255 +206 +11 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +214 +48 +255 +251 +233 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +254 +252 +255 +247 +213 +255 +234 +152 +255 +211 +35 +255 +204 +0 +255 +222 +92 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +248 +220 +255 +204 +0 +255 +208 +19 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +251 +235 +255 +204 +0 +255 +205 +5 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +1 +255 +204 +0 +255 +255 +254 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +1 +255 +204 +0 +255 +255 +254 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +1 +255 +204 +0 +255 +255 +254 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +215 +54 +255 +234 +150 +255 +247 +215 +255 +254 +248 +255 +254 +249 +255 +245 +204 +255 +218 +68 +255 +204 +0 +255 +212 +42 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +208 +19 +255 +204 +0 +255 +242 +190 +255 +255 +254 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +208 +19 +255 +204 +0 +255 +242 +190 +255 +255 +254 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +208 +19 +255 +204 +0 +255 +242 +190 +255 +255 +254 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +247 +217 +255 +204 +2 +255 +206 +10 +255 +251 +236 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +252 +239 +255 +206 +11 +255 +204 +2 +255 +247 +216 +255 +255 +255 +255 +241 +186 +255 +219 +75 +255 +207 +15 +255 +206 +9 +255 +215 +57 +255 +242 +188 +255 +255 +255 +255 +255 +255 +255 +247 +217 +255 +204 +2 +255 +206 +10 +255 +251 +236 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +252 +239 +255 +206 +11 +255 +204 +2 +255 +247 +216 +255 +255 +255 +255 +241 +186 +255 +219 +75 +255 +207 +15 +255 +206 +9 +255 +215 +57 +255 +242 +188 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +2 +255 +238 +172 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +221 +84 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +221 +84 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +221 +84 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +221 +85 +255 +204 +0 +255 +230 +132 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +232 +138 +255 +204 +0 +255 +220 +80 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +205 +5 +255 +245 +204 +255 +255 +255 +255 +255 +255 +255 +221 +85 +255 +204 +0 +255 +230 +132 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +232 +138 +255 +204 +0 +255 +220 +80 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +205 +5 +255 +245 +204 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +245 +203 +255 +226 +111 +255 +213 +46 +255 +206 +9 +255 +205 +5 +255 +209 +27 +255 +221 +83 +255 +243 +195 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +250 +229 +255 +221 +83 +255 +208 +18 +255 +204 +1 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +250 +229 +255 +221 +83 +255 +208 +18 +255 +204 +1 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +250 +229 +255 +221 +83 +255 +208 +18 +255 +204 +1 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +245 +205 +255 +204 +0 +255 +209 +25 +255 +254 +249 +255 +255 +255 +255 +255 +255 +255 +254 +251 +255 +210 +29 +255 +204 +0 +255 +244 +198 +255 +255 +255 +255 +255 +255 +255 +221 +84 +255 +245 +205 +255 +254 +249 +255 +249 +227 +255 +222 +88 +255 +204 +0 +255 +222 +88 +255 +255 +255 +255 +255 +255 +255 +245 +205 +255 +204 +0 +255 +209 +25 +255 +254 +249 +255 +255 +255 +255 +255 +255 +255 +254 +251 +255 +210 +29 +255 +204 +0 +255 +244 +198 +255 +255 +255 +255 +255 +255 +255 +221 +84 +255 +245 +205 +255 +254 +249 +255 +249 +227 +255 +222 +88 +255 +204 +0 +255 +222 +88 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +218 +71 +255 +204 +0 +255 +236 +159 +255 +255 +255 +255 +255 +255 +255 +238 +168 +255 +204 +0 +255 +216 +60 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +252 +239 +255 +204 +0 +255 +210 +29 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +218 +71 +255 +204 +0 +255 +236 +159 +255 +255 +255 +255 +255 +255 +255 +238 +168 +255 +204 +0 +255 +216 +60 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +252 +239 +255 +204 +0 +255 +210 +29 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +206 +10 +255 +206 +11 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +206 +10 +255 +206 +11 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +242 +192 +255 +204 +0 +255 +213 +46 +255 +255 +255 +255 +255 +255 +255 +215 +56 +255 +204 +0 +255 +240 +178 +255 +255 +255 +255 +255 +255 +255 +254 +252 +255 +232 +139 +255 +214 +48 +255 +206 +10 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +205 +6 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +242 +192 +255 +204 +0 +255 +213 +46 +255 +255 +255 +255 +255 +255 +255 +215 +56 +255 +204 +0 +255 +240 +178 +255 +255 +255 +255 +255 +255 +255 +254 +252 +255 +232 +139 +255 +214 +48 +255 +206 +10 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +205 +6 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +209 +26 +255 +209 +27 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +209 +26 +255 +209 +27 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +216 +58 +255 +204 +0 +255 +241 +187 +255 +244 +199 +255 +204 +0 +255 +212 +42 +255 +255 +254 +255 +255 +255 +255 +255 +255 +255 +227 +113 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +216 +58 +255 +204 +0 +255 +241 +187 +255 +244 +199 +255 +204 +0 +255 +212 +42 +255 +255 +254 +255 +255 +255 +255 +255 +255 +255 +227 +113 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +213 +43 +255 +213 +43 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +213 +43 +255 +213 +43 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +240 +179 +255 +204 +0 +255 +218 +72 +255 +221 +86 +255 +204 +0 +255 +236 +158 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +208 +18 +255 +204 +0 +255 +238 +168 +255 +252 +240 +255 +255 +254 +255 +252 +241 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +240 +179 +255 +204 +0 +255 +218 +72 +255 +221 +86 +255 +204 +0 +255 +236 +158 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +208 +18 +255 +204 +0 +255 +238 +168 +255 +252 +240 +255 +255 +254 +255 +252 +241 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +254 +255 +213 +45 +255 +204 +1 +255 +205 +3 +255 +209 +27 +255 +254 +249 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +206 +9 +255 +204 +0 +255 +239 +176 +255 +254 +248 +255 +248 +221 +255 +221 +87 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +254 +255 +213 +45 +255 +204 +1 +255 +205 +3 +255 +209 +27 +255 +254 +249 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +206 +9 +255 +204 +0 +255 +239 +176 +255 +254 +248 +255 +248 +221 +255 +221 +87 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +237 +165 +255 +204 +0 +255 +204 +0 +255 +232 +138 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +220 +81 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +219 +76 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +237 +165 +255 +204 +0 +255 +204 +0 +255 +232 +138 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +220 +81 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +219 +76 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +248 +218 +255 +204 +0 +255 +207 +15 +255 +252 +241 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +251 +235 +255 +220 +82 +255 +206 +10 +255 +207 +16 +255 +223 +96 +255 +252 +240 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +248 +218 +255 +204 +0 +255 +207 +15 +255 +252 +241 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +251 +235 +255 +220 +82 +255 +206 +10 +255 +207 +16 +255 +223 +96 +255 +252 +240 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +236 +158 +255 +204 +0 +255 +227 +116 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +236 +158 +255 +204 +0 +255 +227 +116 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +252 +238 +255 +218 +71 +255 +204 +0 +255 +247 +213 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +252 +238 +255 +218 +71 +255 +204 +0 +255 +247 +213 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +219 +74 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +204 +0 +255 +204 +0 +255 +219 +74 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +205 +4 +255 +217 +65 +255 +250 +229 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +204 +0 +255 +205 +4 +255 +217 +65 +255 +250 +229 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 +255 diff --git a/extra/images/testing/ppm/binary.fig b/extra/images/testing/ppm/binary.fig new file mode 100644 index 0000000000000000000000000000000000000000..68a1fa1ac10fd7c8dcdddb7407527bd327f83baf GIT binary patch literal 57660 zcmeHNTZo-k6`sTkSRcGSwWTPuPfA4cAX*9~MTl4nHOAP7f{hZyhh$PFCHUCZ`k*g9 zl|E@7DpZhC>{}}$DEeR~*XEu{(4f>b_X{)0470m-_Bre9voC9}f9-!CPLlO=m|6c? z>-*N)-#2q|&Y5i9J@?Abwr~CEwz*%rZ(Cp4`qIudukT#iJ@@jajZe(JxO?t5FZ}rD zySAvpcr!*flr%;*Je#|2<>$QUz22RX`O`1yli5po;?Qw_M{qx=?EGR4Bl) zmFSs@Gw2c-1qkE%EoJ6wx}gI7I>=#bco?OQ6yP{AnVx91LSn|uZ{U=Wb&lWOB{S{I&J#yFQrA z{5G-dlLX>%k}edJ2+susLk?2RcXc+`UmQd?Owy*BS?&~s5k!erfB?D@4Nq2cX36r& z5&UG0>=VPf;}pHfHRROD_51l8mdML|Bv8bxVrgO?)eLf{@MZ5BCw1VEB!P62aH_8o zy#Q8=n)5r0R5cB54UQc|51s`Bq8Urr%n$l9vB*RBV88f%3B3 zt~{NN>6$sF^w>je$WfJm_fjhE;2L0-%+N}d;EX+b$E3^EOr0~%mrrBgDv z;G|4bdTh%rSrj%0>@i>5!8O1{nL(8(*-3l!jzg7OvZ!qi*jK)|05-tHN~dIS*-1I3 zK#wD5HWO{RB~iUxkOTIT&karHVWP~SN|gAdgdKh<;P*@XI3U5>q>_FTJNpWJa(?Wl zS2`tw*BqQk1IqHnak&N-xhekX^`_2i^u<~i;_PmZk;F4lZvKs-3dkxtDVLg+zGSx{pT z6HEMfOw10zF&*^(`h@f$|r2mN$8IyVlMXh0rdN~xtO5sRO->+PII9dO(cS@ zoIUpEln?TPi2+0MRzRDC^yP1ooK6z9Vu@yGT20CxBxMT(B*|MDbBwC-H)iXUK@*9f z6Jd|dNzLP=Y+}q4XJpJVO6G6OBghc8Vo5;T3nUginUT#(QUysFbByBn8>4#3pov7# z%OC+spmy$7zzmQao1d34$0+qT*2LGDh+`l#LvUh=NmXp)_zOKn9zg@~Yl|fTZ9N1< zrUUUHn$}gtO*7xE{?eyzQAI1`pv5>Qr~1njiqjT53mFcu zU61SpkYL7An>3aA3AfGVI0r~;~hDxeCe0;+&2 zpbDr0s(>n>3aA3AfGVI0r~;~hDxeCe0;+&2pbDr0s=ytsz@8aXe7FPV+VJ>S|6)#T zH2Xeh=09!@e$kxyk-7GFEZV>^jHS9H1EAh=6v(;e=N*rq@ncuL^p@GPHu0n4@8D2= z24a3P0P3wkfu!1whbTeA;jdVyPCjK8kC@eEvwY56{DV3ExPuP9CK>q2F)qCkDUej# zF%czbnE!ryK8=oZSC&#$-Mx;PeZO7z$>c=<- zUO&UXzk5GDGb-Qz`n&%NqhgYQpBxe0QPET#Fu9DAlPD$iUjESf z3$Ls3+Ox)H%qk{qz)z0B?wp&XZpq{X&P2>5O0d|`ubXqPn#H4Lb;+#WG&lB`6W_9K zzW?RX*6_Ow8Te<~x0s(C5%HqMtoi0psvnGC3?Z{7%eurTDAc=ElFwe`d|$ zuiD=Nkm$gJX5sth+TX@jz4c$4-2eIEbMoyXKRL$5ySXuMtvqnQeM)f`e71J*A)CDZ zk3j~0z@QBpZk{!#pRpzQ>aI$-BXNoi7>D1I$zf5ycTfQSQgaZ%!0|D1aJVqnI=llIDGYx>HSf!){uK_%R$(zuBN ztLE@J`=W0CWA>>MUu(fEcr^(AUV7WUty@~KADhE1JjSj{_!yVoG*RHf?+3=gna2v1h%{=W02l=SU-$S110RG6u1dIIqC!*wRX`O`1yli5Kow90Q~_0>UV)DQ DnAHDz literal 0 HcmV?d00001 diff --git a/extra/images/testing/ppm/binary.ppm b/extra/images/testing/ppm/binary.ppm new file mode 100644 index 0000000000000000000000000000000000000000..b774663b8de639d934596981fec69ce1709592b4 GIT binary patch literal 57654 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 Date: Thu, 1 Apr 2010 02:22:42 -0700 Subject: [PATCH 009/157] add fastcall functions to ffi tests --- basis/compiler/tests/alien.factor | 22 ++++++++++++++++++++++ vm/ffi_test.c | 24 ++++++++++++++++++++++++ vm/ffi_test.h | 12 ++++++++++++ 3 files changed, 58 insertions(+) diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index 71efe8a929..08ff47ee5a 100755 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -22,6 +22,8 @@ IN: compiler.tests.alien "f-cdecl" libfactor-ffi-tests-path cdecl add-library "f-stdcall" libfactor-ffi-tests-path stdcall add-library + +"f-fastcall" libfactor-ffi-tests-path fastcall add-library >> LIBRARY: f-cdecl @@ -603,3 +605,23 @@ FUNCTION: void this_does_not_exist ( ) ; : assembly-test-1 ( -- ) void { } cdecl [ ] alien-assembly ; [ ] [ assembly-test-1 ] unit-test + +LIBRARY: f-fastcall + +FUNCTION: int ffi_test_49 ( int x ) ; +FUNCTION: int ffi_test_50 ( int x, int y ) ; +FUNCTION: int ffi_test_51 ( int x, int y, int z ) ; +FUNCTION: int ffi_test_52 ( int x, float y, int z ) ; +FUNCTION: int ffi_test_53 ( int x, float y, int z, int w ) ; +FUNCTION: int ffi_test_54 ( test-struct-11 x, int y ) ; +FUNCTION: int ffi_test_55 ( int x, int y, int z ) ; +FUNCTION: int ffi_test_56 ( int x, int y, int z ) ; + +[ 4 ] [ 3 ffi_test_49 ] unit-test +[ 8 ] [ 3 4 ffi_test_50 ] unit-test +[ 13 ] [ 3 4 5 ffi_test_51 ] unit-test +[ 13 ] [ 3 4.0 5 ffi_test_52 ] unit-test +[ 19 ] [ 3 4.0 5 6 ffi_test_53 ] unit-test +[ 13 ] [ 3 4 test-struct-11 5 ffi_test_54 ] unit-test +[ 19 ] [ 3 4 test-struct-11 5 6 ffi_test_55 ] unit-test +[ 26 ] [ 3 4 test-struct-11 5 6 7 ffi_test_56 ] unit-test diff --git a/vm/ffi_test.c b/vm/ffi_test.c index 11f7498f30..6ad9a26b27 100755 --- a/vm/ffi_test.c +++ b/vm/ffi_test.c @@ -329,3 +329,27 @@ short ffi_test_48(struct bool_field_test x) } #endif + +FACTOR_FASTCALL(int) ffi_test_49(int x) { return x + 1; } +FACTOR_FASTCALL(int) ffi_test_50(int x, int y) { return x + y + 1; } +FACTOR_FASTCALL(int) ffi_test_51(int x, int y, int z) { return x + y + z + 1; } +FACTOR_FASTCALL(int) ffi_test_52(int x, float y, int z) { return x + y + z + 1; } +FACTOR_FASTCALL(int) ffi_test_53(int x, float y, int z, int w) +{ + return x + y + z + w + 1; +} + +FACTOR_FASTCALL(int) ffi_test_54(test_struct_11 x, int y) +{ + return x.x + x.y + y + 1; +} + +FACTOR_FASTCALL(int) ffi_test_55(test_struct_11 x, int y, int z) +{ + return x.x + x.y + y + z + 1; +} + +FACTOR_FASTCALL(int) ffi_test_56(test_struct_11 x, int y, int z, int w) +{ + return x.x + x.y + y + z + w + 1; +} diff --git a/vm/ffi_test.h b/vm/ffi_test.h index c61c95d6df..0ee593a26e 100755 --- a/vm/ffi_test.h +++ b/vm/ffi_test.h @@ -1,9 +1,12 @@ #if defined(_MSC_VER) #define FACTOR_STDCALL(return_type) return_type __stdcall + #define FACTOR_FASTCALL(return_type) return_type __fastcall #elif defined(i386) || defined(__i386) || defined(__i386__) #define FACTOR_STDCALL(return_type) __attribute__((stdcall)) return_type + #define FACTOR_FASTCALL(return_type) __attribute__((fastcall)) return_type #else #define FACTOR_STDCALL(return_type) return_type + #define FACTOR_FASTCALL(return_type) return_type #endif #if defined(__APPLE__) @@ -119,3 +122,12 @@ struct bool_field_test { FACTOR_EXPORT short ffi_test_48(struct bool_field_test x); #endif + +FACTOR_EXPORT FACTOR_FASTCALL(int) ffi_test_49(int x); +FACTOR_EXPORT FACTOR_FASTCALL(int) ffi_test_50(int x, int y); +FACTOR_EXPORT FACTOR_FASTCALL(int) ffi_test_51(int x, int y, int z); +FACTOR_EXPORT FACTOR_FASTCALL(int) ffi_test_52(int x, float y, int z); +FACTOR_EXPORT FACTOR_FASTCALL(int) ffi_test_53(int x, float y, int z, int w); +FACTOR_EXPORT FACTOR_FASTCALL(int) ffi_test_54(test_struct_11 x, int y); +FACTOR_EXPORT FACTOR_FASTCALL(int) ffi_test_55(test_struct_11 x, int y, int z); +FACTOR_EXPORT FACTOR_FASTCALL(int) ffi_test_56(test_struct_11 x, int y, int z, int w); From 4fd61f0b5c64ecd39181991035ec5061af8fcab4 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Thu, 1 Apr 2010 02:53:40 -0700 Subject: [PATCH 010/157] cpu.architecture: alter param-regs to take abi as an (ignored for now) argument --- basis/compiler/codegen/codegen.factor | 16 ++++++++-------- basis/cpu/architecture/architecture.factor | 8 ++++---- basis/cpu/ppc/linux/linux.factor | 2 +- basis/cpu/ppc/macosx/macosx.factor | 2 +- basis/cpu/ppc/ppc.factor | 6 +++--- basis/cpu/x86/32/32.factor | 11 +++++++---- basis/cpu/x86/64/64.factor | 14 +++++++------- basis/cpu/x86/64/unix/unix.factor | 4 ++-- basis/cpu/x86/64/winnt/winnt.factor | 4 ++-- basis/math/floats/env/x86/64/64.factor | 10 +++++----- 10 files changed, 40 insertions(+), 37 deletions(-) diff --git a/basis/compiler/codegen/codegen.factor b/basis/compiler/codegen/codegen.factor index d8f0823d44..12e263a3f4 100755 --- a/basis/compiler/codegen/codegen.factor +++ b/basis/compiler/codegen/codegen.factor @@ -300,12 +300,12 @@ M: float-rep next-fastcall-param M: double-rep next-fastcall-param float-regs inc [ ?dummy-stack-params ] [ ?dummy-int-params ] bi ; -GENERIC: reg-class-full? ( reg-class -- ? ) +GENERIC# reg-class-full? 1 ( reg-class abi -- ? ) -M: stack-params reg-class-full? drop t ; +M: stack-params reg-class-full? 2drop t ; M: reg-class reg-class-full? - [ get ] [ param-regs length ] bi >= ; + [ get ] swap '[ _ param-regs length ] bi >= ; : alloc-stack-param ( rep -- n reg-class rep ) stack-params get @@ -315,10 +315,10 @@ M: reg-class reg-class-full? : alloc-fastcall-param ( rep -- n reg-class rep ) [ [ reg-class-of get ] [ reg-class-of ] [ next-fastcall-param ] tri ] keep ; -: alloc-parameter ( parameter -- reg rep ) - c-type-rep dup reg-class-of reg-class-full? +:: alloc-parameter ( parameter abi -- reg rep ) + parameter c-type-rep dup reg-class-of abi reg-class-full? [ alloc-stack-param ] [ alloc-fastcall-param ] if - [ param-reg ] dip ; + [ abi param-reg ] dip ; : (flatten-int-type) ( type -- seq ) stack-size cell align cell /i void* c-type ; @@ -355,8 +355,8 @@ M: c-type-name flatten-value-type c-type flatten-value-type ; #! Moves values from C stack to registers (if word is #! %load-param-reg) and registers to C stack (if word is #! %save-param-reg). - [ alien-parameters flatten-value-types ] - [ '[ alloc-parameter _ execute ] ] + [ [ alien-parameters flatten-value-types ] [ abi>> ] bi ] + [ '[ _ alloc-parameter _ execute ] ] bi* each-parameter ; inline : reverse-each-parameter ( parameters quot -- ) diff --git a/basis/cpu/architecture/architecture.factor b/basis/cpu/architecture/architecture.factor index b617746a06..9a50b0a2e2 100644 --- a/basis/cpu/architecture/architecture.factor +++ b/basis/cpu/architecture/architecture.factor @@ -484,15 +484,15 @@ HOOK: %loop-entry cpu ( -- ) GENERIC: return-reg ( reg-class -- reg ) ! Sequence of registers used for parameter passing in class -GENERIC: param-regs ( reg-class -- regs ) +GENERIC# param-regs 1 ( reg-class abi -- regs ) -M: stack-params param-regs drop f ; +M: stack-params param-regs 2drop f ; -GENERIC: param-reg ( n reg-class -- reg ) +GENERIC# param-reg 1 ( n reg-class abi -- reg ) M: reg-class param-reg param-regs nth ; -M: stack-params param-reg drop ; +M: stack-params param-reg 2drop ; ! Is this integer small enough to be an immediate operand for ! %add-imm, %sub-imm, and %mul-imm? diff --git a/basis/cpu/ppc/linux/linux.factor b/basis/cpu/ppc/linux/linux.factor index 5cfa1391c4..0a1e8477e8 100644 --- a/basis/cpu/ppc/linux/linux.factor +++ b/basis/cpu/ppc/linux/linux.factor @@ -13,7 +13,7 @@ M: linux reserved-area-size 2 cells ; M: linux lr-save 1 cells ; -M: float-regs param-regs drop { 1 2 3 4 5 6 7 8 } ; +M: float-regs param-regs 2drop { 1 2 3 4 5 6 7 8 } ; M: ppc value-struct? drop f ; diff --git a/basis/cpu/ppc/macosx/macosx.factor b/basis/cpu/ppc/macosx/macosx.factor index 152a3aa720..49e9768cf6 100644 --- a/basis/cpu/ppc/macosx/macosx.factor +++ b/basis/cpu/ppc/macosx/macosx.factor @@ -8,7 +8,7 @@ M: macosx reserved-area-size 6 cells ; M: macosx lr-save 2 cells ; -M: float-regs param-regs drop { 1 2 3 4 5 6 7 8 9 10 11 12 13 } ; +M: float-regs param-regs 2drop { 1 2 3 4 5 6 7 8 9 10 11 12 13 } ; M: ppc value-struct? drop t ; diff --git a/basis/cpu/ppc/ppc.factor b/basis/cpu/ppc/ppc.factor index 36beb86792..e721713154 100644 --- a/basis/cpu/ppc/ppc.factor +++ b/basis/cpu/ppc/ppc.factor @@ -237,7 +237,7 @@ M: spill-slot float-function-param* [ 1 ] dip n>> spill@ LFD ; M: integer float-function-param* FMR ; : float-function-param ( i src -- ) - [ float-regs param-regs nth ] dip float-function-param* ; + [ float-regs cdecl param-regs nth ] dip float-function-param* ; : float-function-return ( reg -- ) float-regs return-reg double-rep %copy ; @@ -587,7 +587,7 @@ M: ppc %reload ( dst rep src -- ) M: ppc %loop-entry ; M: int-regs return-reg drop 3 ; -M: int-regs param-regs drop { 3 4 5 6 7 8 9 10 } ; +M: int-regs param-regs 2drop { 3 4 5 6 7 8 9 10 } ; M: float-regs return-reg drop 1 ; M:: ppc %save-param-reg ( stack reg rep -- ) @@ -647,7 +647,7 @@ M:: ppc %box ( n rep func -- ) ! If the source is a stack location, load it into freg #0. ! If the source is f, then we assume the value is already in ! freg #0. - n [ 0 rep reg-class-of param-reg rep %load-param-reg ] when* + n [ 0 rep reg-class-of cdecl param-reg rep %load-param-reg ] when* rep double-rep? 5 4 ? %load-vm-addr func f %alien-invoke ; diff --git a/basis/cpu/x86/32/32.factor b/basis/cpu/x86/32/32.factor index d296b730d2..df5bdd2bb4 100755 --- a/basis/cpu/x86/32/32.factor +++ b/basis/cpu/x86/32/32.factor @@ -85,8 +85,8 @@ M: x86.32 return-struct-in-registers? ( c-type -- ? ) ! On x86, parameters are never passed in registers. M: int-regs return-reg drop EAX ; -M: int-regs param-regs drop { } ; -M: float-regs param-regs drop { } ; +M: int-regs param-regs 2drop { } ; +M: float-regs param-regs 2drop { } ; GENERIC: load-return-reg ( src rep -- ) GENERIC: store-return-reg ( dst rep -- ) @@ -297,14 +297,17 @@ M:: x86.32 %binary-float-function ( dst src1 src2 func -- ) [ abi>> mingw = os windows? not or ] bi and ; +: callee-cleanup? ( abi -- ? ) + { stdcall fastcall thiscall } member? ; + M: x86.32 %cleanup ( params -- ) - #! a) If we just called an stdcall function in Windows, it + #! a) If we just called a stdcall function in Windows, it #! cleaned up the stack frame for us. But we don't want that #! so we 'undo' the cleanup since we do that in %epilogue. #! b) If we just called a function returning a struct, we #! have to fix ESP. { - { [ dup abi>> stdcall? ] [ drop ESP stack-frame get params>> SUB ] } + { [ dup abi>> callee-cleanup? ] [ drop ESP stack-frame get params>> SUB ] } { [ dup funny-large-struct-return? ] [ drop EAX PUSH ] } [ drop ] } cond ; diff --git a/basis/cpu/x86/64/64.factor b/basis/cpu/x86/64/64.factor index 04f64f96b6..6e33219a66 100644 --- a/basis/cpu/x86/64/64.factor +++ b/basis/cpu/x86/64/64.factor @@ -11,10 +11,10 @@ cpu.architecture vm ; FROM: layouts => cell cells ; IN: cpu.x86.64 -: param-reg-0 ( -- reg ) 0 int-regs param-reg ; inline -: param-reg-1 ( -- reg ) 1 int-regs param-reg ; inline -: param-reg-2 ( -- reg ) 2 int-regs param-reg ; inline -: param-reg-3 ( -- reg ) 3 int-regs param-reg ; inline +: param-reg-0 ( -- reg ) 0 int-regs cdecl param-reg ; inline +: param-reg-1 ( -- reg ) 1 int-regs cdecl param-reg ; inline +: param-reg-2 ( -- reg ) 2 int-regs cdecl param-reg ; inline +: param-reg-3 ( -- reg ) 3 int-regs cdecl param-reg ; inline M: x86.64 pic-tail-reg RBX ; @@ -154,7 +154,7 @@ M:: x86.64 %unbox-large-struct ( n c-type -- ) "to_value_struct" f %alien-invoke ; : load-return-value ( rep -- ) - [ [ 0 ] dip reg-class-of param-reg ] + [ [ 0 ] dip reg-class-of cdecl param-reg ] [ reg-class-of return-reg ] [ ] tri %copy ; @@ -162,7 +162,7 @@ M:: x86.64 %unbox-large-struct ( n c-type -- ) M:: x86.64 %box ( n rep func -- ) n [ n - 0 rep reg-class-of param-reg + 0 rep reg-class-of cdecl param-reg rep %load-param-reg ] [ rep load-return-value @@ -249,7 +249,7 @@ M: x86.64 %end-callback-value ( ctype -- ) unbox-return ; : float-function-param ( i src -- ) - [ float-regs param-regs nth ] dip double-rep %copy ; + [ float-regs cdecl param-regs nth ] dip double-rep %copy ; : float-function-return ( reg -- ) float-regs return-reg double-rep %copy ; diff --git a/basis/cpu/x86/64/unix/unix.factor b/basis/cpu/x86/64/unix/unix.factor index 2fb32ce733..01e02d274d 100644 --- a/basis/cpu/x86/64/unix/unix.factor +++ b/basis/cpu/x86/64/unix/unix.factor @@ -7,10 +7,10 @@ compiler.cfg.registers ; IN: cpu.x86.64.unix M: int-regs param-regs - drop { RDI RSI RDX RCX R8 R9 } ; + 2drop { RDI RSI RDX RCX R8 R9 } ; M: float-regs param-regs - drop { XMM0 XMM1 XMM2 XMM3 XMM4 XMM5 XMM6 XMM7 } ; + 2drop { XMM0 XMM1 XMM2 XMM3 XMM4 XMM5 XMM6 XMM7 } ; M: x86.64 reserved-stack-space 0 ; diff --git a/basis/cpu/x86/64/winnt/winnt.factor b/basis/cpu/x86/64/winnt/winnt.factor index c75bb5a1b9..5d8ecc5cfb 100644 --- a/basis/cpu/x86/64/winnt/winnt.factor +++ b/basis/cpu/x86/64/winnt/winnt.factor @@ -5,9 +5,9 @@ compiler.cfg.registers cpu.architecture cpu.x86.assembler cpu.x86 cpu.x86.assembler.operands ; IN: cpu.x86.64.winnt -M: int-regs param-regs drop { RCX RDX R8 R9 } ; +M: int-regs param-regs 2drop { RCX RDX R8 R9 } ; -M: float-regs param-regs drop { XMM0 XMM1 XMM2 XMM3 } ; +M: float-regs param-regs 2drop { XMM0 XMM1 XMM2 XMM3 } ; M: x86.64 reserved-stack-space 4 cells ; diff --git a/basis/math/floats/env/x86/64/64.factor b/basis/math/floats/env/x86/64/64.factor index c20eed1cab..93cb11104f 100644 --- a/basis/math/floats/env/x86/64/64.factor +++ b/basis/math/floats/env/x86/64/64.factor @@ -4,22 +4,22 @@ IN: math.floats.env.x86.64 M: x86.64 get-sse-env void { void* } cdecl [ - int-regs param-regs first [] STMXCSR + int-regs cdecl param-regs first [] STMXCSR ] alien-assembly ; M: x86.64 set-sse-env void { void* } cdecl [ - int-regs param-regs first [] LDMXCSR + int-regs cdecl param-regs first [] LDMXCSR ] alien-assembly ; M: x86.64 get-x87-env void { void* } cdecl [ - int-regs param-regs first [] FNSTSW - int-regs param-regs first 2 [+] FNSTCW + int-regs cdecl param-regs first [] FNSTSW + int-regs cdecl param-regs first 2 [+] FNSTCW ] alien-assembly ; M: x86.64 set-x87-env void { void* } cdecl [ FNCLEX - int-regs param-regs first 2 [+] FLDCW + int-regs cdecl param-regs first 2 [+] FLDCW ] alien-assembly ; From a191937c47c0d3ad7cc58008ffc5567f8e008f97 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Thu, 1 Apr 2010 03:02:36 -0700 Subject: [PATCH 011/157] typos in ffi tests --- basis/compiler/tests/alien.factor | 10 +++++----- vm/ffi_test.c | 6 +++--- vm/ffi_test.h | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index 08ff47ee5a..2bde4234b4 100755 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -614,14 +614,14 @@ FUNCTION: int ffi_test_51 ( int x, int y, int z ) ; FUNCTION: int ffi_test_52 ( int x, float y, int z ) ; FUNCTION: int ffi_test_53 ( int x, float y, int z, int w ) ; FUNCTION: int ffi_test_54 ( test-struct-11 x, int y ) ; -FUNCTION: int ffi_test_55 ( int x, int y, int z ) ; -FUNCTION: int ffi_test_56 ( int x, int y, int z ) ; +FUNCTION: int ffi_test_55 ( test-struct-11 x, int y, int z ) ; +FUNCTION: int ffi_test_56 ( test-struct-11 x, int y, int z, int w ) ; [ 4 ] [ 3 ffi_test_49 ] unit-test [ 8 ] [ 3 4 ffi_test_50 ] unit-test [ 13 ] [ 3 4 5 ffi_test_51 ] unit-test [ 13 ] [ 3 4.0 5 ffi_test_52 ] unit-test [ 19 ] [ 3 4.0 5 6 ffi_test_53 ] unit-test -[ 13 ] [ 3 4 test-struct-11 5 ffi_test_54 ] unit-test -[ 19 ] [ 3 4 test-struct-11 5 6 ffi_test_55 ] unit-test -[ 26 ] [ 3 4 test-struct-11 5 6 7 ffi_test_56 ] unit-test +[ 13 ] [ 3 4 test-struct-11 5 ffi_test_54 ] unit-test +[ 19 ] [ 3 4 test-struct-11 5 6 ffi_test_55 ] unit-test +[ 26 ] [ 3 4 test-struct-11 5 6 7 ffi_test_56 ] unit-test diff --git a/vm/ffi_test.c b/vm/ffi_test.c index 6ad9a26b27..d45a08cf8b 100755 --- a/vm/ffi_test.c +++ b/vm/ffi_test.c @@ -339,17 +339,17 @@ FACTOR_FASTCALL(int) ffi_test_53(int x, float y, int z, int w) return x + y + z + w + 1; } -FACTOR_FASTCALL(int) ffi_test_54(test_struct_11 x, int y) +FACTOR_FASTCALL(int) ffi_test_54(struct test_struct_11 x, int y) { return x.x + x.y + y + 1; } -FACTOR_FASTCALL(int) ffi_test_55(test_struct_11 x, int y, int z) +FACTOR_FASTCALL(int) ffi_test_55(struct test_struct_11 x, int y, int z) { return x.x + x.y + y + z + 1; } -FACTOR_FASTCALL(int) ffi_test_56(test_struct_11 x, int y, int z, int w) +FACTOR_FASTCALL(int) ffi_test_56(struct test_struct_11 x, int y, int z, int w) { return x.x + x.y + y + z + w + 1; } diff --git a/vm/ffi_test.h b/vm/ffi_test.h index 0ee593a26e..6fe35fdb42 100755 --- a/vm/ffi_test.h +++ b/vm/ffi_test.h @@ -128,6 +128,6 @@ FACTOR_EXPORT FACTOR_FASTCALL(int) ffi_test_50(int x, int y); FACTOR_EXPORT FACTOR_FASTCALL(int) ffi_test_51(int x, int y, int z); FACTOR_EXPORT FACTOR_FASTCALL(int) ffi_test_52(int x, float y, int z); FACTOR_EXPORT FACTOR_FASTCALL(int) ffi_test_53(int x, float y, int z, int w); -FACTOR_EXPORT FACTOR_FASTCALL(int) ffi_test_54(test_struct_11 x, int y); -FACTOR_EXPORT FACTOR_FASTCALL(int) ffi_test_55(test_struct_11 x, int y, int z); -FACTOR_EXPORT FACTOR_FASTCALL(int) ffi_test_56(test_struct_11 x, int y, int z, int w); +FACTOR_EXPORT FACTOR_FASTCALL(int) ffi_test_54(struct test_struct_11 x, int y); +FACTOR_EXPORT FACTOR_FASTCALL(int) ffi_test_55(struct test_struct_11 x, int y, int z); +FACTOR_EXPORT FACTOR_FASTCALL(int) ffi_test_56(struct test_struct_11 x, int y, int z, int w); From 615c64443b8a06fe3104955d86d910988eeccf5f Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Thu, 1 Apr 2010 03:35:37 -0700 Subject: [PATCH 012/157] update M\ int-regs param-regs for x86-32 to give input regs for thiscall/fastcall --- basis/cpu/x86/32/32.factor | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/basis/cpu/x86/32/32.factor b/basis/cpu/x86/32/32.factor index df5bdd2bb4..c707294e42 100755 --- a/basis/cpu/x86/32/32.factor +++ b/basis/cpu/x86/32/32.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2005, 2010 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: locals alien.c-types alien.libraries alien.syntax arrays -kernel fry math namespaces sequences system layouts io +USING: locals alien alien.c-types alien.libraries alien.syntax +arrays kernel fry math namespaces sequences system layouts io vocabs.loader accessors init combinators command-line make compiler compiler.units compiler.constants compiler.alien compiler.codegen compiler.codegen.fixup @@ -83,11 +83,18 @@ M: x86.32 return-struct-in-registers? ( c-type -- ? ) : struct-return@ ( n -- operand ) [ next-stack@ ] [ stack-frame get params>> local@ ] if* ; -! On x86, parameters are never passed in registers. +! On x86, parameters are usually never passed in registers, except with Microsoft's +! "thiscall" and "fastcall" abis M: int-regs return-reg drop EAX ; -M: int-regs param-regs 2drop { } ; M: float-regs param-regs 2drop { } ; +M: int-regs param-regs + nip { + { thiscall [ { ECX } ] } + { fastcall [ { ECX EDX } ] } + [ drop { } ] + } case ; + GENERIC: load-return-reg ( src rep -- ) GENERIC: store-return-reg ( dst rep -- ) From c743608456a464407ee3b895ce32db0e386c3080 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Thu, 1 Apr 2010 14:15:34 -0700 Subject: [PATCH 013/157] check gc after fastcall ffi tests like stdcall tests --- basis/compiler/tests/alien.factor | 37 ++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index 2bde4234b4..7aab8c8920 100755 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -606,17 +606,34 @@ FUNCTION: void this_does_not_exist ( ) ; [ ] [ assembly-test-1 ] unit-test -LIBRARY: f-fastcall - -FUNCTION: int ffi_test_49 ( int x ) ; -FUNCTION: int ffi_test_50 ( int x, int y ) ; -FUNCTION: int ffi_test_51 ( int x, int y, int z ) ; -FUNCTION: int ffi_test_52 ( int x, float y, int z ) ; -FUNCTION: int ffi_test_53 ( int x, float y, int z, int w ) ; -FUNCTION: int ffi_test_54 ( test-struct-11 x, int y ) ; -FUNCTION: int ffi_test_55 ( test-struct-11 x, int y, int z ) ; -FUNCTION: int ffi_test_56 ( test-struct-11 x, int y, int z, int w ) ; +[ f ] [ "f-fastcall" load-library f = ] unit-test +[ fastcall ] [ "f-fastcall" library abi>> ] unit-test +: ffi_test_49 ( x -- int ) + int "f-fastcall" "ffi_test_49" { int } + alien-invoke gc ; +: ffi_test_50 ( x y -- int ) + int "f-fastcall" "ffi_test_50" { int int } + alien-invoke gc ; +: ffi_test_51 ( x y z -- int ) + int "f-fastcall" "ffi_test_51" { int int int } + alien-invoke gc ; +: ffi_test_52 ( x y z -- int ) + int "f-fastcall" "ffi_test_52" { int float int } + alien-invoke gc ; +: ffi_test_53 ( x y z w -- int ) + int "f-fastcall" "ffi_test_53" { int int int int } + alien-invoke gc ; +: ffi_test_54 ( x y -- int ) + int "f-fastcall" "ffi_test_54" { test-struct-11 int } + alien-invoke gc ; +: ffi_test_55 ( x y z -- int ) + int "f-fastcall" "ffi_test_55" { test-struct-11 int int } + alien-invoke gc ; +: ffi_test_56 ( x y z w -- int ) + int "f-fastcall" "ffi_test_56" { test-struct-11 int int int } + alien-invoke gc ; + [ 4 ] [ 3 ffi_test_49 ] unit-test [ 8 ] [ 3 4 ffi_test_50 ] unit-test [ 13 ] [ 3 4 5 ffi_test_51 ] unit-test From 666081f155072d523559d23e0324d16d517b94ae Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Thu, 1 Apr 2010 17:36:09 -0700 Subject: [PATCH 014/157] update %load-param-reg, %save-param-reg, and %cleanup to take register args into account --- basis/cpu/x86/32/32.factor | 26 +++++++++++++++++++------- basis/cpu/x86/64/64.factor | 2 -- basis/cpu/x86/x86.factor | 2 ++ 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/basis/cpu/x86/32/32.factor b/basis/cpu/x86/32/32.factor index c707294e42..44e3f040f6 100755 --- a/basis/cpu/x86/32/32.factor +++ b/basis/cpu/x86/32/32.factor @@ -66,7 +66,7 @@ M:: x86.32 %dispatch ( src temp -- ) M: x86.32 pic-tail-reg EBX ; -M: x86.32 reserved-stack-space 4 cells ; +M: x86.32 reserved-stack-space 0 ; M: x86.32 %alien-invoke 0 CALL rc-relative rel-dlsym ; @@ -115,12 +115,17 @@ M: x86.32 %prologue ( n -- ) M: x86.32 %prepare-jump pic-tail-reg 0 MOV xt-tail-pic-offset rc-absolute-cell rel-here ; -M: x86.32 %load-param-reg - stack-params assert= - [ [ EAX ] dip local@ MOV ] dip - stack@ EAX MOV ; +M: stack-params copy-register* + drop + { + { [ dup integer? ] [ EAX swap next-stack@ MOV EAX MOV ] } + { [ over integer? ] [ EAX swap MOV param@ EAX MOV ] } + } cond ; -M: x86.32 %save-param-reg 3drop ; +M: x86.32 %save-param-reg + dup stack-params? [ 3drop ] [ [ param@ ] 2dip %copy ] if ; + +M: x86.32 %load-param-reg [ swap local@ ] dip %copy ; : (%box) ( n rep -- ) #! If n is f, push the return register onto the stack; we @@ -307,6 +312,13 @@ M:: x86.32 %binary-float-function ( dst src1 src2 func -- ) : callee-cleanup? ( abi -- ? ) { stdcall fastcall thiscall } member? ; +: stack-arg-size ( params -- n ) + dup abi>> '[ + alien-parameters flatten-value-types + [ _ alloc-parameter 2drop ] each + stack-params get + ] with-param-regs ; + M: x86.32 %cleanup ( params -- ) #! a) If we just called a stdcall function in Windows, it #! cleaned up the stack frame for us. But we don't want that @@ -314,7 +326,7 @@ M: x86.32 %cleanup ( params -- ) #! b) If we just called a function returning a struct, we #! have to fix ESP. { - { [ dup abi>> callee-cleanup? ] [ drop ESP stack-frame get params>> SUB ] } + { [ dup abi>> callee-cleanup? ] [ stack-arg-size ESP swap SUB ] } { [ dup funny-large-struct-return? ] [ drop EAX PUSH ] } [ drop ] } cond ; diff --git a/basis/cpu/x86/64/64.factor b/basis/cpu/x86/64/64.factor index 6e33219a66..ab75dbf00b 100644 --- a/basis/cpu/x86/64/64.factor +++ b/basis/cpu/x86/64/64.factor @@ -49,8 +49,6 @@ M: x86.64 %vm-field ( dst field -- ) M: x86.64 %vm-field-ptr ( dst field -- ) [ vm-reg ] dip vm-field-offset [+] LEA ; -: param@ ( n -- op ) reserved-stack-space + stack@ ; - M: x86.64 %prologue ( n -- ) temp-reg -7 [] LEA dup PUSH diff --git a/basis/cpu/x86/x86.factor b/basis/cpu/x86/x86.factor index dbb112bf4b..a071485de0 100644 --- a/basis/cpu/x86/x86.factor +++ b/basis/cpu/x86/x86.factor @@ -41,6 +41,8 @@ HOOK: extra-stack-space cpu ( stack-frame -- n ) : gc-root@ ( n -- op ) gc-root-offset special@ ; +: param@ ( n -- op ) reserved-stack-space + stack@ ; + : decr-stack-reg ( n -- ) dup 0 = [ drop ] [ stack-reg swap SUB ] if ; From 9c1a9158beec68576dad344521738f9c2696912c Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Thu, 1 Apr 2010 18:25:56 -0700 Subject: [PATCH 015/157] retire mixed int/float fastcall tests because who cares --- basis/compiler/tests/alien.factor | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index 7aab8c8920..2b10c8bd38 100755 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -618,27 +618,7 @@ FUNCTION: void this_does_not_exist ( ) ; : ffi_test_51 ( x y z -- int ) int "f-fastcall" "ffi_test_51" { int int int } alien-invoke gc ; -: ffi_test_52 ( x y z -- int ) - int "f-fastcall" "ffi_test_52" { int float int } - alien-invoke gc ; -: ffi_test_53 ( x y z w -- int ) - int "f-fastcall" "ffi_test_53" { int int int int } - alien-invoke gc ; -: ffi_test_54 ( x y -- int ) - int "f-fastcall" "ffi_test_54" { test-struct-11 int } - alien-invoke gc ; -: ffi_test_55 ( x y z -- int ) - int "f-fastcall" "ffi_test_55" { test-struct-11 int int } - alien-invoke gc ; -: ffi_test_56 ( x y z w -- int ) - int "f-fastcall" "ffi_test_56" { test-struct-11 int int int } - alien-invoke gc ; [ 4 ] [ 3 ffi_test_49 ] unit-test [ 8 ] [ 3 4 ffi_test_50 ] unit-test [ 13 ] [ 3 4 5 ffi_test_51 ] unit-test -[ 13 ] [ 3 4.0 5 ffi_test_52 ] unit-test -[ 19 ] [ 3 4.0 5 6 ffi_test_53 ] unit-test -[ 13 ] [ 3 4 test-struct-11 5 ffi_test_54 ] unit-test -[ 19 ] [ 3 4 test-struct-11 5 6 ffi_test_55 ] unit-test -[ 26 ] [ 3 4 test-struct-11 5 6 7 ffi_test_56 ] unit-test From 553b9fcd933d83bf4ab05b4e5c79205f65374eb2 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Thu, 1 Apr 2010 18:34:15 -0700 Subject: [PATCH 016/157] make "fastcall" symbol private since it doesn't really work in all cases --- basis/compiler/tests/alien.factor | 1 + basis/cpu/x86/32/32.factor | 1 + core/alien/alien.factor | 6 +++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index 2b10c8bd38..07457c8f4e 100755 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -6,6 +6,7 @@ namespaces.private parser quotations sequences specialized-arrays stack-checker stack-checker.errors system threads tools.test words alien.complex concurrency.promises ; FROM: alien.c-types => float short ; +FROM: alien.private => fastcall ; SPECIALIZED-ARRAY: float SPECIALIZED-ARRAY: char IN: compiler.tests.alien diff --git a/basis/cpu/x86/32/32.factor b/basis/cpu/x86/32/32.factor index 44e3f040f6..e346f8ab8c 100755 --- a/basis/cpu/x86/32/32.factor +++ b/basis/cpu/x86/32/32.factor @@ -10,6 +10,7 @@ compiler.cfg.intrinsics compiler.cfg.stack-frame cpu.x86.assembler cpu.x86.assembler.operands cpu.x86 cpu.architecture vm ; FROM: layouts => cell ; +FROM: alien.private => fastcall ; IN: cpu.x86.32 M: x86.32 machine-registers diff --git a/core/alien/alien.factor b/core/alien/alien.factor index 4dab6f8452..194e4201d2 100644 --- a/core/alien/alien.factor +++ b/core/alien/alien.factor @@ -5,7 +5,11 @@ kernel.private byte-arrays byte-vectors arrays init continuations.private ; IN: alien -SINGLETONS: stdcall thiscall fastcall cdecl mingw ; +SINGLETONS: stdcall thiscall cdecl mingw ; + + UNION: abi stdcall thiscall fastcall cdecl mingw ; From 88da92543c7f2d9ffde33f5144f8c45bb2400c43 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Thu, 1 Apr 2010 18:48:12 -0700 Subject: [PATCH 017/157] add a test that multiple stdcalls or fastcalls in the same word behave correctly --- basis/compiler/tests/alien.factor | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index 07457c8f4e..7b35b8772c 100755 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -1,10 +1,11 @@ USING: accessors alien alien.c-types alien.libraries alien.syntax arrays classes.struct combinators -compiler continuations effects io io.backend io.pathnames -io.streams.string kernel math memory namespaces -namespaces.private parser quotations sequences -specialized-arrays stack-checker stack-checker.errors -system threads tools.test words alien.complex concurrency.promises ; +compiler continuations effects generalizations io +io.backend io.pathnames io.streams.string kernel +math memory namespaces namespaces.private parser +quotations sequences specialized-arrays stack-checker +stack-checker.errors system threads tools.test words +alien.complex concurrency.promises ; FROM: alien.c-types => float short ; FROM: alien.private => fastcall ; SPECIALIZED-ARRAY: float @@ -140,6 +141,14 @@ unit-test 11 6 -7 ffi_test_19 [ x>> ] [ y>> ] [ z>> ] tri ] unit-test +: multi_ffi_test_18 ( w x y z w' x' y' z' -- int int ) + [ int "f-stdcall" "ffi_test_18" { int int int int } alien-invoke ] + 4 ndip + int "f-stdcall" "ffi_test_18" { int int int int } alien-invoke + gc ; + +[ 25 85 ] [ 2 3 4 5 6 7 8 9 multi_ffi_test_18 ] unit-test + FUNCTION: double ffi_test_6 float x float y ; [ 6.0 ] [ 3.0 2.0 ffi_test_6 ] unit-test [ "a" "b" ffi_test_6 ] must-fail @@ -619,7 +628,12 @@ FUNCTION: void this_does_not_exist ( ) ; : ffi_test_51 ( x y z -- int ) int "f-fastcall" "ffi_test_51" { int int int } alien-invoke gc ; +: multi_ffi_test_51 ( x y z x' y' z' -- int int ) + [ int "f-fastcall" "ffi_test_51" { int int int } alien-invoke ] + 3dip + int "f-fastcall" "ffi_test_51" { int int int } alien-invoke gc ; [ 4 ] [ 3 ffi_test_49 ] unit-test [ 8 ] [ 3 4 ffi_test_50 ] unit-test [ 13 ] [ 3 4 5 ffi_test_51 ] unit-test +[ 13 22 ] [ 3 4 5 6 7 8 multi_ffi_test_51 ] unit-test From c12424f8346cd62f7ae46e848476ed855794cff6 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Thu, 1 Apr 2010 19:25:24 -0700 Subject: [PATCH 018/157] update alien docs to mention abi symbols --- core/alien/alien-docs.factor | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/core/alien/alien-docs.factor b/core/alien/alien-docs.factor index 5f91d4c695..34ff33bff9 100644 --- a/core/alien/alien-docs.factor +++ b/core/alien/alien-docs.factor @@ -3,8 +3,24 @@ alien.syntax compiler definitions math libc eval debugger parser io io.backend system alien.accessors alien.libraries alien.c-types quotations kernel sequences ; +FROM: alien.private => fastcall ; IN: alien +HELP: cdecl +{ $description "This symbol is passed as the " { $snippet "abi" } " argument to " { $link alien-indirect } ", " { $link alien-callback } ", " { $link alien-assembly } ", and " { $link add-library } " to indicate that the standard C calling convention should be used, where the caller cleans up the stack frame after calling the function. This symbol only has meaning on 32-bit x86 platforms." } ; + +HELP: stdcall +{ $description "This symbol is passed as the " { $snippet "abi" } " argument to " { $link alien-indirect } ", " { $link alien-callback } ", " { $link alien-assembly } ", and " { $link add-library } " to indicate that the Windows API calling convention should be used, where the called function cleans up its own stack frame before returning to the caller. This symbol only has meaning on 32-bit x86 platforms." } ; + +HELP: fastcall +{ $warning "In the current implementation this ABI only works for functions that take only integer and pointer arguments." } +{ $description "This symbol is passed as the " { $snippet "abi" } " argument to " { $link alien-indirect } ", " { $link alien-callback } ", " { $link alien-assembly } ", and " { $link add-library } " to indicate that the \"fast call\" calling convention should be used, where the first two integer or pointer arguments are passed in registers and the function cleans up its own stack frame before returning to the caller. This symbol only has meaning on 32-bit x86 platforms." } ; + +HELP: thiscall +{ $description "This symbol is passed as the " { $snippet "abi" } " argument to " { $link alien-indirect } ", " { $link alien-callback } ", " { $link alien-assembly } ", and " { $link add-library } " to indicate that Microsoft Visual C++ calling convention should be used, where the first argument (which must be a \"this\" pointer) is passed in a register and the function cleans up its own stack frame before returning to the caller. This symbol only has meaning on 32-bit x86 platforms." } ; + +{ cdecl stdcall fastcall thiscall } related-words + HELP: >c-ptr { $values { "obj" object } { "c-ptr" c-ptr } } { $contract "Outputs a pointer to the binary data of this object." } ; @@ -85,7 +101,7 @@ HELP: alien-indirect-error } ; HELP: alien-indirect -{ $values { "args..." "zero or more objects passed to the C function" } { "funcptr" "a C function pointer" } { "return" "a C return type" } { "parameters" "a sequence of C parameter types" } { "abi" "one of " { $snippet "\"cdecl\"" } " or " { $snippet "\"stdcall\"" } } { "return..." "the return value of the function, if not " { $link void } } } +{ $values { "args..." "zero or more objects passed to the C function" } { "funcptr" "a C function pointer" } { "return" "a C return type" } { "parameters" "a sequence of C parameter types" } { "abi" "one of " { $link cdecl } " or " { $link stdcall } } { "return..." "the return value of the function, if not " { $link void } } } { $description "Invokes a C function pointer passed on the data stack. Input parameters are taken from the data stack following the function pointer, and the return value is pushed on the data stack after the function returns. A return type of " { $link void } " indicates that no value is to be expected." } @@ -101,7 +117,7 @@ HELP: alien-callback-error } ; HELP: alien-callback -{ $values { "return" "a C return type" } { "parameters" "a sequence of C parameter types" } { "abi" "one of " { $snippet "\"cdecl\"" } " or " { $snippet "\"stdcall\"" } } { "quot" quotation } { "alien" alien } } +{ $values { "return" "a C return type" } { "parameters" "a sequence of C parameter types" } { "abi" "one of " { $link cdecl } " or " { $link stdcall } } { "quot" quotation } { "alien" alien } } { $description "Defines a callback from C to Factor which accepts the given set of parameters from the C caller, pushes them on the data stack, calls the quotation, and passes a return value back to the C caller. A return type of " { $snippet "void" } " indicates that no value is to be returned." $nl @@ -128,7 +144,7 @@ HELP: alien-assembly-error } ; HELP: alien-assembly -{ $values { "args..." "zero or more objects passed to the C function" } { "return" "a C return type" } { "parameters" "a sequence of C parameter types" } { "abi" "one of " { $snippet "\"cdecl\"" } " or " { $snippet "\"stdcall\"" } } { "quot" quotation } { "return..." "the return value of the function, if not " { $link void } } } +{ $values { "args..." "zero or more objects passed to the C function" } { "return" "a C return type" } { "parameters" "a sequence of C parameter types" } { "abi" "one of " { $link cdecl } " or " { $link stdcall } } { "quot" quotation } { "return..." "the return value of the function, if not " { $link void } } } { $description "Invokes arbitrary machine code, generated at compile-time by the quotation. Input parameters are taken from the data stack, and the return value is pushed on the data stack after the function returns. A return type of " { $link void } " indicates that no value is to be expected." } From 88fbcba0676ca4370aa6422f14051012dc46889b Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Thu, 1 Apr 2010 20:56:43 -0700 Subject: [PATCH 019/157] flatten non-integral types to (stack-value) on x86.32 --- basis/compiler/alien/alien.factor | 2 +- basis/compiler/codegen/codegen.factor | 11 ++++++++++- basis/cpu/architecture/architecture.factor | 3 +++ basis/cpu/ppc/ppc.factor | 2 ++ basis/cpu/x86/32/32.factor | 12 +++++++++--- basis/cpu/x86/64/64.factor | 2 ++ basis/cpu/x86/64/unix/unix.factor | 8 +------- 7 files changed, 28 insertions(+), 12 deletions(-) diff --git a/basis/compiler/alien/alien.factor b/basis/compiler/alien/alien.factor index 7426d7e940..63df85be05 100644 --- a/basis/compiler/alien/alien.factor +++ b/basis/compiler/alien/alien.factor @@ -9,7 +9,7 @@ IN: compiler.alien : alien-parameters ( params -- seq ) dup parameters>> - swap return>> large-struct? [ void* prefix ] when ; + swap return>> large-struct? [ struct-return-pointer-type prefix ] when ; : alien-return ( params -- type ) return>> dup large-struct? [ drop void ] when ; diff --git a/basis/compiler/codegen/codegen.factor b/basis/compiler/codegen/codegen.factor index 12e263a3f4..4ffe062090 100755 --- a/basis/compiler/codegen/codegen.factor +++ b/basis/compiler/codegen/codegen.factor @@ -320,8 +320,17 @@ M: reg-class reg-class-full? [ alloc-stack-param ] [ alloc-fastcall-param ] if [ abi param-reg ] dip ; +SYMBOL: (stack-value) +<< void* c-type clone \ (stack-value) define-primitive-type +stack-params \ (stack-value) c-type (>>rep) >> + +: ((flatten-type)) ( type to-type -- seq ) + [ stack-size cell align cell /i ] dip c-type ; inline + : (flatten-int-type) ( type -- seq ) - stack-size cell align cell /i void* c-type ; + void* ((flatten-type)) ; +: (flatten-stack-type) ( type -- seq ) + (stack-value) ((flatten-type)) ; GENERIC: flatten-value-type ( type -- types ) diff --git a/basis/cpu/architecture/architecture.factor b/basis/cpu/architecture/architecture.factor index 9a50b0a2e2..6f3865497b 100644 --- a/basis/cpu/architecture/architecture.factor +++ b/basis/cpu/architecture/architecture.factor @@ -502,6 +502,9 @@ HOOK: immediate-arithmetic? cpu ( n -- ? ) ! %and-imm, %or-imm, and %xor-imm? HOOK: immediate-bitwise? cpu ( n -- ? ) +! What c-type describes the implicit struct return pointer for large structs? +HOOK: struct-return-pointer-type cpu ( -- c-type ) + ! Is this structure small enough to be returned in registers? HOOK: return-struct-in-registers? cpu ( c-type -- ? ) diff --git a/basis/cpu/ppc/ppc.factor b/basis/cpu/ppc/ppc.factor index f81d8705bf..dd9252129a 100644 --- a/basis/cpu/ppc/ppc.factor +++ b/basis/cpu/ppc/ppc.factor @@ -704,6 +704,8 @@ M: ppc immediate-arithmetic? ( n -- ? ) -32768 32767 between? ; M: ppc immediate-bitwise? ( n -- ? ) 0 65535 between? ; +M: ppc struct-return-pointer-type void* ; + M: ppc return-struct-in-registers? ( c-type -- ? ) c-type return-in-registers?>> ; diff --git a/basis/cpu/x86/32/32.factor b/basis/cpu/x86/32/32.factor index e346f8ab8c..71439373c0 100755 --- a/basis/cpu/x86/32/32.factor +++ b/basis/cpu/x86/32/32.factor @@ -2,8 +2,8 @@ ! See http://factorcode.org/license.txt for BSD license. USING: locals alien alien.c-types alien.libraries alien.syntax arrays kernel fry math namespaces sequences system layouts io -vocabs.loader accessors init combinators command-line make -compiler compiler.units compiler.constants compiler.alien +vocabs.loader accessors init classes.struct combinators command-line +make compiler compiler.units compiler.constants compiler.alien compiler.codegen compiler.codegen.fixup compiler.cfg.instructions compiler.cfg.builder compiler.cfg.intrinsics compiler.cfg.stack-frame @@ -357,6 +357,12 @@ M: x86.32 callback-return-rewind ( params -- n ) } cond ; ! Dreadful -M: object flatten-value-type (flatten-int-type) ; +M: object flatten-value-type (flatten-stack-type) ; +M: struct-c-type flatten-value-type (flatten-stack-type) ; +M: long-long-type flatten-value-type (flatten-stack-type) ; +M: c-type flatten-value-type + dup rep>> int-rep? [ (flatten-int-type) ] [ (flatten-stack-type) ] if ; + +M: x86.64 struct-return-pointer-type (stack-value) ; check-sse diff --git a/basis/cpu/x86/64/64.factor b/basis/cpu/x86/64/64.factor index ab75dbf00b..87578dd8db 100644 --- a/basis/cpu/x86/64/64.factor +++ b/basis/cpu/x86/64/64.factor @@ -275,6 +275,8 @@ M:: x86.64 %call-gc ( gc-root-count temp -- ) ! Call GC "inline_gc" f %alien-invoke ; +M: x86.64 struct-return-pointer-type void* ; + ! The result of reading 4 bytes from memory is a fixnum on ! x86-64. enable-alien-4-intrinsics diff --git a/basis/cpu/x86/64/unix/unix.factor b/basis/cpu/x86/64/unix/unix.factor index 01e02d274d..a1868a3bc8 100644 --- a/basis/cpu/x86/64/unix/unix.factor +++ b/basis/cpu/x86/64/unix/unix.factor @@ -14,11 +14,6 @@ M: float-regs param-regs M: x86.64 reserved-stack-space 0 ; -SYMBOL: (stack-value) -! The ABI for passing structs by value is pretty great -<< void* c-type clone \ (stack-value) define-primitive-type -stack-params \ (stack-value) c-type (>>rep) >> - : struct-types&offset ( struct-type -- pairs ) fields>> [ [ type>> ] [ offset>> ] bi 2array @@ -36,8 +31,7 @@ stack-params \ (stack-value) c-type (>>rep) >> ] map ; : flatten-large-struct ( c-type -- seq ) - heap-size cell align - cell /i \ (stack-value) c-type ; + (flatten-stack-type) ; : flatten-struct ( c-type -- seq ) dup heap-size 16 > [ From 2c3fde412ab29a21be2b71c47a33a466aaa05b57 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Thu, 1 Apr 2010 22:01:10 -0700 Subject: [PATCH 020/157] cpu.x86.32: add load-return-regs methods for stack-params so callbacks can box the struct return pointer --- basis/cpu/x86/32/32.factor | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/basis/cpu/x86/32/32.factor b/basis/cpu/x86/32/32.factor index 71439373c0..02f9380e01 100755 --- a/basis/cpu/x86/32/32.factor +++ b/basis/cpu/x86/32/32.factor @@ -99,6 +99,9 @@ M: int-regs param-regs GENERIC: load-return-reg ( src rep -- ) GENERIC: store-return-reg ( dst rep -- ) +M: stack-params load-return-reg drop EAX swap MOV ; +M: stack-params store-return-reg drop EAX MOV ; + M: int-rep load-return-reg drop EAX swap MOV ; M: int-rep store-return-reg drop EAX MOV ; @@ -363,6 +366,6 @@ M: long-long-type flatten-value-type (flatten-stack-type) ; M: c-type flatten-value-type dup rep>> int-rep? [ (flatten-int-type) ] [ (flatten-stack-type) ] if ; -M: x86.64 struct-return-pointer-type (stack-value) ; +M: x86.32 struct-return-pointer-type (stack-value) ; check-sse From fd0569e553243eb7a9f2c8e2b622ed5d0fcdee4c Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Thu, 1 Apr 2010 22:47:16 -0700 Subject: [PATCH 021/157] compiler.tests.alien: add back fastcall float and struct tests --- basis/compiler/tests/alien.factor | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index 7b35b8772c..63d32d71ac 100755 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -637,3 +637,25 @@ FUNCTION: void this_does_not_exist ( ) ; [ 8 ] [ 3 4 ffi_test_50 ] unit-test [ 13 ] [ 3 4 5 ffi_test_51 ] unit-test [ 13 22 ] [ 3 4 5 6 7 8 multi_ffi_test_51 ] unit-test + +: ffi_test_52 ( x y z -- int ) + int "f-fastcall" "ffi_test_52" { int float int } + alien-invoke gc ; +: ffi_test_53 ( x y z w -- int ) + int "f-fastcall" "ffi_test_53" { int float int int } + alien-invoke gc ; +: ffi_test_54 ( x y -- int ) + int "f-fastcall" "ffi_test_54" { test-struct-11 int } + alien-invoke gc ; +: ffi_test_55 ( x y z -- int ) + int "f-fastcall" "ffi_test_55" { test-struct-11 int int } + alien-invoke gc ; +: ffi_test_56 ( x y z w -- int ) + int "f-fastcall" "ffi_test_56" { test-struct-11 int int int } + alien-invoke gc ; + +[ 13 ] [ 3 4.0 5 ffi_test_52 ] unit-test +[ 19 ] [ 3 4.0 5 6 ffi_test_53 ] unit-test +[ 13 ] [ 3 4 test-struct-11 5 ffi_test_54 ] unit-test +[ 19 ] [ 3 4 test-struct-11 5 6 ffi_test_55 ] unit-test +[ 26 ] [ 3 4 test-struct-11 5 6 7 ffi_test_56 ] unit-test From 69abcd4b9b5ac3901b654b140a597669c8e425ad Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Thu, 1 Apr 2010 23:43:55 -0700 Subject: [PATCH 022/157] test indirect fastcalls --- basis/compiler/tests/alien.factor | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index 63d32d71ac..d4dd1f6eb8 100755 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -659,3 +659,11 @@ FUNCTION: void this_does_not_exist ( ) ; [ 13 ] [ 3 4 test-struct-11 5 ffi_test_54 ] unit-test [ 19 ] [ 3 4 test-struct-11 5 6 ffi_test_55 ] unit-test [ 26 ] [ 3 4 test-struct-11 5 6 7 ffi_test_56 ] unit-test + +: fastcall-ii-indirect ( x y ptr -- result ) + int { int int } fastcall alien-indirect ; +: fastcall-ifi-indirect ( x y z ptr -- result ) + int { int float int } fastcall alien-indirect ; + +[ 8 ] [ 3 4 &: ffi_test_50 fastcall-ii-indirect ] unit-test +[ 13 ] [ 3 4.0 5 &: ffi_test_52 fastcall-ifi-indirect ] unit-test From 5dcfb383a630f33bc11098777714fba97e41f361 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Thu, 1 Apr 2010 23:52:56 -0700 Subject: [PATCH 023/157] add tests for struct returns from fastcall --- basis/compiler/tests/alien.factor | 9 +++++++++ vm/ffi_test.c | 12 ++++++++++++ vm/ffi_test.h | 2 ++ 3 files changed, 23 insertions(+) diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index d4dd1f6eb8..fdbcf6948e 100755 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -653,12 +653,20 @@ FUNCTION: void this_does_not_exist ( ) ; : ffi_test_56 ( x y z w -- int ) int "f-fastcall" "ffi_test_56" { test-struct-11 int int int } alien-invoke gc ; +: ffi_test_57 ( x y -- test-struct-11 ) + test-struct-11 "f-fastcall" "ffi_test_57" { int int } + alien-invoke gc ; +: ffi_test_58 ( x y z -- test-struct-11 ) + test-struct-11 "f-fastcall" "ffi_test_58" { int int int } + alien-invoke gc ; [ 13 ] [ 3 4.0 5 ffi_test_52 ] unit-test [ 19 ] [ 3 4.0 5 6 ffi_test_53 ] unit-test [ 13 ] [ 3 4 test-struct-11 5 ffi_test_54 ] unit-test [ 19 ] [ 3 4 test-struct-11 5 6 ffi_test_55 ] unit-test [ 26 ] [ 3 4 test-struct-11 5 6 7 ffi_test_56 ] unit-test +[ S{ test-struct-11 f 7 -1 } ] [ 3 4 ffi_test_57 ] unit-test +[ S{ test-struct-11 f 7 -3 } ] [ 3 4 7 ffi_test_58 ] unit-test : fastcall-ii-indirect ( x y ptr -- result ) int { int int } fastcall alien-indirect ; @@ -667,3 +675,4 @@ FUNCTION: void this_does_not_exist ( ) ; [ 8 ] [ 3 4 &: ffi_test_50 fastcall-ii-indirect ] unit-test [ 13 ] [ 3 4.0 5 &: ffi_test_52 fastcall-ifi-indirect ] unit-test + diff --git a/vm/ffi_test.c b/vm/ffi_test.c index d45a08cf8b..993ca18fa3 100755 --- a/vm/ffi_test.c +++ b/vm/ffi_test.c @@ -353,3 +353,15 @@ FACTOR_FASTCALL(int) ffi_test_56(struct test_struct_11 x, int y, int z, int w) { return x.x + x.y + y + z + w + 1; } + +FACTOR_FASTCALL(struct test_struct_11) ffi_test_57(int x, int y) +{ + struct test_struct_11 r = { x + y, x - y }; + return r; +} + +FACTOR_FASTCALL(struct test_struct_11) ffi_test_58(int x, int y, int z) +{ + struct test_struct_11 r = { x + y, y - z }; + return r; +} diff --git a/vm/ffi_test.h b/vm/ffi_test.h index 6fe35fdb42..08b8f95c39 100755 --- a/vm/ffi_test.h +++ b/vm/ffi_test.h @@ -131,3 +131,5 @@ FACTOR_EXPORT FACTOR_FASTCALL(int) ffi_test_53(int x, float y, int z, int w); FACTOR_EXPORT FACTOR_FASTCALL(int) ffi_test_54(struct test_struct_11 x, int y); FACTOR_EXPORT FACTOR_FASTCALL(int) ffi_test_55(struct test_struct_11 x, int y, int z); FACTOR_EXPORT FACTOR_FASTCALL(int) ffi_test_56(struct test_struct_11 x, int y, int z, int w); +FACTOR_EXPORT FACTOR_FASTCALL(struct test_struct_11) ffi_test_57(int x, int y); +FACTOR_EXPORT FACTOR_FASTCALL(struct test_struct_11) ffi_test_58(int x, int y, int z); From 43d73dcd4d6f0967d91f6c1c4134cb8ab6acfbf0 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Thu, 1 Apr 2010 23:54:08 -0700 Subject: [PATCH 024/157] remove fastcall struct param tests because GCC appears to behave differently from VC++ here and again, who cares --- basis/compiler/tests/alien.factor | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index fdbcf6948e..757576525a 100755 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -644,15 +644,6 @@ FUNCTION: void this_does_not_exist ( ) ; : ffi_test_53 ( x y z w -- int ) int "f-fastcall" "ffi_test_53" { int float int int } alien-invoke gc ; -: ffi_test_54 ( x y -- int ) - int "f-fastcall" "ffi_test_54" { test-struct-11 int } - alien-invoke gc ; -: ffi_test_55 ( x y z -- int ) - int "f-fastcall" "ffi_test_55" { test-struct-11 int int } - alien-invoke gc ; -: ffi_test_56 ( x y z w -- int ) - int "f-fastcall" "ffi_test_56" { test-struct-11 int int int } - alien-invoke gc ; : ffi_test_57 ( x y -- test-struct-11 ) test-struct-11 "f-fastcall" "ffi_test_57" { int int } alien-invoke gc ; @@ -662,9 +653,6 @@ FUNCTION: void this_does_not_exist ( ) ; [ 13 ] [ 3 4.0 5 ffi_test_52 ] unit-test [ 19 ] [ 3 4.0 5 6 ffi_test_53 ] unit-test -[ 13 ] [ 3 4 test-struct-11 5 ffi_test_54 ] unit-test -[ 19 ] [ 3 4 test-struct-11 5 6 ffi_test_55 ] unit-test -[ 26 ] [ 3 4 test-struct-11 5 6 7 ffi_test_56 ] unit-test [ S{ test-struct-11 f 7 -1 } ] [ 3 4 ffi_test_57 ] unit-test [ S{ test-struct-11 f 7 -3 } ] [ 3 4 7 ffi_test_58 ] unit-test From 47f3ace5ac197b5963e2c8ce28d5d343f870e6a5 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Fri, 2 Apr 2010 00:00:34 -0700 Subject: [PATCH 025/157] test fastcall indirect struct return --- basis/compiler/tests/alien.factor | 3 +++ 1 file changed, 3 insertions(+) diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index 757576525a..667fd43285 100755 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -660,7 +660,10 @@ FUNCTION: void this_does_not_exist ( ) ; int { int int } fastcall alien-indirect ; : fastcall-ifi-indirect ( x y z ptr -- result ) int { int float int } fastcall alien-indirect ; +: fastcall-struct-return-indirect ( x y ptr -- result ) + test-struct-11 { int int } fastcall alien-indirect ; [ 8 ] [ 3 4 &: ffi_test_50 fastcall-ii-indirect ] unit-test [ 13 ] [ 3 4.0 5 &: ffi_test_52 fastcall-ifi-indirect ] unit-test +[ S{ test-struct-11 f 7 -1 } ] [ 3 4 &: ffi_test_57 fastcall-struct-return-indirect ] unit-test From 1c5f718e802331842417343347aaf8e23ec3542d Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Fri, 2 Apr 2010 00:23:39 -0700 Subject: [PATCH 026/157] add tests for fastcall callbacks --- basis/compiler/tests/alien.factor | 46 +++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index 667fd43285..c54ce443d6 100755 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -658,12 +658,52 @@ FUNCTION: void this_does_not_exist ( ) ; : fastcall-ii-indirect ( x y ptr -- result ) int { int int } fastcall alien-indirect ; +: fastcall-iii-indirect ( x y z ptr -- result ) + int { int int int } fastcall alien-indirect ; : fastcall-ifi-indirect ( x y z ptr -- result ) int { int float int } fastcall alien-indirect ; -: fastcall-struct-return-indirect ( x y ptr -- result ) +: fastcall-ifii-indirect ( x y z w ptr -- result ) + int { int float int int } fastcall alien-indirect ; +: fastcall-struct-return-ii-indirect ( x y ptr -- result ) test-struct-11 { int int } fastcall alien-indirect ; +: fastcall-struct-return-iii-indirect ( x y z ptr -- result ) + test-struct-11 { int int int } fastcall alien-indirect ; [ 8 ] [ 3 4 &: ffi_test_50 fastcall-ii-indirect ] unit-test -[ 13 ] [ 3 4.0 5 &: ffi_test_52 fastcall-ifi-indirect ] unit-test -[ S{ test-struct-11 f 7 -1 } ] [ 3 4 &: ffi_test_57 fastcall-struct-return-indirect ] unit-test +[ 13 ] [ 3 4 5 &: ffi_test_51 fastcall-iii-indirect ] unit-test +[ 13 ] [ 3 4.0 5 &: ffi_test_52 fastcall-ifi-indirect ] unit-test +[ 19 ] [ 3 4.0 5 6 &: ffi_test_53 fastcall-ifii-indirect ] unit-test +[ S{ test-struct-11 f 7 -1 } ] +[ 3 4 &: ffi_test_57 fastcall-struct-return-ii-indirect ] unit-test + +[ S{ test-struct-11 f 7 -3 } ] +[ 3 4 7 &: ffi_test_58 fastcall-struct-return-iii-indirect ] unit-test + +: fastcall-ii-callback ( -- ptr ) + int { int int } fastcall [ + 1 + ] alien-callback ; +: fastcall-iii-callback ( -- ptr ) + int { int int int } fastcall [ + + 1 + ] alien-callback ; +: fastcall-ifi-callback ( -- ptr ) + int { int float int } fastcall + [ [ >integer ] dip + + 1 + ] alien-callback ; +: fastcall-ifii-callback ( -- ptr ) + int { int float int int } fastcall + [ [ >integer ] 2dip + + + 1 + ] alien-callback ; +: fastcall-struct-return-ii-callback ( -- ptr ) + test-struct-11 { int int } fastcall + [ [ + ] [ - ] 2bi test-struct-11 ] alien-callback ; +: fastcall-struct-return-iii-callback ( -- ptr ) + test-struct-11 { int int int } fastcall + [ [ drop + ] [ - nip ] 3bi test-struct-11 ] alien-callback ; + +[ 8 ] [ 3 4 fastcall-ii-callback fastcall-ii-indirect ] unit-test +[ 13 ] [ 3 4 5 fastcall-iii-callback fastcall-iii-indirect ] unit-test +[ 13 ] [ 3 4.0 5 fastcall-ifi-callback fastcall-ifi-indirect ] unit-test +[ 19 ] [ 3 4.0 5 6 fastcall-ifii-callback fastcall-ifii-indirect ] unit-test + +[ S{ test-struct-11 f 7 -1 } ] +[ 3 4 fastcall-struct-return-ii-callback fastcall-struct-return-ii-indirect ] unit-test + +[ S{ test-struct-11 f 7 -3 } ] +[ 3 4 7 fastcall-struct-return-iii-callback fastcall-struct-return-iii-indirect ] unit-test From 2d22a8eb49c5010c3bab9507d1c0dd99cdc9a198 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Fri, 2 Apr 2010 00:30:27 -0700 Subject: [PATCH 027/157] tools.disassembler: allow aliens to be used in address pairs --- basis/tools/disassembler/disassembler.factor | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/basis/tools/disassembler/disassembler.factor b/basis/tools/disassembler/disassembler.factor index c0b3c9a586..c8df2f1094 100644 --- a/basis/tools/disassembler/disassembler.factor +++ b/basis/tools/disassembler/disassembler.factor @@ -15,6 +15,11 @@ HOOK: disassemble* disassembler-backend ( from to -- lines ) TR: tabs>spaces "\t" "\s" ; +GENERIC: (>address) ( object -- n ) + +M: integer (>address) ; +M: alien (>address) alien-address ; + PRIVATE> M: byte-array disassemble @@ -24,7 +29,7 @@ M: byte-array disassemble 2array disassemble ] with-destructors ; -M: pair disassemble first2 disassemble* [ tabs>spaces print ] each ; +M: pair disassemble first2 [ (>address) ] bi@ disassemble* [ tabs>spaces print ] each ; M: word disassemble word-code 2array disassemble ; From 77e63550a776838780f2fa7f5f0cf166f9b35307 Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Fri, 2 Apr 2010 00:47:37 -0700 Subject: [PATCH 028/157] Add syntax highlighting for BEFORE: and AFTER: --- misc/fuel/fuel-font-lock.el | 4 ++++ misc/fuel/fuel-syntax.el | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/misc/fuel/fuel-font-lock.el b/misc/fuel/fuel-font-lock.el index 983e1bcb98..8d3990fcd8 100644 --- a/misc/fuel/fuel-font-lock.el +++ b/misc/fuel/fuel-font-lock.el @@ -126,6 +126,10 @@ (,fuel-syntax--type-definition-regex 2 'factor-font-lock-type-name) (,fuel-syntax--method-definition-regex (1 'factor-font-lock-type-name) (2 'factor-font-lock-word)) + (,fuel-syntax--before-definition-regex (1 'factor-font-lock-type-name) + (2 'factor-font-lock-word)) + (,fuel-syntax--after-definition-regex (1 'factor-font-lock-type-name) + (2 'factor-font-lock-word)) (,fuel-syntax--tuple-decl-regex 2 'factor-font-lock-type-name) (,fuel-syntax--constructor-regex . 'factor-font-lock-constructor) (,fuel-syntax--setter-regex . 'factor-font-lock-setter-word) diff --git a/misc/fuel/fuel-syntax.el b/misc/fuel/fuel-syntax.el index 114355b3db..d13a670df4 100644 --- a/misc/fuel/fuel-syntax.el +++ b/misc/fuel/fuel-syntax.el @@ -44,8 +44,8 @@ (defconst fuel-syntax--parsing-words '(":" "::" ";" "&:" "<<" ">" - "ABOUT:" "ALIAS:" "ALIEN:" "ARTICLE:" - "B" "BIN:" + "ABOUT:" "AFTER:" "ALIAS:" "ALIEN:" "ARTICLE:" + "B" "BEFORE:" "BIN:" "C:" "CALLBACK:" "C-ENUM:" "C-STRUCT:" "C-TYPE:" "C-UNION:" "CHAR:" "COM-INTERFACE:" "CONSTANT:" "call-next-method" "DEFER:" "EBNF:" ";EBNF" "ERROR:" "EXCLUDE:" @@ -88,6 +88,12 @@ (defconst fuel-syntax--method-definition-regex "^M::? +\\([^ ]+\\) +\\([^ ]+\\)") +(defconst fuel-syntax--before-definition-regex + "^BEFORE: +\\([^ ]+\\) +\\([^ ]+\\)") + +(defconst fuel-syntax--after-definition-regex + "^AFTER: +\\([^ ]+\\) +\\([^ ]+\\)") + (defconst fuel-syntax--integer-regex "\\_<-?[0-9]+\\_>") @@ -157,6 +163,7 @@ "\\_ Date: Fri, 2 Apr 2010 23:16:53 -0700 Subject: [PATCH 029/157] update some more doc examples using old abi strings --- basis/alien/libraries/libraries-docs.factor | 6 +++--- core/alien/alien-docs.factor | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/basis/alien/libraries/libraries-docs.factor b/basis/alien/libraries/libraries-docs.factor index d2e510e0e9..8676ac8c58 100644 --- a/basis/alien/libraries/libraries-docs.factor +++ b/basis/alien/libraries/libraries-docs.factor @@ -43,7 +43,7 @@ HELP: load-library { $description "Loads a library by logical name and outputs a handle which may be passed to " { $link dlsym } " or " { $link dlclose } ". If the library is already loaded, returns the existing handle." } ; HELP: add-library -{ $values { "name" string } { "path" string } { "abi" "one of " { $snippet "\"cdecl\"" } " or " { $snippet "\"stdcall\"" } } } +{ $values { "name" string } { "path" string } { "abi" "one of " { $link cdecl } " or " { $link stdcall } } } { $description "Defines a new logical library named " { $snippet "name" } " located in the file system at " { $snippet "path" } " and the specified ABI. The logical library name can then be used by a " { $link POSTPONE: LIBRARY: } " form to specify the logical library for subsequent " { $link POSTPONE: FUNCTION: } " definitions." } { $notes "Because the entire source file is parsed before top-level forms are executed, " { $link add-library } " must be placed within a " { $snippet "<< ... >>" } " parse-time evaluation block." $nl @@ -53,8 +53,8 @@ $nl { $examples "Here is a typical usage of " { $link add-library } ":" { $code "<< \"freetype\" {" - " { [ os macosx? ] [ \"libfreetype.6.dylib\" \"cdecl\" add-library ] }" - " { [ os windows? ] [ \"freetype6.dll\" \"cdecl\" add-library ] }" + " { [ os macosx? ] [ \"libfreetype.6.dylib\" cdecl add-library ] }" + " { [ os windows? ] [ \"freetype6.dll\" cdecl add-library ] }" " [ drop ]" "} cond >>" } diff --git a/core/alien/alien-docs.factor b/core/alien/alien-docs.factor index 34ff33bff9..6c64b2fac3 100644 --- a/core/alien/alien-docs.factor +++ b/core/alien/alien-docs.factor @@ -130,7 +130,7 @@ HELP: alien-callback "A simple example, showing a C function which returns the difference of two given integers:" { $code ": difference-callback ( -- alien )" - " int { int int } \"cdecl\" [ - ] alien-callback ;" + " int { int int } cdecl [ - ] alien-callback ;" } } { $errors "Throws an " { $link alien-callback-error } " if the word calling " { $link alien-callback } " is not compiled." } ; From 39f066726c21a69f71dfdd90b8b8c558e7f7656a Mon Sep 17 00:00:00 2001 From: William Schlieper Date: Sat, 3 Apr 2010 08:48:15 -0400 Subject: [PATCH 030/157] Added mouse support to game.input on Linux --- basis/game/input/x11/x11.factor | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/basis/game/input/x11/x11.factor b/basis/game/input/x11/x11.factor index 4e6f610531..1e103ad0fa 100644 --- a/basis/game/input/x11/x11.factor +++ b/basis/game/input/x11/x11.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2010 Erik Charlebois, William Schlieper. ! See http://factorcode.org/license.txt for BSD license. -USING: arrays kernel game.input namespaces +USING: accessors alien.c-types arrays kernel game.input namespaces math classes bit-arrays system sequences vectors x11 x11.xlib ; IN: game.input.x11 @@ -84,9 +84,24 @@ M: linux x>hid-bit-order M: x11-game-input-backend read-keyboard dpy get 256 [ XQueryKeymap drop ] keep x-bits>hid-bits keyboard-state boa ; + +: query-pointer ( -- x y buttons ) + dpy get dup XDefaultRootWindow + 0 0 0 0 0 0 0 + [ XQueryPointer drop ] 3keep + [ *int ] tri@ ; + +SYMBOL: mouse-reset? M: x11-game-input-backend read-mouse - 0 0 0 0 2 mouse-state boa ; + mouse-reset? get [ reset-mouse ] unless + query-pointer + mouse-state new + swap 256 /i >>buttons + swap 400 - >>dy + swap 400 - >>dx + 0 >>scroll-dy 0 >>scroll-dx ; M: x11-game-input-backend reset-mouse - ; + dpy get dup XDefaultRootWindow dup + 0 0 0 0 400 400 XWarpPointer drop t mouse-reset? set-global ; From 925d2c7e58653998e88aa0036bb619ce336455ec Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Sun, 4 Apr 2010 03:23:04 -0700 Subject: [PATCH 031/157] PGM image loading and saving --- basis/images/pgm/authors.txt | 1 + basis/images/pgm/pgm-tests.factor | 7 + basis/images/pgm/pgm.factor | 63 + basis/images/pgm/summary.txt | 1 + extra/images/testing/pgm/radial.ascii.fig | Bin 0 -> 16443 bytes extra/images/testing/pgm/radial.ascii.pgm | 16388 +++++++++++++++++++ extra/images/testing/pgm/radial.binary.fig | Bin 0 -> 16443 bytes extra/images/testing/pgm/radial.binary.pgm | Bin 0 -> 16438 bytes 8 files changed, 16460 insertions(+) create mode 100644 basis/images/pgm/authors.txt create mode 100644 basis/images/pgm/pgm-tests.factor create mode 100644 basis/images/pgm/pgm.factor create mode 100644 basis/images/pgm/summary.txt create mode 100644 extra/images/testing/pgm/radial.ascii.fig create mode 100644 extra/images/testing/pgm/radial.ascii.pgm create mode 100644 extra/images/testing/pgm/radial.binary.fig create mode 100644 extra/images/testing/pgm/radial.binary.pgm diff --git a/basis/images/pgm/authors.txt b/basis/images/pgm/authors.txt new file mode 100644 index 0000000000..6f03a12101 --- /dev/null +++ b/basis/images/pgm/authors.txt @@ -0,0 +1 @@ +Erik Charlebois diff --git a/basis/images/pgm/pgm-tests.factor b/basis/images/pgm/pgm-tests.factor new file mode 100644 index 0000000000..7bfade4717 --- /dev/null +++ b/basis/images/pgm/pgm-tests.factor @@ -0,0 +1,7 @@ +! Copyright (C) 2010 Erik Charlebois. +! See http://factorcode.org/license.txt for BSD license. +USING: images.testing ; +IN: images.pgm.tests + +"vocab:images/testing/pgm/radial.binary.pgm" decode-test +"vocab:images/testing/pgm/radial.ascii.pgm" decode-test diff --git a/basis/images/pgm/pgm.factor b/basis/images/pgm/pgm.factor new file mode 100644 index 0000000000..e673565fc9 --- /dev/null +++ b/basis/images/pgm/pgm.factor @@ -0,0 +1,63 @@ +! Copyright (C) 2010 Erik Charlebois. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors alien.c-types ascii combinators images images.loader +io io.encodings.ascii io.encodings.string kernel locals make math +math.parser sequences specialized-arrays ; +SPECIALIZED-ARRAY: ushort +IN: images.pgm + +SINGLETON: pgm-image +"pgm" pgm-image register-image-class + +: read-token ( -- token ) + [ read1 dup blank? + [ t ] + [ dup CHAR: # = + [ "\n" read-until 2drop t ] + [ f ] if + ] if + ] [ drop ] while + " \n\r\t" read-until drop swap + prefix ascii decode ; + +: read-number ( -- number ) + read-token string>number ; + +:: read-numbers ( n lim -- ) + n lim = [ + read-number , + n 1 + lim read-numbers + ] unless ; + +ERROR: INSPECT a ; +:: read-pgm ( -- image ) + read-token :> type + read-number :> width + read-number :> height + read-number :> max + width height * :> npixels + max 256 >= :> wide + + type { + { "P2" [ [ 0 npixels read-numbers ] wide [ ushort-array{ } ] [ B{ } ] if make ] } + { "P5" [ wide [ 2 ] [ 1 ] if npixels * read ] } + } case :> data + + image new + L >>component-order + { width height } >>dim + f >>upside-down? + data >>bitmap + wide [ ushort-components ] [ ubyte-components ] if >>component-type ; + +M: pgm-image stream>image + drop [ read-pgm ] with-input-stream ; + +M: pgm-image image>stream + drop { + [ drop "P5\n" ascii encode write ] + [ dim>> first number>string " " append ascii encode write ] + [ dim>> second number>string "\n" append ascii encode write ] + [ component-type>> ubyte-components = [ "255\n" ] [ "65535\n" ] if ascii encode write ] + [ bitmap>> write ] + } cleave ; diff --git a/basis/images/pgm/summary.txt b/basis/images/pgm/summary.txt new file mode 100644 index 0000000000..f558b7cbb5 --- /dev/null +++ b/basis/images/pgm/summary.txt @@ -0,0 +1 @@ +Image loading for PGM image files. diff --git a/extra/images/testing/pgm/radial.ascii.fig b/extra/images/testing/pgm/radial.ascii.fig new file mode 100644 index 0000000000000000000000000000000000000000..6e52311b94202145e080cf8f4dc7794d43490754 GIT binary patch literal 16443 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 literal 0 HcmV?d00001 diff --git a/extra/images/testing/pgm/radial.ascii.pgm b/extra/images/testing/pgm/radial.ascii.pgm new file mode 100644 index 0000000000..1a7a6a832d --- /dev/null +++ b/extra/images/testing/pgm/radial.ascii.pgm @@ -0,0 +1,16388 @@ +P2 +# CREATOR: GIMP PNM Filter Version 1.1 +128 128 +255 +0 +2 +4 +6 +8 +10 +12 +13 +16 +17 +19 +21 +22 +24 +26 +28 +30 +32 +33 +35 +36 +38 +40 +41 +42 +44 +45 +46 +48 +49 +51 +52 +54 +55 +56 +57 +58 +59 +60 +61 +63 +63 +65 +65 +66 +67 +67 +68 +69 +70 +71 +71 +72 +72 +72 +73 +74 +74 +74 +74 +74 +74 +75 +74 +75 +75 +74 +75 +74 +74 +74 +74 +73 +73 +73 +72 +72 +71 +70 +69 +69 +69 +67 +66 +66 +65 +64 +63 +62 +61 +60 +59 +58 +57 +56 +55 +54 +52 +51 +49 +48 +46 +45 +43 +42 +41 +39 +38 +36 +34 +33 +31 +29 +27 +26 +25 +23 +21 +19 +18 +16 +14 +12 +10 +8 +6 +4 +2 +2 +4 +6 +8 +10 +12 +13 +16 +18 +20 +21 +23 +24 +27 +29 +31 +32 +34 +35 +37 +38 +40 +41 +43 +45 +46 +48 +49 +50 +52 +54 +55 +56 +57 +59 +60 +61 +61 +63 +64 +66 +66 +67 +68 +69 +69 +70 +71 +72 +73 +73 +74 +74 +75 +76 +76 +76 +77 +76 +77 +77 +78 +77 +77 +77 +77 +77 +77 +78 +77 +77 +77 +76 +76 +75 +75 +74 +74 +74 +73 +72 +71 +71 +70 +68 +68 +67 +67 +65 +64 +63 +62 +60 +59 +59 +57 +56 +54 +54 +52 +51 +49 +47 +46 +45 +43 +41 +41 +38 +37 +35 +34 +32 +30 +29 +27 +25 +23 +21 +19 +18 +15 +14 +12 +10 +8 +6 +4 +4 +6 +8 +10 +12 +14 +16 +18 +20 +21 +23 +25 +27 +28 +30 +32 +34 +36 +37 +39 +40 +43 +44 +46 +47 +49 +50 +51 +53 +54 +56 +58 +58 +60 +60 +62 +63 +65 +66 +67 +68 +68 +70 +71 +72 +73 +73 +74 +74 +75 +76 +76 +78 +77 +78 +78 +79 +80 +79 +80 +80 +80 +80 +80 +80 +80 +80 +80 +80 +80 +79 +79 +78 +78 +78 +78 +77 +77 +76 +75 +75 +74 +73 +72 +71 +70 +70 +69 +67 +67 +65 +64 +63 +62 +61 +60 +59 +57 +56 +54 +53 +52 +51 +49 +47 +46 +44 +42 +41 +39 +38 +35 +34 +32 +31 +29 +27 +25 +23 +22 +19 +18 +16 +14 +12 +10 +8 +6 +6 +8 +10 +12 +14 +16 +18 +19 +22 +23 +26 +27 +29 +31 +33 +35 +37 +38 +39 +41 +43 +45 +47 +48 +49 +51 +53 +54 +56 +57 +58 +60 +61 +63 +64 +65 +66 +67 +69 +69 +70 +71 +72 +73 +74 +75 +76 +77 +77 +78 +79 +79 +80 +80 +81 +81 +81 +82 +82 +83 +82 +83 +83 +83 +83 +83 +83 +83 +83 +83 +82 +82 +82 +82 +80 +80 +80 +79 +79 +78 +77 +76 +75 +75 +74 +73 +73 +72 +71 +69 +68 +67 +66 +65 +64 +62 +61 +59 +59 +57 +55 +54 +52 +51 +50 +48 +47 +45 +43 +42 +40 +38 +36 +35 +33 +31 +29 +27 +25 +24 +22 +20 +18 +16 +14 +12 +10 +7 +8 +9 +12 +14 +16 +18 +19 +22 +24 +25 +27 +30 +31 +34 +35 +37 +38 +41 +42 +44 +45 +47 +49 +50 +52 +53 +55 +56 +58 +59 +61 +62 +63 +65 +66 +67 +69 +70 +71 +72 +73 +73 +75 +76 +77 +77 +78 +80 +80 +81 +81 +82 +82 +84 +83 +84 +84 +84 +85 +86 +85 +86 +86 +86 +86 +85 +86 +86 +86 +86 +85 +85 +84 +84 +84 +83 +83 +82 +81 +80 +80 +80 +78 +78 +77 +76 +75 +74 +73 +72 +71 +69 +68 +68 +66 +65 +64 +62 +61 +59 +58 +57 +55 +53 +52 +50 +49 +47 +46 +44 +42 +40 +39 +36 +35 +33 +31 +29 +28 +26 +23 +22 +20 +18 +16 +14 +12 +10 +10 +12 +14 +16 +18 +20 +22 +23 +26 +28 +30 +31 +33 +36 +37 +38 +41 +42 +45 +45 +48 +50 +51 +53 +55 +56 +58 +59 +60 +62 +63 +64 +66 +68 +69 +69 +71 +73 +74 +74 +76 +77 +77 +78 +79 +80 +82 +82 +82 +84 +85 +85 +85 +86 +86 +87 +87 +88 +88 +89 +88 +88 +89 +88 +89 +89 +88 +89 +88 +88 +88 +88 +87 +87 +86 +86 +86 +85 +85 +84 +82 +82 +82 +81 +80 +79 +78 +77 +75 +74 +73 +72 +71 +70 +68 +67 +66 +64 +64 +62 +60 +59 +57 +56 +54 +53 +51 +49 +48 +46 +44 +42 +40 +39 +37 +35 +34 +31 +30 +28 +26 +24 +21 +20 +18 +16 +14 +12 +12 +14 +16 +18 +20 +22 +24 +26 +28 +30 +32 +34 +36 +38 +39 +41 +43 +45 +47 +48 +50 +52 +53 +55 +57 +58 +59 +61 +63 +64 +65 +67 +69 +70 +71 +73 +74 +74 +76 +77 +78 +79 +80 +81 +83 +83 +84 +85 +85 +86 +87 +87 +89 +89 +90 +89 +90 +90 +91 +91 +91 +92 +92 +92 +92 +92 +91 +92 +92 +91 +91 +91 +90 +89 +89 +89 +88 +87 +87 +86 +86 +85 +84 +83 +82 +81 +80 +79 +78 +77 +76 +75 +74 +72 +71 +69 +68 +67 +66 +64 +63 +61 +59 +58 +56 +55 +53 +52 +50 +49 +46 +45 +43 +41 +39 +37 +36 +33 +32 +30 +28 +26 +24 +22 +20 +18 +15 +14 +14 +15 +18 +20 +22 +24 +26 +28 +30 +31 +33 +36 +37 +40 +42 +43 +45 +47 +48 +50 +52 +54 +56 +57 +59 +61 +62 +64 +65 +67 +68 +70 +71 +72 +74 +75 +76 +77 +78 +80 +81 +82 +83 +84 +85 +86 +87 +87 +88 +89 +89 +90 +90 +91 +92 +92 +93 +93 +94 +94 +94 +95 +94 +94 +94 +94 +94 +94 +94 +94 +94 +94 +93 +92 +92 +92 +90 +91 +90 +89 +88 +87 +86 +86 +85 +84 +83 +82 +81 +80 +78 +77 +76 +75 +73 +72 +70 +69 +68 +67 +65 +63 +62 +61 +59 +57 +56 +54 +52 +50 +49 +47 +45 +43 +41 +40 +38 +35 +34 +32 +30 +28 +26 +24 +22 +20 +17 +16 +15 +17 +20 +22 +24 +26 +28 +30 +32 +34 +35 +38 +40 +41 +44 +45 +48 +49 +51 +53 +54 +56 +58 +60 +62 +63 +65 +66 +68 +69 +70 +72 +73 +74 +76 +77 +79 +80 +81 +82 +84 +84 +85 +87 +87 +89 +89 +90 +91 +91 +92 +93 +94 +94 +94 +95 +96 +96 +96 +97 +97 +97 +97 +97 +98 +98 +98 +97 +97 +96 +96 +96 +95 +95 +95 +95 +94 +93 +92 +92 +91 +90 +89 +88 +88 +87 +86 +84 +83 +82 +81 +80 +79 +77 +76 +74 +73 +72 +71 +69 +68 +66 +64 +63 +61 +59 +58 +57 +54 +53 +51 +49 +48 +45 +43 +42 +39 +37 +35 +34 +31 +30 +28 +26 +24 +21 +20 +18 +17 +20 +22 +23 +26 +28 +30 +31 +34 +36 +38 +40 +42 +44 +46 +48 +49 +51 +53 +55 +57 +59 +60 +62 +63 +65 +66 +68 +70 +72 +73 +74 +76 +78 +78 +79 +81 +83 +83 +84 +86 +87 +89 +89 +90 +91 +92 +92 +94 +95 +95 +96 +96 +97 +98 +98 +99 +98 +99 +100 +100 +99 +100 +100 +100 +100 +100 +100 +100 +99 +99 +98 +99 +98 +98 +97 +96 +96 +95 +95 +93 +93 +92 +91 +90 +89 +89 +87 +86 +85 +84 +83 +81 +79 +78 +77 +75 +74 +73 +71 +70 +69 +67 +65 +64 +62 +60 +59 +57 +55 +53 +51 +49 +47 +46 +44 +41 +40 +38 +36 +34 +32 +30 +27 +26 +24 +21 +19 +19 +21 +24 +26 +28 +30 +32 +34 +35 +38 +40 +41 +44 +45 +48 +50 +52 +54 +56 +56 +59 +61 +62 +64 +66 +67 +69 +71 +73 +74 +76 +77 +78 +79 +81 +83 +84 +85 +86 +87 +89 +90 +91 +92 +93 +93 +95 +96 +97 +97 +97 +98 +99 +100 +100 +100 +101 +101 +102 +103 +102 +102 +103 +103 +102 +103 +102 +102 +103 +102 +102 +102 +101 +100 +100 +99 +99 +98 +98 +98 +97 +96 +95 +94 +92 +91 +91 +89 +89 +88 +87 +85 +84 +83 +81 +79 +78 +77 +75 +74 +73 +71 +69 +68 +66 +64 +62 +61 +59 +57 +55 +54 +51 +49 +48 +46 +43 +42 +40 +38 +36 +33 +32 +29 +27 +26 +23 +21 +21 +23 +25 +27 +30 +32 +33 +35 +38 +40 +42 +44 +45 +48 +50 +52 +53 +55 +57 +59 +61 +63 +64 +67 +68 +69 +71 +73 +75 +76 +77 +79 +81 +82 +83 +85 +87 +88 +89 +90 +91 +92 +93 +95 +95 +96 +97 +98 +99 +99 +101 +101 +102 +102 +103 +104 +104 +105 +105 +105 +105 +105 +106 +106 +106 +106 +106 +106 +105 +105 +105 +104 +104 +103 +103 +103 +102 +101 +101 +100 +99 +98 +97 +96 +96 +95 +93 +93 +91 +90 +88 +87 +86 +85 +83 +82 +81 +79 +77 +76 +74 +73 +71 +69 +68 +66 +65 +63 +61 +59 +57 +56 +54 +51 +50 +48 +46 +43 +42 +40 +38 +35 +34 +32 +30 +27 +25 +23 +22 +25 +27 +29 +32 +34 +35 +38 +40 +42 +44 +45 +48 +50 +52 +53 +56 +57 +60 +61 +64 +65 +67 +69 +70 +72 +74 +76 +77 +79 +80 +81 +83 +84 +86 +87 +88 +90 +91 +92 +94 +95 +96 +97 +98 +99 +100 +101 +102 +102 +103 +104 +105 +105 +106 +106 +107 +108 +108 +108 +108 +108 +108 +108 +109 +109 +108 +108 +108 +108 +107 +107 +106 +106 +106 +105 +104 +104 +103 +103 +102 +101 +100 +99 +98 +97 +96 +95 +94 +92 +91 +90 +89 +87 +86 +84 +83 +82 +80 +79 +76 +75 +74 +71 +70 +69 +67 +65 +63 +61 +59 +57 +56 +54 +51 +49 +48 +46 +44 +42 +40 +38 +35 +34 +31 +29 +27 +25 +24 +26 +29 +31 +33 +35 +37 +39 +42 +44 +46 +48 +49 +51 +54 +56 +57 +60 +61 +63 +65 +67 +69 +71 +73 +74 +76 +77 +79 +81 +82 +84 +85 +87 +89 +90 +91 +92 +94 +95 +96 +97 +99 +99 +100 +102 +103 +104 +104 +106 +106 +107 +108 +108 +109 +109 +110 +110 +110 +111 +111 +111 +111 +111 +111 +112 +111 +111 +111 +111 +111 +110 +110 +109 +109 +108 +108 +107 +106 +105 +105 +103 +102 +101 +100 +99 +99 +97 +96 +95 +94 +92 +91 +90 +88 +87 +86 +84 +82 +80 +79 +77 +75 +74 +72 +71 +69 +67 +65 +63 +61 +60 +58 +56 +54 +52 +50 +48 +46 +44 +42 +39 +37 +35 +34 +31 +28 +27 +26 +28 +31 +33 +35 +37 +39 +41 +44 +45 +47 +50 +52 +54 +56 +58 +59 +62 +64 +66 +67 +69 +71 +73 +75 +76 +78 +80 +82 +83 +85 +86 +88 +90 +91 +92 +94 +95 +97 +97 +98 +100 +101 +103 +103 +104 +105 +106 +107 +108 +109 +109 +110 +111 +111 +112 +112 +113 +113 +114 +114 +114 +114 +114 +115 +114 +114 +114 +113 +113 +113 +113 +112 +111 +111 +110 +110 +109 +108 +108 +107 +106 +106 +104 +103 +102 +102 +99 +99 +97 +97 +95 +94 +92 +91 +89 +87 +87 +84 +83 +81 +80 +78 +77 +75 +73 +71 +69 +67 +66 +63 +62 +60 +58 +56 +54 +51 +50 +48 +46 +44 +42 +39 +37 +35 +33 +31 +28 +28 +31 +32 +35 +36 +39 +41 +43 +46 +47 +49 +52 +54 +56 +57 +60 +62 +63 +65 +68 +69 +71 +73 +75 +77 +79 +80 +82 +84 +85 +87 +88 +90 +91 +93 +95 +96 +97 +99 +100 +101 +102 +104 +105 +106 +107 +108 +109 +109 +111 +111 +113 +113 +113 +114 +114 +115 +116 +116 +116 +117 +117 +117 +117 +117 +117 +117 +117 +117 +117 +116 +115 +115 +115 +115 +113 +113 +112 +111 +111 +110 +109 +108 +107 +106 +104 +103 +102 +102 +100 +98 +97 +96 +95 +93 +92 +90 +89 +87 +85 +84 +82 +80 +79 +77 +75 +73 +72 +69 +67 +66 +64 +61 +60 +57 +56 +53 +52 +49 +48 +46 +43 +41 +38 +37 +35 +33 +30 +30 +31 +34 +36 +39 +40 +42 +45 +47 +49 +52 +54 +56 +57 +60 +62 +64 +65 +68 +69 +71 +74 +76 +77 +79 +81 +83 +84 +86 +87 +89 +90 +93 +94 +96 +97 +99 +100 +101 +103 +104 +106 +106 +108 +109 +110 +111 +112 +112 +114 +114 +115 +115 +117 +117 +117 +117 +119 +118 +119 +119 +119 +120 +119 +120 +119 +120 +120 +119 +119 +119 +119 +118 +118 +117 +116 +116 +115 +114 +114 +113 +111 +111 +110 +109 +108 +106 +105 +104 +103 +101 +100 +99 +97 +96 +94 +92 +91 +89 +87 +86 +84 +83 +80 +79 +77 +76 +73 +71 +70 +67 +65 +64 +62 +59 +57 +55 +54 +51 +49 +47 +45 +43 +41 +38 +37 +34 +31 +32 +34 +35 +38 +40 +43 +45 +46 +49 +52 +53 +55 +57 +59 +62 +64 +66 +68 +70 +72 +73 +75 +77 +79 +81 +83 +85 +86 +88 +90 +91 +93 +95 +97 +98 +99 +101 +102 +103 +105 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +117 +119 +119 +120 +121 +120 +121 +121 +122 +122 +122 +122 +123 +123 +122 +123 +122 +122 +122 +121 +121 +120 +121 +120 +119 +118 +117 +117 +116 +115 +114 +113 +112 +111 +110 +108 +107 +106 +105 +104 +102 +100 +99 +98 +96 +95 +93 +91 +90 +88 +86 +84 +83 +81 +79 +77 +75 +74 +71 +70 +68 +66 +63 +62 +59 +57 +55 +53 +51 +49 +47 +45 +42 +40 +38 +36 +33 +33 +35 +37 +40 +42 +44 +47 +49 +51 +53 +56 +57 +59 +61 +63 +66 +68 +70 +72 +74 +76 +78 +80 +82 +83 +86 +87 +88 +90 +93 +94 +95 +97 +99 +101 +102 +103 +105 +106 +107 +108 +110 +111 +113 +113 +115 +116 +116 +118 +118 +120 +120 +121 +121 +122 +123 +124 +124 +125 +124 +125 +126 +126 +125 +125 +125 +125 +126 +125 +125 +124 +124 +124 +123 +122 +122 +121 +121 +119 +118 +117 +116 +116 +115 +113 +112 +111 +110 +109 +107 +106 +105 +103 +102 +100 +98 +97 +96 +93 +92 +90 +89 +87 +85 +83 +81 +79 +78 +76 +74 +71 +70 +68 +65 +64 +62 +59 +58 +56 +53 +51 +48 +46 +44 +42 +39 +38 +35 +35 +36 +39 +42 +43 +46 +48 +50 +53 +54 +57 +59 +61 +64 +65 +68 +69 +72 +74 +75 +78 +80 +81 +83 +86 +87 +89 +91 +93 +94 +96 +98 +99 +101 +102 +104 +105 +107 +109 +110 +111 +113 +114 +116 +116 +117 +119 +120 +121 +121 +122 +123 +124 +124 +126 +126 +126 +127 +127 +128 +128 +128 +128 +128 +128 +128 +128 +128 +128 +127 +127 +127 +127 +126 +125 +125 +124 +123 +123 +121 +121 +120 +118 +118 +116 +115 +114 +112 +111 +110 +108 +107 +105 +104 +102 +101 +99 +98 +96 +94 +93 +91 +89 +87 +85 +84 +82 +80 +78 +75 +74 +71 +70 +68 +65 +63 +61 +59 +57 +55 +52 +50 +49 +46 +44 +41 +39 +37 +37 +39 +40 +43 +46 +48 +49 +52 +54 +57 +59 +61 +63 +66 +68 +70 +72 +73 +76 +77 +80 +82 +84 +86 +88 +90 +92 +94 +95 +97 +98 +100 +101 +103 +105 +107 +108 +110 +111 +112 +113 +115 +116 +118 +118 +120 +121 +122 +123 +124 +124 +126 +127 +127 +128 +128 +129 +129 +129 +130 +131 +131 +131 +131 +131 +131 +131 +131 +130 +130 +130 +129 +129 +129 +128 +127 +126 +126 +125 +124 +123 +122 +121 +120 +119 +118 +116 +115 +114 +113 +111 +110 +108 +107 +104 +103 +102 +100 +98 +96 +95 +93 +91 +90 +87 +85 +84 +82 +79 +78 +75 +74 +72 +69 +67 +65 +63 +60 +59 +56 +55 +52 +49 +47 +46 +43 +41 +38 +37 +40 +42 +44 +47 +49 +52 +54 +56 +58 +61 +62 +65 +67 +69 +72 +73 +75 +77 +80 +82 +83 +86 +88 +89 +92 +93 +95 +97 +99 +101 +102 +104 +106 +108 +108 +110 +112 +114 +115 +116 +118 +119 +120 +121 +122 +124 +125 +126 +127 +128 +128 +130 +130 +130 +131 +132 +132 +133 +133 +133 +133 +134 +134 +134 +134 +133 +134 +133 +133 +132 +133 +132 +131 +131 +130 +129 +128 +127 +126 +126 +125 +124 +123 +121 +120 +119 +118 +117 +115 +114 +112 +111 +109 +107 +105 +104 +103 +101 +99 +97 +95 +94 +91 +90 +87 +86 +83 +82 +80 +78 +76 +73 +71 +69 +67 +65 +62 +61 +59 +56 +53 +52 +49 +47 +45 +43 +40 +39 +41 +44 +46 +48 +51 +54 +56 +58 +60 +63 +64 +66 +69 +71 +73 +76 +78 +80 +81 +84 +86 +88 +89 +92 +93 +95 +97 +100 +100 +103 +104 +106 +108 +110 +112 +113 +114 +116 +118 +119 +120 +122 +123 +124 +126 +126 +128 +128 +129 +130 +131 +132 +133 +134 +134 +134 +135 +136 +136 +136 +137 +137 +137 +137 +137 +137 +136 +136 +136 +136 +135 +134 +134 +133 +133 +131 +132 +130 +130 +128 +127 +126 +125 +124 +123 +121 +121 +118 +117 +116 +114 +112 +111 +110 +108 +107 +105 +102 +101 +100 +98 +95 +94 +91 +90 +88 +86 +83 +82 +79 +78 +76 +73 +71 +69 +67 +65 +62 +60 +58 +55 +54 +51 +49 +47 +44 +42 +41 +44 +46 +47 +50 +53 +55 +57 +60 +61 +64 +66 +68 +71 +72 +75 +77 +79 +82 +84 +85 +88 +90 +91 +93 +95 +98 +99 +101 +103 +105 +107 +108 +110 +112 +113 +115 +117 +118 +120 +121 +122 +124 +126 +126 +128 +129 +130 +131 +132 +133 +134 +135 +135 +136 +137 +138 +138 +139 +138 +139 +139 +140 +139 +139 +140 +139 +139 +139 +139 +138 +137 +138 +136 +136 +135 +135 +134 +133 +132 +131 +130 +129 +128 +127 +126 +124 +122 +121 +119 +119 +117 +115 +113 +112 +111 +109 +107 +105 +103 +101 +99 +98 +96 +94 +92 +90 +87 +86 +84 +82 +79 +78 +75 +73 +71 +68 +66 +64 +61 +60 +58 +55 +53 +50 +48 +46 +43 +42 +44 +47 +50 +52 +54 +56 +58 +61 +64 +66 +68 +70 +72 +74 +77 +79 +81 +83 +85 +87 +90 +92 +93 +95 +98 +99 +101 +103 +105 +107 +109 +111 +112 +115 +116 +117 +119 +120 +123 +123 +125 +126 +128 +129 +130 +132 +132 +134 +135 +136 +137 +137 +138 +139 +140 +140 +141 +141 +141 +141 +142 +143 +142 +143 +142 +142 +142 +142 +142 +141 +141 +141 +140 +139 +138 +137 +137 +135 +134 +134 +132 +132 +130 +129 +128 +126 +125 +124 +122 +121 +119 +118 +115 +115 +112 +110 +109 +107 +106 +104 +101 +100 +98 +96 +93 +92 +90 +88 +85 +83 +81 +79 +77 +74 +72 +70 +67 +66 +63 +61 +59 +56 +54 +52 +49 +47 +45 +44 +46 +49 +51 +54 +56 +58 +61 +62 +65 +67 +70 +72 +74 +76 +78 +81 +83 +85 +87 +89 +92 +93 +96 +98 +100 +102 +104 +106 +107 +110 +111 +113 +115 +117 +118 +120 +121 +123 +125 +126 +127 +129 +130 +132 +132 +134 +136 +136 +137 +139 +139 +140 +141 +142 +142 +143 +143 +144 +144 +145 +145 +145 +145 +145 +145 +145 +144 +145 +145 +144 +143 +143 +142 +142 +141 +140 +139 +138 +138 +136 +135 +134 +133 +132 +130 +129 +128 +126 +124 +123 +121 +120 +118 +116 +114 +113 +111 +109 +107 +106 +104 +102 +100 +98 +95 +94 +91 +90 +87 +86 +83 +81 +79 +76 +74 +72 +70 +68 +65 +63 +61 +58 +55 +54 +51 +48 +46 +45 +48 +50 +52 +55 +58 +60 +62 +64 +67 +69 +71 +74 +76 +78 +80 +83 +84 +86 +90 +91 +93 +95 +97 +99 +101 +103 +105 +108 +109 +111 +113 +115 +117 +118 +120 +122 +124 +126 +127 +128 +130 +132 +132 +134 +136 +136 +138 +139 +140 +141 +141 +143 +144 +144 +145 +146 +146 +147 +147 +148 +148 +148 +148 +148 +148 +147 +148 +147 +147 +146 +147 +145 +145 +144 +143 +143 +142 +141 +140 +138 +138 +137 +135 +135 +133 +131 +130 +128 +127 +125 +124 +122 +120 +119 +117 +115 +114 +111 +109 +108 +106 +103 +102 +99 +97 +95 +93 +92 +89 +87 +85 +83 +81 +78 +76 +74 +71 +69 +66 +65 +62 +60 +57 +55 +52 +50 +48 +47 +50 +52 +54 +57 +58 +61 +64 +66 +68 +71 +72 +75 +77 +80 +82 +85 +86 +89 +91 +93 +95 +98 +100 +102 +104 +105 +108 +110 +111 +114 +115 +117 +119 +121 +122 +125 +126 +127 +129 +131 +133 +134 +136 +137 +138 +140 +140 +142 +143 +144 +144 +145 +146 +147 +148 +148 +149 +150 +150 +150 +151 +150 +151 +151 +151 +150 +150 +151 +149 +149 +149 +148 +148 +147 +146 +145 +145 +144 +142 +141 +140 +139 +138 +137 +135 +133 +132 +131 +129 +127 +126 +125 +123 +121 +119 +117 +116 +113 +111 +109 +107 +105 +104 +101 +99 +98 +95 +94 +91 +89 +87 +84 +82 +79 +78 +75 +73 +71 +68 +65 +64 +61 +59 +56 +54 +52 +49 +48 +50 +53 +56 +58 +60 +62 +65 +67 +69 +72 +75 +77 +79 +81 +83 +86 +88 +90 +93 +95 +97 +99 +102 +104 +105 +108 +110 +111 +113 +116 +117 +119 +121 +123 +124 +127 +128 +129 +131 +133 +134 +136 +137 +139 +140 +142 +143 +144 +146 +146 +147 +148 +149 +150 +151 +151 +152 +152 +153 +153 +153 +154 +154 +153 +154 +153 +153 +153 +152 +152 +152 +151 +151 +150 +149 +149 +148 +146 +145 +144 +143 +142 +140 +139 +138 +137 +135 +134 +132 +130 +128 +126 +125 +123 +122 +119 +117 +115 +113 +111 +110 +108 +106 +104 +101 +99 +97 +95 +93 +90 +88 +86 +83 +81 +79 +76 +75 +72 +70 +67 +65 +62 +60 +58 +56 +53 +50 +49 +52 +55 +57 +59 +61 +64 +66 +69 +71 +74 +76 +78 +81 +83 +85 +88 +90 +93 +95 +96 +98 +101 +103 +105 +107 +109 +111 +114 +115 +118 +119 +121 +123 +125 +127 +129 +130 +132 +134 +136 +137 +139 +140 +141 +143 +144 +145 +147 +148 +149 +150 +151 +151 +152 +153 +154 +154 +155 +156 +156 +156 +157 +156 +157 +156 +156 +156 +155 +155 +155 +155 +154 +153 +153 +152 +151 +150 +149 +147 +147 +145 +144 +143 +141 +140 +138 +137 +136 +134 +132 +130 +128 +127 +125 +124 +122 +120 +118 +116 +113 +112 +110 +107 +105 +103 +101 +99 +97 +94 +92 +90 +88 +86 +83 +81 +78 +76 +73 +72 +69 +67 +65 +62 +59 +57 +55 +51 +51 +53 +55 +58 +60 +63 +66 +68 +71 +73 +75 +77 +80 +82 +85 +87 +89 +91 +93 +96 +98 +101 +103 +105 +108 +110 +111 +114 +115 +118 +120 +122 +123 +125 +127 +129 +131 +132 +134 +136 +137 +139 +141 +142 +144 +145 +147 +148 +149 +150 +151 +153 +154 +154 +155 +156 +157 +157 +158 +158 +158 +159 +159 +159 +159 +160 +159 +159 +158 +158 +158 +157 +157 +155 +155 +155 +153 +152 +151 +150 +149 +147 +147 +146 +144 +142 +141 +140 +138 +136 +134 +133 +131 +129 +127 +126 +123 +121 +119 +118 +115 +113 +112 +109 +107 +105 +103 +101 +98 +96 +94 +91 +89 +87 +84 +82 +80 +78 +76 +73 +71 +68 +66 +63 +61 +58 +55 +54 +52 +55 +57 +60 +63 +65 +67 +69 +72 +74 +77 +79 +81 +84 +86 +89 +91 +93 +95 +98 +100 +102 +104 +106 +109 +111 +113 +115 +118 +120 +122 +123 +126 +128 +130 +131 +133 +135 +136 +138 +140 +142 +143 +144 +146 +148 +149 +150 +151 +152 +154 +155 +156 +157 +158 +159 +159 +160 +161 +161 +162 +162 +162 +162 +162 +162 +162 +162 +161 +161 +161 +160 +159 +159 +158 +157 +157 +155 +154 +153 +151 +151 +150 +148 +146 +145 +143 +142 +140 +138 +137 +135 +133 +131 +129 +127 +126 +123 +121 +119 +118 +115 +114 +111 +108 +107 +104 +102 +100 +98 +95 +94 +91 +89 +86 +84 +82 +79 +77 +74 +72 +70 +67 +64 +62 +60 +57 +54 +54 +56 +58 +61 +64 +66 +69 +71 +74 +76 +78 +80 +83 +86 +88 +90 +93 +95 +97 +100 +102 +104 +106 +109 +111 +113 +115 +117 +119 +121 +123 +125 +127 +130 +132 +133 +135 +137 +138 +140 +142 +144 +146 +147 +149 +150 +152 +153 +154 +155 +156 +158 +159 +159 +161 +161 +162 +162 +163 +164 +164 +164 +164 +165 +165 +165 +165 +165 +164 +164 +163 +163 +162 +161 +160 +160 +159 +158 +156 +155 +155 +153 +151 +150 +148 +147 +146 +144 +142 +141 +139 +137 +135 +133 +132 +129 +127 +126 +123 +121 +119 +117 +115 +112 +110 +108 +107 +104 +102 +100 +97 +95 +92 +90 +88 +85 +83 +81 +79 +75 +73 +71 +69 +66 +63 +61 +58 +56 +55 +57 +60 +62 +65 +67 +69 +72 +74 +77 +80 +82 +84 +87 +89 +92 +94 +96 +99 +101 +103 +106 +108 +110 +112 +115 +117 +119 +121 +123 +125 +127 +130 +132 +133 +136 +137 +139 +141 +143 +145 +146 +148 +149 +151 +153 +154 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +166 +166 +167 +168 +167 +168 +168 +168 +168 +167 +167 +167 +166 +165 +165 +164 +163 +163 +162 +161 +159 +158 +156 +155 +154 +152 +151 +149 +148 +146 +144 +143 +141 +139 +138 +135 +133 +131 +130 +127 +126 +123 +121 +119 +117 +115 +113 +111 +108 +106 +104 +101 +99 +97 +95 +91 +89 +87 +84 +82 +79 +77 +74 +72 +70 +67 +65 +62 +59 +57 +56 +58 +60 +63 +66 +68 +71 +73 +76 +79 +81 +84 +86 +89 +91 +94 +96 +98 +100 +103 +105 +107 +110 +112 +114 +116 +118 +121 +123 +125 +127 +130 +131 +133 +136 +137 +139 +141 +143 +145 +146 +149 +150 +152 +153 +155 +156 +158 +159 +161 +162 +163 +164 +165 +165 +167 +168 +168 +169 +170 +169 +170 +171 +171 +171 +170 +171 +170 +169 +170 +169 +168 +167 +166 +166 +165 +164 +163 +162 +160 +159 +158 +156 +155 +153 +151 +151 +148 +146 +145 +143 +142 +140 +137 +136 +133 +131 +130 +127 +125 +123 +121 +119 +116 +114 +111 +110 +107 +105 +102 +100 +98 +96 +93 +91 +89 +86 +84 +81 +79 +76 +74 +71 +68 +66 +64 +61 +58 +57 +60 +62 +65 +67 +70 +72 +75 +78 +80 +82 +84 +87 +90 +92 +95 +97 +99 +102 +105 +106 +109 +111 +114 +116 +118 +121 +122 +125 +127 +130 +132 +134 +136 +137 +139 +142 +144 +145 +147 +149 +151 +153 +154 +155 +157 +159 +160 +161 +163 +165 +165 +167 +168 +169 +170 +171 +171 +172 +172 +173 +173 +173 +173 +173 +173 +173 +173 +172 +172 +171 +171 +170 +169 +169 +168 +167 +166 +165 +163 +162 +161 +158 +157 +156 +154 +153 +151 +148 +147 +145 +143 +141 +139 +137 +136 +133 +131 +129 +127 +124 +123 +120 +118 +116 +113 +111 +109 +107 +104 +102 +99 +97 +95 +92 +89 +87 +85 +82 +80 +77 +75 +72 +70 +67 +65 +62 +60 +58 +61 +63 +66 +69 +71 +74 +76 +79 +81 +84 +86 +89 +91 +93 +96 +98 +101 +103 +105 +108 +110 +113 +116 +118 +120 +122 +125 +126 +129 +131 +133 +135 +137 +139 +142 +144 +145 +148 +149 +151 +153 +154 +156 +158 +160 +161 +163 +164 +165 +166 +168 +169 +171 +171 +172 +173 +174 +174 +175 +175 +176 +176 +176 +176 +176 +176 +175 +175 +175 +174 +174 +173 +172 +171 +170 +169 +168 +167 +165 +165 +163 +161 +160 +158 +156 +155 +153 +151 +149 +147 +145 +144 +141 +140 +137 +135 +133 +131 +129 +127 +124 +122 +120 +117 +115 +113 +110 +108 +106 +103 +100 +98 +96 +94 +91 +89 +86 +83 +81 +78 +76 +74 +71 +68 +66 +64 +60 +59 +62 +65 +67 +70 +73 +75 +78 +80 +83 +85 +88 +90 +92 +95 +97 +100 +103 +105 +107 +109 +112 +114 +117 +119 +121 +123 +126 +128 +131 +133 +135 +137 +139 +141 +143 +146 +148 +149 +152 +153 +155 +156 +158 +160 +162 +164 +165 +167 +168 +169 +170 +172 +173 +174 +175 +175 +177 +177 +177 +178 +178 +179 +179 +179 +179 +179 +179 +178 +178 +177 +177 +176 +175 +173 +173 +171 +171 +170 +168 +167 +165 +163 +162 +161 +159 +157 +155 +153 +151 +150 +148 +146 +143 +141 +139 +137 +134 +133 +130 +128 +126 +124 +122 +119 +117 +114 +112 +109 +107 +105 +102 +100 +97 +95 +92 +90 +88 +84 +83 +80 +77 +75 +72 +70 +67 +65 +62 +61 +63 +66 +68 +71 +73 +76 +79 +81 +84 +86 +89 +91 +94 +96 +99 +102 +104 +106 +109 +111 +113 +116 +119 +120 +123 +125 +127 +130 +132 +134 +137 +139 +141 +143 +145 +147 +150 +151 +154 +155 +157 +159 +161 +162 +165 +165 +167 +169 +171 +172 +173 +174 +176 +177 +178 +178 +179 +180 +181 +181 +181 +182 +182 +182 +182 +182 +181 +181 +180 +180 +179 +178 +178 +176 +176 +175 +173 +172 +170 +169 +167 +166 +164 +162 +160 +159 +157 +155 +154 +152 +149 +147 +146 +143 +141 +139 +136 +134 +132 +130 +128 +125 +123 +120 +118 +116 +114 +111 +109 +106 +104 +101 +98 +96 +94 +91 +89 +87 +83 +81 +79 +76 +73 +71 +69 +65 +63 +61 +64 +66 +69 +72 +74 +77 +80 +82 +85 +88 +90 +93 +95 +98 +100 +102 +105 +107 +110 +112 +115 +117 +120 +122 +124 +127 +129 +131 +134 +136 +139 +141 +143 +145 +147 +150 +151 +154 +155 +158 +159 +161 +163 +164 +167 +168 +170 +171 +173 +174 +176 +177 +178 +179 +180 +181 +182 +183 +183 +183 +184 +185 +185 +185 +185 +185 +184 +184 +183 +183 +182 +182 +180 +179 +178 +177 +175 +174 +173 +172 +169 +168 +167 +165 +163 +161 +159 +158 +155 +153 +151 +149 +147 +145 +143 +141 +138 +136 +134 +131 +130 +127 +124 +122 +120 +117 +115 +113 +110 +108 +105 +103 +100 +97 +95 +92 +90 +87 +85 +82 +79 +77 +74 +72 +69 +66 +64 +63 +65 +68 +70 +73 +75 +78 +81 +83 +86 +88 +91 +94 +97 +99 +101 +104 +106 +109 +111 +114 +116 +118 +121 +124 +126 +128 +131 +133 +136 +138 +140 +142 +145 +147 +149 +151 +154 +156 +157 +159 +161 +164 +166 +167 +169 +170 +172 +173 +175 +177 +178 +180 +180 +182 +183 +184 +185 +185 +186 +187 +187 +187 +187 +188 +187 +187 +186 +186 +186 +186 +184 +184 +183 +182 +181 +179 +178 +177 +176 +174 +172 +171 +169 +167 +165 +163 +162 +159 +157 +155 +154 +151 +149 +146 +144 +142 +140 +138 +135 +133 +131 +128 +126 +123 +121 +119 +116 +114 +112 +109 +107 +104 +101 +99 +96 +94 +91 +88 +86 +84 +81 +78 +76 +73 +70 +67 +65 +64 +66 +69 +72 +74 +76 +79 +82 +84 +87 +90 +92 +95 +97 +100 +103 +105 +108 +110 +113 +115 +118 +120 +122 +125 +128 +130 +132 +135 +137 +139 +142 +144 +146 +149 +151 +153 +155 +158 +160 +161 +163 +166 +167 +169 +171 +172 +174 +176 +178 +179 +180 +181 +183 +184 +186 +186 +187 +188 +188 +189 +190 +190 +191 +190 +190 +190 +190 +189 +188 +188 +187 +187 +185 +184 +184 +182 +180 +179 +177 +176 +175 +172 +171 +169 +168 +166 +163 +161 +160 +157 +155 +153 +151 +148 +146 +144 +141 +140 +137 +134 +133 +130 +128 +125 +122 +120 +118 +115 +112 +110 +108 +105 +103 +100 +97 +95 +92 +90 +88 +84 +82 +79 +77 +74 +71 +68 +66 +64 +67 +70 +73 +75 +77 +80 +83 +86 +88 +91 +93 +96 +99 +101 +104 +106 +109 +112 +114 +116 +119 +122 +124 +126 +129 +131 +134 +137 +138 +141 +144 +145 +148 +150 +152 +155 +157 +159 +161 +163 +166 +168 +170 +171 +173 +175 +177 +179 +180 +181 +183 +184 +186 +187 +188 +189 +189 +191 +191 +192 +193 +193 +193 +193 +193 +193 +193 +192 +192 +191 +190 +189 +188 +187 +186 +185 +183 +181 +180 +179 +177 +175 +173 +171 +169 +168 +165 +163 +161 +159 +157 +155 +152 +150 +148 +146 +143 +141 +138 +136 +134 +131 +129 +126 +124 +121 +119 +117 +114 +111 +108 +107 +104 +102 +98 +96 +94 +90 +88 +85 +83 +80 +77 +75 +72 +70 +67 +65 +68 +71 +73 +76 +79 +81 +84 +86 +89 +91 +94 +97 +100 +102 +105 +108 +110 +112 +115 +118 +120 +123 +125 +128 +130 +133 +135 +138 +140 +142 +145 +147 +150 +152 +154 +157 +158 +161 +163 +165 +167 +169 +171 +174 +175 +178 +179 +181 +182 +184 +185 +187 +188 +189 +190 +192 +193 +193 +194 +194 +195 +195 +195 +196 +196 +196 +196 +195 +194 +193 +193 +191 +190 +189 +188 +187 +185 +184 +182 +180 +179 +177 +175 +173 +171 +169 +167 +165 +163 +160 +159 +156 +154 +152 +149 +147 +144 +143 +140 +138 +135 +132 +130 +127 +125 +123 +120 +117 +115 +113 +110 +108 +104 +102 +100 +97 +94 +92 +89 +86 +83 +81 +78 +75 +73 +71 +68 +66 +69 +71 +74 +76 +79 +82 +84 +88 +90 +93 +96 +98 +100 +104 +106 +108 +111 +114 +116 +119 +121 +124 +126 +129 +132 +134 +136 +139 +141 +144 +146 +149 +151 +153 +156 +158 +160 +163 +165 +167 +169 +171 +173 +175 +177 +179 +181 +183 +185 +186 +188 +189 +191 +192 +193 +194 +195 +196 +197 +197 +198 +198 +199 +199 +199 +198 +198 +198 +197 +196 +196 +195 +193 +192 +190 +190 +188 +186 +185 +183 +181 +180 +177 +175 +173 +171 +170 +167 +165 +163 +160 +158 +155 +154 +151 +149 +146 +144 +141 +139 +136 +134 +131 +129 +127 +124 +122 +119 +116 +114 +111 +109 +105 +103 +101 +98 +96 +93 +90 +88 +85 +82 +80 +77 +74 +72 +68 +67 +70 +73 +75 +77 +81 +83 +86 +88 +91 +93 +97 +99 +101 +104 +107 +110 +112 +115 +117 +120 +123 +126 +128 +131 +133 +135 +138 +140 +143 +145 +148 +150 +152 +155 +158 +160 +162 +164 +166 +169 +171 +173 +175 +178 +180 +182 +183 +185 +187 +188 +190 +192 +193 +194 +196 +197 +198 +199 +199 +201 +200 +201 +201 +201 +201 +202 +201 +200 +199 +199 +198 +197 +196 +194 +193 +192 +190 +189 +187 +185 +183 +181 +180 +178 +175 +173 +171 +169 +166 +165 +162 +160 +157 +155 +153 +150 +148 +145 +143 +140 +138 +136 +132 +131 +127 +125 +123 +120 +118 +115 +113 +110 +107 +104 +101 +99 +97 +94 +91 +88 +86 +83 +81 +78 +75 +72 +70 +67 +71 +74 +76 +78 +82 +84 +87 +89 +92 +95 +97 +100 +103 +105 +108 +110 +113 +116 +119 +121 +123 +126 +129 +131 +134 +137 +140 +141 +145 +147 +149 +152 +154 +156 +159 +161 +163 +166 +168 +171 +172 +175 +177 +179 +181 +183 +185 +187 +189 +191 +192 +194 +195 +197 +198 +199 +200 +202 +202 +203 +203 +204 +205 +205 +204 +204 +204 +203 +202 +201 +201 +199 +199 +197 +195 +194 +192 +191 +189 +187 +185 +183 +181 +179 +177 +175 +172 +171 +168 +166 +164 +162 +159 +156 +154 +152 +149 +146 +144 +141 +139 +137 +133 +131 +129 +126 +124 +121 +118 +116 +113 +110 +108 +105 +103 +100 +97 +94 +92 +89 +86 +84 +81 +79 +76 +73 +71 +69 +71 +73 +77 +79 +82 +85 +88 +90 +93 +95 +98 +101 +104 +106 +109 +111 +114 +117 +120 +122 +125 +128 +130 +133 +135 +137 +141 +143 +145 +148 +151 +153 +155 +157 +161 +163 +165 +168 +170 +172 +175 +177 +179 +181 +183 +185 +187 +189 +191 +193 +194 +196 +197 +199 +200 +202 +203 +204 +205 +206 +207 +207 +207 +207 +207 +207 +207 +206 +205 +205 +204 +202 +200 +200 +198 +197 +194 +193 +191 +189 +188 +185 +183 +181 +179 +176 +175 +173 +170 +167 +165 +163 +160 +158 +155 +153 +150 +148 +146 +142 +140 +137 +135 +133 +129 +127 +125 +122 +119 +117 +114 +112 +109 +106 +103 +101 +98 +95 +93 +90 +87 +85 +82 +79 +76 +74 +71 +69 +72 +74 +77 +80 +83 +85 +88 +90 +94 +96 +99 +102 +104 +107 +110 +113 +115 +118 +120 +123 +126 +129 +131 +134 +136 +139 +141 +144 +147 +149 +152 +154 +157 +159 +161 +165 +166 +169 +171 +174 +176 +178 +180 +183 +185 +187 +189 +191 +193 +195 +197 +199 +201 +202 +203 +205 +206 +207 +208 +208 +210 +210 +210 +210 +210 +209 +209 +209 +208 +207 +206 +204 +204 +202 +201 +199 +197 +195 +193 +191 +189 +187 +185 +183 +181 +178 +176 +174 +171 +169 +167 +165 +162 +159 +157 +154 +151 +149 +147 +144 +141 +139 +137 +134 +131 +129 +126 +123 +120 +118 +115 +112 +109 +107 +105 +102 +99 +96 +94 +91 +88 +86 +83 +80 +78 +74 +72 +70 +73 +76 +78 +81 +84 +86 +88 +92 +95 +98 +100 +103 +106 +108 +111 +114 +116 +118 +121 +124 +126 +129 +132 +134 +137 +140 +142 +145 +148 +150 +153 +155 +158 +160 +163 +165 +168 +171 +173 +175 +178 +180 +182 +185 +187 +189 +191 +194 +195 +197 +199 +201 +203 +204 +206 +207 +209 +209 +211 +212 +212 +212 +213 +212 +213 +213 +212 +212 +211 +210 +209 +207 +206 +204 +202 +201 +199 +198 +195 +193 +191 +189 +187 +184 +182 +180 +177 +175 +173 +170 +168 +166 +163 +160 +158 +155 +152 +151 +148 +145 +142 +140 +138 +134 +132 +129 +127 +124 +121 +119 +116 +113 +110 +108 +105 +102 +100 +97 +94 +91 +89 +86 +83 +81 +78 +75 +72 +71 +73 +76 +78 +81 +85 +87 +90 +92 +95 +98 +100 +103 +106 +109 +112 +114 +116 +119 +123 +125 +127 +130 +133 +135 +139 +141 +143 +146 +149 +152 +154 +157 +160 +162 +164 +167 +170 +172 +175 +177 +179 +181 +184 +186 +189 +191 +193 +195 +197 +199 +202 +203 +205 +207 +208 +210 +211 +212 +213 +214 +215 +215 +216 +216 +215 +215 +215 +214 +213 +212 +211 +209 +208 +207 +205 +203 +201 +199 +198 +195 +193 +191 +189 +186 +184 +181 +179 +177 +175 +171 +170 +167 +164 +162 +159 +157 +154 +152 +149 +146 +144 +141 +138 +136 +133 +131 +128 +125 +122 +119 +117 +114 +111 +109 +106 +103 +101 +98 +95 +93 +90 +87 +84 +81 +79 +76 +73 +71 +74 +77 +79 +82 +85 +88 +91 +93 +95 +98 +101 +104 +106 +109 +112 +114 +118 +120 +123 +126 +128 +131 +134 +136 +139 +142 +145 +147 +149 +153 +155 +158 +160 +163 +165 +169 +171 +173 +176 +178 +181 +183 +186 +188 +190 +192 +195 +197 +199 +201 +203 +206 +207 +209 +210 +212 +213 +215 +216 +216 +218 +218 +218 +219 +218 +218 +217 +217 +216 +215 +214 +212 +211 +208 +207 +205 +204 +201 +199 +197 +195 +192 +190 +188 +185 +183 +181 +178 +175 +173 +171 +168 +165 +163 +161 +158 +156 +152 +149 +147 +144 +141 +139 +136 +133 +131 +128 +126 +123 +120 +118 +115 +112 +109 +107 +104 +101 +99 +96 +93 +90 +87 +85 +82 +79 +77 +74 +71 +74 +77 +80 +82 +85 +88 +91 +94 +96 +99 +102 +104 +107 +110 +113 +116 +118 +122 +124 +126 +129 +132 +135 +137 +141 +143 +145 +148 +150 +153 +156 +158 +161 +164 +167 +170 +172 +174 +177 +179 +182 +185 +187 +190 +191 +194 +197 +199 +201 +203 +205 +207 +209 +211 +213 +214 +216 +217 +218 +220 +221 +220 +221 +221 +221 +221 +220 +219 +218 +217 +216 +215 +212 +211 +209 +207 +205 +203 +201 +198 +197 +194 +192 +190 +187 +185 +182 +179 +177 +174 +172 +169 +167 +164 +161 +159 +156 +154 +150 +148 +145 +143 +140 +138 +134 +132 +129 +126 +124 +121 +118 +115 +112 +110 +108 +105 +102 +100 +96 +94 +91 +88 +86 +82 +80 +77 +74 +72 +75 +77 +80 +83 +86 +89 +92 +95 +97 +100 +102 +105 +108 +111 +113 +117 +119 +122 +124 +128 +130 +133 +135 +139 +140 +144 +146 +149 +152 +154 +157 +160 +162 +165 +168 +171 +173 +175 +178 +181 +183 +186 +188 +190 +193 +195 +198 +201 +203 +205 +207 +209 +211 +213 +214 +217 +219 +220 +221 +222 +223 +223 +223 +224 +224 +223 +223 +222 +221 +219 +218 +217 +215 +213 +211 +209 +207 +205 +203 +200 +198 +196 +193 +191 +188 +185 +184 +180 +178 +175 +173 +170 +167 +165 +163 +160 +157 +154 +151 +149 +146 +143 +141 +138 +136 +133 +130 +127 +125 +122 +119 +116 +113 +110 +108 +106 +102 +100 +97 +94 +92 +89 +86 +83 +81 +77 +75 +73 +75 +78 +81 +84 +87 +89 +92 +95 +97 +101 +103 +106 +108 +111 +114 +117 +119 +122 +125 +128 +131 +134 +136 +139 +142 +145 +147 +150 +152 +155 +158 +161 +163 +166 +168 +171 +174 +177 +179 +182 +185 +187 +190 +192 +195 +197 +200 +201 +205 +206 +209 +211 +213 +215 +217 +219 +221 +222 +224 +224 +226 +227 +226 +227 +227 +226 +225 +225 +224 +222 +221 +219 +217 +215 +214 +211 +208 +207 +204 +202 +200 +197 +194 +192 +190 +187 +184 +182 +179 +177 +174 +172 +168 +166 +164 +161 +158 +156 +153 +150 +147 +144 +142 +139 +136 +133 +131 +128 +125 +122 +120 +117 +114 +112 +109 +106 +103 +100 +97 +95 +92 +89 +87 +83 +80 +78 +75 +73 +76 +78 +81 +84 +87 +89 +92 +95 +98 +101 +104 +106 +109 +112 +115 +117 +120 +123 +126 +128 +132 +134 +137 +140 +142 +145 +148 +150 +154 +156 +158 +161 +164 +167 +170 +172 +175 +177 +180 +183 +185 +188 +191 +193 +196 +198 +201 +203 +205 +208 +210 +213 +215 +218 +219 +221 +223 +225 +226 +227 +229 +229 +230 +229 +229 +229 +228 +227 +226 +224 +223 +221 +219 +217 +215 +213 +210 +208 +206 +203 +201 +199 +196 +193 +191 +188 +185 +183 +180 +178 +175 +172 +169 +167 +164 +161 +159 +156 +154 +150 +148 +145 +143 +140 +136 +134 +131 +129 +125 +123 +120 +118 +114 +112 +110 +107 +103 +101 +98 +95 +93 +90 +87 +84 +82 +78 +76 +74 +76 +79 +81 +85 +88 +90 +93 +95 +98 +101 +104 +107 +109 +112 +115 +117 +121 +123 +126 +129 +132 +135 +137 +140 +142 +146 +148 +151 +154 +156 +159 +162 +164 +167 +170 +173 +176 +179 +181 +184 +186 +189 +192 +194 +197 +200 +202 +205 +207 +210 +212 +215 +217 +219 +221 +223 +225 +227 +228 +229 +231 +231 +232 +233 +232 +232 +231 +229 +228 +227 +225 +223 +221 +219 +216 +214 +212 +209 +207 +204 +202 +200 +197 +194 +192 +189 +187 +184 +181 +178 +176 +173 +170 +168 +164 +163 +160 +157 +154 +151 +148 +146 +143 +140 +137 +134 +131 +129 +126 +124 +120 +117 +115 +113 +110 +106 +104 +102 +98 +95 +93 +90 +87 +84 +81 +78 +76 +74 +76 +80 +83 +85 +88 +90 +94 +96 +99 +101 +104 +107 +110 +113 +116 +118 +122 +124 +127 +129 +132 +135 +138 +140 +144 +146 +149 +151 +155 +157 +160 +163 +166 +168 +171 +174 +176 +179 +181 +185 +187 +190 +192 +195 +198 +200 +203 +206 +208 +210 +214 +216 +218 +221 +223 +225 +227 +229 +231 +232 +233 +235 +235 +235 +235 +234 +234 +232 +231 +229 +228 +225 +223 +221 +219 +216 +214 +211 +209 +206 +203 +201 +198 +196 +193 +190 +187 +184 +182 +179 +177 +174 +171 +168 +166 +163 +160 +157 +154 +151 +149 +146 +143 +141 +138 +135 +132 +129 +127 +124 +121 +118 +115 +113 +110 +107 +104 +102 +98 +96 +93 +91 +88 +85 +82 +79 +76 +73 +76 +80 +82 +85 +88 +91 +94 +96 +100 +102 +105 +107 +110 +113 +115 +119 +122 +125 +127 +130 +133 +136 +138 +141 +144 +147 +149 +152 +155 +158 +161 +164 +166 +169 +172 +174 +177 +179 +182 +185 +188 +191 +193 +197 +199 +202 +204 +207 +210 +212 +215 +217 +220 +222 +225 +227 +229 +232 +233 +235 +236 +237 +238 +238 +238 +238 +236 +235 +233 +231 +229 +226 +224 +222 +219 +218 +215 +212 +210 +207 +205 +202 +199 +196 +193 +191 +188 +186 +183 +179 +177 +175 +171 +169 +166 +163 +161 +158 +155 +152 +150 +146 +144 +141 +138 +135 +132 +130 +127 +125 +121 +119 +116 +113 +111 +107 +105 +102 +99 +96 +94 +91 +88 +86 +82 +80 +76 +75 +76 +80 +82 +86 +88 +91 +93 +97 +99 +102 +105 +108 +111 +113 +116 +119 +121 +124 +127 +130 +133 +136 +139 +141 +144 +147 +150 +153 +155 +159 +161 +163 +166 +169 +172 +174 +178 +180 +183 +186 +188 +192 +194 +196 +200 +202 +205 +208 +210 +213 +215 +218 +221 +224 +226 +229 +231 +233 +235 +237 +239 +240 +240 +241 +241 +240 +239 +237 +235 +233 +231 +228 +226 +223 +221 +218 +216 +213 +210 +208 +205 +202 +200 +197 +194 +191 +189 +186 +183 +181 +177 +175 +172 +169 +167 +163 +161 +158 +155 +152 +149 +147 +144 +141 +139 +136 +133 +130 +127 +125 +122 +119 +116 +113 +110 +108 +105 +102 +100 +97 +94 +91 +88 +85 +83 +80 +77 +75 +77 +80 +83 +85 +88 +91 +94 +97 +99 +102 +105 +108 +111 +114 +116 +120 +122 +125 +128 +130 +133 +136 +139 +142 +145 +148 +150 +153 +156 +158 +161 +164 +167 +169 +173 +176 +178 +180 +184 +186 +189 +192 +195 +197 +200 +203 +206 +209 +212 +214 +217 +220 +222 +225 +227 +230 +232 +234 +237 +240 +241 +243 +243 +244 +243 +242 +241 +239 +237 +235 +232 +230 +227 +224 +222 +219 +216 +214 +211 +208 +206 +203 +200 +197 +194 +192 +190 +186 +183 +181 +178 +175 +173 +170 +166 +164 +161 +158 +156 +153 +150 +147 +145 +141 +139 +136 +134 +131 +128 +125 +122 +119 +117 +114 +111 +108 +105 +102 +99 +97 +94 +91 +88 +85 +83 +80 +77 +74 +77 +80 +83 +86 +88 +92 +94 +97 +100 +102 +105 +108 +111 +113 +117 +119 +123 +125 +128 +131 +133 +137 +139 +141 +145 +148 +151 +153 +156 +159 +161 +164 +168 +170 +173 +176 +178 +181 +184 +187 +189 +193 +196 +198 +200 +204 +206 +209 +212 +214 +218 +220 +223 +226 +229 +231 +234 +236 +239 +241 +243 +245 +246 +247 +246 +245 +243 +241 +239 +236 +234 +231 +228 +226 +223 +220 +217 +214 +212 +209 +206 +204 +201 +198 +196 +193 +190 +187 +184 +181 +179 +176 +173 +170 +168 +164 +162 +159 +156 +153 +151 +148 +145 +142 +139 +137 +133 +130 +128 +125 +122 +119 +117 +114 +111 +108 +105 +103 +100 +97 +94 +92 +88 +86 +83 +80 +77 +75 +77 +80 +83 +86 +88 +92 +94 +97 +100 +103 +106 +109 +111 +114 +117 +119 +122 +125 +128 +131 +134 +136 +140 +142 +145 +148 +151 +153 +156 +159 +162 +165 +167 +170 +173 +176 +178 +182 +185 +187 +190 +193 +196 +199 +202 +204 +207 +209 +213 +215 +218 +220 +223 +227 +229 +232 +235 +238 +240 +242 +245 +247 +249 +250 +249 +247 +245 +242 +240 +237 +234 +232 +229 +226 +224 +221 +218 +216 +213 +210 +206 +204 +201 +198 +196 +193 +190 +187 +185 +182 +178 +175 +173 +170 +168 +164 +162 +159 +156 +153 +150 +148 +145 +142 +139 +136 +133 +131 +128 +126 +122 +120 +117 +114 +111 +109 +106 +103 +100 +97 +94 +91 +89 +85 +83 +80 +77 +75 +77 +80 +83 +86 +89 +91 +94 +97 +100 +102 +106 +109 +112 +115 +117 +120 +123 +125 +128 +131 +134 +137 +139 +142 +145 +147 +151 +154 +156 +159 +162 +164 +167 +171 +174 +176 +179 +181 +185 +187 +190 +193 +196 +198 +202 +204 +207 +210 +213 +216 +218 +221 +224 +227 +230 +232 +235 +238 +241 +243 +246 +248 +251 +252 +251 +249 +246 +244 +241 +238 +235 +232 +229 +226 +224 +221 +219 +216 +213 +209 +207 +204 +202 +199 +195 +193 +190 +187 +185 +182 +179 +176 +173 +171 +168 +165 +162 +159 +156 +154 +151 +148 +146 +142 +139 +137 +134 +131 +129 +125 +123 +120 +117 +114 +112 +109 +105 +102 +100 +98 +95 +92 +89 +86 +84 +80 +77 +75 +77 +81 +83 +86 +88 +92 +94 +98 +100 +103 +105 +108 +111 +114 +117 +120 +123 +126 +128 +131 +134 +136 +139 +143 +145 +148 +151 +154 +157 +159 +163 +164 +168 +170 +174 +176 +179 +181 +185 +187 +190 +193 +196 +199 +201 +204 +207 +210 +213 +215 +219 +221 +224 +226 +230 +233 +235 +238 +241 +244 +247 +250 +252 +255 +252 +250 +246 +244 +241 +238 +236 +233 +230 +227 +224 +222 +218 +216 +213 +210 +207 +204 +202 +199 +196 +193 +190 +188 +185 +182 +179 +176 +173 +171 +167 +164 +162 +159 +156 +154 +150 +148 +145 +142 +139 +136 +133 +131 +128 +125 +122 +120 +117 +115 +111 +108 +106 +103 +100 +97 +94 +92 +89 +86 +83 +81 +78 +74 +78 +80 +83 +86 +88 +92 +95 +97 +100 +103 +106 +109 +111 +114 +117 +119 +123 +125 +128 +131 +134 +136 +140 +142 +145 +148 +151 +153 +157 +159 +162 +165 +168 +170 +173 +177 +179 +182 +185 +187 +190 +192 +196 +199 +201 +204 +207 +210 +213 +216 +218 +221 +224 +227 +230 +232 +235 +238 +241 +243 +246 +249 +251 +253 +251 +249 +246 +243 +241 +238 +235 +233 +230 +227 +224 +221 +218 +216 +213 +210 +207 +204 +201 +198 +196 +192 +191 +187 +184 +182 +179 +176 +173 +170 +168 +165 +162 +159 +156 +153 +151 +148 +145 +142 +140 +137 +133 +131 +129 +125 +122 +120 +117 +114 +111 +108 +106 +103 +100 +98 +95 +92 +89 +86 +83 +80 +78 +74 +78 +80 +83 +86 +89 +91 +94 +97 +100 +103 +105 +109 +111 +114 +116 +120 +123 +126 +128 +131 +134 +136 +139 +142 +145 +148 +150 +153 +156 +159 +162 +165 +167 +170 +173 +176 +179 +182 +184 +188 +190 +193 +196 +198 +201 +204 +207 +209 +212 +215 +218 +221 +223 +226 +229 +232 +235 +237 +239 +242 +244 +247 +249 +249 +249 +247 +245 +243 +239 +238 +235 +232 +229 +227 +224 +220 +218 +215 +213 +210 +206 +204 +201 +199 +196 +193 +189 +188 +184 +181 +179 +176 +173 +170 +168 +165 +162 +159 +156 +153 +150 +147 +145 +143 +139 +137 +133 +131 +128 +126 +122 +120 +117 +114 +112 +109 +105 +103 +100 +97 +94 +92 +89 +86 +83 +81 +77 +74 +77 +81 +83 +86 +89 +92 +95 +97 +100 +103 +105 +108 +111 +114 +116 +120 +122 +125 +128 +131 +134 +136 +140 +142 +145 +147 +151 +154 +156 +159 +162 +165 +167 +170 +172 +175 +178 +181 +184 +187 +190 +193 +195 +198 +201 +203 +206 +209 +212 +215 +217 +220 +223 +226 +229 +231 +234 +236 +239 +241 +243 +245 +246 +246 +246 +245 +243 +241 +238 +236 +234 +231 +228 +226 +222 +220 +217 +215 +212 +209 +207 +203 +201 +198 +195 +193 +190 +187 +184 +181 +178 +176 +173 +170 +167 +164 +161 +159 +156 +154 +150 +148 +145 +142 +139 +136 +134 +131 +128 +125 +122 +120 +117 +114 +111 +108 +105 +103 +100 +97 +95 +91 +89 +86 +83 +80 +77 +75 +77 +80 +83 +86 +88 +92 +94 +97 +99 +103 +106 +109 +111 +113 +117 +120 +122 +125 +128 +131 +133 +137 +139 +142 +145 +147 +151 +153 +155 +158 +161 +164 +167 +170 +173 +175 +178 +180 +183 +187 +189 +192 +194 +197 +200 +203 +205 +209 +212 +214 +217 +219 +222 +225 +227 +229 +232 +234 +237 +239 +241 +242 +243 +244 +243 +242 +241 +240 +237 +235 +233 +229 +227 +225 +222 +219 +217 +213 +211 +208 +206 +203 +200 +198 +195 +192 +189 +186 +184 +181 +178 +175 +172 +170 +167 +164 +161 +158 +156 +153 +150 +147 +144 +142 +139 +136 +133 +131 +128 +125 +122 +119 +117 +114 +111 +108 +106 +103 +100 +97 +94 +91 +89 +86 +83 +80 +77 +75 +77 +79 +83 +85 +88 +91 +94 +97 +100 +102 +105 +108 +111 +114 +116 +119 +122 +124 +127 +130 +133 +136 +139 +141 +145 +147 +150 +152 +155 +159 +161 +164 +166 +170 +172 +175 +177 +181 +184 +186 +189 +191 +195 +197 +199 +202 +205 +208 +211 +213 +216 +219 +221 +224 +226 +228 +231 +233 +235 +237 +239 +239 +241 +241 +241 +239 +238 +237 +235 +233 +231 +228 +226 +223 +221 +219 +216 +213 +210 +207 +205 +202 +200 +197 +195 +192 +189 +186 +183 +181 +177 +175 +172 +169 +166 +164 +161 +159 +155 +152 +149 +147 +144 +141 +139 +136 +133 +130 +128 +125 +122 +119 +116 +114 +110 +108 +105 +102 +100 +97 +94 +91 +89 +86 +83 +80 +77 +74 +77 +79 +82 +85 +88 +90 +93 +96 +99 +102 +105 +107 +110 +113 +116 +119 +121 +125 +127 +130 +133 +135 +138 +141 +143 +147 +149 +152 +155 +158 +161 +163 +166 +169 +172 +174 +177 +180 +182 +185 +188 +191 +194 +196 +199 +201 +204 +207 +209 +212 +215 +217 +220 +222 +224 +227 +229 +231 +233 +235 +236 +237 +238 +238 +237 +238 +236 +235 +233 +231 +229 +227 +224 +223 +219 +218 +214 +212 +209 +207 +204 +201 +199 +197 +193 +190 +188 +185 +183 +180 +177 +174 +171 +169 +166 +163 +160 +157 +155 +152 +149 +147 +144 +141 +139 +135 +132 +130 +127 +124 +122 +118 +116 +113 +111 +108 +105 +102 +99 +96 +94 +91 +88 +86 +82 +80 +77 +74 +77 +79 +82 +85 +87 +90 +93 +96 +99 +102 +104 +107 +110 +113 +115 +118 +121 +123 +127 +130 +132 +135 +138 +141 +144 +147 +149 +152 +155 +157 +160 +162 +166 +168 +171 +174 +176 +179 +182 +185 +187 +190 +193 +196 +198 +200 +203 +206 +208 +211 +213 +216 +219 +220 +223 +225 +227 +229 +231 +233 +234 +235 +235 +235 +235 +234 +233 +232 +231 +229 +227 +225 +223 +220 +218 +215 +213 +211 +208 +206 +203 +201 +198 +195 +192 +190 +187 +184 +182 +180 +176 +174 +171 +168 +165 +162 +160 +157 +155 +152 +149 +146 +143 +141 +138 +135 +132 +130 +126 +124 +121 +118 +116 +113 +110 +107 +104 +102 +99 +96 +93 +91 +88 +85 +82 +79 +76 +73 +77 +79 +81 +85 +88 +90 +93 +96 +98 +101 +104 +106 +109 +112 +115 +118 +120 +124 +126 +129 +132 +134 +137 +140 +143 +146 +149 +151 +154 +157 +159 +162 +165 +167 +170 +173 +176 +178 +181 +184 +187 +189 +191 +194 +197 +200 +202 +204 +207 +210 +212 +214 +217 +218 +221 +223 +225 +227 +228 +229 +231 +232 +233 +233 +233 +232 +230 +230 +229 +227 +225 +223 +221 +219 +217 +215 +212 +209 +208 +205 +202 +200 +197 +195 +191 +189 +186 +184 +181 +179 +175 +173 +170 +167 +165 +162 +159 +157 +153 +151 +148 +146 +143 +140 +137 +135 +132 +129 +127 +124 +120 +118 +115 +112 +109 +106 +104 +101 +99 +95 +93 +90 +87 +84 +82 +79 +76 +73 +76 +79 +81 +84 +86 +89 +93 +95 +98 +101 +104 +106 +109 +112 +114 +117 +121 +123 +126 +129 +131 +134 +136 +139 +142 +145 +147 +151 +153 +156 +158 +162 +164 +167 +170 +172 +175 +177 +180 +183 +185 +188 +191 +193 +196 +199 +201 +203 +205 +208 +210 +213 +215 +217 +219 +221 +222 +224 +226 +227 +228 +229 +230 +230 +229 +229 +228 +227 +226 +225 +223 +221 +219 +217 +215 +213 +210 +208 +206 +204 +201 +198 +196 +193 +191 +188 +186 +182 +180 +178 +174 +172 +169 +166 +164 +162 +159 +156 +153 +150 +148 +145 +142 +139 +137 +134 +131 +128 +126 +123 +121 +118 +115 +112 +109 +106 +103 +101 +98 +95 +92 +90 +87 +84 +81 +78 +75 +72 +76 +78 +81 +83 +87 +89 +92 +95 +97 +101 +103 +106 +109 +112 +115 +117 +119 +123 +126 +128 +130 +133 +136 +139 +142 +144 +147 +149 +153 +155 +158 +160 +163 +166 +169 +171 +173 +177 +179 +181 +184 +187 +189 +192 +194 +197 +199 +202 +204 +207 +209 +211 +214 +215 +217 +219 +221 +223 +223 +224 +226 +227 +227 +226 +226 +227 +226 +225 +223 +223 +221 +218 +217 +215 +214 +211 +209 +207 +204 +202 +200 +197 +195 +192 +190 +187 +184 +182 +179 +176 +173 +171 +168 +166 +163 +161 +158 +156 +153 +150 +147 +144 +142 +139 +136 +133 +131 +128 +125 +122 +119 +117 +114 +111 +109 +105 +103 +100 +97 +95 +92 +89 +86 +83 +80 +78 +75 +72 +75 +77 +80 +83 +86 +89 +91 +94 +97 +99 +102 +105 +108 +111 +114 +116 +119 +121 +124 +127 +130 +132 +136 +138 +141 +143 +146 +149 +151 +154 +157 +159 +163 +165 +168 +170 +173 +176 +178 +181 +184 +186 +188 +191 +193 +196 +198 +200 +203 +205 +207 +209 +211 +213 +215 +216 +218 +220 +221 +222 +223 +223 +224 +224 +224 +223 +223 +222 +220 +220 +219 +217 +215 +213 +211 +209 +207 +205 +202 +200 +198 +196 +193 +191 +188 +186 +183 +181 +178 +175 +173 +170 +168 +165 +162 +160 +157 +155 +152 +149 +146 +143 +140 +138 +135 +133 +130 +127 +124 +121 +119 +116 +113 +111 +108 +105 +102 +99 +97 +95 +92 +89 +86 +83 +80 +77 +75 +72 +74 +77 +80 +82 +85 +88 +91 +94 +97 +99 +102 +105 +107 +111 +112 +116 +119 +122 +124 +126 +130 +132 +134 +137 +140 +143 +146 +148 +151 +153 +156 +159 +161 +164 +167 +169 +172 +174 +176 +179 +182 +185 +186 +190 +192 +194 +196 +199 +200 +203 +206 +208 +209 +211 +213 +214 +216 +217 +219 +220 +220 +221 +221 +221 +221 +221 +220 +220 +218 +217 +215 +215 +212 +211 +209 +207 +205 +203 +201 +199 +197 +194 +192 +190 +186 +185 +182 +179 +177 +175 +172 +169 +167 +164 +161 +159 +156 +153 +151 +148 +145 +143 +140 +137 +135 +132 +129 +127 +124 +121 +118 +115 +113 +110 +107 +104 +102 +99 +96 +93 +91 +88 +86 +83 +79 +77 +74 +71 +74 +77 +79 +82 +85 +88 +91 +93 +95 +99 +102 +104 +106 +109 +112 +115 +117 +120 +123 +125 +129 +132 +134 +137 +139 +142 +145 +147 +150 +152 +155 +158 +161 +163 +165 +168 +171 +173 +175 +178 +180 +183 +186 +188 +190 +193 +194 +197 +199 +201 +203 +206 +207 +209 +210 +212 +213 +214 +215 +216 +217 +218 +218 +218 +218 +218 +217 +217 +216 +215 +214 +212 +211 +209 +207 +205 +203 +202 +199 +197 +195 +193 +190 +188 +185 +183 +180 +178 +176 +173 +170 +168 +166 +163 +160 +157 +155 +153 +150 +147 +145 +142 +139 +136 +134 +131 +128 +126 +123 +120 +117 +115 +112 +109 +107 +104 +101 +99 +96 +93 +90 +88 +85 +82 +80 +76 +74 +71 +73 +76 +79 +82 +84 +87 +90 +92 +95 +98 +100 +104 +106 +109 +112 +114 +116 +120 +122 +125 +128 +130 +133 +136 +138 +141 +143 +147 +149 +151 +154 +156 +159 +162 +165 +167 +169 +172 +174 +177 +179 +181 +184 +186 +188 +191 +193 +195 +197 +199 +201 +203 +205 +207 +208 +209 +211 +212 +214 +214 +214 +215 +216 +216 +215 +215 +215 +214 +213 +212 +211 +210 +208 +207 +205 +203 +201 +199 +198 +195 +193 +190 +188 +186 +184 +182 +180 +177 +174 +171 +169 +167 +164 +162 +159 +157 +154 +151 +149 +146 +144 +141 +139 +135 +133 +131 +128 +125 +122 +120 +117 +114 +112 +108 +106 +103 +101 +98 +96 +92 +90 +87 +84 +81 +79 +76 +73 +70 +72 +75 +78 +81 +83 +86 +89 +91 +94 +97 +100 +102 +105 +108 +110 +113 +116 +119 +121 +124 +127 +129 +132 +134 +137 +140 +142 +145 +148 +150 +153 +155 +158 +160 +163 +165 +168 +171 +173 +176 +178 +180 +182 +185 +187 +189 +191 +193 +195 +197 +199 +201 +203 +205 +206 +207 +208 +210 +210 +211 +212 +212 +213 +212 +213 +212 +212 +212 +211 +209 +208 +207 +206 +204 +203 +200 +199 +197 +195 +193 +191 +189 +187 +185 +182 +180 +178 +176 +173 +170 +168 +165 +163 +160 +158 +155 +153 +151 +148 +145 +142 +139 +138 +135 +132 +130 +126 +124 +121 +118 +116 +114 +111 +108 +106 +103 +100 +97 +94 +92 +89 +86 +83 +81 +78 +75 +72 +69 +72 +75 +77 +80 +83 +86 +88 +91 +93 +96 +99 +101 +104 +107 +110 +112 +115 +117 +120 +123 +126 +128 +131 +133 +136 +139 +142 +144 +147 +149 +152 +154 +157 +159 +161 +164 +166 +169 +171 +174 +176 +179 +180 +183 +185 +187 +189 +191 +193 +195 +197 +199 +200 +202 +203 +205 +206 +207 +208 +209 +209 +210 +210 +210 +210 +210 +209 +209 +208 +207 +206 +204 +203 +202 +200 +199 +197 +195 +193 +191 +189 +188 +185 +183 +180 +178 +176 +173 +172 +169 +167 +164 +161 +160 +156 +154 +152 +149 +147 +144 +142 +139 +136 +133 +131 +128 +125 +123 +120 +118 +115 +112 +110 +107 +104 +102 +99 +97 +94 +91 +89 +85 +83 +80 +78 +74 +72 +68 +71 +74 +76 +79 +82 +85 +88 +90 +93 +95 +98 +101 +104 +107 +109 +112 +114 +117 +119 +122 +125 +127 +130 +133 +136 +138 +140 +142 +146 +147 +151 +152 +156 +158 +160 +163 +165 +168 +170 +172 +174 +177 +179 +181 +183 +185 +187 +189 +191 +193 +195 +196 +198 +200 +200 +202 +204 +204 +205 +205 +206 +206 +207 +207 +207 +207 +206 +206 +205 +204 +203 +202 +201 +199 +198 +197 +195 +193 +191 +190 +187 +185 +183 +181 +179 +177 +175 +173 +169 +168 +166 +163 +160 +158 +156 +153 +150 +148 +146 +143 +140 +138 +135 +133 +130 +128 +125 +122 +119 +117 +114 +112 +109 +106 +104 +101 +99 +95 +93 +91 +87 +85 +82 +79 +77 +73 +71 +68 +70 +73 +76 +79 +81 +84 +87 +89 +92 +95 +97 +100 +103 +105 +108 +111 +113 +116 +118 +121 +124 +126 +129 +131 +134 +137 +139 +141 +144 +147 +149 +151 +154 +157 +159 +161 +163 +166 +168 +170 +172 +175 +177 +180 +181 +183 +185 +187 +189 +191 +192 +194 +196 +197 +198 +200 +201 +202 +203 +203 +203 +204 +204 +204 +205 +204 +204 +203 +202 +202 +201 +200 +198 +197 +195 +194 +193 +191 +189 +187 +185 +184 +181 +179 +177 +175 +173 +170 +168 +166 +164 +162 +158 +157 +154 +152 +149 +146 +144 +142 +139 +136 +134 +132 +129 +126 +123 +121 +118 +116 +113 +110 +108 +105 +102 +100 +97 +95 +92 +89 +87 +84 +81 +78 +76 +73 +70 +67 +70 +72 +75 +77 +81 +83 +86 +89 +91 +94 +97 +99 +102 +104 +107 +110 +113 +115 +118 +120 +123 +125 +128 +131 +132 +135 +138 +141 +142 +145 +147 +150 +152 +155 +158 +160 +162 +164 +167 +168 +171 +173 +175 +177 +179 +181 +184 +185 +187 +188 +190 +192 +193 +195 +196 +196 +198 +199 +200 +200 +201 +201 +201 +202 +202 +201 +201 +201 +200 +199 +198 +197 +196 +194 +193 +192 +190 +189 +187 +185 +183 +182 +180 +177 +176 +173 +171 +169 +167 +165 +162 +160 +157 +155 +153 +150 +148 +146 +143 +141 +138 +136 +133 +131 +128 +126 +123 +120 +117 +115 +112 +110 +107 +105 +102 +99 +97 +94 +91 +89 +86 +83 +80 +77 +75 +72 +69 +66 +69 +72 +74 +77 +79 +82 +85 +87 +90 +93 +96 +98 +100 +104 +106 +108 +111 +113 +116 +119 +121 +124 +126 +129 +132 +134 +136 +139 +141 +144 +146 +149 +151 +154 +155 +158 +160 +163 +165 +167 +169 +172 +174 +175 +177 +179 +181 +183 +185 +186 +188 +189 +190 +192 +194 +194 +196 +196 +197 +197 +198 +198 +198 +199 +199 +198 +198 +198 +197 +196 +196 +194 +194 +192 +190 +189 +187 +186 +185 +183 +181 +180 +177 +175 +173 +172 +169 +167 +164 +162 +160 +158 +155 +154 +151 +149 +146 +143 +141 +139 +136 +134 +132 +129 +127 +124 +122 +119 +117 +114 +111 +109 +106 +103 +100 +98 +95 +92 +90 +88 +85 +82 +79 +77 +74 +71 +68 +65 +68 +71 +73 +76 +78 +82 +84 +86 +90 +92 +94 +97 +99 +102 +105 +107 +110 +113 +115 +117 +120 +122 +126 +128 +130 +132 +136 +137 +140 +143 +145 +147 +149 +152 +154 +156 +159 +161 +163 +166 +168 +169 +172 +174 +175 +177 +179 +180 +182 +184 +186 +187 +188 +190 +190 +191 +193 +193 +194 +195 +196 +195 +196 +196 +195 +196 +195 +194 +194 +194 +193 +192 +191 +189 +188 +186 +186 +184 +182 +181 +179 +177 +175 +173 +171 +170 +167 +165 +163 +161 +159 +157 +154 +152 +150 +147 +144 +143 +140 +137 +135 +133 +130 +128 +125 +123 +120 +117 +115 +112 +110 +108 +105 +103 +99 +97 +94 +91 +89 +87 +84 +81 +78 +76 +73 +71 +68 +64 +67 +70 +72 +75 +77 +81 +83 +85 +88 +91 +93 +96 +99 +101 +104 +107 +109 +112 +114 +117 +119 +121 +124 +126 +129 +132 +133 +136 +138 +141 +143 +145 +148 +150 +152 +155 +157 +159 +161 +163 +165 +167 +169 +171 +173 +175 +177 +179 +180 +182 +183 +185 +186 +187 +188 +189 +190 +191 +191 +192 +193 +193 +193 +193 +193 +192 +192 +192 +192 +191 +190 +189 +188 +187 +186 +184 +183 +181 +180 +178 +176 +175 +173 +172 +170 +167 +166 +163 +161 +159 +157 +154 +153 +151 +148 +146 +143 +141 +139 +136 +133 +132 +128 +127 +124 +121 +119 +116 +114 +112 +109 +106 +103 +101 +98 +96 +94 +91 +88 +86 +83 +80 +77 +75 +72 +70 +67 +63 +66 +69 +71 +74 +76 +79 +82 +85 +87 +90 +92 +95 +98 +100 +102 +105 +107 +110 +113 +115 +118 +120 +122 +125 +128 +130 +132 +135 +137 +140 +141 +144 +146 +149 +151 +153 +155 +157 +159 +161 +163 +166 +168 +170 +171 +172 +174 +176 +178 +179 +180 +182 +183 +185 +185 +186 +187 +188 +189 +190 +190 +189 +190 +190 +190 +190 +189 +189 +189 +188 +187 +186 +186 +184 +183 +182 +181 +179 +178 +176 +175 +172 +170 +169 +167 +165 +163 +161 +159 +157 +155 +153 +151 +149 +146 +144 +142 +139 +137 +135 +132 +130 +128 +125 +122 +121 +118 +115 +112 +110 +107 +105 +102 +100 +98 +94 +93 +89 +87 +84 +82 +80 +77 +74 +72 +69 +66 +62 +65 +67 +71 +73 +76 +78 +80 +83 +86 +88 +91 +93 +96 +99 +101 +104 +106 +109 +111 +114 +117 +118 +121 +124 +126 +129 +130 +133 +135 +137 +140 +142 +144 +147 +149 +151 +153 +155 +157 +159 +161 +164 +166 +167 +169 +170 +172 +174 +175 +176 +178 +180 +181 +182 +183 +184 +185 +185 +186 +186 +186 +187 +187 +187 +188 +187 +187 +186 +186 +185 +185 +184 +183 +181 +180 +180 +178 +176 +176 +174 +172 +170 +169 +167 +165 +163 +161 +160 +158 +156 +154 +152 +149 +147 +145 +142 +140 +138 +136 +133 +131 +128 +126 +124 +121 +119 +116 +114 +111 +109 +106 +104 +102 +98 +96 +94 +91 +89 +86 +84 +81 +78 +75 +73 +70 +68 +65 +61 +64 +67 +69 +72 +75 +77 +80 +83 +85 +88 +90 +92 +95 +97 +100 +103 +105 +108 +110 +112 +115 +118 +120 +122 +125 +127 +129 +132 +134 +136 +139 +140 +142 +145 +147 +149 +151 +153 +156 +157 +159 +161 +163 +164 +166 +168 +170 +172 +173 +174 +175 +176 +178 +179 +180 +181 +182 +182 +184 +183 +184 +184 +185 +185 +184 +184 +184 +184 +184 +182 +182 +182 +180 +179 +178 +177 +176 +174 +173 +171 +170 +168 +167 +165 +163 +161 +159 +157 +156 +153 +152 +149 +147 +145 +142 +140 +138 +136 +134 +132 +129 +127 +124 +122 +120 +117 +115 +113 +110 +108 +105 +103 +100 +98 +95 +92 +90 +88 +85 +82 +80 +77 +75 +72 +69 +66 +64 +61 +63 +66 +69 +71 +74 +76 +79 +81 +83 +86 +89 +91 +93 +96 +99 +101 +104 +106 +108 +111 +114 +116 +119 +121 +123 +125 +128 +130 +132 +135 +137 +139 +141 +144 +145 +147 +149 +151 +153 +156 +157 +159 +161 +163 +164 +166 +168 +169 +171 +171 +173 +175 +175 +177 +178 +179 +179 +179 +181 +181 +181 +181 +182 +182 +182 +181 +181 +181 +180 +180 +179 +179 +177 +177 +175 +174 +173 +171 +170 +169 +167 +165 +165 +163 +161 +159 +157 +155 +154 +151 +150 +147 +145 +143 +141 +139 +137 +134 +132 +130 +127 +125 +123 +121 +118 +116 +114 +111 +108 +106 +104 +101 +99 +96 +93 +91 +89 +87 +84 +81 +79 +76 +73 +71 +69 +65 +63 +59 +62 +65 +67 +70 +73 +74 +77 +80 +82 +85 +87 +90 +93 +95 +98 +99 +103 +105 +107 +110 +112 +114 +117 +119 +121 +123 +125 +128 +130 +132 +135 +137 +139 +141 +143 +146 +148 +149 +151 +154 +155 +157 +158 +160 +162 +163 +165 +166 +168 +169 +171 +172 +173 +174 +175 +175 +176 +177 +178 +178 +179 +179 +179 +179 +179 +179 +178 +178 +178 +177 +177 +176 +175 +174 +173 +171 +170 +169 +168 +166 +165 +164 +162 +161 +159 +157 +155 +153 +152 +149 +147 +145 +143 +141 +139 +137 +135 +133 +131 +128 +126 +124 +122 +119 +117 +114 +112 +110 +107 +105 +102 +100 +98 +95 +93 +90 +87 +84 +82 +80 +78 +75 +72 +70 +67 +65 +62 +59 +61 +63 +66 +68 +71 +73 +76 +79 +81 +83 +86 +88 +91 +93 +96 +99 +101 +103 +106 +108 +110 +113 +116 +117 +120 +122 +124 +127 +129 +131 +133 +135 +137 +139 +141 +143 +146 +147 +149 +151 +153 +155 +156 +158 +160 +161 +163 +164 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +175 +176 +175 +176 +176 +176 +176 +176 +176 +176 +175 +174 +174 +173 +172 +172 +170 +169 +168 +167 +166 +164 +163 +161 +159 +158 +156 +155 +153 +151 +149 +147 +146 +143 +142 +139 +137 +136 +133 +131 +129 +126 +124 +122 +120 +117 +115 +113 +111 +108 +105 +104 +100 +99 +96 +94 +91 +89 +87 +84 +81 +79 +76 +74 +71 +68 +66 +64 +61 +57 +60 +62 +65 +67 +70 +73 +75 +78 +80 +82 +85 +87 +89 +92 +94 +97 +99 +102 +104 +107 +109 +111 +113 +116 +118 +121 +123 +124 +127 +129 +131 +133 +135 +138 +140 +141 +144 +146 +147 +149 +151 +153 +154 +156 +157 +159 +161 +162 +163 +164 +165 +166 +168 +169 +170 +170 +171 +171 +172 +172 +172 +173 +173 +173 +173 +173 +173 +172 +172 +171 +171 +170 +169 +169 +167 +166 +165 +165 +163 +162 +161 +159 +157 +156 +154 +152 +151 +149 +147 +145 +143 +141 +139 +137 +136 +133 +131 +129 +127 +124 +122 +121 +118 +116 +114 +111 +108 +106 +104 +101 +100 +97 +94 +92 +90 +88 +84 +82 +80 +77 +74 +72 +70 +67 +64 +62 +60 +56 +59 +61 +63 +66 +69 +71 +74 +76 +79 +81 +83 +86 +89 +91 +93 +96 +98 +100 +102 +105 +107 +110 +112 +114 +116 +119 +121 +123 +125 +128 +130 +131 +133 +136 +138 +139 +141 +143 +145 +147 +148 +150 +151 +154 +154 +156 +158 +159 +160 +162 +163 +164 +165 +166 +167 +168 +168 +169 +170 +170 +170 +170 +170 +171 +171 +170 +170 +170 +169 +169 +168 +167 +167 +166 +165 +164 +163 +161 +160 +159 +158 +156 +155 +154 +152 +151 +149 +147 +145 +143 +142 +140 +138 +135 +133 +131 +129 +127 +125 +123 +121 +118 +116 +114 +112 +110 +107 +105 +102 +100 +98 +96 +93 +90 +88 +86 +83 +81 +79 +76 +74 +71 +68 +66 +63 +61 +59 +54 +57 +60 +62 +65 +67 +69 +73 +75 +77 +80 +82 +84 +86 +90 +92 +94 +97 +98 +101 +103 +105 +108 +110 +112 +114 +117 +119 +121 +124 +125 +127 +129 +131 +134 +136 +137 +139 +142 +142 +144 +146 +148 +150 +151 +153 +154 +156 +157 +158 +159 +161 +162 +162 +163 +164 +165 +165 +166 +167 +167 +167 +168 +168 +168 +168 +168 +167 +167 +166 +166 +166 +165 +164 +163 +162 +161 +160 +159 +158 +157 +155 +154 +152 +152 +150 +148 +146 +144 +143 +141 +139 +137 +135 +134 +132 +130 +127 +125 +123 +121 +119 +116 +115 +113 +110 +108 +106 +103 +101 +99 +97 +94 +92 +89 +87 +84 +82 +80 +77 +74 +72 +69 +67 +65 +62 +59 +57 +53 +56 +59 +61 +64 +66 +68 +70 +73 +75 +78 +80 +83 +85 +88 +90 +92 +95 +97 +99 +102 +104 +107 +108 +110 +113 +115 +117 +119 +122 +124 +125 +127 +130 +132 +133 +135 +137 +139 +140 +142 +144 +146 +147 +149 +151 +152 +153 +154 +156 +157 +158 +159 +159 +160 +162 +162 +163 +163 +163 +164 +164 +165 +164 +165 +165 +165 +165 +164 +164 +163 +163 +162 +162 +160 +160 +159 +158 +157 +156 +155 +153 +152 +150 +149 +147 +145 +144 +142 +141 +139 +137 +135 +133 +131 +130 +128 +125 +123 +122 +119 +118 +115 +113 +111 +108 +106 +104 +101 +99 +97 +95 +92 +90 +88 +85 +83 +81 +78 +76 +73 +71 +68 +66 +63 +61 +59 +56 +52 +55 +57 +60 +62 +64 +67 +69 +72 +74 +76 +79 +81 +84 +86 +89 +91 +94 +96 +97 +100 +103 +105 +107 +109 +111 +113 +115 +117 +119 +121 +124 +126 +127 +129 +131 +133 +134 +136 +139 +140 +142 +143 +144 +147 +148 +149 +151 +151 +153 +154 +155 +156 +157 +158 +159 +159 +160 +161 +161 +161 +162 +162 +162 +162 +162 +161 +161 +161 +161 +161 +160 +159 +159 +158 +157 +156 +155 +154 +153 +152 +150 +150 +148 +147 +145 +144 +141 +140 +138 +136 +135 +134 +132 +129 +127 +125 +124 +121 +120 +117 +115 +113 +111 +109 +107 +104 +102 +100 +98 +96 +93 +91 +88 +87 +84 +82 +79 +76 +74 +71 +70 +67 +64 +62 +60 +57 +55 +51 +54 +56 +58 +61 +63 +66 +68 +70 +73 +75 +78 +80 +82 +84 +87 +89 +91 +94 +96 +99 +100 +102 +104 +107 +110 +111 +113 +116 +117 +120 +122 +123 +125 +128 +129 +131 +133 +134 +136 +137 +139 +140 +143 +144 +145 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +157 +158 +158 +159 +158 +159 +159 +159 +159 +159 +159 +158 +158 +158 +157 +156 +156 +155 +155 +153 +153 +152 +150 +149 +148 +147 +145 +144 +142 +140 +140 +138 +136 +135 +133 +131 +129 +127 +125 +123 +121 +119 +118 +115 +113 +111 +109 +107 +104 +102 +101 +98 +96 +94 +92 +89 +87 +84 +83 +80 +77 +76 +73 +70 +68 +66 +64 +61 +58 +56 +53 +49 +52 +55 +57 +60 +62 +64 +67 +69 +71 +73 +76 +79 +81 +83 +86 +88 +90 +92 +95 +96 +98 +101 +104 +105 +108 +110 +112 +113 +115 +118 +119 +121 +123 +125 +127 +128 +131 +132 +133 +135 +137 +138 +140 +142 +143 +144 +145 +147 +148 +149 +150 +151 +151 +152 +154 +153 +154 +155 +156 +155 +156 +157 +157 +156 +156 +156 +156 +156 +155 +155 +154 +154 +153 +152 +152 +150 +150 +149 +147 +146 +146 +144 +143 +142 +141 +139 +137 +135 +134 +132 +130 +129 +127 +125 +123 +121 +120 +117 +116 +113 +112 +109 +108 +105 +103 +101 +98 +97 +94 +92 +90 +88 +86 +83 +81 +78 +76 +73 +71 +69 +67 +64 +62 +59 +57 +54 +51 +48 +50 +53 +55 +58 +61 +63 +65 +68 +70 +72 +75 +77 +79 +81 +84 +85 +88 +91 +93 +95 +97 +100 +101 +103 +106 +107 +110 +112 +114 +116 +117 +120 +121 +123 +124 +127 +128 +130 +131 +133 +135 +136 +137 +139 +141 +142 +143 +144 +145 +146 +147 +148 +149 +149 +150 +151 +152 +152 +153 +153 +153 +154 +153 +153 +153 +153 +153 +153 +153 +152 +152 +151 +150 +150 +149 +149 +148 +146 +145 +144 +143 +141 +140 +139 +138 +136 +135 +133 +131 +130 +129 +127 +125 +123 +121 +119 +118 +115 +114 +112 +109 +108 +105 +104 +101 +99 +97 +95 +93 +91 +88 +86 +84 +81 +79 +77 +74 +73 +70 +68 +66 +63 +60 +58 +56 +53 +51 +47 +50 +51 +54 +56 +58 +61 +63 +65 +69 +71 +73 +75 +78 +80 +82 +84 +86 +89 +91 +93 +95 +97 +100 +102 +103 +105 +108 +109 +112 +114 +115 +117 +119 +120 +122 +124 +126 +128 +129 +130 +132 +134 +135 +136 +138 +139 +140 +141 +143 +143 +144 +145 +146 +147 +148 +148 +148 +150 +150 +150 +150 +151 +151 +151 +151 +150 +150 +151 +149 +150 +149 +148 +148 +147 +147 +146 +145 +144 +143 +141 +140 +139 +138 +137 +135 +133 +132 +130 +130 +127 +126 +124 +122 +121 +119 +117 +115 +114 +112 +109 +108 +105 +104 +101 +99 +97 +95 +93 +90 +89 +87 +84 +82 +79 +78 +75 +73 +71 +68 +66 +64 +61 +59 +56 +54 +52 +49 +45 +48 +50 +53 +55 +57 +60 +62 +64 +67 +69 +71 +73 +76 +79 +80 +82 +85 +87 +89 +91 +94 +95 +97 +100 +102 +104 +106 +107 +109 +111 +113 +115 +117 +119 +120 +122 +124 +125 +127 +129 +130 +131 +133 +134 +136 +137 +138 +139 +140 +141 +142 +142 +144 +144 +145 +146 +146 +147 +147 +147 +148 +148 +148 +148 +148 +148 +148 +147 +147 +147 +146 +145 +145 +144 +144 +143 +142 +141 +140 +139 +138 +137 +135 +134 +133 +132 +130 +128 +127 +125 +124 +122 +120 +119 +117 +115 +114 +111 +109 +108 +105 +104 +101 +100 +98 +95 +94 +92 +89 +87 +85 +82 +80 +78 +76 +73 +71 +69 +67 +64 +62 +60 +57 +55 +52 +50 +47 +44 +46 +49 +51 +54 +56 +58 +61 +63 +65 +67 +70 +72 +74 +76 +78 +81 +83 +85 +87 +89 +92 +93 +96 +98 +99 +101 +103 +106 +107 +110 +111 +113 +115 +116 +118 +120 +121 +123 +125 +126 +128 +129 +130 +131 +133 +134 +135 +136 +137 +138 +139 +140 +141 +141 +142 +143 +143 +143 +144 +145 +145 +145 +146 +145 +145 +145 +145 +145 +144 +144 +144 +143 +142 +141 +141 +140 +140 +138 +138 +137 +135 +134 +133 +131 +130 +129 +128 +126 +124 +123 +121 +119 +118 +117 +115 +113 +111 +109 +107 +105 +104 +102 +99 +97 +96 +93 +91 +90 +87 +85 +83 +81 +78 +77 +74 +72 +70 +67 +65 +63 +61 +58 +56 +54 +51 +48 +47 +43 +45 +47 +49 +52 +54 +56 +59 +61 +64 +66 +68 +70 +73 +74 +77 +79 +82 +84 +85 +88 +90 +92 +94 +96 +97 +100 +102 +103 +105 +107 +109 +111 +113 +114 +116 +117 +119 +121 +123 +124 +125 +126 +127 +129 +130 +131 +133 +134 +134 +135 +137 +138 +138 +138 +140 +140 +141 +141 +142 +142 +142 +142 +142 +142 +142 +143 +142 +142 +142 +141 +141 +141 +139 +139 +138 +137 +137 +135 +135 +134 +133 +132 +130 +129 +127 +127 +125 +124 +122 +120 +119 +118 +116 +114 +113 +111 +109 +107 +105 +104 +102 +100 +98 +96 +93 +91 +90 +87 +85 +84 +81 +79 +77 +74 +72 +70 +68 +66 +63 +61 +59 +56 +54 +52 +49 +47 +45 +41 +44 +45 +48 +50 +52 +55 +57 +59 +61 +64 +66 +68 +71 +72 +75 +78 +79 +82 +84 +86 +88 +90 +91 +93 +96 +98 +99 +102 +103 +105 +106 +108 +111 +112 +113 +115 +117 +119 +120 +121 +123 +124 +126 +127 +127 +129 +130 +131 +132 +133 +134 +135 +135 +136 +136 +137 +137 +139 +138 +139 +139 +139 +139 +139 +139 +139 +140 +139 +139 +139 +138 +137 +137 +136 +135 +135 +134 +133 +132 +131 +130 +129 +128 +127 +125 +124 +123 +121 +120 +118 +116 +115 +113 +111 +110 +108 +107 +105 +103 +102 +99 +97 +95 +93 +91 +90 +87 +86 +83 +81 +80 +77 +75 +73 +70 +68 +66 +64 +62 +60 +58 +55 +52 +51 +48 +46 +43 +39 +42 +44 +46 +49 +50 +53 +56 +58 +60 +62 +65 +67 +69 +71 +74 +76 +78 +79 +81 +84 +86 +87 +90 +91 +94 +96 +97 +99 +101 +103 +105 +106 +108 +109 +111 +112 +115 +116 +117 +118 +120 +122 +122 +124 +125 +127 +128 +129 +129 +130 +132 +132 +133 +133 +134 +135 +135 +136 +136 +136 +136 +136 +137 +137 +137 +136 +137 +136 +136 +136 +135 +135 +134 +133 +132 +132 +131 +131 +129 +128 +127 +127 +125 +124 +123 +121 +120 +119 +117 +116 +114 +112 +112 +110 +107 +107 +105 +103 +101 +99 +98 +96 +93 +91 +90 +87 +86 +84 +82 +79 +77 +75 +73 +71 +69 +67 +64 +62 +60 +58 +55 +54 +51 +49 +46 +44 +41 +38 +40 +43 +45 +47 +49 +51 +54 +56 +58 +61 +62 +65 +67 +69 +72 +73 +76 +77 +80 +81 +83 +85 +88 +90 +92 +94 +96 +97 +99 +101 +102 +104 +106 +107 +109 +110 +112 +114 +115 +116 +118 +119 +120 +121 +122 +124 +125 +126 +127 +127 +128 +129 +130 +131 +131 +132 +132 +132 +133 +133 +134 +134 +134 +134 +134 +134 +133 +134 +133 +132 +133 +131 +132 +131 +130 +129 +128 +128 +126 +126 +125 +124 +122 +121 +120 +119 +118 +116 +115 +114 +112 +111 +109 +107 +106 +104 +102 +101 +98 +97 +95 +93 +91 +90 +87 +86 +84 +82 +80 +78 +75 +73 +72 +69 +67 +65 +63 +60 +59 +56 +53 +51 +49 +47 +45 +43 +40 +36 +39 +41 +44 +45 +48 +50 +52 +55 +57 +59 +61 +63 +65 +67 +69 +71 +74 +76 +78 +80 +81 +84 +86 +87 +89 +91 +93 +95 +97 +99 +100 +101 +103 +105 +106 +109 +109 +111 +113 +114 +115 +117 +117 +119 +120 +121 +122 +123 +124 +125 +126 +126 +127 +128 +128 +129 +130 +130 +130 +130 +131 +131 +131 +131 +131 +131 +131 +131 +130 +130 +129 +129 +128 +128 +127 +126 +126 +125 +124 +124 +122 +121 +120 +119 +117 +116 +116 +113 +113 +111 +109 +108 +107 +105 +103 +102 +100 +99 +97 +94 +93 +91 +89 +88 +85 +83 +81 +80 +78 +76 +73 +72 +70 +67 +65 +63 +61 +59 +56 +54 +52 +50 +48 +46 +43 +41 +38 +34 +37 +39 +41 +44 +46 +48 +50 +53 +55 +57 +59 +61 +63 +66 +68 +70 +71 +73 +76 +77 +79 +82 +84 +85 +87 +89 +91 +93 +94 +96 +98 +100 +101 +103 +104 +106 +107 +108 +110 +112 +112 +114 +115 +116 +118 +119 +119 +121 +121 +122 +123 +124 +125 +125 +126 +127 +127 +127 +127 +128 +128 +128 +128 +129 +128 +128 +128 +128 +128 +127 +127 +126 +126 +125 +124 +124 +123 +122 +122 +120 +120 +118 +118 +116 +115 +114 +113 +111 +110 +108 +107 +106 +104 +103 +101 +100 +97 +96 +94 +92 +91 +89 +87 +86 +84 +82 +80 +78 +76 +73 +72 +70 +68 +66 +63 +61 +59 +56 +55 +53 +51 +48 +46 +44 +41 +40 +37 +33 +35 +37 +39 +42 +44 +46 +49 +51 +53 +55 +57 +59 +62 +63 +66 +67 +69 +71 +74 +76 +78 +80 +81 +84 +86 +87 +89 +90 +92 +94 +95 +97 +98 +100 +102 +104 +104 +106 +108 +109 +110 +111 +112 +114 +114 +116 +116 +118 +118 +120 +121 +121 +122 +123 +123 +123 +124 +124 +125 +125 +125 +126 +126 +125 +126 +125 +125 +125 +125 +125 +124 +123 +123 +123 +122 +121 +120 +120 +119 +118 +117 +116 +115 +113 +112 +111 +110 +109 +108 +107 +105 +103 +102 +100 +99 +97 +95 +94 +93 +90 +88 +87 +85 +83 +82 +80 +77 +76 +73 +72 +70 +68 +66 +63 +61 +59 +58 +56 +53 +51 +49 +47 +44 +42 +40 +37 +36 +31 +33 +36 +38 +41 +42 +45 +47 +49 +51 +53 +55 +57 +60 +61 +64 +65 +68 +70 +71 +74 +76 +77 +80 +81 +83 +85 +87 +89 +90 +92 +93 +95 +96 +98 +99 +101 +103 +104 +105 +107 +108 +108 +110 +111 +112 +113 +114 +115 +116 +117 +118 +118 +119 +120 +120 +121 +121 +122 +122 +122 +123 +122 +123 +122 +122 +123 +122 +123 +122 +122 +121 +120 +120 +120 +119 +119 +118 +117 +116 +115 +114 +113 +112 +111 +110 +109 +108 +106 +105 +104 +102 +101 +99 +98 +97 +95 +93 +92 +90 +88 +86 +84 +83 +81 +79 +77 +76 +73 +72 +70 +68 +66 +64 +62 +60 +58 +56 +53 +52 +49 +47 +44 +42 +40 +38 +36 +34 +29 +32 +34 +36 +38 +41 +43 +45 +47 +50 +52 +54 +56 +58 +60 +62 +64 +66 +68 +70 +71 +74 +75 +77 +79 +81 +83 +85 +86 +88 +89 +91 +92 +94 +95 +97 +99 +100 +101 +102 +104 +105 +106 +107 +108 +110 +111 +111 +113 +113 +114 +115 +116 +117 +117 +118 +118 +118 +119 +119 +119 +120 +120 +120 +120 +120 +120 +119 +120 +119 +119 +118 +118 +117 +117 +116 +116 +115 +114 +113 +113 +111 +110 +109 +108 +108 +107 +105 +104 +102 +101 +99 +98 +97 +95 +94 +92 +91 +89 +87 +86 +84 +83 +80 +79 +77 +76 +74 +72 +69 +68 +66 +64 +61 +60 +57 +55 +53 +51 +49 +47 +45 +43 +41 +39 +37 +34 +32 +28 +31 +33 +35 +37 +39 +41 +43 +46 +47 +50 +51 +53 +56 +58 +60 +61 +64 +65 +67 +70 +72 +73 +75 +77 +79 +80 +82 +83 +85 +87 +89 +90 +92 +93 +95 +96 +97 +99 +100 +102 +102 +103 +105 +106 +106 +108 +109 +110 +111 +111 +112 +113 +113 +114 +115 +115 +116 +116 +117 +116 +117 +117 +117 +116 +117 +117 +117 +117 +116 +115 +116 +115 +114 +114 +113 +113 +112 +111 +111 +110 +109 +108 +107 +106 +104 +104 +102 +101 +100 +98 +98 +96 +94 +93 +92 +90 +89 +87 +86 +84 +82 +81 +78 +77 +75 +73 +72 +69 +68 +66 +63 +61 +60 +57 +56 +54 +51 +50 +48 +46 +43 +41 +39 +37 +35 +32 +30 +27 +29 +31 +33 +35 +37 +39 +41 +43 +45 +48 +50 +52 +54 +56 +58 +59 +62 +64 +65 +68 +69 +71 +73 +74 +77 +78 +80 +81 +83 +84 +86 +88 +90 +90 +92 +94 +95 +96 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +110 +111 +112 +112 +112 +113 +113 +113 +113 +114 +114 +114 +114 +114 +114 +114 +113 +113 +114 +113 +112 +112 +111 +110 +110 +110 +109 +108 +107 +106 +105 +104 +104 +102 +101 +100 +99 +98 +96 +95 +93 +92 +91 +89 +87 +86 +85 +83 +81 +80 +78 +76 +74 +72 +71 +69 +68 +66 +63 +62 +60 +57 +56 +53 +52 +50 +47 +46 +44 +41 +39 +37 +35 +33 +31 +28 +25 +27 +29 +31 +33 +36 +37 +40 +41 +43 +46 +48 +50 +52 +54 +56 +58 +60 +61 +63 +65 +68 +69 +71 +72 +74 +75 +78 +79 +81 +82 +84 +85 +87 +88 +90 +91 +92 +93 +95 +96 +98 +98 +100 +101 +101 +102 +104 +105 +106 +106 +107 +108 +108 +109 +110 +110 +110 +110 +111 +111 +111 +111 +111 +112 +111 +111 +111 +111 +111 +110 +110 +109 +109 +109 +108 +107 +106 +106 +105 +105 +103 +103 +101 +101 +100 +98 +97 +96 +95 +94 +92 +91 +90 +89 +87 +85 +84 +82 +81 +79 +77 +76 +74 +72 +71 +69 +67 +66 +63 +61 +60 +58 +55 +53 +52 +49 +47 +45 +43 +42 +39 +38 +35 +34 +31 +29 +27 +22 +25 +27 +29 +31 +34 +35 +37 +40 +42 +44 +46 +48 +50 +52 +54 +56 +58 +59 +61 +63 +64 +66 +68 +71 +72 +74 +75 +77 +79 +80 +81 +83 +84 +85 +87 +89 +90 +91 +92 +93 +95 +96 +97 +98 +99 +100 +101 +102 +102 +103 +104 +105 +105 +105 +106 +107 +108 +107 +108 +108 +108 +109 +108 +108 +108 +108 +109 +108 +108 +108 +107 +107 +107 +105 +105 +105 +104 +103 +102 +102 +101 +100 +99 +98 +97 +96 +95 +93 +92 +91 +90 +88 +87 +86 +84 +83 +82 +80 +78 +77 +75 +74 +72 +70 +69 +66 +65 +63 +61 +60 +57 +56 +54 +51 +49 +48 +46 +43 +41 +40 +38 +35 +33 +31 +29 +27 +25 +21 +23 +25 +27 +29 +32 +33 +36 +38 +40 +42 +44 +46 +48 +50 +52 +54 +55 +57 +59 +61 +63 +64 +66 +68 +70 +71 +73 +74 +76 +77 +80 +81 +82 +84 +85 +86 +87 +89 +90 +92 +92 +93 +94 +95 +96 +97 +98 +99 +99 +100 +102 +102 +103 +103 +104 +104 +104 +105 +105 +105 +105 +105 +106 +106 +105 +105 +105 +106 +105 +105 +105 +104 +104 +103 +102 +102 +101 +101 +100 +99 +98 +97 +97 +95 +94 +94 +93 +91 +89 +88 +88 +86 +84 +83 +82 +80 +79 +77 +76 +75 +72 +71 +69 +68 +66 +65 +62 +61 +59 +58 +56 +54 +51 +50 +48 +46 +44 +42 +40 +38 +36 +34 +31 +30 +27 +25 +23 +19 +22 +24 +26 +27 +30 +32 +34 +36 +38 +39 +42 +43 +46 +47 +50 +51 +53 +55 +57 +58 +60 +63 +64 +66 +67 +69 +70 +73 +74 +75 +76 +78 +80 +81 +83 +83 +85 +86 +87 +89 +90 +91 +92 +93 +94 +95 +95 +96 +97 +98 +98 +99 +100 +100 +101 +102 +101 +102 +103 +103 +103 +102 +103 +103 +102 +102 +103 +102 +103 +102 +102 +101 +101 +100 +100 +100 +99 +98 +98 +97 +96 +94 +93 +93 +92 +91 +90 +89 +87 +87 +85 +83 +83 +81 +80 +78 +77 +75 +74 +72 +71 +69 +68 +65 +64 +63 +61 +59 +57 +55 +54 +51 +50 +47 +46 +44 +42 +40 +38 +36 +34 +32 +30 +28 +25 +24 +22 +17 +19 +21 +23 +25 +28 +30 +31 +34 +36 +37 +40 +42 +43 +46 +47 +50 +51 +53 +54 +57 +58 +60 +62 +64 +65 +67 +68 +70 +72 +73 +74 +76 +77 +79 +80 +81 +83 +83 +85 +86 +87 +88 +89 +91 +91 +92 +92 +93 +95 +95 +96 +96 +97 +98 +98 +99 +99 +99 +99 +100 +100 +100 +100 +100 +100 +100 +100 +100 +99 +99 +98 +99 +98 +97 +97 +97 +96 +95 +94 +94 +92 +92 +91 +90 +89 +89 +87 +86 +84 +84 +82 +81 +80 +79 +77 +75 +74 +73 +71 +70 +68 +67 +65 +63 +62 +60 +59 +56 +55 +53 +51 +49 +47 +46 +44 +42 +40 +38 +36 +34 +32 +29 +28 +25 +24 +21 +19 +16 +18 +19 +22 +24 +26 +28 +30 +31 +34 +36 +38 +40 +42 +44 +45 +47 +49 +50 +52 +54 +56 +57 +59 +61 +62 +65 +66 +67 +69 +71 +72 +73 +75 +76 +78 +79 +80 +81 +83 +83 +85 +86 +86 +87 +88 +89 +90 +91 +91 +92 +93 +94 +95 +95 +95 +95 +96 +96 +97 +97 +97 +97 +97 +97 +97 +98 +97 +97 +97 +96 +96 +96 +95 +95 +94 +94 +93 +92 +92 +91 +90 +89 +88 +87 +86 +86 +84 +83 +82 +81 +80 +78 +77 +76 +75 +73 +72 +71 +69 +68 +66 +64 +63 +61 +59 +58 +56 +54 +53 +50 +49 +47 +45 +44 +42 +40 +38 +35 +33 +32 +29 +28 +26 +24 +22 +19 +17 +13 +16 +18 +19 +22 +24 +26 +28 +30 +31 +34 +36 +38 +40 +42 +43 +45 +47 +48 +50 +52 +54 +55 +57 +59 +60 +62 +63 +65 +67 +68 +69 +71 +72 +74 +75 +76 +77 +79 +80 +81 +82 +82 +84 +85 +86 +87 +88 +88 +89 +89 +91 +91 +92 +92 +93 +93 +94 +93 +94 +94 +94 +94 +94 +95 +95 +95 +95 +94 +94 +94 +93 +93 +93 +92 +92 +91 +90 +89 +89 +88 +88 +87 +85 +84 +84 +82 +82 +80 +79 +79 +78 +76 +75 +73 +72 +70 +69 +68 +66 +65 +63 +62 +61 +59 +58 +56 +54 +52 +50 +48 +47 +45 +44 +41 +39 +37 +35 +34 +31 +30 +28 +26 +24 +22 +20 +18 +16 +12 +14 +16 +18 +20 +22 +24 +26 +28 +30 +32 +33 +36 +38 +39 +41 +43 +45 +46 +48 +50 +52 +54 +55 +57 +58 +59 +61 +63 +64 +65 +67 +68 +69 +71 +72 +74 +75 +76 +77 +78 +79 +80 +82 +82 +83 +84 +84 +86 +87 +87 +88 +88 +89 +89 +90 +90 +90 +90 +91 +91 +91 +92 +92 +92 +92 +91 +91 +92 +91 +91 +91 +90 +89 +89 +88 +88 +87 +87 +86 +85 +85 +84 +84 +82 +81 +80 +79 +78 +77 +76 +75 +74 +72 +71 +70 +68 +67 +66 +64 +63 +61 +60 +58 +56 +55 +53 +52 +50 +48 +46 +45 +43 +41 +39 +38 +36 +34 +32 +30 +28 +26 +24 +22 +20 +18 +15 +14 +9 +12 +14 +16 +18 +20 +22 +24 +25 +28 +30 +32 +34 +35 +37 +39 +41 +42 +44 +46 +48 +49 +50 +53 +54 +56 +58 +59 +60 +62 +63 +65 +66 +67 +69 +70 +71 +72 +73 +74 +75 +76 +78 +78 +80 +81 +81 +82 +83 +83 +85 +85 +86 +86 +86 +86 +88 +88 +87 +88 +89 +89 +88 +89 +89 +89 +88 +89 +88 +88 +88 +88 +88 +87 +87 +86 +85 +85 +84 +84 +83 +82 +81 +81 +80 +79 +78 +77 +76 +75 +73 +72 +71 +70 +68 +67 +66 +64 +63 +62 +60 +59 +57 +56 +54 +53 +51 +49 +48 +46 +45 +43 +41 +39 +37 +35 +34 +31 +30 +28 +26 +24 +22 +20 +18 +16 +14 +12 +8 +10 +12 +14 +16 +18 +20 +22 +24 +25 +27 +29 +32 +33 +35 +37 +38 +40 +41 +44 +45 +48 +49 +50 +52 +53 +55 +56 +57 +60 +61 +62 +63 +65 +66 +67 +68 +69 +71 +72 +73 +74 +75 +76 +76 +78 +79 +79 +80 +80 +81 +82 +83 +83 +83 +84 +85 +85 +85 +86 +86 +86 +86 +86 +86 +86 +86 +86 +85 +85 +85 +85 +84 +84 +83 +83 +82 +82 +81 +81 +80 +79 +79 +78 +77 +75 +75 +74 +73 +72 +71 +69 +69 +67 +66 +65 +63 +62 +61 +59 +58 +57 +55 +54 +52 +50 +48 +47 +45 +44 +42 +40 +38 +36 +35 +33 +31 +30 +27 +26 +23 +22 +20 +18 +16 +14 +12 +10 +5 +8 +10 +12 +14 +16 +18 +20 +22 +24 +25 +27 +29 +31 +33 +34 +36 +38 +40 +42 +43 +45 +47 +48 +49 +52 +52 +54 +55 +56 +58 +60 +60 +62 +63 +65 +66 +67 +68 +69 +71 +72 +72 +73 +74 +75 +76 +77 +77 +78 +78 +79 +80 +80 +81 +82 +82 +82 +82 +82 +83 +83 +83 +83 +84 +83 +83 +82 +83 +82 +82 +82 +81 +81 +80 +81 +80 +80 +79 +78 +77 +77 +76 +75 +74 +74 +72 +72 +71 +69 +68 +67 +66 +64 +63 +62 +60 +60 +58 +57 +55 +54 +53 +51 +50 +48 +47 +45 +43 +41 +39 +38 +36 +34 +33 +31 +29 +27 +25 +23 +22 +20 +18 +16 +14 +12 +10 +8 +4 +6 +8 +10 +12 +14 +16 +17 +19 +21 +24 +25 +27 +29 +30 +33 +34 +36 +38 +39 +41 +43 +44 +46 +47 +49 +50 +52 +53 +55 +56 +57 +58 +60 +61 +62 +63 +65 +65 +67 +67 +68 +70 +71 +71 +72 +73 +74 +75 +75 +76 +76 +77 +77 +78 +79 +79 +79 +79 +80 +80 +80 +81 +81 +81 +80 +81 +80 +80 +80 +79 +79 +79 +79 +78 +78 +77 +77 +76 +75 +75 +74 +73 +72 +71 +71 +70 +69 +68 +67 +66 +65 +64 +62 +61 +60 +59 +57 +56 +54 +53 +52 +50 +48 +47 +46 +44 +43 +41 +39 +37 +36 +34 +33 +30 +29 +27 +26 +23 +21 +20 +18 +16 +13 +11 +10 +8 +6 +2 +4 +6 +8 +10 +11 +14 +16 +18 +19 +21 +23 +25 +27 +29 +30 +32 +33 +35 +37 +39 +40 +42 +43 +45 +46 +48 +49 +51 +52 +53 +55 +56 +57 +58 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +69 +70 +71 +71 +72 +73 +74 +74 +74 +76 +75 +77 +77 +77 +77 +77 +78 +77 +77 +78 +77 +77 +77 +77 +77 +77 +77 +77 +76 +75 +75 +74 +74 +73 +73 +72 +71 +71 +70 +69 +68 +67 +66 +65 +64 +63 +62 +60 +60 +59 +57 +56 +54 +54 +52 +50 +49 +48 +46 +44 +43 +42 +40 +38 +37 +35 +33 +32 +30 +28 +27 +25 +23 +22 +20 +18 +16 +14 +11 +10 +8 +6 +4 diff --git a/extra/images/testing/pgm/radial.binary.fig b/extra/images/testing/pgm/radial.binary.fig new file mode 100644 index 0000000000000000000000000000000000000000..6e52311b94202145e080cf8f4dc7794d43490754 GIT binary patch literal 16443 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 literal 0 HcmV?d00001 diff --git a/extra/images/testing/pgm/radial.binary.pgm b/extra/images/testing/pgm/radial.binary.pgm new file mode 100644 index 0000000000000000000000000000000000000000..598ee59e2d01f0216f3df07a56713eb23c5d9661 GIT binary patch literal 16438 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 literal 0 HcmV?d00001 From 964f45fc777207a5bce9df2bb06482d07af1f546 Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Sun, 4 Apr 2010 18:57:58 -0700 Subject: [PATCH 032/157] Techniques work --- extra/fluids/authors.txt | 1 + extra/fluids/colors.ppm | Bin 0 -> 81 bytes extra/fluids/fluids.factor | 164 + extra/fluids/particle2.pgm | 16388 +++++++++++++++++++++++++++ extra/gpu/effects/blur/authors.txt | 1 + extra/gpu/effects/blur/blur.factor | 81 + extra/gpu/effects/blur/summary.txt | 1 + extra/gpu/effects/quad/authors.txt | 1 + extra/gpu/effects/quad/quad.factor | 4 + extra/gpu/effects/quad/summary.txt | 1 + extra/gpu/effects/step/authors.txt | 1 + extra/gpu/effects/step/step.factor | 23 + extra/gpu/effects/step/summary.txt | 1 + extra/gpu/util/util.factor | 69 +- 14 files changed, 16732 insertions(+), 4 deletions(-) create mode 100644 extra/fluids/authors.txt create mode 100644 extra/fluids/colors.ppm create mode 100644 extra/fluids/fluids.factor create mode 100644 extra/fluids/particle2.pgm create mode 100644 extra/gpu/effects/blur/authors.txt create mode 100644 extra/gpu/effects/blur/blur.factor create mode 100644 extra/gpu/effects/blur/summary.txt create mode 100644 extra/gpu/effects/quad/authors.txt create mode 100644 extra/gpu/effects/quad/quad.factor create mode 100644 extra/gpu/effects/quad/summary.txt create mode 100644 extra/gpu/effects/step/authors.txt create mode 100644 extra/gpu/effects/step/step.factor create mode 100644 extra/gpu/effects/step/summary.txt diff --git a/extra/fluids/authors.txt b/extra/fluids/authors.txt new file mode 100644 index 0000000000..6f03a12101 --- /dev/null +++ b/extra/fluids/authors.txt @@ -0,0 +1 @@ +Erik Charlebois diff --git a/extra/fluids/colors.ppm b/extra/fluids/colors.ppm new file mode 100644 index 0000000000000000000000000000000000000000..c12c455f4c1d7fcd2f991538bcb556b62dd52f2b GIT binary patch literal 81 zcmWGA<5E^|4svx2@ei_6aQE~LPzdnzRdCD9DM>9-2um$0&dkqKFw`^TGBi*y85n?QAu0j@SUnTh literal 0 HcmV?d00001 diff --git a/extra/fluids/fluids.factor b/extra/fluids/fluids.factor new file mode 100644 index 0000000000..a0d75fd6e3 --- /dev/null +++ b/extra/fluids/fluids.factor @@ -0,0 +1,164 @@ +! Copyright (C) 2010 Erik Charlebois. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors arrays classes.struct destructors game.loop +game.worlds gpu gpu.buffers gpu.framebuffers gpu.render gpu.shaders +gpu.state gpu.textures gpu.util images images.loader kernel literals +locals make math math.rectangles math.vectors namespaces opengl.gl +sequences specialized-arrays ui.gadgets.worlds images.ppm +ui.gestures ui.pixel-formats images.pgm gpu.effects.blur ; +FROM: alien.c-types => float ; +SPECIALIZED-ARRAY: float +IN: fluids + +STRUCT: float2_t + { x float } + { y float } ; + +: f2+ ( lhs rhs -- res ) + [ [ x>> ] bi@ + ] + [ [ y>> ] bi@ + ] + 2bi float2_t ; inline + +: f2- ( lhs rhs -- res ) + [ [ x>> ] bi@ - ] + [ [ y>> ] bi@ - ] + 2bi float2_t ; inline + +: f2*n ( lhs rhs -- res ) + [ [ x>> ] dip * ] + [ [ y>> ] dip * ] + 2bi float2_t ; inline + +STRUCT: particle_t + { p float2_t } + { p' float2_t } + { m float } ; +SPECIALIZED-ARRAY: particle_t + +CONSTANT: gravity S{ float2_t f 0.0 -0.1 } + +:: verlet-integrate-particle ( p dt -- p' ) + p p>> 2.0 f2*n :> v1 + p p'>> :> v2 + gravity dt dt * 1.0 p m>> 2.0 * / * f2*n :> v3 + v1 v2 f2- v3 f2+ + p p m>> particle_t ; inline + +CONSTANT: initial-particles +particle_t-array{ + S{ particle_t f S{ float2_t f 0.5 0.6 } S{ float2_t f 0.499 0.599 } 1.0 } + S{ particle_t f S{ float2_t f 0.5 0.6 } S{ float2_t f 0.501 0.599 } 3.0 } + + S{ particle_t f S{ float2_t f 0.5 0.5 } S{ float2_t f 0.5 0.5 } 2.0 } + S{ particle_t f S{ float2_t f 0.5 0.6 } S{ float2_t f 0.5 0.599 } 1.0 } + S{ particle_t f S{ float2_t f 0.6 0.5 } S{ float2_t f 0.6 0.5 } 3.0 } + S{ particle_t f S{ float2_t f 0.7 0.5 } S{ float2_t f 0.7 0.5 } 1.0 } + S{ particle_t f S{ float2_t f 0.1 0.5 } S{ float2_t f 0.1 0.5 } 5.0 } + S{ particle_t f S{ float2_t f 0.2 0.5 } S{ float2_t f 0.2 0.5 } 1.0 } + S{ particle_t f S{ float2_t f 0.3 0.3 } S{ float2_t f 0.3 0.3 } 4.0 } + S{ particle_t f S{ float2_t f 0.5 0.15 } S{ float2_t f 0.5 0.15 } 1.0 } + S{ particle_t f S{ float2_t f 0.5 0.1 } S{ float2_t f 0.5 0.1 } 9.0 } +} + +: integrate-particles! ( particles dt -- particles ) + [ verlet-integrate-particle ] curry map! ; + +TUPLE: fluids-world < game-world + particles texture framebuffer color-texture ramp { paused boolean initial: f } ; + +: make-texture ( pathname -- texture ) + load-image + [ + [ component-order>> ] + [ component-type>> ] bi + T{ texture-parameters + { wrap clamp-texcoord-to-edge } + { min-filter filter-nearest } + { mag-filter filter-nearest } + { min-mipmap-filter f } } + + ] + [ + 0 swap [ allocate-texture-image ] 3keep 2drop + ] bi ; + +SYMBOL: fluid + +: integrate ( world -- ) + particles>> $[ 60 fps 1000000 /f ] integrate-particles! drop ; + +: pause ( -- ) + fluid get [ not ] change-paused drop ; + +: step ( -- ) + fluid get paused>> [ fluid get integrate ] when ; + +M: fluids-world begin-game-world + dup fluid set + init-gpu + initial-particles clone >>particles + "C:/Users/erikc/Pictures/particle2.pgm" make-texture >>texture + "C:/Users/erikc/Pictures/colors.ppm" make-texture >>ramp + + RGB float-components T{ texture-parameters + { wrap clamp-texcoord-to-edge } + { min-filter filter-linear } + { min-mipmap-filter f } + } >>color-texture + + dup color-texture>> 0 1array f f { 320 240 } >>framebuffer + drop ; + +M: fluids-world end-game-world + framebuffer>> dispose ; + +M: fluids-world tick-game-world + dup paused>> [ drop ] [ integrate ] if ; + +M:: fluids-world draw-world* ( world -- ) + world framebuffer>> { { default-attachment { 0 0 0 } } } clear-framebuffer + system-framebuffer { { default-attachment { 0 0 0 } } } clear-framebuffer + + f eq-add func-one func-one dup set-gpu-state + f origin-upper-left 1.0 set-gpu-state + world particles>> [ + [ p>> [ x>> , ] [ y>> , ] bi ] each + ] curry float-array{ } make :> verts + + { 0 0 } { 320 240 } set-gpu-state + GL_POINT_SPRITE glEnable + world verts { + { "primitive-mode" [ 2drop points-mode ] } + { "uniforms" [ drop texture>> 50.0 window-point-uniforms boa ] } + { "vertex-array" [ nip stream-upload draw-usage vertex-buffer byte-array>buffer &dispose window-point-program &dispose &dispose ] } + { "indexes" [ nip length 2 / 0 swap ] } + { "framebuffer" [ drop framebuffer>> ] } + } 2 render + + world color-texture>> gaussian-blur + { 0 0 } { 640 480 } set-gpu-state + world ramp>> { + { "primitive-mode" [ 2drop triangle-strip-mode ] } + { "uniforms" [ step-uniforms boa ] } + { "vertex-array" [ 2drop step-program ] } + { "indexes" [ 2drop T{ index-range f 0 4 } ] } + } 2 render + ; + +GAME: fluids { + { world-class fluids-world } + { title "Fluids Test" } + { pixel-format-attributes { + windowed double-buffered T{ depth-bits { value 24 } } } } + { pref-dim { 640 480 } } + { tick-interval-micros $[ 60 fps ] } +} ; + +MAIN: fluids + +fluids-world H{ + { T{ button-down } [ [ + hand-loc get { 640 480 } v/ 2 v*n 1 v-n { 1 -1 } v* first2 float2_t + dup 2.0 particle_t suffix + ] change-particles drop ] } +} set-gestures diff --git a/extra/fluids/particle2.pgm b/extra/fluids/particle2.pgm new file mode 100644 index 0000000000..99bf7a4057 --- /dev/null +++ b/extra/fluids/particle2.pgm @@ -0,0 +1,16388 @@ +P2 +# CREATOR: GIMP PNM Filter Version 1.1 +128 128 +255 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +1 +2 +2 +3 +3 +3 +4 +4 +4 +4 +4 +4 +4 +4 +3 +4 +3 +3 +3 +2 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +3 +3 +3 +4 +5 +6 +6 +7 +7 +7 +7 +8 +8 +8 +8 +8 +8 +8 +8 +7 +7 +6 +6 +5 +5 +4 +4 +2 +2 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +2 +4 +4 +5 +6 +7 +7 +8 +8 +10 +10 +10 +11 +12 +12 +12 +12 +12 +12 +12 +12 +12 +11 +11 +11 +11 +10 +10 +9 +8 +7 +7 +6 +5 +5 +3 +2 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +3 +5 +6 +7 +7 +9 +10 +10 +11 +12 +13 +13 +14 +14 +15 +15 +15 +15 +16 +16 +16 +15 +15 +16 +15 +15 +15 +15 +14 +13 +13 +12 +12 +11 +10 +9 +7 +6 +6 +5 +4 +3 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +1 +3 +4 +6 +7 +9 +9 +10 +12 +13 +13 +15 +15 +16 +17 +17 +18 +18 +19 +19 +19 +20 +20 +20 +20 +20 +20 +20 +19 +19 +19 +19 +18 +17 +17 +16 +15 +14 +13 +13 +12 +10 +9 +8 +7 +6 +5 +3 +2 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +2 +4 +6 +7 +9 +9 +11 +12 +14 +15 +15 +16 +17 +19 +19 +19 +20 +21 +21 +23 +23 +23 +23 +23 +24 +24 +24 +24 +24 +24 +24 +22 +23 +23 +21 +21 +20 +19 +19 +19 +18 +16 +16 +15 +13 +12 +11 +10 +8 +6 +5 +4 +2 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +3 +4 +6 +8 +9 +11 +12 +13 +14 +16 +17 +18 +19 +20 +21 +22 +23 +23 +25 +25 +26 +26 +26 +27 +27 +27 +27 +28 +27 +28 +28 +27 +27 +27 +26 +26 +26 +25 +25 +24 +23 +22 +21 +21 +19 +18 +17 +16 +15 +13 +12 +10 +9 +8 +5 +4 +3 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +2 +5 +6 +8 +9 +11 +13 +14 +16 +17 +19 +19 +20 +21 +23 +24 +25 +26 +27 +28 +28 +28 +29 +30 +30 +31 +31 +31 +32 +31 +32 +31 +32 +31 +32 +31 +31 +30 +29 +29 +28 +27 +27 +26 +25 +24 +23 +22 +20 +19 +18 +16 +15 +14 +13 +11 +9 +8 +6 +5 +2 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +4 +7 +8 +10 +12 +13 +15 +16 +18 +19 +20 +22 +23 +25 +26 +27 +28 +29 +30 +30 +32 +32 +33 +33 +34 +34 +35 +35 +35 +35 +35 +36 +35 +35 +35 +35 +34 +35 +34 +33 +33 +32 +32 +30 +30 +28 +28 +27 +26 +25 +23 +22 +21 +19 +18 +17 +15 +13 +11 +10 +8 +6 +5 +2 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +3 +6 +7 +10 +12 +13 +15 +17 +18 +20 +21 +22 +24 +26 +27 +28 +30 +31 +31 +32 +33 +34 +35 +36 +37 +37 +37 +38 +38 +39 +39 +40 +39 +39 +39 +39 +40 +39 +39 +38 +38 +37 +36 +36 +36 +34 +33 +33 +32 +30 +30 +29 +26 +26 +25 +23 +22 +20 +19 +17 +15 +14 +11 +9 +8 +5 +3 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +5 +7 +9 +11 +13 +15 +16 +19 +20 +22 +23 +25 +27 +28 +30 +30 +32 +33 +34 +35 +37 +37 +39 +40 +39 +40 +41 +42 +42 +43 +43 +43 +43 +44 +43 +44 +43 +43 +43 +42 +43 +41 +41 +40 +40 +39 +38 +38 +37 +35 +34 +34 +32 +30 +30 +28 +27 +25 +24 +22 +21 +19 +17 +15 +13 +11 +9 +7 +5 +3 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +4 +6 +8 +11 +13 +15 +16 +18 +21 +22 +23 +25 +27 +28 +30 +32 +33 +35 +35 +37 +38 +39 +40 +41 +42 +43 +44 +45 +45 +45 +46 +47 +47 +47 +47 +47 +48 +47 +47 +47 +47 +47 +46 +45 +45 +45 +43 +43 +42 +41 +41 +40 +38 +37 +36 +34 +33 +32 +30 +28 +27 +26 +24 +22 +20 +18 +16 +15 +12 +10 +9 +6 +4 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +5 +8 +10 +11 +14 +16 +17 +19 +22 +24 +25 +27 +29 +31 +32 +34 +36 +36 +38 +39 +40 +42 +42 +44 +45 +45 +47 +48 +48 +49 +49 +50 +51 +50 +51 +51 +52 +51 +51 +51 +51 +51 +50 +50 +50 +49 +48 +47 +47 +46 +44 +44 +43 +42 +41 +40 +38 +37 +35 +33 +32 +31 +28 +27 +25 +24 +22 +20 +18 +15 +13 +11 +10 +8 +5 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +4 +6 +8 +11 +12 +15 +17 +19 +21 +23 +25 +27 +29 +31 +32 +34 +35 +38 +39 +40 +42 +43 +44 +45 +47 +48 +49 +49 +51 +52 +52 +52 +53 +54 +54 +54 +55 +55 +55 +55 +55 +55 +55 +54 +54 +53 +54 +53 +52 +52 +50 +50 +49 +47 +46 +45 +44 +43 +42 +41 +39 +37 +36 +34 +32 +31 +29 +27 +25 +23 +21 +19 +17 +15 +13 +10 +8 +5 +3 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +4 +7 +8 +11 +13 +16 +18 +21 +22 +25 +27 +28 +30 +32 +34 +35 +37 +39 +41 +42 +44 +45 +47 +48 +50 +50 +51 +53 +54 +55 +55 +55 +56 +57 +58 +58 +58 +59 +58 +59 +59 +59 +59 +58 +58 +58 +57 +57 +57 +56 +55 +54 +53 +52 +52 +50 +49 +48 +47 +46 +44 +42 +41 +40 +37 +36 +34 +32 +31 +29 +26 +24 +22 +20 +18 +16 +13 +11 +9 +6 +4 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +4 +7 +9 +12 +14 +17 +19 +21 +23 +26 +28 +30 +32 +34 +36 +37 +39 +41 +43 +44 +46 +48 +49 +51 +52 +53 +55 +55 +56 +57 +58 +59 +59 +60 +61 +62 +62 +62 +63 +63 +63 +63 +63 +63 +62 +62 +62 +62 +61 +60 +60 +59 +58 +57 +56 +55 +54 +53 +52 +51 +49 +47 +46 +44 +43 +41 +40 +37 +36 +34 +32 +30 +28 +25 +23 +21 +19 +17 +15 +12 +10 +7 +5 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +5 +8 +10 +13 +15 +17 +20 +22 +24 +27 +29 +31 +33 +35 +37 +39 +41 +43 +45 +46 +48 +50 +51 +53 +54 +56 +57 +58 +60 +60 +61 +62 +63 +63 +64 +65 +66 +66 +66 +67 +67 +67 +66 +67 +67 +67 +66 +66 +65 +65 +64 +64 +63 +62 +61 +61 +59 +58 +57 +55 +54 +53 +51 +50 +49 +46 +44 +43 +41 +39 +37 +35 +33 +31 +29 +27 +24 +22 +20 +17 +15 +12 +10 +7 +5 +3 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +5 +8 +10 +13 +16 +19 +21 +23 +26 +28 +30 +32 +34 +37 +38 +41 +43 +45 +47 +48 +50 +52 +53 +55 +57 +58 +59 +60 +61 +63 +64 +65 +65 +67 +68 +68 +69 +69 +70 +70 +70 +70 +70 +71 +71 +71 +70 +71 +70 +69 +68 +68 +67 +66 +66 +65 +64 +63 +62 +60 +59 +58 +56 +55 +53 +52 +50 +49 +46 +44 +43 +40 +38 +37 +34 +32 +30 +28 +26 +23 +21 +18 +16 +13 +11 +8 +6 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +5 +8 +11 +14 +16 +18 +21 +24 +26 +29 +31 +33 +36 +37 +40 +42 +44 +46 +48 +50 +51 +54 +55 +56 +58 +60 +61 +63 +64 +65 +67 +67 +69 +70 +71 +71 +72 +73 +73 +74 +74 +74 +74 +75 +75 +75 +75 +75 +74 +74 +73 +73 +72 +71 +70 +70 +69 +68 +66 +65 +64 +63 +62 +60 +59 +56 +55 +53 +51 +50 +48 +46 +44 +41 +39 +37 +35 +33 +31 +28 +26 +24 +21 +19 +16 +14 +11 +9 +6 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +5 +9 +11 +13 +16 +19 +22 +24 +26 +30 +32 +34 +36 +39 +41 +43 +46 +48 +50 +51 +53 +55 +57 +58 +60 +62 +63 +65 +66 +68 +70 +70 +72 +73 +73 +75 +75 +76 +76 +77 +78 +78 +79 +78 +78 +79 +79 +78 +78 +78 +78 +77 +76 +75 +75 +75 +73 +73 +72 +70 +69 +68 +66 +65 +64 +62 +60 +59 +57 +56 +53 +51 +50 +48 +45 +44 +40 +39 +36 +34 +32 +29 +27 +24 +21 +19 +16 +14 +11 +9 +6 +3 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +6 +8 +11 +14 +16 +19 +22 +24 +27 +30 +32 +35 +37 +40 +42 +44 +46 +48 +50 +53 +55 +57 +58 +61 +62 +64 +65 +67 +69 +70 +72 +73 +74 +75 +77 +78 +78 +79 +80 +80 +81 +81 +82 +82 +82 +83 +83 +83 +83 +82 +82 +81 +81 +81 +80 +79 +78 +78 +77 +75 +74 +73 +72 +71 +68 +67 +66 +64 +62 +61 +59 +57 +55 +52 +50 +49 +46 +44 +42 +39 +37 +35 +32 +30 +28 +24 +22 +19 +17 +14 +11 +9 +6 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +6 +9 +11 +14 +17 +19 +22 +25 +28 +31 +33 +35 +38 +41 +43 +45 +48 +50 +52 +54 +56 +58 +61 +62 +64 +65 +67 +69 +71 +72 +74 +75 +77 +78 +79 +80 +81 +82 +83 +84 +84 +85 +85 +86 +87 +87 +86 +86 +86 +86 +86 +86 +85 +85 +84 +84 +82 +82 +81 +80 +79 +78 +76 +75 +74 +73 +71 +69 +68 +66 +64 +62 +60 +58 +56 +54 +52 +50 +48 +45 +43 +40 +38 +35 +33 +30 +27 +25 +22 +20 +16 +13 +11 +8 +6 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +5 +8 +11 +14 +17 +19 +22 +25 +28 +31 +33 +35 +38 +41 +43 +45 +48 +51 +52 +54 +57 +59 +62 +64 +65 +68 +69 +71 +73 +75 +76 +78 +79 +80 +82 +83 +84 +85 +86 +87 +87 +89 +89 +89 +90 +90 +90 +90 +90 +90 +91 +90 +90 +89 +89 +88 +88 +87 +85 +85 +84 +82 +81 +81 +79 +77 +76 +75 +73 +71 +69 +68 +66 +63 +61 +59 +57 +55 +52 +50 +48 +45 +43 +40 +38 +36 +33 +31 +28 +25 +22 +19 +16 +14 +11 +8 +5 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +5 +8 +10 +13 +16 +20 +22 +25 +27 +31 +33 +36 +38 +41 +43 +46 +49 +51 +54 +56 +58 +60 +62 +64 +67 +69 +71 +73 +75 +77 +78 +80 +81 +83 +84 +85 +87 +88 +88 +89 +91 +91 +92 +93 +93 +94 +94 +94 +94 +94 +95 +94 +94 +94 +93 +93 +92 +91 +90 +90 +89 +87 +87 +86 +84 +83 +81 +80 +78 +77 +75 +73 +70 +69 +67 +65 +62 +60 +58 +56 +54 +51 +48 +46 +43 +42 +38 +36 +33 +31 +28 +25 +22 +19 +16 +13 +11 +8 +5 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +4 +7 +10 +13 +17 +19 +22 +25 +28 +30 +33 +36 +39 +41 +44 +47 +50 +52 +54 +56 +59 +61 +64 +66 +68 +70 +72 +74 +76 +77 +80 +82 +83 +85 +87 +87 +89 +90 +92 +92 +93 +94 +96 +96 +97 +97 +97 +98 +98 +98 +98 +98 +98 +98 +98 +97 +97 +95 +95 +94 +93 +92 +92 +90 +89 +88 +86 +84 +83 +81 +79 +78 +76 +74 +72 +70 +68 +66 +64 +61 +59 +57 +54 +52 +50 +46 +44 +41 +39 +36 +33 +30 +27 +25 +22 +19 +16 +13 +10 +7 +4 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +6 +10 +13 +16 +19 +21 +24 +27 +30 +33 +36 +39 +41 +45 +47 +50 +53 +55 +57 +59 +62 +64 +67 +69 +72 +74 +76 +77 +79 +81 +84 +85 +86 +89 +90 +91 +92 +94 +95 +96 +97 +98 +99 +100 +100 +101 +101 +101 +102 +102 +102 +102 +102 +102 +101 +101 +100 +100 +99 +99 +98 +96 +95 +94 +93 +91 +90 +88 +87 +85 +83 +82 +79 +78 +75 +74 +71 +69 +66 +65 +63 +60 +57 +54 +52 +50 +47 +44 +42 +39 +36 +33 +30 +27 +24 +22 +19 +15 +12 +9 +6 +4 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +6 +9 +12 +16 +18 +21 +24 +27 +30 +34 +36 +39 +41 +44 +48 +49 +53 +55 +57 +61 +63 +66 +68 +70 +73 +75 +77 +79 +81 +82 +85 +87 +89 +90 +92 +93 +95 +97 +98 +99 +100 +101 +102 +103 +104 +104 +105 +105 +106 +106 +106 +106 +106 +106 +105 +106 +104 +104 +104 +102 +102 +101 +100 +99 +97 +96 +95 +93 +91 +91 +88 +87 +85 +83 +81 +79 +77 +75 +72 +71 +67 +65 +63 +60 +58 +55 +53 +50 +47 +44 +41 +39 +36 +33 +30 +27 +25 +21 +18 +15 +12 +9 +5 +3 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +5 +8 +11 +14 +18 +21 +24 +26 +30 +33 +35 +38 +42 +44 +47 +50 +53 +55 +58 +61 +63 +66 +68 +71 +73 +75 +77 +80 +82 +84 +87 +88 +90 +92 +94 +95 +97 +99 +100 +101 +103 +103 +105 +106 +107 +108 +108 +109 +109 +109 +110 +110 +110 +110 +110 +110 +109 +109 +108 +107 +106 +106 +105 +104 +102 +101 +100 +99 +97 +95 +94 +91 +90 +88 +86 +85 +82 +80 +77 +75 +73 +70 +69 +66 +63 +60 +58 +55 +53 +50 +47 +44 +41 +39 +36 +33 +30 +27 +24 +20 +18 +14 +12 +8 +5 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +4 +7 +11 +14 +17 +20 +23 +26 +29 +33 +35 +38 +41 +44 +47 +50 +53 +55 +58 +61 +64 +66 +69 +71 +73 +77 +78 +81 +83 +86 +87 +90 +92 +93 +96 +97 +99 +100 +102 +103 +105 +107 +107 +108 +110 +110 +111 +112 +113 +113 +113 +114 +113 +113 +114 +113 +114 +113 +113 +112 +112 +110 +110 +108 +108 +106 +105 +104 +102 +100 +99 +97 +96 +94 +92 +90 +88 +85 +84 +81 +79 +76 +74 +71 +69 +66 +63 +61 +59 +55 +53 +50 +47 +44 +41 +39 +35 +32 +29 +26 +23 +20 +17 +13 +10 +7 +4 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +6 +10 +13 +16 +19 +23 +26 +28 +32 +35 +38 +41 +44 +47 +50 +53 +56 +58 +61 +64 +67 +69 +72 +74 +77 +80 +82 +85 +86 +89 +91 +93 +95 +97 +99 +101 +103 +104 +106 +108 +108 +110 +111 +112 +114 +114 +115 +116 +117 +117 +117 +118 +118 +117 +118 +118 +117 +117 +116 +116 +115 +115 +113 +113 +111 +110 +108 +107 +106 +104 +102 +101 +99 +97 +95 +93 +91 +89 +86 +85 +82 +79 +76 +74 +72 +69 +66 +64 +61 +58 +56 +52 +49 +47 +44 +41 +38 +35 +31 +28 +26 +22 +19 +16 +12 +9 +6 +3 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +5 +8 +12 +15 +19 +21 +25 +28 +30 +34 +37 +40 +43 +47 +49 +52 +56 +58 +61 +63 +67 +70 +72 +75 +78 +80 +83 +85 +87 +90 +92 +94 +96 +99 +100 +102 +104 +106 +108 +109 +111 +112 +114 +115 +116 +117 +118 +119 +120 +120 +121 +121 +121 +121 +121 +122 +121 +122 +120 +120 +120 +119 +118 +118 +116 +115 +113 +112 +111 +109 +108 +106 +104 +102 +101 +98 +97 +94 +92 +90 +87 +85 +82 +80 +78 +75 +72 +70 +66 +64 +61 +58 +55 +52 +50 +46 +44 +40 +37 +34 +31 +27 +25 +21 +18 +15 +12 +9 +5 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +7 +11 +13 +17 +20 +23 +27 +30 +34 +37 +39 +43 +46 +48 +52 +55 +58 +61 +63 +66 +69 +72 +75 +77 +80 +83 +85 +88 +91 +93 +95 +97 +99 +102 +104 +106 +107 +110 +111 +113 +115 +116 +117 +119 +120 +121 +122 +123 +123 +124 +124 +125 +125 +125 +126 +125 +125 +125 +125 +124 +124 +122 +122 +120 +120 +118 +117 +116 +115 +112 +111 +109 +108 +105 +104 +102 +99 +97 +95 +93 +90 +88 +86 +83 +80 +77 +75 +72 +70 +66 +64 +61 +58 +54 +52 +48 +46 +43 +39 +36 +33 +30 +26 +23 +21 +17 +13 +10 +7 +3 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +6 +9 +12 +16 +19 +22 +25 +29 +32 +35 +39 +42 +45 +48 +51 +54 +57 +60 +63 +66 +70 +72 +75 +78 +81 +83 +86 +89 +90 +94 +96 +98 +101 +103 +105 +107 +109 +111 +113 +115 +116 +118 +119 +121 +122 +124 +125 +126 +127 +127 +128 +128 +129 +129 +129 +130 +129 +129 +129 +129 +128 +127 +126 +126 +124 +123 +122 +122 +119 +118 +116 +114 +113 +112 +109 +107 +105 +103 +101 +98 +96 +93 +91 +88 +86 +83 +81 +78 +75 +72 +69 +66 +63 +60 +57 +54 +51 +48 +45 +41 +38 +36 +32 +29 +26 +23 +19 +16 +13 +9 +5 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +4 +8 +11 +14 +18 +21 +24 +28 +31 +34 +38 +41 +44 +47 +51 +53 +57 +60 +62 +66 +68 +72 +75 +78 +80 +83 +86 +89 +92 +93 +97 +99 +102 +104 +106 +109 +111 +112 +115 +116 +118 +120 +122 +124 +125 +126 +128 +128 +129 +131 +131 +132 +133 +133 +133 +134 +134 +133 +134 +133 +132 +132 +132 +130 +129 +129 +127 +126 +125 +123 +122 +120 +119 +116 +115 +112 +110 +108 +106 +104 +102 +99 +97 +94 +91 +89 +86 +83 +80 +78 +75 +72 +69 +66 +63 +60 +57 +53 +50 +47 +44 +41 +38 +34 +32 +28 +25 +21 +18 +15 +11 +7 +4 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +6 +9 +13 +16 +20 +23 +27 +30 +33 +37 +40 +43 +46 +50 +53 +56 +59 +62 +65 +68 +72 +74 +77 +81 +83 +86 +89 +92 +94 +97 +100 +102 +105 +106 +109 +112 +114 +115 +118 +120 +122 +124 +125 +127 +129 +130 +131 +133 +134 +134 +135 +136 +136 +137 +137 +138 +137 +137 +137 +137 +137 +136 +135 +135 +133 +132 +131 +130 +128 +127 +125 +124 +122 +120 +118 +116 +114 +111 +109 +107 +105 +102 +100 +97 +95 +92 +89 +86 +83 +80 +77 +74 +71 +68 +66 +62 +59 +56 +53 +49 +46 +43 +39 +37 +33 +30 +27 +23 +20 +17 +13 +10 +6 +3 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +5 +8 +12 +15 +19 +22 +25 +29 +32 +35 +38 +42 +46 +48 +51 +55 +58 +61 +64 +68 +71 +74 +77 +80 +83 +86 +88 +91 +94 +97 +99 +103 +105 +108 +110 +113 +115 +117 +119 +121 +123 +125 +127 +129 +130 +132 +133 +135 +136 +137 +138 +139 +140 +140 +140 +141 +141 +141 +141 +141 +140 +140 +140 +138 +138 +137 +136 +135 +133 +132 +130 +128 +127 +125 +123 +121 +119 +117 +115 +113 +110 +108 +105 +103 +100 +97 +94 +92 +88 +86 +83 +80 +77 +74 +71 +68 +65 +62 +58 +55 +52 +48 +45 +42 +39 +36 +31 +29 +26 +22 +19 +15 +11 +8 +4 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +6 +10 +14 +17 +20 +24 +27 +30 +34 +37 +41 +44 +47 +51 +53 +57 +61 +64 +67 +70 +73 +76 +80 +82 +85 +88 +91 +94 +97 +100 +102 +105 +108 +110 +113 +116 +118 +121 +122 +125 +126 +128 +131 +133 +134 +135 +137 +139 +139 +141 +142 +143 +144 +144 +145 +145 +146 +146 +145 +145 +144 +145 +143 +142 +142 +141 +140 +139 +137 +135 +134 +132 +131 +128 +127 +125 +123 +120 +118 +116 +113 +110 +107 +105 +103 +100 +97 +95 +91 +89 +85 +82 +79 +76 +73 +70 +67 +63 +61 +57 +54 +50 +48 +44 +41 +37 +34 +30 +27 +24 +20 +17 +13 +10 +6 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +5 +8 +11 +15 +19 +21 +25 +29 +32 +36 +39 +43 +46 +50 +53 +56 +60 +63 +66 +69 +72 +76 +78 +82 +85 +87 +91 +94 +97 +100 +103 +106 +108 +111 +114 +116 +119 +121 +124 +126 +128 +130 +132 +134 +136 +138 +140 +141 +143 +143 +144 +145 +146 +147 +148 +148 +149 +149 +149 +149 +149 +148 +148 +148 +146 +146 +145 +144 +142 +141 +139 +138 +136 +134 +132 +130 +128 +126 +123 +121 +119 +116 +114 +111 +109 +105 +102 +99 +97 +94 +91 +88 +85 +81 +79 +76 +72 +69 +66 +63 +60 +56 +53 +49 +46 +43 +39 +36 +32 +29 +26 +22 +19 +15 +11 +8 +4 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +6 +9 +13 +17 +20 +23 +27 +31 +34 +38 +41 +45 +48 +51 +55 +58 +61 +64 +68 +72 +74 +77 +81 +85 +87 +91 +93 +96 +99 +103 +106 +108 +111 +114 +116 +119 +121 +124 +126 +128 +131 +133 +136 +137 +139 +141 +143 +144 +146 +147 +148 +150 +151 +151 +152 +153 +153 +153 +153 +153 +152 +153 +152 +151 +151 +150 +149 +147 +146 +145 +143 +141 +140 +137 +136 +134 +131 +129 +126 +124 +121 +119 +116 +113 +110 +108 +105 +103 +99 +97 +93 +91 +88 +84 +81 +78 +74 +72 +68 +65 +61 +58 +55 +52 +48 +45 +41 +37 +34 +31 +27 +23 +20 +17 +13 +9 +6 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +4 +8 +11 +15 +18 +22 +25 +29 +33 +36 +39 +42 +46 +49 +53 +57 +60 +64 +66 +70 +74 +77 +80 +84 +86 +90 +93 +96 +99 +102 +105 +108 +111 +113 +116 +119 +122 +125 +127 +130 +132 +134 +136 +139 +141 +143 +145 +147 +148 +150 +151 +153 +153 +155 +155 +156 +156 +157 +157 +157 +157 +157 +156 +156 +155 +154 +153 +153 +151 +150 +148 +146 +144 +142 +140 +139 +136 +134 +131 +129 +127 +124 +122 +119 +117 +114 +111 +108 +105 +102 +99 +96 +93 +89 +86 +84 +80 +76 +73 +70 +67 +63 +60 +56 +54 +50 +46 +43 +39 +36 +32 +29 +25 +22 +18 +14 +11 +7 +4 +0 +0 +0 +0 +0 +0 +0 +0 +2 +5 +9 +12 +16 +20 +24 +26 +31 +34 +38 +42 +45 +48 +52 +55 +59 +62 +65 +69 +72 +75 +79 +83 +86 +89 +92 +95 +98 +102 +104 +107 +111 +113 +116 +119 +122 +124 +128 +130 +133 +135 +137 +139 +142 +144 +146 +148 +150 +151 +153 +154 +156 +157 +158 +159 +160 +161 +161 +160 +161 +161 +161 +160 +160 +159 +158 +157 +156 +155 +154 +152 +150 +148 +147 +144 +142 +140 +137 +135 +133 +130 +128 +124 +122 +119 +116 +113 +111 +107 +104 +101 +98 +95 +92 +89 +85 +82 +79 +75 +72 +68 +65 +62 +58 +55 +52 +48 +45 +41 +38 +35 +30 +27 +23 +19 +16 +13 +9 +5 +2 +0 +0 +0 +0 +0 +0 +0 +4 +7 +11 +14 +18 +22 +25 +28 +32 +36 +39 +43 +46 +50 +54 +57 +60 +64 +67 +71 +74 +77 +81 +84 +87 +91 +94 +98 +100 +104 +107 +110 +113 +116 +119 +122 +124 +127 +130 +133 +135 +139 +140 +143 +145 +147 +149 +152 +153 +155 +157 +158 +159 +161 +162 +163 +164 +164 +164 +164 +165 +165 +164 +165 +164 +162 +162 +161 +159 +158 +156 +155 +153 +152 +150 +147 +145 +142 +141 +138 +136 +133 +130 +127 +124 +122 +119 +116 +113 +110 +107 +104 +101 +97 +94 +91 +88 +84 +81 +77 +74 +71 +67 +64 +61 +57 +54 +50 +47 +43 +39 +36 +33 +28 +25 +22 +18 +14 +11 +6 +3 +0 +0 +0 +0 +0 +0 +1 +5 +9 +12 +16 +19 +23 +26 +30 +33 +38 +41 +44 +48 +51 +55 +58 +62 +66 +69 +73 +76 +80 +83 +86 +90 +93 +96 +99 +103 +106 +109 +112 +115 +118 +122 +125 +127 +130 +133 +136 +138 +141 +144 +146 +149 +150 +152 +154 +157 +158 +160 +162 +163 +165 +166 +166 +167 +168 +168 +169 +169 +168 +169 +168 +167 +167 +166 +165 +164 +162 +160 +158 +157 +155 +153 +150 +149 +146 +144 +141 +139 +136 +133 +130 +127 +124 +121 +118 +116 +113 +109 +106 +102 +99 +96 +93 +89 +86 +83 +80 +77 +73 +69 +66 +62 +59 +55 +51 +48 +44 +41 +37 +34 +31 +26 +23 +19 +16 +12 +8 +5 +1 +0 +0 +0 +0 +0 +2 +6 +10 +13 +17 +21 +24 +28 +31 +35 +39 +43 +46 +50 +53 +57 +61 +63 +68 +71 +74 +78 +81 +85 +88 +92 +95 +99 +102 +105 +108 +112 +115 +118 +121 +124 +127 +130 +132 +136 +138 +142 +144 +146 +149 +151 +154 +157 +159 +160 +162 +164 +165 +167 +168 +169 +170 +171 +172 +172 +172 +172 +173 +173 +172 +172 +171 +169 +168 +167 +165 +164 +162 +160 +158 +156 +154 +152 +149 +147 +144 +142 +139 +136 +133 +131 +127 +124 +121 +118 +114 +112 +108 +105 +101 +98 +95 +92 +88 +85 +81 +78 +74 +71 +68 +64 +60 +57 +54 +49 +46 +43 +38 +35 +31 +28 +25 +21 +17 +13 +9 +6 +3 +0 +0 +0 +0 +0 +3 +7 +11 +14 +18 +22 +26 +29 +33 +37 +40 +44 +48 +51 +55 +58 +62 +66 +69 +73 +76 +80 +83 +86 +90 +94 +97 +100 +104 +107 +110 +114 +117 +120 +123 +127 +130 +133 +136 +139 +142 +144 +147 +150 +152 +155 +157 +159 +161 +163 +166 +168 +169 +171 +172 +173 +174 +175 +176 +176 +177 +177 +177 +176 +176 +175 +174 +174 +172 +170 +169 +167 +166 +164 +161 +159 +157 +154 +152 +149 +147 +144 +141 +138 +135 +133 +130 +127 +123 +120 +117 +114 +110 +107 +104 +101 +97 +93 +90 +87 +83 +80 +77 +73 +69 +66 +62 +58 +55 +51 +48 +44 +40 +37 +33 +30 +26 +22 +18 +15 +11 +7 +4 +0 +0 +0 +0 +1 +5 +8 +12 +16 +20 +23 +27 +30 +34 +38 +42 +45 +49 +53 +57 +60 +63 +67 +71 +75 +78 +81 +85 +89 +92 +95 +99 +102 +106 +109 +113 +116 +119 +122 +126 +128 +132 +135 +138 +141 +144 +147 +149 +153 +155 +157 +160 +163 +165 +167 +169 +171 +173 +174 +175 +177 +178 +178 +179 +181 +180 +180 +180 +180 +179 +178 +178 +177 +175 +174 +172 +171 +169 +167 +165 +163 +160 +158 +155 +152 +150 +147 +144 +141 +138 +135 +132 +129 +126 +122 +119 +116 +112 +109 +106 +102 +99 +96 +92 +88 +85 +82 +78 +74 +71 +68 +63 +60 +56 +52 +49 +45 +42 +38 +34 +30 +27 +24 +19 +16 +12 +9 +4 +1 +0 +0 +0 +2 +6 +10 +13 +17 +21 +24 +28 +32 +35 +40 +43 +47 +51 +54 +58 +62 +65 +68 +72 +76 +79 +83 +87 +90 +93 +97 +101 +104 +108 +111 +114 +118 +121 +125 +128 +131 +134 +137 +141 +144 +147 +150 +153 +155 +158 +161 +163 +166 +168 +170 +172 +174 +177 +178 +179 +181 +182 +182 +184 +184 +184 +185 +185 +184 +184 +182 +182 +181 +179 +177 +176 +174 +172 +170 +168 +166 +163 +160 +158 +155 +152 +149 +147 +144 +140 +137 +134 +131 +128 +125 +121 +118 +115 +111 +108 +104 +101 +98 +94 +90 +87 +84 +80 +76 +72 +69 +65 +62 +58 +54 +50 +47 +43 +40 +36 +32 +29 +24 +21 +17 +13 +10 +6 +2 +0 +0 +0 +3 +7 +10 +15 +18 +22 +25 +30 +33 +37 +40 +45 +48 +52 +56 +59 +63 +67 +71 +74 +78 +81 +84 +88 +92 +95 +99 +102 +106 +109 +113 +117 +120 +124 +126 +130 +134 +137 +140 +143 +146 +150 +153 +155 +158 +161 +164 +166 +169 +171 +173 +176 +178 +179 +181 +183 +184 +186 +187 +187 +187 +188 +189 +189 +188 +187 +187 +186 +184 +183 +181 +180 +178 +175 +174 +171 +169 +166 +163 +160 +158 +155 +153 +149 +146 +143 +140 +137 +133 +130 +126 +123 +120 +116 +113 +110 +106 +103 +99 +95 +92 +88 +84 +82 +78 +73 +70 +66 +63 +59 +55 +52 +48 +45 +40 +37 +33 +29 +25 +22 +18 +14 +11 +7 +3 +0 +0 +0 +4 +8 +12 +15 +19 +23 +26 +31 +35 +38 +42 +46 +50 +53 +57 +61 +64 +67 +71 +75 +79 +83 +87 +90 +93 +97 +100 +104 +107 +112 +115 +119 +122 +125 +129 +132 +136 +139 +142 +145 +148 +152 +155 +158 +161 +164 +166 +169 +171 +174 +176 +179 +181 +183 +185 +186 +188 +190 +190 +191 +192 +192 +192 +193 +192 +191 +190 +189 +188 +187 +185 +183 +181 +179 +177 +174 +172 +169 +166 +164 +161 +158 +154 +151 +149 +145 +142 +138 +136 +132 +129 +125 +122 +118 +114 +111 +108 +105 +100 +97 +94 +89 +86 +82 +79 +76 +71 +68 +64 +60 +56 +53 +49 +46 +42 +39 +34 +31 +27 +23 +19 +16 +11 +8 +4 +1 +0 +1 +5 +9 +13 +16 +20 +24 +28 +32 +35 +39 +43 +47 +50 +55 +58 +61 +65 +69 +73 +77 +80 +84 +87 +91 +94 +99 +102 +106 +110 +113 +116 +120 +123 +127 +130 +134 +137 +140 +145 +148 +151 +154 +157 +160 +163 +166 +169 +172 +175 +177 +180 +182 +185 +186 +189 +190 +192 +193 +194 +195 +196 +196 +196 +196 +195 +195 +194 +193 +191 +190 +188 +187 +184 +182 +180 +177 +174 +171 +169 +166 +163 +160 +157 +153 +151 +148 +144 +140 +137 +134 +130 +127 +124 +121 +116 +113 +110 +105 +102 +98 +95 +91 +87 +84 +80 +77 +73 +69 +65 +62 +58 +54 +50 +46 +43 +39 +36 +32 +27 +24 +21 +17 +12 +9 +5 +2 +0 +2 +6 +9 +14 +17 +21 +25 +29 +32 +36 +40 +44 +48 +51 +55 +59 +63 +66 +70 +74 +78 +82 +85 +89 +92 +96 +100 +103 +108 +111 +114 +118 +121 +125 +128 +132 +136 +140 +143 +146 +149 +153 +156 +160 +162 +166 +169 +171 +174 +177 +180 +183 +185 +188 +189 +192 +194 +195 +197 +198 +199 +199 +200 +200 +200 +200 +199 +198 +197 +195 +194 +191 +190 +188 +185 +182 +180 +177 +175 +172 +169 +166 +163 +159 +156 +153 +150 +146 +143 +140 +136 +132 +129 +126 +121 +118 +115 +111 +107 +103 +100 +97 +93 +89 +85 +81 +78 +74 +71 +66 +63 +60 +55 +51 +47 +44 +40 +36 +32 +29 +25 +21 +17 +14 +10 +6 +2 +0 +3 +7 +11 +15 +18 +22 +26 +29 +33 +37 +41 +45 +49 +53 +56 +60 +63 +68 +72 +75 +79 +83 +87 +90 +94 +97 +101 +105 +109 +113 +116 +119 +124 +127 +131 +134 +137 +141 +145 +148 +152 +155 +158 +162 +165 +168 +171 +175 +177 +180 +183 +185 +188 +191 +193 +195 +197 +199 +200 +201 +203 +203 +204 +204 +204 +203 +202 +202 +200 +199 +197 +195 +193 +190 +188 +186 +183 +180 +177 +174 +171 +168 +165 +162 +158 +155 +151 +148 +144 +142 +138 +134 +131 +127 +123 +119 +116 +113 +109 +105 +102 +98 +94 +90 +86 +83 +79 +76 +71 +68 +64 +60 +56 +53 +49 +45 +41 +38 +34 +30 +26 +22 +18 +14 +10 +7 +3 +0 +4 +7 +11 +16 +19 +23 +26 +31 +35 +38 +42 +46 +49 +53 +57 +61 +65 +69 +72 +77 +80 +84 +87 +92 +96 +99 +102 +106 +110 +113 +117 +122 +124 +128 +132 +135 +139 +143 +146 +150 +153 +157 +160 +163 +167 +170 +173 +177 +180 +183 +186 +188 +191 +194 +196 +199 +200 +203 +204 +206 +207 +207 +208 +208 +208 +208 +206 +206 +204 +203 +201 +198 +196 +194 +191 +189 +186 +183 +180 +177 +174 +170 +167 +164 +160 +157 +153 +150 +146 +143 +140 +135 +132 +128 +125 +121 +117 +113 +110 +106 +103 +99 +95 +92 +88 +84 +80 +76 +72 +69 +64 +62 +57 +53 +50 +46 +42 +38 +35 +30 +27 +23 +19 +15 +11 +8 +3 +1 +4 +8 +12 +16 +20 +23 +28 +31 +36 +39 +43 +47 +51 +54 +59 +62 +66 +70 +74 +78 +81 +85 +89 +93 +96 +100 +104 +108 +111 +115 +119 +122 +126 +130 +134 +137 +140 +144 +148 +152 +155 +159 +162 +165 +169 +173 +176 +179 +183 +185 +189 +191 +194 +197 +199 +201 +204 +206 +208 +209 +211 +211 +212 +212 +212 +212 +210 +209 +208 +206 +204 +201 +199 +197 +194 +191 +188 +185 +182 +179 +175 +173 +169 +166 +162 +159 +155 +151 +148 +144 +140 +137 +134 +130 +126 +122 +119 +115 +112 +107 +104 +100 +96 +92 +89 +85 +81 +77 +73 +70 +66 +62 +58 +54 +50 +47 +43 +39 +36 +32 +28 +24 +20 +16 +12 +8 +5 +2 +6 +9 +13 +16 +21 +25 +28 +32 +36 +40 +44 +47 +51 +55 +59 +63 +66 +71 +74 +78 +82 +86 +89 +93 +97 +101 +104 +108 +113 +116 +120 +124 +128 +131 +135 +139 +142 +145 +149 +153 +156 +160 +164 +168 +171 +174 +178 +181 +184 +187 +191 +194 +196 +200 +202 +205 +208 +210 +211 +213 +214 +215 +216 +216 +215 +215 +214 +213 +211 +209 +207 +205 +202 +199 +197 +194 +191 +187 +185 +181 +178 +174 +170 +168 +164 +160 +157 +154 +149 +145 +142 +139 +135 +131 +128 +124 +120 +116 +112 +108 +104 +101 +98 +94 +90 +86 +82 +78 +74 +70 +67 +63 +59 +55 +51 +47 +43 +40 +36 +32 +28 +24 +21 +17 +13 +9 +5 +1 +5 +10 +13 +17 +21 +25 +29 +33 +37 +40 +45 +48 +52 +56 +60 +63 +67 +71 +75 +79 +83 +87 +90 +94 +98 +102 +106 +109 +113 +117 +121 +124 +128 +132 +136 +139 +143 +147 +151 +155 +158 +162 +165 +169 +172 +176 +179 +183 +187 +190 +193 +196 +199 +202 +205 +208 +210 +213 +215 +216 +218 +219 +219 +220 +219 +219 +218 +217 +215 +213 +211 +207 +205 +202 +200 +197 +193 +190 +187 +183 +179 +176 +172 +169 +165 +162 +158 +155 +151 +148 +143 +140 +136 +132 +128 +124 +121 +117 +113 +110 +106 +102 +98 +94 +90 +87 +83 +79 +76 +72 +67 +64 +60 +56 +52 +48 +45 +40 +37 +32 +29 +25 +21 +17 +13 +10 +6 +3 +7 +10 +14 +18 +21 +26 +30 +33 +37 +41 +45 +49 +52 +56 +61 +64 +68 +72 +76 +80 +84 +87 +92 +95 +99 +103 +107 +110 +114 +118 +121 +125 +130 +133 +137 +141 +145 +148 +152 +155 +160 +163 +167 +171 +174 +178 +181 +185 +189 +192 +195 +198 +202 +205 +208 +211 +214 +216 +218 +220 +222 +222 +224 +223 +224 +223 +221 +220 +218 +216 +213 +211 +208 +205 +202 +199 +195 +192 +188 +185 +181 +178 +174 +171 +167 +164 +159 +156 +152 +149 +145 +141 +138 +133 +129 +126 +122 +118 +114 +110 +107 +103 +99 +96 +91 +87 +84 +80 +75 +72 +69 +64 +61 +57 +53 +49 +45 +41 +37 +34 +30 +26 +22 +18 +13 +10 +6 +2 +7 +10 +14 +18 +22 +26 +30 +34 +38 +41 +46 +49 +54 +57 +61 +65 +68 +73 +76 +81 +84 +88 +92 +96 +100 +103 +107 +111 +115 +119 +123 +127 +130 +134 +138 +142 +146 +150 +153 +157 +161 +164 +168 +172 +175 +180 +183 +186 +190 +193 +197 +200 +204 +208 +211 +214 +217 +219 +222 +223 +225 +226 +227 +228 +227 +227 +225 +223 +222 +219 +216 +214 +211 +207 +204 +200 +197 +194 +190 +187 +183 +179 +175 +172 +168 +164 +161 +157 +153 +150 +145 +142 +138 +134 +130 +126 +123 +118 +115 +111 +107 +103 +100 +96 +92 +88 +85 +80 +76 +73 +69 +65 +61 +57 +53 +49 +45 +41 +37 +34 +29 +27 +22 +18 +15 +10 +7 +3 +7 +11 +15 +19 +22 +27 +30 +34 +38 +42 +46 +50 +53 +58 +62 +66 +70 +73 +77 +81 +85 +89 +93 +97 +101 +104 +109 +112 +116 +119 +123 +128 +132 +135 +139 +143 +146 +151 +154 +158 +161 +165 +169 +173 +177 +181 +185 +188 +191 +196 +199 +203 +206 +209 +212 +215 +219 +222 +224 +226 +229 +231 +231 +231 +231 +230 +229 +226 +224 +221 +219 +216 +212 +209 +206 +203 +199 +195 +191 +188 +184 +180 +177 +174 +170 +166 +162 +158 +155 +151 +146 +142 +139 +135 +131 +127 +123 +119 +116 +112 +109 +104 +100 +96 +92 +89 +85 +81 +78 +73 +70 +66 +62 +57 +54 +50 +46 +42 +39 +34 +31 +27 +23 +19 +15 +11 +7 +3 +7 +11 +15 +19 +23 +27 +31 +34 +39 +43 +46 +51 +54 +58 +62 +66 +70 +73 +78 +82 +86 +90 +93 +97 +101 +105 +109 +113 +116 +120 +124 +128 +132 +136 +139 +143 +147 +152 +155 +159 +163 +167 +170 +175 +178 +182 +185 +189 +193 +197 +200 +205 +207 +211 +215 +218 +221 +225 +227 +229 +232 +234 +235 +235 +235 +234 +232 +230 +227 +225 +221 +218 +215 +211 +207 +204 +200 +197 +193 +189 +185 +181 +178 +175 +170 +166 +163 +159 +155 +152 +147 +144 +140 +135 +132 +128 +124 +120 +116 +112 +108 +105 +101 +97 +93 +89 +85 +82 +78 +74 +69 +66 +62 +58 +54 +51 +46 +42 +39 +35 +31 +27 +23 +19 +15 +11 +7 +4 +7 +12 +16 +19 +24 +28 +31 +35 +39 +43 +46 +51 +55 +59 +63 +66 +70 +74 +78 +82 +86 +90 +93 +97 +102 +105 +110 +113 +117 +121 +125 +129 +133 +136 +140 +144 +148 +152 +156 +159 +163 +168 +171 +175 +179 +183 +187 +191 +194 +198 +202 +205 +209 +213 +216 +220 +224 +227 +230 +233 +235 +237 +239 +239 +239 +237 +235 +232 +230 +226 +224 +220 +217 +213 +209 +205 +201 +198 +194 +190 +186 +183 +179 +175 +171 +167 +164 +160 +156 +152 +148 +144 +141 +137 +132 +129 +125 +121 +117 +113 +109 +105 +101 +98 +94 +90 +85 +82 +78 +74 +70 +66 +62 +59 +55 +51 +47 +43 +39 +35 +31 +28 +23 +19 +15 +12 +7 +4 +8 +12 +15 +19 +23 +27 +31 +36 +39 +43 +47 +51 +55 +59 +63 +67 +70 +75 +78 +82 +86 +90 +94 +97 +102 +106 +110 +113 +117 +122 +125 +129 +133 +137 +141 +144 +148 +152 +156 +160 +164 +168 +171 +175 +180 +183 +188 +191 +195 +199 +203 +207 +210 +214 +218 +222 +225 +229 +232 +235 +238 +241 +242 +243 +242 +241 +238 +235 +232 +228 +225 +222 +218 +214 +210 +206 +203 +199 +195 +192 +187 +183 +180 +176 +172 +168 +164 +160 +156 +152 +148 +145 +141 +137 +133 +129 +126 +122 +117 +113 +109 +105 +102 +98 +93 +90 +86 +82 +79 +75 +70 +67 +63 +59 +55 +51 +47 +43 +39 +35 +31 +28 +23 +20 +16 +12 +8 +4 +8 +12 +16 +20 +24 +28 +32 +36 +39 +44 +47 +51 +55 +59 +63 +67 +70 +74 +79 +83 +87 +91 +94 +98 +102 +106 +110 +114 +117 +122 +125 +129 +133 +138 +141 +145 +149 +153 +156 +161 +165 +168 +172 +176 +180 +184 +188 +191 +195 +199 +203 +207 +212 +215 +219 +222 +226 +230 +234 +237 +241 +244 +246 +247 +246 +244 +240 +237 +234 +230 +227 +222 +219 +215 +212 +208 +204 +200 +196 +192 +188 +184 +181 +176 +173 +168 +165 +160 +157 +153 +149 +145 +141 +137 +133 +129 +125 +121 +117 +114 +110 +106 +102 +98 +94 +90 +86 +83 +78 +74 +71 +67 +63 +59 +55 +51 +47 +43 +40 +35 +31 +28 +24 +19 +15 +12 +8 +4 +8 +12 +16 +20 +23 +28 +31 +36 +39 +44 +47 +51 +55 +59 +63 +67 +71 +75 +79 +83 +86 +91 +95 +98 +102 +106 +110 +114 +118 +121 +126 +130 +134 +137 +141 +145 +149 +153 +157 +160 +165 +169 +173 +177 +180 +185 +188 +193 +196 +200 +204 +207 +211 +215 +219 +223 +227 +232 +235 +239 +243 +246 +249 +252 +250 +247 +243 +239 +235 +231 +227 +223 +220 +215 +212 +208 +204 +200 +196 +192 +188 +185 +181 +177 +172 +169 +165 +161 +157 +153 +149 +145 +141 +137 +134 +129 +126 +121 +118 +114 +110 +106 +102 +98 +94 +91 +86 +83 +79 +74 +71 +67 +63 +59 +55 +52 +47 +43 +39 +36 +31 +28 +24 +20 +16 +12 +8 +4 +8 +12 +16 +20 +24 +27 +31 +36 +40 +43 +47 +51 +55 +59 +62 +67 +70 +75 +78 +83 +87 +90 +95 +98 +102 +106 +110 +114 +118 +122 +126 +130 +133 +138 +141 +145 +149 +153 +157 +161 +165 +169 +173 +176 +181 +184 +189 +193 +196 +200 +204 +208 +212 +216 +220 +224 +227 +231 +235 +239 +243 +247 +251 +255 +251 +247 +243 +240 +236 +232 +227 +224 +219 +216 +212 +208 +204 +200 +196 +192 +189 +184 +180 +177 +173 +169 +165 +161 +157 +153 +149 +145 +142 +138 +134 +130 +126 +122 +117 +114 +110 +106 +102 +98 +95 +90 +86 +83 +78 +75 +71 +67 +63 +59 +55 +51 +47 +43 +39 +36 +32 +27 +24 +20 +16 +12 +8 +4 +8 +12 +16 +20 +24 +28 +32 +36 +39 +43 +47 +51 +55 +59 +63 +66 +70 +75 +78 +83 +86 +90 +94 +99 +102 +106 +110 +114 +118 +122 +126 +130 +133 +137 +142 +145 +149 +153 +157 +161 +164 +168 +173 +176 +180 +184 +188 +192 +196 +200 +203 +208 +211 +216 +220 +223 +227 +231 +235 +239 +243 +246 +249 +251 +249 +246 +243 +238 +235 +231 +228 +224 +219 +215 +212 +208 +204 +200 +196 +192 +188 +184 +181 +177 +172 +168 +165 +161 +157 +153 +149 +145 +141 +138 +133 +129 +126 +122 +118 +114 +110 +106 +102 +98 +94 +91 +86 +82 +79 +75 +70 +66 +63 +59 +55 +51 +47 +43 +39 +36 +32 +28 +24 +20 +16 +12 +9 +4 +8 +12 +15 +20 +23 +28 +32 +35 +39 +43 +47 +51 +55 +59 +63 +67 +70 +75 +79 +82 +86 +90 +94 +98 +102 +105 +110 +114 +118 +121 +125 +130 +133 +138 +141 +145 +149 +153 +156 +161 +165 +168 +172 +177 +180 +184 +188 +192 +196 +199 +203 +207 +211 +215 +219 +222 +227 +230 +234 +237 +241 +244 +246 +247 +246 +244 +241 +237 +234 +231 +226 +222 +218 +215 +211 +207 +204 +200 +195 +192 +188 +184 +181 +176 +173 +168 +165 +161 +157 +153 +149 +145 +141 +138 +133 +130 +125 +122 +117 +114 +109 +106 +102 +98 +94 +90 +86 +83 +79 +74 +71 +67 +62 +59 +55 +51 +47 +43 +39 +35 +31 +28 +24 +19 +16 +12 +8 +4 +8 +12 +16 +19 +23 +27 +31 +35 +39 +43 +47 +50 +55 +59 +63 +67 +70 +74 +79 +82 +86 +90 +94 +98 +102 +105 +110 +113 +118 +121 +125 +129 +133 +137 +141 +145 +149 +152 +156 +160 +164 +168 +172 +176 +180 +184 +188 +191 +195 +199 +202 +207 +211 +214 +217 +221 +225 +229 +232 +236 +239 +241 +242 +244 +242 +241 +238 +235 +232 +229 +226 +222 +218 +214 +210 +206 +202 +199 +195 +191 +188 +183 +180 +176 +171 +168 +164 +160 +157 +152 +148 +145 +141 +137 +133 +129 +125 +121 +118 +114 +109 +106 +102 +98 +94 +90 +86 +82 +79 +75 +70 +66 +62 +59 +55 +51 +47 +43 +39 +35 +31 +28 +23 +20 +16 +12 +8 +4 +8 +12 +16 +20 +24 +27 +31 +35 +39 +43 +47 +50 +54 +59 +62 +66 +70 +74 +78 +82 +85 +90 +93 +98 +101 +105 +109 +113 +117 +121 +124 +128 +133 +136 +140 +144 +148 +152 +155 +160 +163 +167 +171 +176 +179 +183 +187 +190 +194 +198 +201 +206 +209 +213 +216 +220 +223 +227 +230 +233 +236 +237 +238 +239 +238 +237 +236 +233 +230 +227 +223 +220 +216 +212 +209 +205 +202 +198 +194 +190 +186 +182 +179 +175 +171 +167 +164 +160 +156 +152 +148 +144 +140 +136 +132 +129 +125 +121 +117 +113 +109 +105 +101 +98 +93 +89 +86 +82 +78 +74 +70 +66 +62 +59 +54 +51 +47 +43 +39 +35 +31 +27 +23 +20 +15 +12 +7 +4 +8 +11 +15 +19 +23 +27 +31 +34 +39 +43 +47 +50 +54 +58 +62 +66 +70 +73 +77 +82 +85 +89 +93 +97 +101 +105 +109 +113 +116 +120 +124 +128 +132 +136 +139 +143 +148 +151 +155 +158 +163 +167 +170 +174 +178 +182 +185 +190 +193 +197 +201 +204 +207 +211 +214 +218 +222 +224 +227 +229 +232 +234 +235 +236 +235 +234 +232 +230 +228 +224 +221 +218 +215 +211 +207 +204 +200 +197 +193 +189 +186 +182 +178 +174 +171 +166 +162 +159 +155 +151 +148 +143 +140 +135 +132 +128 +124 +120 +117 +113 +109 +104 +101 +97 +93 +89 +86 +81 +78 +73 +69 +66 +62 +58 +55 +51 +46 +42 +39 +35 +31 +27 +23 +19 +15 +12 +7 +3 +7 +11 +14 +19 +23 +26 +30 +34 +38 +42 +46 +50 +53 +58 +61 +66 +69 +74 +77 +81 +84 +89 +93 +97 +101 +104 +108 +112 +116 +119 +124 +128 +131 +135 +139 +142 +146 +151 +154 +158 +162 +165 +170 +174 +177 +181 +185 +188 +192 +196 +199 +202 +206 +209 +213 +216 +219 +222 +224 +227 +228 +230 +232 +232 +231 +231 +229 +227 +225 +222 +219 +216 +213 +209 +205 +202 +199 +196 +192 +188 +185 +180 +176 +173 +169 +166 +162 +158 +154 +151 +146 +143 +139 +135 +131 +127 +124 +120 +116 +112 +108 +105 +100 +96 +92 +89 +85 +81 +77 +73 +69 +65 +61 +58 +54 +50 +46 +42 +38 +34 +30 +26 +23 +19 +14 +10 +6 +2 +6 +11 +15 +18 +22 +26 +30 +34 +37 +42 +46 +50 +53 +57 +61 +65 +69 +73 +76 +80 +84 +88 +92 +96 +100 +103 +107 +112 +115 +119 +122 +126 +131 +134 +138 +142 +146 +149 +153 +157 +161 +164 +169 +172 +176 +179 +183 +186 +190 +194 +197 +200 +204 +208 +210 +214 +216 +219 +222 +224 +225 +227 +227 +228 +227 +226 +225 +224 +221 +219 +217 +214 +210 +207 +204 +201 +197 +194 +190 +186 +183 +180 +176 +172 +169 +164 +160 +157 +153 +150 +146 +142 +138 +134 +131 +126 +123 +119 +115 +111 +107 +103 +99 +96 +92 +88 +84 +80 +76 +73 +69 +65 +61 +57 +54 +49 +45 +42 +37 +34 +30 +26 +23 +18 +14 +11 +7 +2 +6 +10 +14 +18 +22 +26 +29 +33 +38 +41 +45 +49 +53 +56 +60 +64 +68 +72 +76 +79 +84 +87 +91 +95 +99 +103 +106 +111 +114 +119 +122 +126 +129 +133 +137 +141 +145 +149 +152 +155 +160 +163 +167 +170 +175 +178 +182 +185 +188 +191 +196 +198 +201 +205 +208 +210 +213 +216 +218 +220 +222 +222 +223 +224 +224 +222 +222 +220 +218 +215 +213 +210 +208 +205 +201 +198 +195 +192 +188 +185 +181 +178 +174 +171 +167 +163 +160 +156 +152 +149 +145 +141 +137 +134 +130 +126 +122 +118 +115 +110 +106 +103 +99 +95 +91 +88 +84 +80 +76 +72 +68 +64 +60 +57 +53 +48 +45 +41 +38 +33 +29 +25 +22 +17 +14 +10 +6 +2 +5 +9 +13 +18 +22 +25 +29 +33 +36 +41 +44 +49 +52 +56 +60 +64 +67 +72 +75 +79 +83 +87 +91 +94 +98 +102 +106 +109 +114 +117 +121 +125 +129 +132 +136 +140 +144 +147 +151 +155 +158 +162 +165 +169 +173 +177 +179 +183 +187 +190 +193 +196 +199 +202 +205 +207 +210 +213 +215 +216 +218 +218 +220 +220 +220 +218 +218 +216 +214 +213 +210 +208 +205 +202 +199 +197 +193 +190 +187 +183 +180 +176 +172 +169 +165 +162 +159 +154 +151 +147 +144 +140 +136 +133 +129 +125 +121 +117 +114 +109 +106 +102 +98 +94 +91 +87 +83 +79 +76 +71 +67 +63 +60 +56 +52 +48 +44 +40 +36 +32 +29 +25 +21 +17 +13 +9 +5 +1 +5 +8 +13 +17 +21 +25 +28 +32 +36 +39 +44 +48 +51 +55 +59 +63 +67 +70 +74 +78 +82 +86 +90 +94 +97 +102 +105 +108 +112 +116 +120 +124 +127 +131 +135 +139 +142 +146 +149 +153 +157 +161 +164 +167 +171 +175 +177 +181 +184 +188 +191 +194 +197 +200 +202 +205 +207 +209 +211 +213 +214 +215 +215 +216 +216 +215 +214 +212 +211 +209 +207 +205 +202 +200 +197 +194 +191 +188 +184 +181 +177 +174 +171 +167 +164 +161 +156 +153 +150 +146 +142 +138 +134 +131 +128 +123 +120 +116 +112 +108 +105 +101 +98 +94 +89 +86 +82 +78 +75 +70 +67 +63 +59 +55 +51 +48 +44 +39 +36 +32 +28 +24 +20 +17 +12 +9 +5 +1 +5 +9 +12 +16 +20 +24 +27 +31 +35 +39 +43 +47 +50 +54 +58 +62 +65 +70 +74 +77 +81 +85 +88 +92 +96 +100 +104 +107 +112 +115 +118 +122 +126 +130 +133 +137 +140 +144 +148 +151 +155 +159 +162 +166 +169 +173 +175 +179 +183 +185 +188 +191 +194 +197 +199 +201 +204 +206 +208 +209 +210 +211 +212 +212 +212 +211 +210 +209 +207 +206 +204 +201 +199 +197 +194 +191 +189 +186 +182 +179 +176 +172 +169 +165 +162 +158 +155 +151 +148 +145 +140 +138 +133 +130 +126 +123 +119 +115 +111 +107 +103 +100 +96 +93 +89 +85 +81 +77 +74 +69 +65 +62 +58 +54 +51 +47 +42 +39 +35 +32 +27 +24 +20 +16 +13 +8 +4 +0 +3 +8 +12 +16 +19 +23 +27 +31 +35 +38 +42 +45 +49 +54 +57 +61 +65 +69 +72 +76 +80 +84 +88 +91 +96 +99 +103 +106 +110 +114 +118 +121 +125 +128 +132 +135 +140 +143 +146 +150 +153 +157 +160 +163 +167 +170 +174 +177 +179 +183 +186 +188 +191 +194 +197 +198 +201 +202 +204 +206 +207 +207 +208 +208 +208 +207 +207 +205 +204 +203 +200 +199 +196 +194 +191 +188 +185 +183 +180 +176 +174 +170 +167 +163 +160 +156 +154 +149 +147 +143 +139 +135 +132 +129 +125 +121 +117 +113 +110 +106 +102 +99 +96 +91 +87 +84 +80 +76 +73 +68 +65 +61 +57 +54 +49 +46 +42 +39 +34 +31 +26 +23 +19 +15 +12 +7 +4 +0 +3 +6 +11 +15 +18 +23 +26 +30 +34 +37 +41 +44 +49 +52 +57 +61 +64 +68 +71 +75 +79 +83 +86 +90 +94 +98 +101 +105 +108 +113 +116 +120 +123 +127 +130 +134 +137 +141 +145 +148 +152 +155 +158 +162 +165 +168 +171 +174 +177 +180 +183 +186 +189 +191 +193 +195 +197 +199 +201 +202 +203 +203 +204 +204 +204 +203 +203 +202 +201 +199 +197 +195 +193 +191 +188 +186 +183 +180 +177 +174 +171 +168 +164 +162 +158 +155 +151 +148 +144 +141 +137 +134 +130 +127 +123 +120 +116 +112 +108 +105 +101 +98 +94 +90 +87 +83 +79 +75 +71 +68 +64 +60 +57 +53 +49 +45 +42 +38 +33 +29 +26 +22 +18 +15 +11 +7 +3 +0 +2 +5 +10 +14 +17 +21 +25 +29 +33 +36 +40 +44 +48 +52 +55 +59 +63 +67 +70 +74 +78 +81 +85 +89 +93 +96 +100 +104 +108 +111 +114 +118 +122 +125 +129 +132 +135 +140 +143 +146 +149 +153 +156 +160 +162 +166 +168 +172 +174 +177 +180 +182 +186 +188 +190 +191 +194 +195 +196 +198 +199 +200 +200 +201 +200 +200 +199 +198 +197 +195 +194 +191 +189 +187 +185 +183 +180 +177 +174 +171 +168 +166 +162 +160 +156 +153 +149 +147 +143 +139 +135 +132 +129 +125 +122 +119 +114 +111 +108 +103 +100 +96 +93 +89 +85 +81 +78 +74 +70 +67 +63 +59 +55 +52 +48 +44 +40 +37 +33 +28 +25 +22 +18 +14 +10 +6 +2 +0 +1 +5 +9 +13 +17 +21 +24 +28 +32 +35 +39 +42 +47 +51 +54 +58 +61 +65 +69 +72 +77 +80 +84 +88 +91 +95 +99 +102 +106 +109 +113 +117 +120 +123 +127 +130 +134 +138 +141 +144 +148 +150 +154 +157 +160 +163 +166 +169 +172 +174 +177 +179 +182 +185 +186 +188 +190 +192 +193 +195 +195 +196 +196 +197 +196 +196 +195 +194 +193 +191 +190 +188 +186 +184 +182 +180 +177 +174 +171 +169 +166 +163 +160 +157 +154 +150 +148 +144 +141 +137 +134 +130 +127 +124 +120 +116 +113 +109 +106 +102 +98 +94 +91 +87 +84 +81 +76 +73 +69 +65 +61 +58 +54 +50 +47 +43 +39 +35 +31 +28 +24 +20 +17 +13 +9 +5 +1 +0 +0 +4 +8 +11 +16 +19 +23 +26 +30 +34 +39 +42 +45 +49 +53 +57 +60 +64 +68 +72 +75 +79 +83 +86 +89 +93 +97 +101 +104 +107 +111 +115 +118 +122 +125 +129 +132 +136 +139 +142 +145 +148 +151 +155 +157 +161 +164 +166 +169 +171 +174 +176 +179 +181 +183 +185 +186 +188 +189 +191 +191 +192 +192 +193 +192 +192 +191 +190 +190 +188 +187 +184 +183 +181 +179 +177 +174 +172 +169 +166 +163 +161 +158 +155 +152 +148 +145 +142 +139 +135 +132 +129 +125 +122 +118 +115 +111 +108 +104 +100 +97 +93 +89 +86 +83 +79 +75 +71 +68 +64 +61 +57 +53 +49 +46 +42 +38 +35 +31 +27 +23 +19 +15 +11 +8 +4 +0 +0 +0 +3 +7 +10 +14 +18 +22 +25 +29 +33 +37 +40 +44 +48 +52 +55 +60 +63 +66 +71 +74 +77 +81 +85 +88 +92 +95 +99 +102 +106 +110 +113 +117 +120 +123 +127 +130 +134 +137 +140 +143 +146 +149 +152 +155 +158 +161 +163 +166 +169 +171 +173 +176 +178 +179 +182 +183 +184 +186 +187 +187 +188 +188 +188 +188 +188 +187 +186 +186 +184 +183 +181 +179 +178 +175 +173 +171 +169 +166 +164 +161 +158 +155 +153 +150 +146 +143 +139 +136 +134 +130 +126 +124 +120 +116 +113 +109 +106 +102 +99 +96 +91 +89 +85 +81 +78 +74 +70 +66 +63 +59 +56 +52 +48 +44 +41 +37 +33 +30 +26 +22 +18 +15 +11 +7 +3 +0 +0 +0 +2 +6 +10 +13 +17 +21 +24 +29 +32 +36 +39 +43 +47 +50 +54 +58 +61 +65 +69 +73 +76 +80 +83 +86 +90 +94 +97 +101 +105 +107 +111 +114 +118 +121 +124 +128 +131 +134 +138 +140 +144 +147 +150 +153 +155 +158 +160 +163 +166 +168 +170 +172 +174 +176 +177 +179 +180 +181 +183 +184 +184 +184 +184 +184 +184 +184 +183 +181 +181 +179 +177 +176 +174 +172 +170 +168 +166 +163 +160 +158 +155 +153 +149 +146 +143 +141 +138 +135 +131 +128 +124 +121 +118 +115 +111 +108 +105 +100 +97 +94 +90 +86 +84 +80 +75 +73 +69 +65 +61 +57 +54 +51 +47 +43 +40 +35 +32 +28 +24 +20 +17 +13 +10 +6 +2 +0 +0 +0 +1 +5 +8 +12 +16 +19 +23 +27 +31 +35 +38 +41 +46 +49 +53 +56 +60 +64 +67 +71 +75 +78 +81 +85 +89 +92 +96 +99 +102 +105 +109 +112 +116 +119 +122 +126 +128 +132 +135 +138 +141 +144 +147 +150 +153 +155 +157 +160 +162 +164 +167 +169 +171 +173 +175 +176 +177 +178 +179 +179 +180 +180 +180 +181 +180 +179 +179 +178 +177 +175 +174 +172 +171 +169 +167 +164 +162 +160 +158 +155 +152 +149 +146 +144 +141 +138 +135 +132 +129 +125 +123 +119 +116 +112 +109 +106 +102 +99 +95 +92 +88 +85 +82 +78 +74 +71 +67 +63 +60 +56 +53 +49 +46 +42 +38 +35 +31 +27 +23 +20 +16 +12 +8 +5 +1 +0 +0 +0 +0 +3 +7 +11 +15 +18 +22 +26 +29 +33 +37 +41 +44 +47 +51 +55 +59 +62 +66 +70 +72 +76 +80 +83 +87 +90 +93 +97 +101 +103 +107 +111 +113 +117 +121 +124 +126 +130 +133 +136 +138 +141 +144 +147 +149 +152 +155 +157 +159 +162 +163 +165 +167 +169 +171 +172 +173 +174 +175 +176 +176 +176 +177 +177 +176 +176 +175 +174 +173 +172 +170 +169 +167 +165 +163 +162 +159 +157 +155 +152 +149 +147 +144 +141 +138 +136 +133 +129 +127 +123 +120 +117 +114 +110 +107 +104 +101 +97 +94 +91 +87 +83 +80 +76 +72 +69 +65 +62 +59 +55 +51 +48 +44 +40 +37 +33 +29 +26 +22 +18 +15 +11 +8 +3 +0 +0 +0 +0 +0 +3 +5 +10 +14 +17 +20 +24 +28 +32 +35 +39 +42 +46 +50 +54 +57 +60 +64 +67 +71 +74 +78 +82 +84 +88 +91 +95 +99 +102 +105 +108 +112 +114 +117 +121 +124 +128 +130 +133 +136 +139 +141 +144 +147 +149 +151 +154 +156 +158 +160 +163 +164 +165 +167 +169 +169 +170 +171 +172 +173 +173 +173 +173 +172 +172 +171 +170 +170 +169 +167 +166 +164 +162 +160 +158 +156 +154 +151 +149 +146 +144 +142 +139 +136 +133 +130 +127 +124 +121 +118 +114 +111 +108 +105 +102 +99 +95 +92 +89 +84 +81 +78 +75 +71 +68 +64 +61 +57 +53 +50 +46 +42 +39 +35 +32 +28 +24 +20 +17 +14 +9 +6 +2 +0 +0 +0 +0 +0 +1 +4 +8 +12 +16 +19 +23 +26 +30 +34 +37 +41 +45 +48 +52 +56 +58 +62 +66 +69 +73 +76 +80 +83 +87 +90 +93 +97 +100 +103 +106 +110 +112 +116 +118 +121 +124 +127 +131 +133 +136 +138 +141 +144 +146 +148 +151 +153 +155 +157 +159 +161 +161 +163 +165 +165 +167 +167 +168 +169 +169 +168 +168 +168 +168 +167 +166 +166 +165 +163 +162 +160 +159 +157 +155 +153 +151 +148 +146 +144 +141 +139 +136 +133 +131 +127 +125 +122 +118 +115 +113 +109 +106 +103 +100 +96 +93 +90 +86 +83 +80 +76 +72 +69 +66 +63 +59 +55 +52 +48 +45 +41 +38 +33 +30 +27 +23 +20 +16 +12 +9 +4 +0 +0 +0 +0 +0 +0 +0 +3 +6 +11 +14 +17 +21 +25 +29 +32 +36 +39 +43 +47 +50 +53 +57 +61 +63 +67 +71 +74 +77 +81 +84 +88 +91 +94 +97 +101 +103 +107 +110 +113 +116 +119 +122 +125 +128 +130 +133 +135 +138 +141 +143 +145 +148 +149 +152 +154 +155 +157 +158 +159 +161 +162 +162 +163 +164 +165 +165 +165 +165 +164 +164 +164 +163 +162 +160 +159 +158 +157 +156 +153 +152 +149 +147 +146 +143 +140 +138 +136 +133 +130 +127 +125 +122 +119 +116 +113 +109 +107 +103 +100 +97 +94 +90 +88 +84 +81 +77 +74 +71 +67 +64 +60 +57 +53 +50 +47 +43 +39 +36 +32 +28 +25 +22 +18 +15 +11 +7 +3 +0 +0 +0 +0 +0 +0 +0 +2 +6 +10 +13 +16 +20 +24 +27 +30 +34 +37 +42 +44 +48 +52 +55 +59 +62 +65 +68 +73 +76 +79 +82 +86 +89 +92 +95 +99 +101 +104 +108 +111 +114 +116 +119 +122 +125 +128 +130 +132 +135 +137 +139 +142 +144 +146 +148 +150 +151 +153 +155 +156 +157 +158 +159 +160 +160 +161 +161 +161 +161 +161 +161 +160 +159 +158 +157 +156 +154 +153 +152 +149 +148 +146 +144 +142 +140 +137 +135 +133 +130 +127 +125 +122 +120 +116 +114 +110 +107 +105 +102 +98 +95 +92 +89 +86 +82 +79 +76 +72 +68 +66 +62 +58 +55 +51 +48 +45 +42 +38 +34 +31 +27 +24 +20 +17 +13 +9 +6 +2 +0 +0 +0 +0 +0 +0 +0 +0 +4 +8 +11 +15 +19 +21 +26 +28 +32 +36 +40 +43 +47 +50 +54 +56 +60 +64 +67 +70 +74 +77 +80 +83 +87 +90 +93 +95 +99 +102 +105 +108 +111 +114 +117 +119 +122 +125 +127 +130 +132 +134 +136 +139 +141 +143 +145 +146 +148 +150 +151 +153 +153 +154 +156 +155 +156 +157 +157 +157 +157 +157 +156 +156 +155 +154 +153 +152 +151 +149 +148 +146 +145 +143 +140 +139 +137 +134 +131 +129 +127 +125 +122 +120 +116 +114 +111 +108 +105 +102 +99 +96 +93 +90 +87 +84 +80 +77 +74 +70 +67 +63 +60 +57 +53 +50 +46 +43 +40 +36 +33 +29 +25 +21 +18 +14 +11 +8 +4 +1 +0 +0 +0 +0 +0 +0 +0 +0 +3 +6 +10 +13 +16 +20 +24 +27 +31 +34 +37 +41 +45 +48 +52 +54 +58 +61 +65 +68 +71 +74 +77 +81 +84 +87 +90 +94 +96 +100 +102 +105 +108 +111 +113 +116 +119 +122 +124 +127 +129 +131 +133 +135 +137 +139 +141 +143 +144 +146 +147 +148 +149 +150 +151 +152 +152 +153 +153 +153 +153 +153 +152 +152 +151 +150 +149 +148 +147 +146 +144 +143 +141 +140 +138 +136 +133 +131 +129 +127 +124 +121 +119 +117 +114 +111 +108 +105 +103 +99 +96 +94 +91 +88 +84 +81 +78 +74 +71 +68 +64 +61 +58 +55 +51 +48 +45 +41 +38 +34 +30 +27 +24 +20 +17 +13 +10 +6 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +4 +8 +11 +15 +19 +21 +25 +29 +32 +36 +39 +43 +46 +50 +53 +56 +59 +63 +66 +69 +72 +75 +78 +82 +85 +88 +91 +94 +97 +100 +103 +105 +108 +111 +113 +116 +118 +121 +124 +126 +128 +130 +132 +134 +135 +138 +139 +141 +142 +144 +145 +146 +147 +147 +148 +149 +149 +149 +149 +149 +149 +149 +148 +147 +147 +146 +144 +143 +143 +140 +139 +138 +136 +134 +132 +130 +128 +126 +124 +121 +119 +116 +113 +111 +108 +106 +102 +100 +97 +94 +91 +88 +85 +82 +78 +76 +72 +69 +66 +62 +59 +56 +52 +49 +46 +43 +39 +36 +32 +29 +25 +22 +18 +15 +11 +8 +4 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +6 +10 +13 +17 +20 +24 +27 +31 +34 +37 +41 +44 +47 +51 +54 +58 +60 +63 +66 +70 +73 +76 +79 +82 +85 +88 +92 +94 +97 +100 +103 +105 +108 +110 +113 +116 +118 +121 +122 +125 +126 +129 +130 +132 +134 +136 +137 +138 +140 +141 +142 +143 +144 +144 +145 +145 +145 +145 +145 +145 +145 +144 +144 +143 +142 +141 +140 +138 +137 +135 +134 +132 +130 +128 +127 +124 +122 +121 +118 +116 +113 +111 +108 +105 +102 +100 +97 +94 +91 +88 +85 +82 +79 +76 +73 +70 +67 +63 +60 +57 +54 +50 +48 +44 +40 +37 +34 +30 +27 +24 +20 +16 +14 +10 +6 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +4 +8 +11 +15 +18 +22 +25 +28 +32 +35 +39 +41 +45 +48 +51 +55 +58 +61 +65 +68 +70 +74 +77 +80 +83 +86 +88 +92 +95 +97 +99 +102 +105 +107 +110 +112 +115 +117 +119 +121 +123 +125 +128 +128 +131 +132 +134 +135 +136 +137 +138 +139 +139 +140 +140 +141 +141 +141 +141 +141 +141 +141 +140 +139 +138 +137 +136 +135 +133 +132 +131 +129 +127 +125 +123 +121 +119 +116 +115 +112 +110 +108 +104 +103 +100 +97 +94 +91 +89 +86 +83 +79 +76 +74 +71 +68 +64 +61 +58 +55 +52 +48 +45 +42 +39 +35 +32 +29 +25 +22 +19 +15 +12 +7 +4 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +6 +10 +13 +17 +20 +23 +26 +30 +33 +37 +39 +43 +46 +50 +53 +56 +59 +62 +65 +69 +71 +75 +77 +80 +83 +86 +89 +92 +94 +97 +100 +102 +104 +107 +109 +112 +114 +116 +118 +120 +122 +123 +125 +127 +128 +130 +131 +132 +133 +135 +135 +136 +137 +136 +137 +137 +138 +138 +137 +137 +136 +136 +135 +134 +133 +133 +131 +130 +128 +126 +125 +124 +122 +120 +118 +115 +114 +112 +109 +107 +105 +102 +100 +97 +94 +91 +89 +86 +83 +81 +78 +74 +72 +68 +66 +62 +59 +56 +53 +49 +47 +43 +40 +36 +33 +30 +27 +23 +20 +16 +13 +10 +6 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +4 +8 +11 +14 +18 +21 +24 +27 +31 +35 +37 +41 +44 +47 +50 +53 +57 +59 +63 +66 +69 +72 +74 +78 +80 +83 +86 +88 +91 +94 +97 +99 +101 +104 +106 +108 +110 +112 +115 +116 +118 +120 +121 +123 +124 +126 +127 +128 +130 +130 +132 +132 +132 +133 +134 +134 +134 +134 +133 +133 +132 +132 +131 +130 +130 +129 +127 +126 +125 +123 +122 +120 +118 +116 +115 +113 +111 +109 +106 +103 +101 +99 +97 +94 +91 +89 +86 +83 +80 +77 +75 +72 +69 +66 +63 +60 +56 +54 +50 +47 +44 +41 +38 +34 +31 +28 +24 +22 +18 +14 +11 +7 +4 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +5 +9 +12 +16 +19 +22 +25 +29 +32 +36 +39 +42 +45 +48 +51 +54 +58 +60 +63 +66 +69 +72 +74 +78 +81 +83 +85 +89 +91 +93 +96 +98 +100 +103 +105 +107 +109 +112 +113 +115 +116 +118 +120 +121 +122 +123 +125 +126 +127 +127 +128 +129 +129 +130 +129 +130 +130 +129 +129 +128 +128 +127 +126 +126 +125 +123 +122 +121 +119 +118 +116 +115 +113 +111 +109 +108 +105 +103 +101 +98 +96 +94 +90 +88 +86 +83 +81 +77 +75 +72 +69 +66 +64 +60 +57 +54 +51 +48 +45 +42 +38 +36 +32 +29 +25 +22 +19 +16 +12 +9 +5 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +4 +7 +10 +14 +17 +20 +24 +27 +30 +33 +36 +39 +42 +45 +49 +51 +54 +58 +61 +64 +67 +69 +72 +75 +77 +80 +82 +85 +88 +90 +93 +95 +98 +100 +102 +103 +105 +108 +109 +111 +113 +115 +116 +118 +119 +120 +121 +122 +123 +124 +125 +124 +125 +125 +125 +126 +126 +125 +125 +125 +124 +124 +123 +122 +121 +119 +119 +118 +116 +114 +113 +111 +110 +107 +106 +104 +101 +100 +97 +95 +92 +90 +88 +85 +83 +80 +78 +75 +72 +69 +67 +64 +60 +58 +55 +52 +49 +45 +43 +39 +36 +33 +30 +26 +24 +20 +17 +13 +10 +7 +4 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +5 +8 +12 +15 +18 +21 +24 +27 +31 +34 +37 +40 +43 +47 +49 +52 +55 +58 +61 +64 +66 +69 +72 +75 +77 +80 +82 +84 +87 +90 +92 +94 +96 +99 +100 +103 +104 +106 +107 +109 +111 +113 +113 +115 +116 +117 +118 +119 +119 +120 +120 +121 +122 +122 +122 +122 +122 +122 +121 +121 +120 +119 +118 +117 +116 +115 +114 +113 +111 +110 +108 +106 +104 +103 +101 +98 +96 +94 +92 +90 +88 +85 +82 +80 +77 +74 +72 +69 +66 +64 +61 +58 +55 +52 +49 +46 +43 +40 +37 +34 +31 +28 +25 +22 +18 +15 +12 +9 +5 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +6 +9 +13 +16 +19 +22 +26 +28 +31 +34 +38 +40 +43 +47 +49 +53 +55 +58 +61 +64 +67 +69 +72 +74 +77 +79 +82 +84 +86 +88 +91 +93 +95 +97 +98 +101 +103 +104 +106 +107 +108 +110 +111 +112 +113 +114 +115 +116 +116 +117 +117 +118 +117 +118 +118 +118 +118 +117 +117 +116 +115 +115 +113 +112 +112 +110 +109 +108 +106 +104 +102 +101 +99 +97 +95 +93 +91 +89 +86 +85 +82 +80 +77 +74 +72 +69 +67 +63 +61 +58 +56 +53 +50 +47 +44 +41 +38 +34 +32 +28 +25 +22 +19 +16 +13 +10 +6 +3 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +4 +7 +10 +13 +17 +20 +23 +26 +29 +32 +36 +38 +41 +44 +47 +49 +53 +56 +58 +61 +63 +66 +69 +71 +74 +76 +78 +81 +84 +86 +88 +89 +91 +93 +96 +97 +99 +100 +102 +104 +105 +106 +108 +108 +110 +111 +111 +112 +112 +113 +113 +114 +114 +114 +114 +114 +113 +113 +112 +112 +111 +110 +110 +108 +108 +107 +105 +103 +102 +101 +99 +97 +96 +93 +92 +90 +88 +85 +83 +81 +79 +76 +74 +71 +69 +66 +64 +61 +59 +55 +53 +50 +47 +44 +41 +39 +35 +32 +30 +27 +23 +20 +16 +13 +10 +8 +4 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +5 +8 +12 +15 +18 +20 +24 +27 +30 +33 +36 +39 +41 +44 +47 +50 +53 +55 +58 +60 +63 +66 +69 +70 +73 +76 +78 +80 +82 +84 +86 +88 +90 +92 +93 +95 +97 +98 +99 +101 +102 +104 +105 +106 +106 +107 +108 +109 +109 +110 +109 +110 +110 +110 +110 +109 +109 +109 +108 +108 +107 +106 +104 +104 +103 +102 +100 +99 +97 +96 +93 +92 +90 +88 +86 +85 +83 +80 +78 +75 +73 +71 +68 +65 +64 +61 +59 +55 +53 +50 +47 +44 +41 +39 +36 +33 +29 +27 +24 +21 +17 +14 +12 +8 +4 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +6 +8 +12 +15 +18 +22 +25 +27 +30 +33 +36 +39 +42 +45 +47 +50 +53 +55 +58 +60 +63 +65 +68 +70 +72 +75 +77 +78 +81 +83 +85 +87 +89 +90 +92 +93 +95 +96 +97 +99 +100 +101 +102 +102 +103 +104 +105 +105 +105 +106 +106 +106 +106 +106 +105 +105 +104 +104 +104 +103 +102 +101 +100 +99 +98 +96 +95 +94 +92 +91 +88 +87 +85 +83 +81 +79 +76 +74 +73 +70 +67 +66 +63 +60 +58 +55 +53 +49 +47 +44 +42 +39 +36 +33 +30 +27 +24 +21 +18 +15 +12 +9 +6 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +3 +6 +10 +12 +16 +18 +22 +25 +27 +31 +33 +36 +39 +41 +44 +47 +49 +52 +55 +57 +60 +62 +64 +67 +69 +71 +73 +76 +77 +79 +81 +83 +85 +87 +88 +90 +92 +93 +94 +95 +96 +98 +99 +99 +100 +100 +101 +101 +102 +102 +102 +102 +102 +102 +102 +102 +100 +100 +100 +99 +98 +97 +96 +95 +94 +92 +92 +90 +88 +87 +85 +84 +82 +79 +78 +76 +73 +71 +69 +67 +64 +62 +59 +58 +55 +52 +50 +47 +45 +42 +39 +36 +33 +31 +27 +24 +22 +18 +16 +13 +9 +7 +3 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +4 +8 +10 +13 +16 +19 +22 +25 +27 +30 +34 +36 +39 +41 +44 +47 +49 +52 +55 +57 +59 +61 +64 +66 +68 +70 +73 +74 +76 +78 +79 +81 +83 +84 +87 +88 +89 +90 +92 +93 +93 +94 +95 +96 +96 +97 +98 +98 +98 +99 +98 +99 +98 +98 +97 +97 +97 +95 +95 +94 +94 +92 +92 +90 +89 +87 +86 +85 +83 +81 +80 +78 +76 +74 +72 +71 +68 +66 +64 +61 +59 +57 +54 +52 +49 +47 +45 +41 +39 +36 +33 +30 +27 +24 +22 +19 +16 +13 +11 +7 +4 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +4 +7 +11 +14 +16 +19 +23 +25 +28 +31 +34 +35 +38 +41 +44 +46 +48 +51 +53 +56 +58 +60 +62 +64 +67 +69 +70 +73 +75 +76 +78 +79 +81 +82 +84 +86 +87 +87 +89 +90 +91 +91 +92 +93 +93 +93 +94 +95 +94 +94 +94 +94 +94 +94 +93 +92 +92 +91 +90 +89 +88 +87 +87 +86 +84 +83 +81 +79 +78 +76 +74 +73 +71 +68 +67 +65 +63 +61 +58 +56 +54 +51 +49 +46 +43 +41 +38 +36 +33 +30 +27 +25 +22 +19 +17 +14 +11 +8 +5 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +5 +8 +11 +13 +17 +20 +22 +25 +27 +30 +33 +36 +38 +40 +43 +45 +48 +50 +53 +55 +57 +59 +61 +63 +66 +67 +69 +71 +73 +74 +76 +77 +79 +81 +82 +83 +84 +84 +86 +86 +88 +88 +88 +89 +90 +90 +90 +91 +90 +91 +91 +90 +90 +89 +89 +88 +87 +87 +86 +85 +84 +83 +82 +80 +79 +78 +76 +75 +73 +71 +69 +68 +66 +63 +61 +59 +57 +55 +52 +50 +48 +46 +43 +40 +38 +35 +33 +30 +27 +25 +22 +20 +16 +13 +11 +8 +5 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +5 +9 +11 +13 +16 +20 +22 +25 +28 +30 +33 +36 +38 +40 +42 +44 +48 +50 +51 +54 +56 +58 +60 +62 +64 +66 +68 +69 +70 +72 +74 +75 +77 +78 +79 +80 +81 +82 +83 +84 +85 +85 +86 +86 +86 +86 +86 +86 +86 +86 +86 +86 +86 +84 +85 +83 +83 +82 +81 +80 +79 +78 +77 +76 +73 +72 +71 +69 +68 +65 +64 +62 +60 +58 +56 +54 +51 +49 +47 +45 +42 +40 +37 +35 +33 +30 +27 +25 +22 +20 +17 +14 +11 +8 +5 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +6 +9 +11 +14 +16 +19 +22 +25 +27 +30 +32 +34 +37 +39 +42 +44 +46 +49 +50 +52 +55 +57 +59 +60 +62 +64 +65 +68 +68 +70 +72 +72 +74 +75 +76 +77 +78 +79 +79 +80 +81 +81 +82 +82 +82 +83 +83 +83 +82 +83 +82 +81 +81 +80 +80 +79 +78 +77 +76 +76 +74 +72 +71 +70 +68 +67 +66 +64 +62 +61 +58 +56 +55 +53 +50 +48 +46 +45 +42 +39 +37 +35 +32 +29 +27 +25 +22 +20 +16 +14 +11 +9 +6 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +6 +8 +11 +13 +17 +20 +21 +25 +27 +29 +32 +34 +36 +39 +41 +43 +45 +48 +49 +51 +53 +55 +57 +58 +60 +62 +63 +65 +67 +68 +70 +70 +71 +72 +73 +75 +76 +75 +77 +77 +77 +78 +78 +79 +78 +78 +78 +78 +78 +78 +78 +77 +77 +76 +75 +75 +74 +73 +72 +70 +69 +67 +67 +65 +64 +62 +61 +59 +57 +56 +53 +51 +49 +47 +46 +43 +41 +39 +36 +34 +31 +29 +27 +24 +22 +19 +17 +14 +11 +8 +5 +3 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +5 +8 +11 +13 +16 +18 +21 +24 +26 +29 +30 +33 +36 +37 +40 +42 +44 +46 +48 +50 +51 +53 +55 +56 +58 +60 +61 +62 +64 +66 +66 +67 +69 +70 +70 +71 +72 +73 +74 +73 +74 +75 +75 +74 +75 +74 +75 +74 +74 +74 +73 +73 +72 +72 +70 +70 +68 +67 +67 +65 +64 +62 +61 +60 +58 +57 +55 +54 +52 +50 +48 +46 +44 +42 +40 +37 +35 +33 +31 +29 +27 +24 +22 +19 +16 +14 +11 +8 +6 +3 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +6 +8 +11 +13 +16 +18 +21 +23 +25 +28 +30 +32 +34 +36 +39 +40 +43 +44 +46 +48 +50 +52 +53 +55 +56 +58 +59 +60 +62 +63 +64 +65 +66 +67 +67 +68 +68 +70 +70 +70 +70 +71 +70 +71 +70 +71 +70 +70 +70 +69 +68 +69 +67 +66 +66 +64 +64 +62 +62 +60 +59 +58 +57 +55 +53 +52 +50 +48 +46 +45 +43 +40 +38 +36 +35 +32 +29 +28 +25 +23 +20 +18 +16 +13 +11 +8 +5 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +5 +8 +10 +13 +15 +18 +20 +22 +25 +27 +29 +31 +33 +35 +37 +39 +41 +42 +45 +47 +48 +49 +51 +53 +54 +55 +56 +58 +59 +60 +61 +62 +63 +63 +64 +65 +65 +66 +67 +66 +67 +67 +67 +67 +67 +67 +66 +66 +66 +64 +65 +64 +63 +62 +61 +60 +59 +58 +57 +56 +54 +53 +51 +50 +48 +46 +45 +43 +41 +40 +37 +35 +33 +31 +29 +26 +24 +22 +20 +18 +15 +13 +10 +7 +5 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +5 +7 +9 +12 +14 +17 +19 +22 +24 +26 +28 +30 +31 +34 +35 +37 +39 +41 +43 +45 +46 +48 +49 +50 +52 +53 +54 +56 +56 +57 +59 +59 +60 +61 +61 +61 +62 +63 +62 +63 +63 +63 +63 +62 +63 +62 +62 +61 +61 +61 +59 +59 +58 +57 +56 +55 +54 +53 +52 +50 +49 +47 +46 +44 +43 +41 +40 +37 +36 +34 +32 +30 +28 +25 +24 +21 +19 +17 +14 +12 +10 +7 +4 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +4 +6 +9 +12 +14 +16 +18 +21 +22 +24 +27 +28 +30 +32 +35 +36 +37 +40 +41 +43 +44 +45 +47 +48 +49 +50 +52 +52 +54 +55 +55 +56 +56 +58 +57 +58 +59 +58 +58 +59 +59 +59 +59 +59 +59 +58 +58 +57 +57 +56 +55 +55 +53 +53 +52 +51 +49 +48 +47 +45 +44 +42 +41 +39 +37 +36 +34 +32 +31 +29 +27 +25 +22 +20 +18 +16 +14 +11 +8 +6 +4 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +3 +6 +9 +11 +12 +15 +17 +19 +21 +23 +25 +27 +28 +31 +33 +34 +36 +37 +39 +40 +42 +43 +44 +46 +46 +48 +49 +50 +51 +52 +52 +53 +54 +54 +54 +54 +55 +55 +55 +55 +56 +55 +54 +54 +54 +54 +53 +52 +52 +52 +50 +49 +49 +48 +47 +46 +44 +43 +42 +40 +39 +37 +36 +34 +33 +30 +29 +27 +25 +23 +21 +19 +16 +15 +12 +11 +8 +6 +4 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +5 +7 +9 +12 +14 +16 +18 +20 +22 +24 +26 +27 +29 +31 +33 +33 +35 +37 +38 +40 +40 +41 +42 +44 +45 +46 +46 +48 +48 +49 +50 +49 +51 +50 +51 +51 +52 +51 +51 +51 +51 +50 +50 +50 +49 +48 +49 +47 +47 +46 +45 +44 +43 +42 +41 +39 +38 +37 +35 +34 +32 +30 +28 +27 +25 +23 +21 +19 +17 +15 +14 +12 +10 +7 +5 +3 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +4 +6 +8 +10 +13 +15 +17 +18 +21 +22 +23 +25 +27 +29 +30 +32 +33 +35 +35 +37 +38 +39 +40 +41 +42 +43 +44 +44 +45 +46 +46 +46 +47 +47 +47 +48 +47 +47 +47 +47 +47 +47 +46 +46 +45 +44 +43 +43 +42 +41 +40 +39 +38 +37 +35 +34 +33 +32 +30 +29 +27 +26 +24 +22 +20 +19 +17 +15 +13 +11 +8 +6 +4 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +3 +5 +7 +9 +11 +13 +15 +17 +18 +20 +22 +23 +25 +27 +28 +29 +30 +32 +33 +34 +36 +36 +37 +38 +39 +40 +40 +41 +42 +42 +42 +43 +43 +44 +43 +43 +44 +43 +43 +43 +42 +42 +41 +41 +41 +40 +39 +38 +37 +37 +35 +34 +33 +32 +31 +29 +28 +26 +25 +23 +22 +20 +19 +16 +15 +12 +11 +9 +7 +5 +3 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +4 +5 +7 +9 +12 +13 +15 +16 +19 +20 +21 +23 +24 +25 +27 +29 +29 +31 +32 +33 +33 +34 +35 +35 +37 +37 +38 +39 +38 +38 +39 +39 +39 +40 +40 +39 +39 +39 +38 +38 +38 +37 +37 +36 +35 +34 +34 +33 +31 +31 +30 +28 +26 +26 +25 +23 +21 +20 +18 +17 +14 +13 +11 +10 +7 +6 +4 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +2 +4 +6 +8 +9 +11 +13 +15 +17 +17 +19 +20 +22 +23 +24 +26 +27 +28 +29 +30 +31 +32 +32 +33 +34 +34 +34 +35 +35 +35 +35 +36 +35 +36 +35 +35 +35 +35 +34 +34 +33 +32 +32 +31 +31 +29 +29 +28 +27 +26 +25 +24 +22 +21 +19 +18 +16 +15 +13 +12 +10 +7 +6 +4 +3 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +3 +5 +6 +8 +9 +11 +13 +14 +16 +17 +18 +20 +20 +21 +23 +24 +25 +26 +26 +28 +28 +29 +29 +30 +31 +31 +31 +32 +31 +31 +31 +31 +32 +31 +31 +30 +30 +30 +29 +28 +29 +28 +27 +26 +25 +24 +23 +21 +21 +20 +18 +17 +15 +14 +13 +11 +10 +8 +6 +4 +2 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +4 +6 +7 +9 +10 +12 +13 +15 +15 +17 +18 +19 +20 +21 +22 +23 +24 +24 +25 +26 +26 +26 +27 +27 +27 +28 +28 +28 +28 +28 +27 +27 +27 +27 +26 +26 +25 +25 +24 +23 +22 +21 +20 +20 +18 +17 +15 +15 +13 +12 +11 +9 +8 +6 +5 +2 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +4 +5 +7 +8 +10 +10 +12 +14 +15 +16 +16 +18 +19 +19 +19 +20 +21 +22 +22 +23 +23 +23 +24 +23 +24 +24 +24 +24 +23 +24 +23 +23 +22 +22 +21 +20 +20 +19 +19 +18 +16 +15 +14 +13 +12 +11 +10 +9 +7 +6 +4 +3 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +3 +4 +6 +7 +9 +10 +11 +11 +12 +13 +14 +15 +16 +17 +17 +18 +18 +18 +19 +20 +20 +20 +20 +20 +19 +19 +19 +19 +19 +19 +18 +18 +17 +17 +16 +15 +14 +14 +13 +11 +11 +9 +8 +8 +6 +4 +4 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +3 +4 +4 +6 +6 +8 +9 +9 +11 +11 +12 +13 +14 +14 +14 +15 +15 +15 +16 +16 +16 +16 +16 +16 +15 +15 +15 +15 +14 +14 +13 +13 +12 +11 +11 +9 +9 +8 +7 +5 +4 +4 +2 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +9 +9 +10 +10 +11 +11 +11 +12 +11 +12 +12 +12 +12 +12 +11 +11 +11 +11 +10 +9 +9 +8 +7 +7 +6 +6 +4 +3 +2 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +2 +3 +4 +5 +5 +6 +6 +7 +7 +7 +7 +8 +8 +8 +8 +8 +8 +8 +7 +8 +7 +6 +6 +6 +5 +5 +4 +3 +2 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 diff --git a/extra/gpu/effects/blur/authors.txt b/extra/gpu/effects/blur/authors.txt new file mode 100644 index 0000000000..6f03a12101 --- /dev/null +++ b/extra/gpu/effects/blur/authors.txt @@ -0,0 +1 @@ +Erik Charlebois diff --git a/extra/gpu/effects/blur/blur.factor b/extra/gpu/effects/blur/blur.factor new file mode 100644 index 0000000000..0a25654976 --- /dev/null +++ b/extra/gpu/effects/blur/blur.factor @@ -0,0 +1,81 @@ +! Copyright (C) 2010 Erik Charlebois. +! See http://factorcode.org/license.txt for BSD license. +USING: destructors fry gpu.render gpu.shaders gpu.state gpu.textures +gpu.util images kernel locals math math.rectangles sequences ; +IN: gpu.effects.blur + +GLSL-SHADER: blur-fragment-shader fragment-shader +uniform sampler2D texture; +uniform bool horizontal; +uniform float blurSize; +varying vec2 texcoord; +void main() +{ + vec4 col = 0.16 * texture2D(texture, texcoord); + if (horizontal) + { + const vec2 blurX1 = vec2(blurSize, 0.0); + const vec2 blurX2 = vec2(blurSize * 2.0, 0.0); + const vec2 blurX3 = vec2(blurSize * 3.0, 0.0); + const vec2 blurX4 = vec2(blurSize * 4.0, 0.0); + col += 0.15 * ( texture2D(texture, texcoord - blurX1) + + texture2D(texture, texcoord + blurX1)); + col += 0.12 * ( texture2D(texture, texcoord - blurX2) + + texture2D(texture, texcoord + blurX2)); + col += 0.09 * ( texture2D(texture, texcoord - blurX3) + + texture2D(texture, texcoord + blurX3)); + col += 0.05 * ( texture2D(texture, texcoord - blurX4) + + texture2D(texture, texcoord + blurX4)); + } + else + { + const vec2 blurY1 = vec2(0.0, blurSize); + const vec2 blurY2 = vec2(0.0, blurSize * 2.0); + const vec2 blurY3 = vec2(0.0, blurSize * 3.0); + const vec2 blurY4 = vec2(0.0, blurSize * 4.0); + col += 0.15 * ( texture2D(texture, texcoord - blurY1) + + texture2D(texture, texcoord + blurY1)); + col += 0.12 * ( texture2D(texture, texcoord - blurY2) + + texture2D(texture, texcoord + blurY2)); + col += 0.09 * ( texture2D(texture, texcoord - blurY3) + + texture2D(texture, texcoord + blurY3)); + col += 0.05 * ( texture2D(texture, texcoord - blurY4) + + texture2D(texture, texcoord + blurY4)); + } + gl_FragColor = col ; +} +; + +UNIFORM-TUPLE: blur-uniforms + { "texture" texture-uniform f } + { "horizontal" bool-uniform f } + { "blurSize" float-uniform f } ; + +GLSL-PROGRAM: blur-program window-vertex-shader blur-fragment-shader window-vertex-format ; + +:: (blur) ( texture horizontal? framebuffer dim -- ) + { 0 0 } dim set-gpu-state + texture horizontal? 1.0 dim horizontal? [ first ] [ second ] if / blur-uniforms boa framebuffer { + { "primitive-mode" [ 2drop triangle-strip-mode ] } + { "uniforms" [ drop ] } + { "vertex-array" [ 2drop blur-program &dispose ] } + { "indexes" [ 2drop T{ index-range f 0 4 } ] } + { "framebuffer" [ nip ] } + } 2 render ; + +:: blur ( texture horizontal? -- texture ) + texture 0 texture-dim :> dim + dim L ubyte-components <2d-render-texture> :> ( target-framebuffer target-texture ) + texture horizontal? target-framebuffer dim (blur) + target-framebuffer dispose + target-texture ; + +: horizontal-blur ( texture -- texture ) t blur ; inline + +: vertical-blur ( texture -- texture ) f blur ; inline + +: discompose ( quot1 quot2 -- compose ) + '[ @ &dispose @ ] with-destructors ; inline + +: gaussian-blur ( texture -- texture ) + [ horizontal-blur ] [ vertical-blur ] discompose ; diff --git a/extra/gpu/effects/blur/summary.txt b/extra/gpu/effects/blur/summary.txt new file mode 100644 index 0000000000..a9c5314a2e --- /dev/null +++ b/extra/gpu/effects/blur/summary.txt @@ -0,0 +1 @@ +Blur effects for textures. diff --git a/extra/gpu/effects/quad/authors.txt b/extra/gpu/effects/quad/authors.txt new file mode 100644 index 0000000000..6f03a12101 --- /dev/null +++ b/extra/gpu/effects/quad/authors.txt @@ -0,0 +1 @@ +Erik Charlebois diff --git a/extra/gpu/effects/quad/quad.factor b/extra/gpu/effects/quad/quad.factor new file mode 100644 index 0000000000..5a770ba838 --- /dev/null +++ b/extra/gpu/effects/quad/quad.factor @@ -0,0 +1,4 @@ +! Copyright (C) 2010 Erik Charlebois. +! See http://factorcode.org/license.txt for BSD license. +USING: ; +IN: gpu.effects.quad diff --git a/extra/gpu/effects/quad/summary.txt b/extra/gpu/effects/quad/summary.txt new file mode 100644 index 0000000000..8952404931 --- /dev/null +++ b/extra/gpu/effects/quad/summary.txt @@ -0,0 +1 @@ +Render a screen-aligned quad. diff --git a/extra/gpu/effects/step/authors.txt b/extra/gpu/effects/step/authors.txt new file mode 100644 index 0000000000..6f03a12101 --- /dev/null +++ b/extra/gpu/effects/step/authors.txt @@ -0,0 +1 @@ +Erik Charlebois diff --git a/extra/gpu/effects/step/step.factor b/extra/gpu/effects/step/step.factor new file mode 100644 index 0000000000..eff2a47e23 --- /dev/null +++ b/extra/gpu/effects/step/step.factor @@ -0,0 +1,23 @@ +! Copyright (C) 2010 Erik Charlebois. +! See http://factorcode.org/license.txt for BSD license. +USING: ; +IN: gpu.effects.step + +GLSL-SHADER: step-fragment-shader fragment-shader +const vec4 luminance = vec4(0.3, 0.59, 0.11, 0.0); +uniform sampler2D texture; +uniform sampler2D ramp; +varying vec2 texcoord; +void main() +{ + vec4 col = texture2D(texture, texcoord); + float l = dot(col, luminance); + gl_FragColor = texture2D(ramp, vec2(l, 0.0)); +} +; + +UNIFORM-TUPLE: step-uniforms + { "texture" texture-uniform f } + { "ramp" texture-uniform f } ; + +GLSL-PROGRAM: step-program window-vertex-shader step-fragment-shader window-vertex-format ; diff --git a/extra/gpu/effects/step/summary.txt b/extra/gpu/effects/step/summary.txt new file mode 100644 index 0000000000..61028dd28a --- /dev/null +++ b/extra/gpu/effects/step/summary.txt @@ -0,0 +1 @@ +Render a quad with a step texture. diff --git a/extra/gpu/util/util.factor b/extra/gpu/util/util.factor index d33fcf8c09..ffca3a5478 100644 --- a/extra/gpu/util/util.factor +++ b/extra/gpu/util/util.factor @@ -1,6 +1,6 @@ ! (c)2009 Joe Groff bsd license -USING: gpu.buffers gpu.render gpu.shaders gpu.textures images kernel -specialized-arrays ; +USING: arrays gpu.buffers gpu.framebuffers gpu.render gpu.shaders +gpu.textures images kernel locals specialized-arrays ; FROM: alien.c-types => float ; SPECIALIZED-ARRAY: float IN: gpu.util @@ -44,10 +44,58 @@ CONSTANT: environment-cube-map-mv-matrices { 0.0 0.0 0.0 1.0 } } } } + +GLSL-SHADER: window-vertex-shader vertex-shader +attribute vec2 vertex; +varying vec2 texcoord; +void main() +{ + texcoord = vertex * vec2(0.5) + vec2(0.5); + gl_Position = vec4(vertex, 0.0, 1.0); +} +; -VERTEX-FORMAT: window-vertex +GLSL-SHADER: window-fragment-shader fragment-shader +uniform sampler2D texture; +varying vec2 texcoord; +void main() +{ + gl_FragColor = texture2D(texture, texcoord); +} +; + +VERTEX-FORMAT: window-vertex-format { "vertex" float-components 2 f } ; +UNIFORM-TUPLE: window-uniforms + { "texture" texture-uniform f } ; + +GLSL-PROGRAM: window-program window-vertex-shader window-fragment-shader window-vertex-format ; + +GLSL-SHADER: window-point-vertex-shader vertex-shader +uniform float point_size; +attribute vec2 vertex; +void main() +{ + gl_Position = vec4(vertex, 0.0, 1.0); + gl_PointSize = point_size; +} +; + +GLSL-SHADER: window-point-fragment-shader fragment-shader +uniform sampler2D texture; +void main() +{ + gl_FragColor = texture2D(texture, gl_PointCoord); +} +; + +UNIFORM-TUPLE: window-point-uniforms + { "texture" texture-uniform f } + { "point_size" float-uniform f } ; + +GLSL-PROGRAM: window-point-program window-point-vertex-shader window-point-fragment-shader window-vertex-format ; + CONSTANT: window-vertexes float-array{ -1.0 -1.0 @@ -62,4 +110,17 @@ CONSTANT: window-vertexes byte-array>buffer ; inline : ( program-instance -- vertex-array ) - [ ] dip window-vertex ; inline + [ ] dip window-vertex-format ; inline + +:: <2d-render-texture> ( dim order type -- renderbuffer texture ) + order type T{ texture-parameters { wrap clamp-texcoord-to-edge } + { min-filter filter-linear } { min-mipmap-filter f } } + [ 0 1array f f dim ] keep ; + +: draw-texture ( texture -- ) + { + { "primitive-mode" [ drop triangle-strip-mode ] } + { "uniforms" [ window-uniforms boa ] } + { "vertex-array" [ drop window-program ] } + { "indexes" [ drop T{ index-range f 0 4 } ] } + } render ; From 6081abea041db9bc2fb7651321568784c8079b70 Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Sun, 4 Apr 2010 20:52:09 -0700 Subject: [PATCH 033/157] Fix step effect --- extra/fluids/fluids.factor | 3 ++- extra/gpu/effects/step/step.factor | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/extra/fluids/fluids.factor b/extra/fluids/fluids.factor index a0d75fd6e3..d241a82ede 100644 --- a/extra/fluids/fluids.factor +++ b/extra/fluids/fluids.factor @@ -5,7 +5,8 @@ game.worlds gpu gpu.buffers gpu.framebuffers gpu.render gpu.shaders gpu.state gpu.textures gpu.util images images.loader kernel literals locals make math math.rectangles math.vectors namespaces opengl.gl sequences specialized-arrays ui.gadgets.worlds images.ppm -ui.gestures ui.pixel-formats images.pgm gpu.effects.blur ; +ui.gestures ui.pixel-formats images.pgm gpu.effects.blur +gpu.effects.step ; FROM: alien.c-types => float ; SPECIALIZED-ARRAY: float IN: fluids diff --git a/extra/gpu/effects/step/step.factor b/extra/gpu/effects/step/step.factor index eff2a47e23..f50c0c3cc1 100644 --- a/extra/gpu/effects/step/step.factor +++ b/extra/gpu/effects/step/step.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2010 Erik Charlebois. ! See http://factorcode.org/license.txt for BSD license. -USING: ; +USING: gpu.render gpu.shaders gpu.util ; IN: gpu.effects.step GLSL-SHADER: step-fragment-shader fragment-shader From a91d7a0e7bdf270bfe80cb15cb7b857a2f14660d Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Mon, 5 Apr 2010 01:38:39 -0700 Subject: [PATCH 034/157] Get fluids working on Mac --- extra/fluids/fluids.factor | 14 +++++++------- extra/gpu/effects/blur/blur.factor | 27 ++++++++++++++------------- extra/gpu/util/util.factor | 18 +++++++++++++----- 3 files changed, 34 insertions(+), 25 deletions(-) diff --git a/extra/fluids/fluids.factor b/extra/fluids/fluids.factor index d241a82ede..1b4f1524de 100644 --- a/extra/fluids/fluids.factor +++ b/extra/fluids/fluids.factor @@ -98,14 +98,14 @@ M: fluids-world begin-game-world dup fluid set init-gpu initial-particles clone >>particles - "C:/Users/erikc/Pictures/particle2.pgm" make-texture >>texture - "C:/Users/erikc/Pictures/colors.ppm" make-texture >>ramp + "resource:extra/fluids/particle2.pgm" make-texture >>texture + "resource:extra/fluids/colors.ppm" make-texture >>ramp RGB float-components T{ texture-parameters - { wrap clamp-texcoord-to-edge } - { min-filter filter-linear } - { min-mipmap-filter f } - } >>color-texture + { wrap clamp-texcoord-to-edge } + { min-filter filter-linear } + { min-mipmap-filter f } } + >>color-texture dup color-texture>> 0 1array f f { 320 240 } >>framebuffer drop ; @@ -135,7 +135,7 @@ M:: fluids-world draw-world* ( world -- ) { "indexes" [ nip length 2 / 0 swap ] } { "framebuffer" [ drop framebuffer>> ] } } 2 render - + world color-texture>> gaussian-blur { 0 0 } { 640 480 } set-gpu-state world ramp>> { diff --git a/extra/gpu/effects/blur/blur.factor b/extra/gpu/effects/blur/blur.factor index 0a25654976..ed72b28374 100644 --- a/extra/gpu/effects/blur/blur.factor +++ b/extra/gpu/effects/blur/blur.factor @@ -1,7 +1,8 @@ ! Copyright (C) 2010 Erik Charlebois. ! See http://factorcode.org/license.txt for BSD license. -USING: destructors fry gpu.render gpu.shaders gpu.state gpu.textures -gpu.util images kernel locals math math.rectangles sequences ; +USING: arrays destructors fry gpu.framebuffers gpu.render gpu.shaders +gpu.state gpu.textures gpu.util images kernel locals math +math.rectangles sequences ; IN: gpu.effects.blur GLSL-SHADER: blur-fragment-shader fragment-shader @@ -14,10 +15,10 @@ void main() vec4 col = 0.16 * texture2D(texture, texcoord); if (horizontal) { - const vec2 blurX1 = vec2(blurSize, 0.0); - const vec2 blurX2 = vec2(blurSize * 2.0, 0.0); - const vec2 blurX3 = vec2(blurSize * 3.0, 0.0); - const vec2 blurX4 = vec2(blurSize * 4.0, 0.0); + vec2 blurX1 = vec2(blurSize, 0.0); + vec2 blurX2 = vec2(blurSize * 2.0, 0.0); + vec2 blurX3 = vec2(blurSize * 3.0, 0.0); + vec2 blurX4 = vec2(blurSize * 4.0, 0.0); col += 0.15 * ( texture2D(texture, texcoord - blurX1) + texture2D(texture, texcoord + blurX1)); col += 0.12 * ( texture2D(texture, texcoord - blurX2) @@ -29,10 +30,10 @@ void main() } else { - const vec2 blurY1 = vec2(0.0, blurSize); - const vec2 blurY2 = vec2(0.0, blurSize * 2.0); - const vec2 blurY3 = vec2(0.0, blurSize * 3.0); - const vec2 blurY4 = vec2(0.0, blurSize * 4.0); + vec2 blurY1 = vec2(0.0, blurSize); + vec2 blurY2 = vec2(0.0, blurSize * 2.0); + vec2 blurY3 = vec2(0.0, blurSize * 3.0); + vec2 blurY4 = vec2(0.0, blurSize * 4.0); col += 0.15 * ( texture2D(texture, texcoord - blurY1) + texture2D(texture, texcoord + blurY1)); col += 0.12 * ( texture2D(texture, texcoord - blurY2) @@ -42,7 +43,7 @@ void main() col += 0.05 * ( texture2D(texture, texcoord - blurY4) + texture2D(texture, texcoord + blurY4)); } - gl_FragColor = col ; + gl_FragColor = col; } ; @@ -52,7 +53,7 @@ UNIFORM-TUPLE: blur-uniforms { "blurSize" float-uniform f } ; GLSL-PROGRAM: blur-program window-vertex-shader blur-fragment-shader window-vertex-format ; - + :: (blur) ( texture horizontal? framebuffer dim -- ) { 0 0 } dim set-gpu-state texture horizontal? 1.0 dim horizontal? [ first ] [ second ] if / blur-uniforms boa framebuffer { @@ -65,7 +66,7 @@ GLSL-PROGRAM: blur-program window-vertex-shader blur-fragment-shader window-vert :: blur ( texture horizontal? -- texture ) texture 0 texture-dim :> dim - dim L ubyte-components <2d-render-texture> :> ( target-framebuffer target-texture ) + dim RGB float-components <2d-render-texture> :> ( target-framebuffer target-texture ) texture horizontal? target-framebuffer dim (blur) target-framebuffer dispose target-texture ; diff --git a/extra/gpu/util/util.factor b/extra/gpu/util/util.factor index ffca3a5478..29fe5f1314 100644 --- a/extra/gpu/util/util.factor +++ b/extra/gpu/util/util.factor @@ -1,6 +1,7 @@ ! (c)2009 Joe Groff bsd license -USING: arrays gpu.buffers gpu.framebuffers gpu.render gpu.shaders -gpu.textures images kernel locals specialized-arrays ; +USING: accessors arrays gpu.buffers gpu.framebuffers gpu.render +gpu.shaders gpu.textures images kernel locals opengl.framebuffers +specialized-arrays ; FROM: alien.c-types => float ; SPECIALIZED-ARRAY: float IN: gpu.util @@ -83,6 +84,7 @@ void main() ; GLSL-SHADER: window-point-fragment-shader fragment-shader +#version 120 uniform sampler2D texture; void main() { @@ -113,9 +115,15 @@ CONSTANT: window-vertexes [ ] dip window-vertex-format ; inline :: <2d-render-texture> ( dim order type -- renderbuffer texture ) - order type T{ texture-parameters { wrap clamp-texcoord-to-edge } - { min-filter filter-linear } { min-mipmap-filter f } } - [ 0 1array f f dim ] keep ; + order type + T{ texture-parameters + { wrap clamp-texcoord-to-edge } + { min-filter filter-linear } + { min-mipmap-filter f } } + [ + 0 1array f f dim + dup { { default-attachment { 0 0 0 } } } clear-framebuffer + ] keep ; : draw-texture ( texture -- ) { From 9b44451682caa17361b68b25be2a85135bb79652 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 5 Apr 2010 14:49:32 -0500 Subject: [PATCH 035/157] Safe SEH is better than abstinence --- Nmakefile | 8 +++++++- vm/os-windows-nt.cpp | 2 +- vm/os-windows-nt.hpp | 2 +- vm/safeseh.asm | 5 +++++ 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100755 vm/safeseh.asm diff --git a/Nmakefile b/Nmakefile index 9df7a6a1ee..dc28e1884c 100755 --- a/Nmakefile +++ b/Nmakefile @@ -2,10 +2,12 @@ LINK_FLAGS = /nologo /DEBUG shell32.lib CL_FLAGS = /nologo /Zi /O2 /W3 /DFACTOR_DEBUG !ELSE -LINK_FLAGS = /nologo /safeseh:no shell32.lib +LINK_FLAGS = /nologo /safeseh shell32.lib CL_FLAGS = /nologo /O2 /W3 !ENDIF +ML_FLAGS = /nologo /safeseh + EXE_OBJS = vm\main-windows-nt.obj vm\factor.res DLL_OBJS = vm\os-windows-nt.obj \ @@ -47,6 +49,7 @@ DLL_OBJS = vm\os-windows-nt.obj \ vm\profiler.obj \ vm\quotations.obj \ vm\run.obj \ + vm\safeseh.obj \ vm\strings.obj \ vm\to_tenured_collector.obj \ vm\tuples.obj \ @@ -60,6 +63,9 @@ DLL_OBJS = vm\os-windows-nt.obj \ .c.obj: cl $(CL_FLAGS) /Fo$@ /c $< +.asm.obj: + ml $(ML_FLAGS) /Fo$@ /c $< + .rs.res: rc $< diff --git a/vm/os-windows-nt.cpp b/vm/os-windows-nt.cpp index 4f90d7f641..711b2a8445 100755 --- a/vm/os-windows-nt.cpp +++ b/vm/os-windows-nt.cpp @@ -87,7 +87,7 @@ LONG factor_vm::exception_handler(PEXCEPTION_RECORD e, void *frame, PCONTEXT c, return ExceptionContinueExecution; } -LONG exception_handler(PEXCEPTION_RECORD e, void *frame, PCONTEXT c, void *dispatch) +extern "C" LONG exception_handler(PEXCEPTION_RECORD e, void *frame, PCONTEXT c, void *dispatch) { return current_vm()->exception_handler(e,frame,c,dispatch); } diff --git a/vm/os-windows-nt.hpp b/vm/os-windows-nt.hpp index d84ac97298..2ba75ccf54 100755 --- a/vm/os-windows-nt.hpp +++ b/vm/os-windows-nt.hpp @@ -22,7 +22,7 @@ typedef char symbol_char; #define FACTOR_DLL NULL -LONG exception_handler(PEXCEPTION_RECORD e, void *frame, PCONTEXT c, void *dispatch); +extern "C" LONG exception_handler(PEXCEPTION_RECORD e, void *frame, PCONTEXT c, void *dispatch); // SSE traps raise these exception codes, which are defined in internal NT headers // but not winbase.h diff --git a/vm/safeseh.asm b/vm/safeseh.asm new file mode 100755 index 0000000000..fb706c1331 --- /dev/null +++ b/vm/safeseh.asm @@ -0,0 +1,5 @@ +.386 +.model flat +exception_handler proto +.safeseh exception_handler +end From ff0e084f94f4a58a433756bca7b696f4ce4e3bdf Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 5 Apr 2010 15:48:09 -0500 Subject: [PATCH 036/157] vm: dllexport exception_handler for great justice --- vm/os-windows-nt.cpp | 2 +- vm/os-windows-nt.hpp | 2 +- vm/platform.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vm/os-windows-nt.cpp b/vm/os-windows-nt.cpp index 711b2a8445..b7f86233a1 100755 --- a/vm/os-windows-nt.cpp +++ b/vm/os-windows-nt.cpp @@ -87,7 +87,7 @@ LONG factor_vm::exception_handler(PEXCEPTION_RECORD e, void *frame, PCONTEXT c, return ExceptionContinueExecution; } -extern "C" LONG exception_handler(PEXCEPTION_RECORD e, void *frame, PCONTEXT c, void *dispatch) +VM_C_API LONG exception_handler(PEXCEPTION_RECORD e, void *frame, PCONTEXT c, void *dispatch) { return current_vm()->exception_handler(e,frame,c,dispatch); } diff --git a/vm/os-windows-nt.hpp b/vm/os-windows-nt.hpp index 2ba75ccf54..60990c0986 100755 --- a/vm/os-windows-nt.hpp +++ b/vm/os-windows-nt.hpp @@ -22,7 +22,7 @@ typedef char symbol_char; #define FACTOR_DLL NULL -extern "C" LONG exception_handler(PEXCEPTION_RECORD e, void *frame, PCONTEXT c, void *dispatch); +VM_C_API LONG exception_handler(PEXCEPTION_RECORD e, void *frame, PCONTEXT c, void *dispatch); // SSE traps raise these exception codes, which are defined in internal NT headers // but not winbase.h diff --git a/vm/platform.hpp b/vm/platform.hpp index a71aae1e89..e5a07a05d4 100755 --- a/vm/platform.hpp +++ b/vm/platform.hpp @@ -3,8 +3,8 @@ #include "os-windows-ce.hpp" #include "os-windows.hpp" #elif defined(WINNT) - #include "os-windows-nt.hpp" #include "os-windows.hpp" + #include "os-windows-nt.hpp" #if defined(FACTOR_AMD64) #include "os-windows-nt.64.hpp" From 9ec94f242d95de50048cb91169647dd58c7008e7 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 5 Apr 2010 03:07:03 -0500 Subject: [PATCH 037/157] Dont use literals twice --- basis/windows/winsock/winsock.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/windows/winsock/winsock.factor b/basis/windows/winsock/winsock.factor index 49a3d6e9fa..4dd7d7385c 100644 --- a/basis/windows/winsock/winsock.factor +++ b/basis/windows/winsock/winsock.factor @@ -3,7 +3,7 @@ USING: alien alien.c-types alien.strings alien.syntax arrays byte-arrays kernel literals math sequences windows.types windows.kernel32 windows.errors math.bitwise io.encodings.utf16n -classes.struct windows.com.syntax init literals ; +classes.struct windows.com.syntax init ; FROM: alien.c-types => short ; IN: windows.winsock From eac2849833289dd4e4604ab5ccf13885e265a2c9 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 5 Apr 2010 17:57:18 -0500 Subject: [PATCH 038/157] Temporary fix for directx bindings until I revert flags{ patch or parsing words get redone --- .../directx/d3d9types/d3d9types.factor | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/basis/windows/directx/d3d9types/d3d9types.factor b/basis/windows/directx/d3d9types/d3d9types.factor index 618d3c79e5..a9485a8fcf 100644 --- a/basis/windows/directx/d3d9types/d3d9types.factor +++ b/basis/windows/directx/d3d9types/d3d9types.factor @@ -759,25 +759,25 @@ CONSTANT: D3DSHADER_ADDRMODE_FORCE_DWORD HEX: 7fffffff CONSTANT: D3DVS_SWIZZLE_SHIFT 16 CONSTANT: D3DVS_SWIZZLE_MASK HEX: 00FF0000 -: D3DVS_X_X ( -- n ) 0 D3DVS_SWIZZLE_SHIFT shift ; inline -: D3DVS_X_Y ( -- n ) 1 D3DVS_SWIZZLE_SHIFT shift ; inline -: D3DVS_X_Z ( -- n ) 2 D3DVS_SWIZZLE_SHIFT shift ; inline -: D3DVS_X_W ( -- n ) 3 D3DVS_SWIZZLE_SHIFT shift ; inline +CONSTANT: D3DVS_X_X $[ 0 16 shift ] +CONSTANT: D3DVS_X_Y $[ 1 16 shift ] +CONSTANT: D3DVS_X_Z $[ 2 16 shift ] +CONSTANT: D3DVS_X_W $[ 3 16 shift ] -: D3DVS_Y_X ( -- n ) 0 D3DVS_SWIZZLE_SHIFT 2 + shift ; inline -: D3DVS_Y_Y ( -- n ) 1 D3DVS_SWIZZLE_SHIFT 2 + shift ; inline -: D3DVS_Y_Z ( -- n ) 2 D3DVS_SWIZZLE_SHIFT 2 + shift ; inline -: D3DVS_Y_W ( -- n ) 3 D3DVS_SWIZZLE_SHIFT 2 + shift ; inline +CONSTANT: D3DVS_Y_X $[ 0 16 2 + shift ] +CONSTANT: D3DVS_Y_Y $[ 1 16 2 + shift ] +CONSTANT: D3DVS_Y_Z $[ 2 16 2 + shift ] +CONSTANT: D3DVS_Y_W $[ 3 16 2 + shift ] -: D3DVS_Z_X ( -- n ) 0 D3DVS_SWIZZLE_SHIFT 4 + shift ; inline -: D3DVS_Z_Y ( -- n ) 1 D3DVS_SWIZZLE_SHIFT 4 + shift ; inline -: D3DVS_Z_Z ( -- n ) 2 D3DVS_SWIZZLE_SHIFT 4 + shift ; inline -: D3DVS_Z_W ( -- n ) 3 D3DVS_SWIZZLE_SHIFT 4 + shift ; inline +CONSTANT: D3DVS_Z_X $[ 0 16 4 + shift ] +CONSTANT: D3DVS_Z_Y $[ 1 16 4 + shift ] +CONSTANT: D3DVS_Z_Z $[ 2 16 4 + shift ] +CONSTANT: D3DVS_Z_W $[ 3 16 4 + shift ] -: D3DVS_W_X ( -- n ) 0 D3DVS_SWIZZLE_SHIFT 6 + shift ; inline -: D3DVS_W_Y ( -- n ) 1 D3DVS_SWIZZLE_SHIFT 6 + shift ; inline -: D3DVS_W_Z ( -- n ) 2 D3DVS_SWIZZLE_SHIFT 6 + shift ; inline -: D3DVS_W_W ( -- n ) 3 D3DVS_SWIZZLE_SHIFT 6 + shift ; inline +CONSTANT: D3DVS_W_X $[ 0 16 6 + shift ] +CONSTANT: D3DVS_W_Y $[ 1 16 6 + shift ] +CONSTANT: D3DVS_W_Z $[ 2 16 6 + shift ] +CONSTANT: D3DVS_W_W $[ 3 16 6 + shift ] CONSTANT: D3DVS_NOSWIZZLE flags{ D3DVS_X_X D3DVS_Y_Y D3DVS_Z_Z D3DVS_W_W } @@ -787,20 +787,20 @@ CONSTANT: D3DSP_SRCMOD_SHIFT 24 CONSTANT: D3DSP_SRCMOD_MASK HEX: 0F000000 TYPEDEF: int D3DSHADER_PARAM_SRCMOD_TYPE -: D3DSPSM_NONE ( -- n ) 0 D3DSP_SRCMOD_SHIFT shift ; inline -: D3DSPSM_NEG ( -- n ) 1 D3DSP_SRCMOD_SHIFT shift ; inline -: D3DSPSM_BIAS ( -- n ) 2 D3DSP_SRCMOD_SHIFT shift ; inline -: D3DSPSM_BIASNEG ( -- n ) 3 D3DSP_SRCMOD_SHIFT shift ; inline -: D3DSPSM_SIGN ( -- n ) 4 D3DSP_SRCMOD_SHIFT shift ; inline -: D3DSPSM_SIGNNEG ( -- n ) 5 D3DSP_SRCMOD_SHIFT shift ; inline -: D3DSPSM_COMP ( -- n ) 6 D3DSP_SRCMOD_SHIFT shift ; inline -: D3DSPSM_X2 ( -- n ) 7 D3DSP_SRCMOD_SHIFT shift ; inline -: D3DSPSM_X2NEG ( -- n ) 8 D3DSP_SRCMOD_SHIFT shift ; inline -: D3DSPSM_DZ ( -- n ) 9 D3DSP_SRCMOD_SHIFT shift ; inline -: D3DSPSM_DW ( -- n ) 10 D3DSP_SRCMOD_SHIFT shift ; inline -: D3DSPSM_ABS ( -- n ) 11 D3DSP_SRCMOD_SHIFT shift ; inline -: D3DSPSM_ABSNEG ( -- n ) 12 D3DSP_SRCMOD_SHIFT shift ; inline -: D3DSPSM_NOT ( -- n ) 13 D3DSP_SRCMOD_SHIFT shift ; inline +CONSTANT: D3DSPSM_NONE $[ 0 24 shift ] +CONSTANT: D3DSPSM_NEG $[ 1 24 shift ] +CONSTANT: D3DSPSM_BIAS $[ 2 24 shift ] +CONSTANT: D3DSPSM_BIASNEG $[ 3 24 shift ] +CONSTANT: D3DSPSM_SIGN $[ 4 24 shift ] +CONSTANT: D3DSPSM_SIGNNEG $[ 5 24 shift ] +CONSTANT: D3DSPSM_COMP $[ 6 24 shift ] +CONSTANT: D3DSPSM_X2 $[ 7 24 shift ] +CONSTANT: D3DSPSM_X2NEG $[ 8 24 shift ] +CONSTANT: D3DSPSM_DZ $[ 9 24 shift ] +CONSTANT: D3DSPSM_DW $[ 10 24 shift ] +CONSTANT: D3DSPSM_ABS $[ 11 24 shift ] +CONSTANT: D3DSPSM_ABSNEG $[ 12 24 shift ] +CONSTANT: D3DSPSM_NOT $[ 13 24 shift ] CONSTANT: D3DSPSM_FORCE_DWORD HEX: 7fffffff : D3DPS_VERSION ( major minor -- n ) From d6fb134d5f8108a0d53d771e28cf3c446d3b1d3a Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 5 Apr 2010 17:19:43 -0400 Subject: [PATCH 039/157] kernel: add examples for if, when, unless and if* --- core/kernel/kernel-docs.factor | 64 +++++++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 4 deletions(-) diff --git a/core/kernel/kernel-docs.factor b/core/kernel/kernel-docs.factor index 064978f99b..f977a0487b 100644 --- a/core/kernel/kernel-docs.factor +++ b/core/kernel/kernel-docs.factor @@ -575,19 +575,51 @@ HELP: if { $values { "?" "a generalized boolean" } { "true" quotation } { "false" quotation } } { $description "If " { $snippet "cond" } " is " { $link f } ", calls the " { $snippet "false" } " quotation. Otherwise calls the " { $snippet "true" } " quotation." $nl -"The " { $snippet "cond" } " value is removed from the stack before either quotation is called." } ; +"The " { $snippet "cond" } " value is removed from the stack before either quotation is called." } +{ $examples + { $example + "USING: io kernel math ;" + "10 3 < [ \"Math is broken\" print ] [ \"Math is good\" print ] if" + "Math is good" + } +} ; HELP: when { $values { "?" "a generalized boolean" } { "true" quotation } } { $description "If " { $snippet "cond" } " is not " { $link f } ", calls the " { $snippet "true" } " quotation." $nl -"The " { $snippet "cond" } " value is removed from the stack before the quotation is called." } ; +"The " { $snippet "cond" } " value is removed from the stack before the quotation is called." } +{ $examples + { $example + "USING: kernel math prettyprint ;" + "-5 dup 0 < [ 3 + ] when ." + "-2" + } +} ; HELP: unless { $values { "?" "a generalized boolean" } { "false" quotation } } { $description "If " { $snippet "cond" } " is " { $link f } ", calls the " { $snippet "false" } " quotation." $nl -"The " { $snippet "cond" } " value is removed from the stack before the quotation is called." } ; +"The " { $snippet "cond" } " value is removed from the stack before the quotation is called." } +{ $examples + { $example + "USING: kernel math prettyprint sequences ;" + "IN: scratchpad" + "" + "CONSTANT: american-cities {" + " \"San Francisco\"" + " \"Los Angeles\"" + " \"New York\"" + "}" + "" + ": add-tax ( price city -- price' )" + " american-cities member? [ 1.1 * ] unless ;" + "" + "123 \"Ottawa\" add-tax ." + "135.3" + } +} ; HELP: if* { $values { "?" "a generalized boolean" } { "true" { $quotation "( ..a ? -- ..b )" } } { "false" { $quotation "( ..a -- ..b )" } } } @@ -596,7 +628,31 @@ $nl "If the condition is true, it is retained on the stack before the " { $snippet "true" } " quotation is called. Otherwise, the condition is removed from the stack and the " { $snippet "false" } " quotation is called." $nl "The following two lines are equivalent:" -{ $code "X [ Y ] [ Z ] if*" "X dup [ Y ] [ drop Z ] if" } } ; +{ $code "X [ Y ] [ Z ] if*" "X dup [ Y ] [ drop Z ] if" } } +{ $examples + "Notice how in this example, the same value is tested by the conditional, and then used in the true branch; the false branch does not need to drop the value because of how " { $link if* } " works:" + { $example + "USING: assocs io kernel math.parser ;" + "IN: scratchpad" + "" + ": curry-price ( meat -- price ) + { + { \"Beef\" 10 } + { \"Chicken\" 12 } + { \"Lamb\" 13 } + } at ; + +: order-curry ( meat -- ) + curry-price [ + \"Your order will be \" write + number>string write + \" dollars.\" write + ] [ \"Invalid order.\" print ] if* ;" + "" + "\"Deer\" order-curry" + "Invalid order." + } +} ; HELP: when* { $values { "?" "a generalized boolean" } { "true" { $quotation "( cond -- ... )" } } } From 430a05dcea92d6a0148a1437246ebff69a8f1333 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 5 Apr 2010 19:06:51 -0400 Subject: [PATCH 040/157] Store stack bounds in TIB on win64 to make C++ exceptions work --- Nmakefile | 2 +- basis/cpu/x86/32/bootstrap.factor | 3 -- basis/cpu/x86/32/unix/bootstrap.factor | 14 +++----- basis/cpu/x86/32/winnt/bootstrap.factor | 46 ++++++++----------------- basis/cpu/x86/64/bootstrap.factor | 12 ++----- basis/cpu/x86/64/unix/bootstrap.factor | 5 +-- basis/cpu/x86/64/winnt/bootstrap.factor | 13 +++++-- basis/cpu/x86/unix/bootstrap.factor | 13 +++++++ basis/cpu/x86/winnt/bootstrap.factor | 32 +++++++++++++++++ 9 files changed, 81 insertions(+), 59 deletions(-) create mode 100644 basis/cpu/x86/unix/bootstrap.factor create mode 100644 basis/cpu/x86/winnt/bootstrap.factor diff --git a/Nmakefile b/Nmakefile index dc28e1884c..02d2b5f1ed 100755 --- a/Nmakefile +++ b/Nmakefile @@ -1,5 +1,5 @@ !IF DEFINED(DEBUG) -LINK_FLAGS = /nologo /DEBUG shell32.lib +LINK_FLAGS = /nologo /safeseh /DEBUG shell32.lib CL_FLAGS = /nologo /Zi /O2 /W3 /DFACTOR_DEBUG !ELSE LINK_FLAGS = /nologo /safeseh shell32.lib diff --git a/basis/cpu/x86/32/bootstrap.factor b/basis/cpu/x86/32/bootstrap.factor index 9b1a1de23d..b2cd241df1 100644 --- a/basis/cpu/x86/32/bootstrap.factor +++ b/basis/cpu/x86/32/bootstrap.factor @@ -330,6 +330,3 @@ IN: bootstrap.x86 jit-delete-current-context jit-start-context ] \ (start-context-and-delete) define-sub-primitive - -<< "vocab:cpu/x86/bootstrap.factor" parse-file suffix! >> -call diff --git a/basis/cpu/x86/32/unix/bootstrap.factor b/basis/cpu/x86/32/unix/bootstrap.factor index 1e3bee4961..56d18511e4 100644 --- a/basis/cpu/x86/32/unix/bootstrap.factor +++ b/basis/cpu/x86/32/unix/bootstrap.factor @@ -1,14 +1,8 @@ ! Copyright (C) 2010 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: cpu.x86.assembler cpu.x86.assembler.operands kernel -layouts parser sequences ; +USING: kernel parser sequences ; IN: bootstrap.x86 -: jit-save-tib ( -- ) ; -: jit-restore-tib ( -- ) ; -: jit-update-tib ( ctx-reg -- ) drop ; -: jit-install-seh ( -- ) ESP bootstrap-cell ADD ; -: jit-update-seh ( ctx-reg -- ) drop ; - -<< "vocab:cpu/x86/32/bootstrap.factor" parse-file suffix! >> -call +<< "vocab:cpu/x86/unix/bootstrap.factor" parse-file suffix! >> call +<< "vocab:cpu/x86/32/bootstrap.factor" parse-file suffix! >> call +<< "vocab:cpu/x86/bootstrap.factor" parse-file suffix! >> call diff --git a/basis/cpu/x86/32/winnt/bootstrap.factor b/basis/cpu/x86/32/winnt/bootstrap.factor index b8ee1dacaf..5628632e6c 100644 --- a/basis/cpu/x86/32/winnt/bootstrap.factor +++ b/basis/cpu/x86/32/winnt/bootstrap.factor @@ -5,50 +5,32 @@ cpu.x86.assembler cpu.x86.assembler.operands kernel layouts locals parser sequences ; IN: bootstrap.x86 -: tib-exception-list-offset ( -- n ) 0 bootstrap-cells ; -: tib-stack-base-offset ( -- n ) 1 bootstrap-cells ; -: tib-stack-limit-offset ( -- n ) 2 bootstrap-cells ; +: tib-segment ( -- ) FS ; +: tib-temp ( -- reg ) EAX ; -: jit-save-tib ( -- ) - tib-exception-list-offset [] FS PUSH - tib-stack-base-offset [] FS PUSH - tib-stack-limit-offset [] FS PUSH ; - -: jit-restore-tib ( -- ) - tib-stack-limit-offset [] FS POP - tib-stack-base-offset [] FS POP - tib-exception-list-offset [] FS POP ; - -:: jit-update-tib ( ctx-reg -- ) - ! There's a redundant load here because we're not allowed - ! to clobber ctx-reg. Clobbers EAX. - ! Save callstack base in TIB - EAX ctx-reg context-callstack-seg-offset [+] MOV - EAX EAX segment-end-offset [+] MOV - tib-stack-base-offset [] EAX FS MOV - ! Save callstack limit in TIB - EAX ctx-reg context-callstack-seg-offset [+] MOV - EAX EAX segment-start-offset [+] MOV - tib-stack-limit-offset [] EAX FS MOV ; +<< "vocab:cpu/x86/winnt/bootstrap.factor" parse-file suffix! >> call : jit-install-seh ( -- ) ! Create a new exception record and store it in the TIB. + ! Clobbers tib-temp. ! Align stack ESP 3 bootstrap-cells ADD ! Exception handler address filled in by callback.cpp - 0 PUSH rc-absolute-cell rt-exception-handler jit-rel + tib-temp 0 MOV rc-absolute-cell rt-exception-handler jit-rel + tib-temp PUSH ! No next handler 0 PUSH ! This is the new exception handler - tib-exception-list-offset [] ESP FS MOV ; + tib-exception-list-offset [] ESP tib-segment MOV ; :: jit-update-seh ( ctx-reg -- ) ! Load exception record structure that jit-install-seh - ! created from the bottom of the callstack. Clobbers EAX. - EAX ctx-reg context-callstack-bottom-offset [+] MOV - EAX bootstrap-cell ADD + ! created from the bottom of the callstack. + ! Clobbers tib-temp. + tib-temp ctx-reg context-callstack-bottom-offset [+] MOV + tib-temp bootstrap-cell ADD ! Store exception record in TIB. - tib-exception-list-offset [] EAX FS MOV ; + tib-exception-list-offset [] tib-temp tib-segment MOV ; -<< "vocab:cpu/x86/32/bootstrap.factor" parse-file suffix! >> -call +<< "vocab:cpu/x86/32/bootstrap.factor" parse-file suffix! >> call +<< "vocab:cpu/x86/bootstrap.factor" parse-file suffix! >> call diff --git a/basis/cpu/x86/64/bootstrap.factor b/basis/cpu/x86/64/bootstrap.factor index 69734df225..68c3d8b702 100644 --- a/basis/cpu/x86/64/bootstrap.factor +++ b/basis/cpu/x86/64/bootstrap.factor @@ -26,11 +26,6 @@ IN: bootstrap.x86 : fixnum>slot@ ( -- ) temp0 1 SAR ; : rex-length ( -- n ) 1 ; -: jit-save-tib ( -- ) ; -: jit-restore-tib ( -- ) ; -: jit-update-tib ( ctx-reg -- ) drop ; -: jit-install-seh ( -- ) stack-reg bootstrap-cell ADD ; - : jit-call ( name -- ) RAX 0 MOV rc-absolute-cell jit-dlsym RAX CALL ; @@ -238,7 +233,9 @@ IN: bootstrap.x86 RSP ctx-reg context-callstack-top-offset [+] MOV ! Load new ds, rs registers - jit-restore-context ; + jit-restore-context + + ctx-reg jit-update-tib ; : jit-pop-context-and-param ( -- ) arg1 ds-reg [] MOV @@ -293,6 +290,3 @@ IN: bootstrap.x86 jit-delete-current-context jit-start-context ] \ (start-context-and-delete) define-sub-primitive - -<< "vocab:cpu/x86/bootstrap.factor" parse-file suffix! >> -call diff --git a/basis/cpu/x86/64/unix/bootstrap.factor b/basis/cpu/x86/64/unix/bootstrap.factor index d19b5306a0..cffb12902c 100644 --- a/basis/cpu/x86/64/unix/bootstrap.factor +++ b/basis/cpu/x86/64/unix/bootstrap.factor @@ -12,5 +12,6 @@ IN: bootstrap.x86 : arg3 ( -- reg ) RDX ; : arg4 ( -- reg ) RCX ; -<< "vocab:cpu/x86/64/bootstrap.factor" parse-file suffix! >> -call +<< "vocab:cpu/x86/unix/bootstrap.factor" parse-file suffix! >> call +<< "vocab:cpu/x86/64/bootstrap.factor" parse-file suffix! >> call +<< "vocab:cpu/x86/bootstrap.factor" parse-file suffix! >> call diff --git a/basis/cpu/x86/64/winnt/bootstrap.factor b/basis/cpu/x86/64/winnt/bootstrap.factor index 113a13918f..f816980e57 100644 --- a/basis/cpu/x86/64/winnt/bootstrap.factor +++ b/basis/cpu/x86/64/winnt/bootstrap.factor @@ -5,6 +5,8 @@ vocabs sequences cpu.x86.assembler parser cpu.x86.assembler.operands ; IN: bootstrap.x86 +DEFER: stack-reg + : stack-frame-size ( -- n ) 8 bootstrap-cells ; : nv-regs ( -- seq ) { RBX RSI RDI R12 R13 R14 R15 } ; : arg1 ( -- reg ) RCX ; @@ -12,5 +14,12 @@ IN: bootstrap.x86 : arg3 ( -- reg ) R8 ; : arg4 ( -- reg ) R9 ; -<< "vocab:cpu/x86/64/bootstrap.factor" parse-file suffix! >> -call +: tib-segment ( -- ) GS ; +: tib-temp ( -- reg ) R11 ; + +: jit-install-seh ( -- ) stack-reg bootstrap-cell ADD ; +: jit-update-seh ( ctx-reg -- ) drop ; + +<< "vocab:cpu/x86/winnt/bootstrap.factor" parse-file suffix! >> call +<< "vocab:cpu/x86/64/bootstrap.factor" parse-file suffix! >> call +<< "vocab:cpu/x86/bootstrap.factor" parse-file suffix! >> call diff --git a/basis/cpu/x86/unix/bootstrap.factor b/basis/cpu/x86/unix/bootstrap.factor new file mode 100644 index 0000000000..20dd738ac6 --- /dev/null +++ b/basis/cpu/x86/unix/bootstrap.factor @@ -0,0 +1,13 @@ +! Copyright (C) 2010 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: cpu.x86.assembler cpu.x86.assembler.operands kernel +layouts ; +IN: bootstrap.x86 + +DEFER: stack-reg + +: jit-save-tib ( -- ) ; +: jit-restore-tib ( -- ) ; +: jit-update-tib ( ctx-reg -- ) drop ; +: jit-install-seh ( -- ) stack-reg bootstrap-cell ADD ; +: jit-update-seh ( ctx-reg -- ) drop ; diff --git a/basis/cpu/x86/winnt/bootstrap.factor b/basis/cpu/x86/winnt/bootstrap.factor new file mode 100644 index 0000000000..b81c1eb604 --- /dev/null +++ b/basis/cpu/x86/winnt/bootstrap.factor @@ -0,0 +1,32 @@ +! Copyright (C) 2010 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: bootstrap.image.private compiler.constants +cpu.x86.assembler cpu.x86.assembler.operands kernel layouts +locals parser sequences ; +IN: bootstrap.x86 + +: tib-exception-list-offset ( -- n ) 0 bootstrap-cells ; +: tib-stack-base-offset ( -- n ) 1 bootstrap-cells ; +: tib-stack-limit-offset ( -- n ) 2 bootstrap-cells ; + +: jit-save-tib ( -- ) + tib-exception-list-offset [] tib-segment PUSH + tib-stack-base-offset [] tib-segment PUSH + tib-stack-limit-offset [] tib-segment PUSH ; + +: jit-restore-tib ( -- ) + tib-stack-limit-offset [] tib-segment POP + tib-stack-base-offset [] tib-segment POP + tib-exception-list-offset [] tib-segment POP ; + +:: jit-update-tib ( ctx-reg -- ) + ! There's a redundant load here because we're not allowed + ! to clobber ctx-reg. Clobbers tib-temp. + ! Save callstack base in TIB + tib-temp ctx-reg context-callstack-seg-offset [+] MOV + tib-temp tib-temp segment-end-offset [+] MOV + tib-stack-base-offset [] tib-temp tib-segment MOV + ! Save callstack limit in TIB + tib-temp ctx-reg context-callstack-seg-offset [+] MOV + tib-temp tib-temp segment-start-offset [+] MOV + tib-stack-limit-offset [] tib-temp tib-segment MOV ; From 2a2d9eb0a223b91cbdeb2633cdc2301934211aa2 Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Tue, 6 Apr 2010 02:44:57 -0700 Subject: [PATCH 041/157] Mach-O FFI constants and data structures. --- extra/macho/authors.txt | 1 + extra/macho/macho.factor | 810 +++++++++++++++++++++++++++++++++++++++ extra/macho/summary.txt | 1 + 3 files changed, 812 insertions(+) create mode 100644 extra/macho/authors.txt create mode 100644 extra/macho/macho.factor create mode 100644 extra/macho/summary.txt diff --git a/extra/macho/authors.txt b/extra/macho/authors.txt new file mode 100644 index 0000000000..6f03a12101 --- /dev/null +++ b/extra/macho/authors.txt @@ -0,0 +1 @@ +Erik Charlebois diff --git a/extra/macho/macho.factor b/extra/macho/macho.factor new file mode 100644 index 0000000000..fbccab35a4 --- /dev/null +++ b/extra/macho/macho.factor @@ -0,0 +1,810 @@ +! Copyright (C) 2010 Erik Charlebois. +! See http:// factorcode.org/license.txt for BSD license. +USING: alien.c-types alien.syntax classes.struct kernel literals math +unix.types ; +IN: macho + +TYPEDEF: int integer_t +TYPEDEF: int vm_prot_t +TYPEDEF: integer_t cpu_type_t +TYPEDEF: integer_t cpu_subtype_t +TYPEDEF: integer_t cpu_threadtype_t + +CONSTANT: VM_PROT_NONE HEX: 00 +CONSTANT: VM_PROT_READ HEX: 01 +CONSTANT: VM_PROT_WRITE HEX: 02 +CONSTANT: VM_PROT_EXECUTE HEX: 04 +CONSTANT: VM_PROT_DEFAULT HEX: 03 +CONSTANT: VM_PROT_ALL HEX: 07 +CONSTANT: VM_PROT_NO_CHANGE HEX: 08 +CONSTANT: VM_PROT_COPY HEX: 10 +CONSTANT: VM_PROT_WANTS_COPY HEX: 10 + +! loader.h +STRUCT: mach_header + { magic uint32_t } + { cputype cpu_type_t } + { cpusubtype cpu_subtype_t } + { filetype uint32_t } + { ncmds uint32_t } + { sizeofcmds uint32_t } + { flags uint32_t } ; + +CONSTANT: MH_MAGIC HEX: feedface +CONSTANT: MH_CIGAM HEX: cefaedfe + +STRUCT: mach_header_64 + { magic uint32_t } + { cputype cpu_type_t } + { cpusubtype cpu_subtype_t } + { filetype uint32_t } + { ncmds uint32_t } + { sizeofcmds uint32_t } + { flags uint32_t } + { reserved uint32_t } ; + +CONSTANT: MH_MAGIC_64 HEX: feedfacf +CONSTANT: MH_CIGAM_64 HEX: cffaedfe + +CONSTANT: MH_OBJECT HEX: 1 +CONSTANT: MH_EXECUTE HEX: 2 +CONSTANT: MH_FVMLIB HEX: 3 +CONSTANT: MH_CORE HEX: 4 +CONSTANT: MH_PRELOAD HEX: 5 +CONSTANT: MH_DYLIB HEX: 6 +CONSTANT: MH_DYLINKER HEX: 7 +CONSTANT: MH_BUNDLE HEX: 8 +CONSTANT: MH_DYLIB_STUB HEX: 9 +CONSTANT: MH_DSYM HEX: a +CONSTANT: MH_KEXT_BUNDLE HEX: b + +CONSTANT: MH_NOUNDEFS HEX: 1 +CONSTANT: MH_INCRLINK HEX: 2 +CONSTANT: MH_DYLDLINK HEX: 4 +CONSTANT: MH_BINDATLOAD HEX: 8 +CONSTANT: MH_PREBOUND HEX: 10 +CONSTANT: MH_SPLIT_SEGS HEX: 20 +CONSTANT: MH_LAZY_INIT HEX: 40 +CONSTANT: MH_TWOLEVEL HEX: 80 +CONSTANT: MH_FORCE_FLAT HEX: 100 +CONSTANT: MH_NOMULTIDEFS HEX: 200 +CONSTANT: MH_NOFIXPREBINDING HEX: 400 +CONSTANT: MH_PREBINDABLE HEX: 800 +CONSTANT: MH_ALLMODSBOUND HEX: 1000 +CONSTANT: MH_SUBSECTIONS_VIA_SYMBOLS HEX: 2000 +CONSTANT: MH_CANONICAL HEX: 4000 +CONSTANT: MH_WEAK_DEFINES HEX: 8000 +CONSTANT: MH_BINDS_TO_WEAK HEX: 10000 +CONSTANT: MH_ALLOW_STACK_EXECUTION HEX: 20000 +CONSTANT: MH_DEAD_STRIPPABLE_DYLIB HEX: 400000 +CONSTANT: MH_ROOT_SAFE HEX: 40000 +CONSTANT: MH_SETUID_SAFE HEX: 80000 +CONSTANT: MH_NO_REEXPORTED_DYLIBS HEX: 100000 +CONSTANT: MH_PIE HEX: 200000 + +STRUCT: load_command + { cmd uint32_t } + { cmdsize uint32_t } ; + +CONSTANT: LC_REQ_DYLD HEX: 80000000 + +CONSTANT: LC_SEGMENT HEX: 1 +CONSTANT: LC_SYMTAB HEX: 2 +CONSTANT: LC_SYMSEG HEX: 3 +CONSTANT: LC_THREAD HEX: 4 +CONSTANT: LC_UNIXTHREAD HEX: 5 +CONSTANT: LC_LOADFVMLIB HEX: 6 +CONSTANT: LC_IDFVMLIB HEX: 7 +CONSTANT: LC_IDENT HEX: 8 +CONSTANT: LC_FVMFILE HEX: 9 +CONSTANT: LC_PREPAGE HEX: a +CONSTANT: LC_DYSYMTAB HEX: b +CONSTANT: LC_LOAD_DYLIB HEX: c +CONSTANT: LC_ID_DYLIB HEX: d +CONSTANT: LC_LOAD_DYLINKER HEX: e +CONSTANT: LC_ID_DYLINKER HEX: f +CONSTANT: LC_PREBOUND_DYLIB HEX: 10 +CONSTANT: LC_ROUTINES HEX: 11 +CONSTANT: LC_SUB_FRAMEWORK HEX: 12 +CONSTANT: LC_SUB_UMBRELLA HEX: 13 +CONSTANT: LC_SUB_CLIENT HEX: 14 +CONSTANT: LC_SUB_LIBRARY HEX: 15 +CONSTANT: LC_TWOLEVEL_HINTS HEX: 16 +CONSTANT: LC_PREBIND_CKSUM HEX: 17 +CONSTANT: LC_LOAD_WEAK_DYLIB HEX: 80000018 +CONSTANT: LC_SEGMENT_64 HEX: 19 +CONSTANT: LC_ROUTINES_64 HEX: 1a +CONSTANT: LC_UUID HEX: 1b +CONSTANT: LC_RPATH HEX: 8000001c +CONSTANT: LC_CODE_SIGNATURE HEX: 1d +CONSTANT: LC_SEGMENT_SPLIT_INFO HEX: 1e +CONSTANT: LC_REEXPORT_DYLIB HEX: 8000001f +CONSTANT: LC_LAZY_LOAD_DYLIB HEX: 20 +CONSTANT: LC_ENCRYPTION_INFO HEX: 21 +CONSTANT: LC_DYLD_INFO HEX: 22 +CONSTANT: LC_DYLD_INFO_ONLY HEX: 80000022 + +UNION-STRUCT: lc_str + { offset uint32_t } + { ptr char* } ; + +STRUCT: segment_command + { cmd uint32_t } + { cmdsize uint32_t } + { segname char[16] } + { vmaddr uint32_t } + { vmsize uint32_t } + { fileoff uint32_t } + { filesize uint32_t } + { maxprot vm_prot_t } + { initprot vm_prot_t } + { nsects uint32_t } + { flags uint32_t } ; + +STRUCT: segment_command_64 + { cmd uint32_t } + { cmdsize uint32_t } + { segname char[16] } + { vmaddr uint64_t } + { vmsize uint64_t } + { fileoff uint64_t } + { filesize uint64_t } + { maxprot vm_prot_t } + { initprot vm_prot_t } + { nsects uint32_t } + { flags uint32_t } ; + +CONSTANT: SG_HIGHVM HEX: 1 +CONSTANT: SG_FVMLIB HEX: 2 +CONSTANT: SG_NORELOC HEX: 4 +CONSTANT: SG_PROTECTED_VERSION_1 HEX: 8 + +STRUCT: section + { sectname char[16] } + { segname char[16] } + { addr uint32_t } + { size uint32_t } + { offset uint32_t } + { align uint32_t } + { reloff uint32_t } + { nreloc uint32_t } + { flags uint32_t } + { reserved1 uint32_t } + { reserved2 uint32_t } ; + +STRUCT: section_64 + { sectname char[16] } + { segname char[16] } + { addr uint64_t } + { size uint64_t } + { offset uint32_t } + { align uint32_t } + { reloff uint32_t } + { nreloc uint32_t } + { flags uint32_t } + { reserved1 uint32_t } + { reserved2 uint32_t } + { reserved3 uint32_t } ; + +CONSTANT: SECTION_TYPE HEX: 000000ff +CONSTANT: SECTION_ATTRIBUTES HEX: ffffff00 + +CONSTANT: S_REGULAR HEX: 0 +CONSTANT: S_ZEROFILL HEX: 1 +CONSTANT: S_CSTRING_LITERALS HEX: 2 +CONSTANT: S_4BYTE_LITERALS HEX: 3 +CONSTANT: S_8BYTE_LITERALS HEX: 4 +CONSTANT: S_LITERAL_POINTERS HEX: 5 +CONSTANT: S_NON_LAZY_SYMBOL_POINTERS HEX: 6 +CONSTANT: S_LAZY_SYMBOL_POINTERS HEX: 7 +CONSTANT: S_SYMBOL_STUBS HEX: 8 +CONSTANT: S_MOD_INIT_FUNC_POINTERS HEX: 9 +CONSTANT: S_MOD_TERM_FUNC_POINTERS HEX: a +CONSTANT: S_COALESCED HEX: b +CONSTANT: S_GB_ZEROFILL HEX: c +CONSTANT: S_INTERPOSING HEX: d +CONSTANT: S_16BYTE_LITERALS HEX: e +CONSTANT: S_DTRACE_DOF HEX: f +CONSTANT: S_LAZY_DYLIB_SYMBOL_POINTERS HEX: 10 + +CONSTANT: SECTION_ATTRIBUTES_USR HEX: ff000000 +CONSTANT: S_ATTR_PURE_INSTRUCTIONS HEX: 80000000 +CONSTANT: S_ATTR_NO_TOC HEX: 40000000 +CONSTANT: S_ATTR_STRIP_STATIC_SYMS HEX: 20000000 +CONSTANT: S_ATTR_NO_DEAD_STRIP HEX: 10000000 +CONSTANT: S_ATTR_LIVE_SUPPORT HEX: 08000000 +CONSTANT: S_ATTR_SELF_MODIFYING_CODE HEX: 04000000 +CONSTANT: S_ATTR_DEBUG HEX: 02000000 +CONSTANT: SECTION_ATTRIBUTES_SYS HEX: 00ffff00 +CONSTANT: S_ATTR_SOME_INSTRUCTIONS HEX: 00000400 +CONSTANT: S_ATTR_EXT_RELOC HEX: 00000200 +CONSTANT: S_ATTR_LOC_RELOC HEX: 00000100 + +CONSTANT: SEG_PAGEZERO "__PAGEZERO" +CONSTANT: SEG_TEXT "__TEXT" +CONSTANT: SECT_TEXT "__text" +CONSTANT: SECT_FVMLIB_INIT0 "__fvmlib_init0" +CONSTANT: SECT_FVMLIB_INIT1 "__fvmlib_init1" +CONSTANT: SEG_DATA "__DATA" +CONSTANT: SECT_DATA "__data" +CONSTANT: SECT_BSS "__bss" +CONSTANT: SECT_COMMON "__common" +CONSTANT: SEG_OBJC "__OBJC" +CONSTANT: SECT_OBJC_SYMBOLS "__symbol_table" +CONSTANT: SECT_OBJC_MODULES "__module_info" +CONSTANT: SECT_OBJC_STRINGS "__selector_strs" +CONSTANT: SECT_OBJC_REFS "__selector_refs" +CONSTANT: SEG_ICON "__ICON" +CONSTANT: SECT_ICON_HEADER "__header" +CONSTANT: SECT_ICON_TIFF "__tiff" +CONSTANT: SEG_LINKEDIT "__LINKEDIT" +CONSTANT: SEG_UNIXSTACK "__UNIXSTACK" +CONSTANT: SEG_IMPORT "__IMPORT" + +STRUCT: fvmlib + { name lc_str } + { minor_version uint32_t } + { header_addr uint32_t } ; + +STRUCT: fvmlib_command + { cmd uint32_t } + { cmdsize uint32_t } + { fvmlib fvmlib } ; + +STRUCT: dylib + { name lc_str } + { timestamp uint32_t } + { current_version uint32_t } + { compatibility_version uint32_t } ; + +STRUCT: dylib_command + { cmd uint32_t } + { cmdsize uint32_t } + { dylib dylib } ; + +STRUCT: sub_framework_command + { cmd uint32_t } + { cmdsize uint32_t } + { umbrella lc_str } ; + +STRUCT: sub_client_command + { cmd uint32_t } + { cmdsize uint32_t } + { client lc_str } ; + +STRUCT: sub_umbrella_command + { cmd uint32_t } + { cmdsize uint32_t } + { sub_umbrella lc_str } ; + +STRUCT: sub_library_command + { cmd uint32_t } + { cmdsize uint32_t } + { sub_library lc_str } ; + +STRUCT: prebound_dylib_command + { cmd uint32_t } + { cmdsize uint32_t } + { name lc_str } + { nmodules uint32_t } + { linked_modules lc_str } ; + +STRUCT: dylinker_command + { cmd uint32_t } + { cmdsize uint32_t } + { name lc_str } ; + +STRUCT: thread_command + { cmd uint32_t } + { cmdsize uint32_t } ; + +STRUCT: routines_command + { cmd uint32_t } + { cmdsize uint32_t } + { init_address uint32_t } + { init_module uint32_t } + { reserved1 uint32_t } + { reserved2 uint32_t } + { reserved3 uint32_t } + { reserved4 uint32_t } + { reserved5 uint32_t } + { reserved6 uint32_t } ; + +STRUCT: routines_command_64 + { cmd uint32_t } + { cmdsize uint32_t } + { init_address uint64_t } + { init_module uint64_t } + { reserved1 uint64_t } + { reserved2 uint64_t } + { reserved3 uint64_t } + { reserved4 uint64_t } + { reserved5 uint64_t } + { reserved6 uint64_t } ; + +STRUCT: symtab_command + { cmd uint32_t } + { cmdsize uint32_t } + { symoff uint32_t } + { nsyms uint32_t } + { stroff uint32_t } + { strsize uint32_t } ; + +STRUCT: dysymtab_command + { cmd uint32_t } + { cmdsize uint32_t } + { ilocalsym uint32_t } + { nlocalsym uint32_t } + { iextdefsym uint32_t } + { nextdefsym uint32_t } + { iundefsym uint32_t } + { nundefsym uint32_t } + { tocoff uint32_t } + { ntoc uint32_t } + { modtaboff uint32_t } + { nmodtab uint32_t } + { extrefsymoff uint32_t } + { nextrefsyms uint32_t } + { indirectsymoff uint32_t } + { nindirectsyms uint32_t } + { extreloff uint32_t } + { nextrel uint32_t } + { locreloff uint32_t } + { nlocrel uint32_t } ; + +CONSTANT: INDIRECT_SYMBOL_LOCAL HEX: 80000000 +CONSTANT: INDIRECT_SYMBOL_ABS HEX: 40000000 + +STRUCT: dylib_table_of_contents + { symbol_index uint32_t } + { module_index uint32_t } ; + +STRUCT: dylib_module + { module_name uint32_t } + { iextdefsym uint32_t } + { nextdefsym uint32_t } + { irefsym uint32_t } + { nrefsym uint32_t } + { ilocalsym uint32_t } + { nlocalsym uint32_t } + { iextrel uint32_t } + { nextrel uint32_t } + { iinit_iterm uint32_t } + { ninit_nterm uint32_t } + { objc_module_info_addr uint32_t } + { objc_module_info_size uint32_t } ; + +STRUCT: dylib_module_64 + { module_name uint32_t } + { iextdefsym uint32_t } + { nextdefsym uint32_t } + { irefsym uint32_t } + { nrefsym uint32_t } + { ilocalsym uint32_t } + { nlocalsym uint32_t } + { iextrel uint32_t } + { nextrel uint32_t } + { iinit_iterm uint32_t } + { ninit_nterm uint32_t } + { objc_module_info_size uint32_t } + { objc_module_info_addr uint64_t } ; + +STRUCT: dylib_reference + { isym_flags uint32_t } ; + +STRUCT: twolevel_hints_command + { cmd uint32_t } + { cmdsize uint32_t } + { offset uint32_t } + { nhints uint32_t } ; + +STRUCT: twolevel_hint + { isub_image_itoc uint32_t } ; + +STRUCT: prebind_cksum_command + { cmd uint32_t } + { cmdsize uint32_t } + { cksum uint32_t } ; + +STRUCT: uuid_command + { cmd uint32_t } + { cmdsize uint32_t } + { uuid uint8_t[16] } ; + +STRUCT: rpath_command + { cmd uint32_t } + { cmdsize uint32_t } + { path lc_str } ; + +STRUCT: linkedit_data_command + { cmd uint32_t } + { cmdsize uint32_t } + { dataoff uint32_t } + { datasize uint32_t } ; + +STRUCT: encryption_info_command + { cmd uint32_t } + { cmdsize uint32_t } + { cryptoff uint32_t } + { cryptsize uint32_t } + { cryptid uint32_t } ; + +STRUCT: dyld_info_command + { cmd uint32_t } + { cmdsize uint32_t } + { rebase_off uint32_t } + { rebase_size uint32_t } + { bind_off uint32_t } + { bind_size uint32_t } + { weak_bind_off uint32_t } + { weak_bind_size uint32_t } + { lazy_bind_off uint32_t } + { lazy_bind_size uint32_t } + { export_off uint32_t } + { export_size uint32_t } ; + +CONSTANT: REBASE_TYPE_POINTER 1 +CONSTANT: REBASE_TYPE_TEXT_ABSOLUTE32 2 +CONSTANT: REBASE_TYPE_TEXT_PCREL32 3 + +CONSTANT: REBASE_OPCODE_MASK HEX: F0 +CONSTANT: REBASE_IMMEDIATE_MASK HEX: 0F +CONSTANT: REBASE_OPCODE_DONE HEX: 00 +CONSTANT: REBASE_OPCODE_SET_TYPE_IMM HEX: 10 +CONSTANT: REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB HEX: 20 +CONSTANT: REBASE_OPCODE_ADD_ADDR_ULEB HEX: 30 +CONSTANT: REBASE_OPCODE_ADD_ADDR_IMM_SCALED HEX: 40 +CONSTANT: REBASE_OPCODE_DO_REBASE_IMM_TIMES HEX: 50 +CONSTANT: REBASE_OPCODE_DO_REBASE_ULEB_TIMES HEX: 60 +CONSTANT: REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB HEX: 70 +CONSTANT: REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB HEX: 80 + +CONSTANT: BIND_TYPE_POINTER 1 +CONSTANT: BIND_TYPE_TEXT_ABSOLUTE32 2 +CONSTANT: BIND_TYPE_TEXT_PCREL32 3 + +CONSTANT: BIND_SPECIAL_DYLIB_SELF 0 +CONSTANT: BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE -1 +CONSTANT: BIND_SPECIAL_DYLIB_FLAT_LOOKUP -2 + +CONSTANT: BIND_SYMBOL_FLAGS_WEAK_IMPORT HEX: 1 +CONSTANT: BIND_SYMBOL_FLAGS_NON_WEAK_DEFINITION HEX: 8 + +CONSTANT: BIND_OPCODE_MASK HEX: F0 +CONSTANT: BIND_IMMEDIATE_MASK HEX: 0F +CONSTANT: BIND_OPCODE_DONE HEX: 00 +CONSTANT: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM HEX: 10 +CONSTANT: BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB HEX: 20 +CONSTANT: BIND_OPCODE_SET_DYLIB_SPECIAL_IMM HEX: 30 +CONSTANT: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM HEX: 40 +CONSTANT: BIND_OPCODE_SET_TYPE_IMM HEX: 50 +CONSTANT: BIND_OPCODE_SET_ADDEND_SLEB HEX: 60 +CONSTANT: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB HEX: 70 +CONSTANT: BIND_OPCODE_ADD_ADDR_ULEB HEX: 80 +CONSTANT: BIND_OPCODE_DO_BIND HEX: 90 +CONSTANT: BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB HEX: A0 +CONSTANT: BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED HEX: B0 +CONSTANT: BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB HEX: C0 + +CONSTANT: EXPORT_SYMBOL_FLAGS_KIND_MASK HEX: 03 +CONSTANT: EXPORT_SYMBOL_FLAGS_KIND_REGULAR HEX: 00 +CONSTANT: EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL HEX: 01 +CONSTANT: EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION HEX: 04 +CONSTANT: EXPORT_SYMBOL_FLAGS_INDIRECT_DEFINITION HEX: 08 +CONSTANT: EXPORT_SYMBOL_FLAGS_HAS_SPECIALIZATIONS HEX: 10 + +STRUCT: symseg_command + { cmd uint32_t } + { cmdsize uint32_t } + { offset uint32_t } + { size uint32_t } ; + +STRUCT: ident_command + { cmd uint32_t } + { cmdsize uint32_t } ; + +STRUCT: fvmfile_command + { cmd uint32_t } + { cmdsize uint32_t } + { name lc_str } + { header_addr uint32_t } ; + +! machine.h +CONSTANT: CPU_STATE_MAX 4 +CONSTANT: CPU_STATE_USER 0 +CONSTANT: CPU_STATE_SYSTEM 1 +CONSTANT: CPU_STATE_IDLE 2 +CONSTANT: CPU_STATE_NICE 3 + +CONSTANT: CPU_ARCH_MASK HEX: ff000000 +CONSTANT: CPU_ARCH_ABI64 HEX: 01000000 + +CONSTANT: CPU_TYPE_ANY -1 +CONSTANT: CPU_TYPE_VAX 1 +CONSTANT: CPU_TYPE_MC680x0 6 +CONSTANT: CPU_TYPE_X86 7 +CONSTANT: CPU_TYPE_I386 $ CPU_TYPE_X86 +CONSTANT: CPU_TYPE_X86_64 $[ CPU_TYPE_X86 CPU_ARCH_ABI64 bitor ] +CONSTANT: CPU_TYPE_MC98000 10 +CONSTANT: CPU_TYPE_HPPA 11 +CONSTANT: CPU_TYPE_ARM 12 +CONSTANT: CPU_TYPE_MC88000 13 +CONSTANT: CPU_TYPE_SPARC 14 +CONSTANT: CPU_TYPE_I860 15 +CONSTANT: CPU_TYPE_POWERPC 18 +CONSTANT: CPU_TYPE_POWERPC64 $[ $ CPU_TYPE_POWERPC CPU_ARCH_ABI64 bitor ] + +CONSTANT: CPU_SUBTYPE_MASK HEX: ff000000 +CONSTANT: CPU_SUBTYPE_LIB64 HEX: 80000000 + +CONSTANT: CPU_SUBTYPE_MULTIPLE -1 +CONSTANT: CPU_SUBTYPE_LITTLE_ENDIAN 0 +CONSTANT: CPU_SUBTYPE_BIG_ENDIAN 1 + +CONSTANT: CPU_THREADTYPE_NONE 0 + +CONSTANT: CPU_SUBTYPE_VAX_ALL 0 +CONSTANT: CPU_SUBTYPE_VAX780 1 +CONSTANT: CPU_SUBTYPE_VAX785 2 +CONSTANT: CPU_SUBTYPE_VAX750 3 +CONSTANT: CPU_SUBTYPE_VAX730 4 +CONSTANT: CPU_SUBTYPE_UVAXI 5 +CONSTANT: CPU_SUBTYPE_UVAXII 6 +CONSTANT: CPU_SUBTYPE_VAX8200 7 +CONSTANT: CPU_SUBTYPE_VAX8500 8 +CONSTANT: CPU_SUBTYPE_VAX8600 9 +CONSTANT: CPU_SUBTYPE_VAX8650 10 +CONSTANT: CPU_SUBTYPE_VAX8800 11 +CONSTANT: CPU_SUBTYPE_UVAXIII 12 + +CONSTANT: CPU_SUBTYPE_MC680x0_ALL 1 +CONSTANT: CPU_SUBTYPE_MC68030 1 +CONSTANT: CPU_SUBTYPE_MC68040 2 +CONSTANT: CPU_SUBTYPE_MC68030_ONLY 3 + +: CPU_SUBTYPE_INTEL ( f m -- subtype ) 4 shift + ; inline + +CONSTANT: CPU_SUBTYPE_I386_ALL 3 +CONSTANT: CPU_SUBTYPE_386 3 +CONSTANT: CPU_SUBTYPE_486 4 +CONSTANT: CPU_SUBTYPE_486SX 132 +CONSTANT: CPU_SUBTYPE_586 5 +CONSTANT: CPU_SUBTYPE_PENT 5 +CONSTANT: CPU_SUBTYPE_PENTPRO 22 +CONSTANT: CPU_SUBTYPE_PENTII_M3 54 +CONSTANT: CPU_SUBTYPE_PENTII_M5 86 +CONSTANT: CPU_SUBTYPE_CELERON 103 +CONSTANT: CPU_SUBTYPE_CELERON_MOBILE 119 +CONSTANT: CPU_SUBTYPE_PENTIUM_3 8 +CONSTANT: CPU_SUBTYPE_PENTIUM_3_M 24 +CONSTANT: CPU_SUBTYPE_PENTIUM_3_XEON 40 +CONSTANT: CPU_SUBTYPE_PENTIUM_M 9 +CONSTANT: CPU_SUBTYPE_PENTIUM_4 10 +CONSTANT: CPU_SUBTYPE_PENTIUM_4_M 26 +CONSTANT: CPU_SUBTYPE_ITANIUM 11 +CONSTANT: CPU_SUBTYPE_ITANIUM_2 27 +CONSTANT: CPU_SUBTYPE_XEON 12 +CONSTANT: CPU_SUBTYPE_XEON_MP 28 + +: CPU_SUBTYPE_INTEL_FAMILY ( x -- family ) 15 bitand ; inline + +CONSTANT: CPU_SUBTYPE_INTEL_FAMILY_MAX 15 + +: CPU_SUBTYPE_INTEL_MODEL ( x -- model ) -4 shift ; inline + +CONSTANT: CPU_SUBTYPE_INTEL_MODEL_ALL 0 +CONSTANT: CPU_SUBTYPE_X86_ALL 3 +CONSTANT: CPU_SUBTYPE_X86_64_ALL 3 +CONSTANT: CPU_SUBTYPE_X86_ARCH1 4 +CONSTANT: CPU_THREADTYPE_INTEL_HTT 1 + +CONSTANT: CPU_SUBTYPE_MIPS_ALL 0 +CONSTANT: CPU_SUBTYPE_MIPS_R2300 1 +CONSTANT: CPU_SUBTYPE_MIPS_R2600 2 +CONSTANT: CPU_SUBTYPE_MIPS_R2800 3 +CONSTANT: CPU_SUBTYPE_MIPS_R2000a 4 +CONSTANT: CPU_SUBTYPE_MIPS_R2000 5 +CONSTANT: CPU_SUBTYPE_MIPS_R3000a 6 +CONSTANT: CPU_SUBTYPE_MIPS_R3000 7 + +CONSTANT: CPU_SUBTYPE_MC98000_ALL 0 +CONSTANT: CPU_SUBTYPE_MC98601 1 + +CONSTANT: CPU_SUBTYPE_HPPA_ALL 0 +CONSTANT: CPU_SUBTYPE_HPPA_7100 0 +CONSTANT: CPU_SUBTYPE_HPPA_7100LC 1 + +CONSTANT: CPU_SUBTYPE_MC88000_ALL 0 +CONSTANT: CPU_SUBTYPE_MC88100 1 +CONSTANT: CPU_SUBTYPE_MC88110 2 + +CONSTANT: CPU_SUBTYPE_SPARC_ALL 0 + +CONSTANT: CPU_SUBTYPE_I860_ALL 0 +CONSTANT: CPU_SUBTYPE_I860_860 1 + +CONSTANT: CPU_SUBTYPE_POWERPC_ALL 0 +CONSTANT: CPU_SUBTYPE_POWERPC_601 1 +CONSTANT: CPU_SUBTYPE_POWERPC_602 2 +CONSTANT: CPU_SUBTYPE_POWERPC_603 3 +CONSTANT: CPU_SUBTYPE_POWERPC_603e 4 +CONSTANT: CPU_SUBTYPE_POWERPC_603ev 5 +CONSTANT: CPU_SUBTYPE_POWERPC_604 6 +CONSTANT: CPU_SUBTYPE_POWERPC_604e 7 +CONSTANT: CPU_SUBTYPE_POWERPC_620 8 +CONSTANT: CPU_SUBTYPE_POWERPC_750 9 +CONSTANT: CPU_SUBTYPE_POWERPC_7400 10 +CONSTANT: CPU_SUBTYPE_POWERPC_7450 11 +CONSTANT: CPU_SUBTYPE_POWERPC_970 100 + +CONSTANT: CPU_SUBTYPE_ARM_ALL 0 +CONSTANT: CPU_SUBTYPE_ARM_V4T 5 +CONSTANT: CPU_SUBTYPE_ARM_V6 6 +CONSTANT: CPU_SUBTYPE_ARM_V5TEJ 7 +CONSTANT: CPU_SUBTYPE_ARM_XSCALE 8 +CONSTANT: CPU_SUBTYPE_ARM_V7 9 + +CONSTANT: CPUFAMILY_UNKNOWN 0 +CONSTANT: CPUFAMILY_POWERPC_G3 HEX: cee41549 +CONSTANT: CPUFAMILY_POWERPC_G4 HEX: 77c184ae +CONSTANT: CPUFAMILY_POWERPC_G5 HEX: ed76d8aa +CONSTANT: CPUFAMILY_INTEL_6_13 HEX: aa33392b +CONSTANT: CPUFAMILY_INTEL_6_14 HEX: 73d67300 +CONSTANT: CPUFAMILY_INTEL_6_15 HEX: 426f69ef +CONSTANT: CPUFAMILY_INTEL_6_23 HEX: 78ea4fbc +CONSTANT: CPUFAMILY_INTEL_6_26 HEX: 6b5a4cd2 +CONSTANT: CPUFAMILY_ARM_9 HEX: e73283ae +CONSTANT: CPUFAMILY_ARM_11 HEX: 8ff620d8 +CONSTANT: CPUFAMILY_ARM_XSCALE HEX: 53b005f5 +CONSTANT: CPUFAMILY_ARM_13 HEX: 0cc90e64 + +CONSTANT: CPUFAMILY_INTEL_YONAH $ CPUFAMILY_INTEL_6_14 +CONSTANT: CPUFAMILY_INTEL_MEROM $ CPUFAMILY_INTEL_6_15 +CONSTANT: CPUFAMILY_INTEL_PENRYN $ CPUFAMILY_INTEL_6_23 +CONSTANT: CPUFAMILY_INTEL_NEHALEM $ CPUFAMILY_INTEL_6_26 + +CONSTANT: CPUFAMILY_INTEL_CORE $ CPUFAMILY_INTEL_6_14 +CONSTANT: CPUFAMILY_INTEL_CORE2 $ CPUFAMILY_INTEL_6_15 + +! fat.h +CONSTANT: FAT_MAGIC HEX: cafebabe +CONSTANT: FAT_CIGAM HEX: bebafeca + +STRUCT: fat_header + { magic uint32_t } + { nfat_arch uint32_t } ; + +STRUCT: fat_arch + { cputype cpu_type_t } + { cpusubtype cpu_subtype_t } + { offset uint32_t } + { size uint32_t } + { align uint32_t } ; + +! nlist.h +STRUCT: nlist + { n_strx int32_t } + { n_type uint8_t } + { n_sect uint8_t } + { n_desc int16_t } + { n_value uint32_t } ; + +STRUCT: nlist_64 + { n_strx uint32_t } + { n_type uint8_t } + { n_sect uint8_t } + { n_desc uint16_t } + { n_value uint64_t } ; + +CONSTANT: N_STAB HEX: e0 +CONSTANT: N_PEXT HEX: 10 +CONSTANT: N_TYPE HEX: 0e +CONSTANT: N_EXT HEX: 01 + +CONSTANT: N_UNDF HEX: 0 +CONSTANT: N_ABS HEX: 2 +CONSTANT: N_SECT HEX: e +CONSTANT: N_PBUD HEX: c +CONSTANT: N_INDR HEX: a + +CONSTANT: NO_SECT 0 +CONSTANT: MAX_SECT 255 + +: GET_COMM_ALIGN ( n_desc -- align ) + -8 shift HEX: 0f bitand ; inline + +: SET_COMM_ALIGN ( n_desc align -- n_desc ) + [ HEX: f0ff bitand ] + [ HEX: 000f bitand 8 shift ] bi* bitor ; inline + +CONSTANT: REFERENCE_TYPE 7 +CONSTANT: REFERENCE_FLAG_UNDEFINED_NON_LAZY 0 +CONSTANT: REFERENCE_FLAG_UNDEFINED_LAZY 1 +CONSTANT: REFERENCE_FLAG_DEFINED 2 +CONSTANT: REFERENCE_FLAG_PRIVATE_DEFINED 3 +CONSTANT: REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY 4 +CONSTANT: REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY 5 + +CONSTANT: REFERENCED_DYNAMICALLY HEX: 0010 + +: GET_LIBRARY_ORDINAL ( n_desc -- ordinal ) + -8 shift HEX: ff bitand ; inline + +: SET_LIBRARY_ORDINAL ( n_desc ordinal -- n_desc ) + [ HEX: 00ff bitand ] + [ HEX: 00ff bitand 8 shift ] bi* bitor ; inline + +CONSTANT: SELF_LIBRARY_ORDINAL HEX: 0 +CONSTANT: MAX_LIBRARY_ORDINAL HEX: fd +CONSTANT: DYNAMIC_LOOKUP_ORDINAL HEX: fe +CONSTANT: EXECUTABLE_ORDINAL HEX: ff + +CONSTANT: N_NO_DEAD_STRIP HEX: 0020 +CONSTANT: N_DESC_DISCARDED HEX: 0020 +CONSTANT: N_WEAK_REF HEX: 0040 +CONSTANT: N_WEAK_DEF HEX: 0080 +CONSTANT: N_REF_TO_WEAK HEX: 0080 +CONSTANT: N_ARM_THUMB_DEF HEX: 0008 + +! ranlib.h +CONSTANT: SYMDEF "__.SYMDEF" +CONSTANT: SYMDEF_SORTED "__.SYMDEF SORTED" + +STRUCT: ranlib + { ran_strx uint32_t } + { ran_off uint32_t } ; + +! reloc.h +STRUCT: relocation_info + { r_address int32_t } + { r_symbolnum_pcrel_length_extern_type uint32_t } ; + +CONSTANT: R_ABS 0 +CONSTANT: R_SCATTERED HEX: 80000000 + +STRUCT: scattered_relocation_info_big_endian + { r_scattered_pcrel_length_type_address uint32_t } + { r_value int32_t } ; + +STRUCT: scattered_relocation_info_little_endian + { r_address_type_length_pcrel_scattered uint32_t } + { r_value int32_t } ; + +TYPEDEF: int reloc_type_generic +C-ENUM: + GENERIC_RELOC_VANILLA + GENERIC_RELOC_PAIR + GENERIC_RELOC_SECTDIFF + GENERIC_RELOC_PB_LA_PTR + GENERIC_RELOC_LOCAL_SECTDIFF ; + +TYPEDEF: int reloc_type_x86_64 +C-ENUM: + X86_64_RELOC_UNSIGNED + X86_64_RELOC_SIGNED + X86_64_RELOC_BRANCH + X86_64_RELOC_GOT_LOAD + X86_64_RELOC_GOT + X86_64_RELOC_SUBTRACTOR + X86_64_RELOC_SIGNED_1 + X86_64_RELOC_SIGNED_2 + X86_64_RELOC_SIGNED_4 ; + +TYPEDEF: int reloc_type_ppc +C-ENUM: + PPC_RELOC_VANILLA + PPC_RELOC_PAIR + PPC_RELOC_BR14 + PPC_RELOC_BR24 + PPC_RELOC_HI16 + PPC_RELOC_LO16 + PPC_RELOC_HA16 + PPC_RELOC_LO14 + PPC_RELOC_SECTDIFF + PPC_RELOC_PB_LA_PTR + PPC_RELOC_HI16_SECTDIFF + PPC_RELOC_LO16_SECTDIFF + PPC_RELOC_HA16_SECTDIFF + PPC_RELOC_JBSR + PPC_RELOC_LO14_SECTDIFF + PPC_RELOC_LOCAL_SECTDIFF ; diff --git a/extra/macho/summary.txt b/extra/macho/summary.txt new file mode 100644 index 0000000000..aaef27545c --- /dev/null +++ b/extra/macho/summary.txt @@ -0,0 +1 @@ +Constants and structs related to the Mach object format. From 4b78fe690beebbe39eae353f57231ae4a8dfb139 Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Tue, 6 Apr 2010 02:46:23 -0700 Subject: [PATCH 042/157] Extend C-ENUM: to allow specifying the constant vvalues like in C. Add C-TYPED-ENUM: to automatically typedef a type. --- basis/alien/data/data-docs.factor | 2 +- basis/alien/syntax/syntax-docs.factor | 17 ++++++++++++++--- basis/alien/syntax/syntax.factor | 16 +++++++++++++--- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/basis/alien/data/data-docs.factor b/basis/alien/data/data-docs.factor index d36a4d5fd2..e34b1ba4fa 100644 --- a/basis/alien/data/data-docs.factor +++ b/basis/alien/data/data-docs.factor @@ -105,7 +105,7 @@ $nl "Important guidelines for passing data in byte arrays:" { $subsections "byte-arrays-gc" } "C-style enumerated types are supported:" -{ $subsections POSTPONE: C-ENUM: } +{ $subsections POSTPONE: C-ENUM: POSTPONE: C-TYPED-ENUM: } "C types can be aliased for convenience and consistency with native library documentation:" { $subsections POSTPONE: TYPEDEF: } "A utility for defining " { $link "destructors" } " for deallocating memory:" diff --git a/basis/alien/syntax/syntax-docs.factor b/basis/alien/syntax/syntax-docs.factor index 58b43cec31..2a8e1b2714 100644 --- a/basis/alien/syntax/syntax-docs.factor +++ b/basis/alien/syntax/syntax-docs.factor @@ -60,13 +60,24 @@ HELP: TYPEDEF: HELP: C-ENUM: { $syntax "C-ENUM: words... ;" } { $values { "words" "a sequence of word names" } } -{ $description "Creates a sequence of word definitions in the current vocabulary. Each word pushes an integer according to its index in the enumeration definition. The first word pushes 0." } +{ $description "Creates a sequence of word definitions in the current vocabulary. Each word pushes an integer according to the rules of C enums." } { $notes "This word emulates a C-style " { $snippet "enum" } " in Factor. While this feature can be used for any purpose, using integer constants is discouraged unless it is for interfacing with C libraries. Factor code should use " { $link "words.symbol" } " or " { $link "singletons" } " instead." } { $examples "Here is an example enumeration definition:" - { $code "C-ENUM: red green blue ;" } + { $code "C-ENUM: red { green 3 } blue ;" } "It is equivalent to the following series of definitions:" - { $code "CONSTANT: red 0" "CONSTANT: green 1" "CONSTANT: blue 2" } + { $code "CONSTANT: red 0" "CONSTANT: green 3" "CONSTANT: blue 4" } +} ; + +HELP: C-TYPED-ENUM: +{ $syntax "C-TYPED-ENUM: foo_t FOO BAR { BAZ 4 } BOL ;" } +{ $description "Typedefs the first word as an int and creates a sequence of word definitions in the current vocabulary. Each word pushes an integer according to the rules of C enums." } +{ $notes "This word emulates a C-style " { $snippet "enum" } " in Factor. While this feature can be used for any purpose, using integer constants is discouraged unless it is for interfacing with C libraries. Factor code should use " { $link "words.symbol" } " or " { $link "singletons" } " instead." } +{ $examples + "Here is an example enumeration definition:" + { $code "C-TYPED-ENUM: color_t red { green 3 } blue ;" } + "It is equivalent to the following series of definitions:" + { $code "TYPEDEF: int color_t" "CONSTANT: red 0" "CONSTANT: green 3" "CONSTANT: blue 4" } } ; HELP: C-TYPE: diff --git a/basis/alien/syntax/syntax.factor b/basis/alien/syntax/syntax.factor index 9eb8ca6287..f7cff225c5 100644 --- a/basis/alien/syntax/syntax.factor +++ b/basis/alien/syntax/syntax.factor @@ -24,9 +24,19 @@ SYNTAX: CALLBACK: SYNTAX: TYPEDEF: scan-c-type CREATE-C-TYPE dup save-location typedef ; -SYNTAX: C-ENUM: - ";" parse-tokens - [ [ create-in ] dip define-constant ] each-index ; +: define-enum-members ( counter -- ) + scan dup ";" = not [ + dup "{" = + [ 2drop scan create-in scan-word [ define-constant ] keep "}" expect ] + [ create-in swap [ define-constant ] keep ] + if 1 + define-enum-members + ] [ 2drop ] if ; + +SYNTAX: C-ENUM: 0 define-enum-members ; + +SYNTAX: C-TYPED-ENUM: + int CREATE-C-TYPE dup save-location typedef + 0 define-enum-members ; SYNTAX: C-TYPE: void CREATE-C-TYPE typedef ; From 26a55bbb16e9c8a74526a8f47f4a33c4cc3c763a Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Tue, 6 Apr 2010 12:58:37 -0700 Subject: [PATCH 043/157] Syntax highlighting for TYPED:: --- misc/fuel/fuel-syntax.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/fuel/fuel-syntax.el b/misc/fuel/fuel-syntax.el index d13a670df4..026a7738e0 100644 --- a/misc/fuel/fuel-syntax.el +++ b/misc/fuel/fuel-syntax.el @@ -118,7 +118,7 @@ (format "\\_<\\(%s\\)?: +\\_<\\(\\w+\\)\\_>" (regexp-opt '(":" "GENERIC" "DEFER" "HOOK" "MAIN" "MATH" "POSTPONE" - "SYMBOL" "SYNTAX" "TYPED" "RENAME")))) + "SYMBOL" "SYNTAX" "TYPED" "TYPED:" "RENAME")))) (defconst fuel-syntax--alias-definition-regex "^ALIAS: +\\(\\_<.+?\\_>\\) +\\(\\_<.+?\\_>\\)") From 669956032766a3dd3a3b6418d63e8bf1dff261db Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Tue, 6 Apr 2010 12:59:46 -0700 Subject: [PATCH 044/157] Helper words for ELF parsing --- extra/elf/elf.factor | 47 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/extra/elf/elf.factor b/extra/elf/elf.factor index 2ad82bc23c..539939856d 100644 --- a/extra/elf/elf.factor +++ b/extra/elf/elf.factor @@ -1,6 +1,8 @@ ! Copyright (C) 2010 Erik Charlebois. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.c-types alien.syntax classes.struct ; +USING: accessors alien alien.c-types alien.strings alien.syntax arrays +classes.struct io.encodings.ascii kernel locals sequences +specialized-arrays strings typed ; IN: elf CONSTANT: EI_NIDENT 16 @@ -456,3 +458,46 @@ STRUCT: Elf32_Dyn STRUCT: Elf64_Dyn { d_tag Elf64_Sxword } { d_val Elf64_Xword } ; + +SPECIALIZED-ARRAYS: Elf32_Shdr Elf64_Shdr uchar ; +UNION: Elf32/64_Ehdr Elf32_Ehdr Elf64_Ehdr ; +UNION: Elf32/64_Shdr Elf32_Shdr Elf64_Shdr ; +UNION: Elf32/64_Shdr-array Elf32_Shdr-array Elf64_Shdr-array ; + +TYPED: 64-bit? ( elf: Elf32/64_Ehdr -- ? ) + e_ident>> EI_CLASS swap nth ELFCLASS64 = ; + +TYPED: elf-header ( c-ptr -- elf: Elf32/64_Ehdr ) + [ Elf64_Ehdr memory>struct 64-bit? ] keep swap + [ Elf64_Ehdr memory>struct ] + [ Elf32_Ehdr memory>struct ] if ; + +TYPED:: elf-section-headers ( elf: Elf32/64_Ehdr -- headers: Elf32/64_Shdr-array ) + elf [ e_shoff>> ] [ e_shnum>> ] bi :> ( off num ) + off elf >c-ptr num + elf 64-bit? + [ ] + [ ] if ; + +TYPED:: elf-section-data ( elf: Elf32/64_Ehdr header: Elf32/64_Shdr -- uchar-array/f ) + header [ sh_offset>> elf >c-ptr ] [ sh_size>> ] bi ; + +TYPED:: elf-section-data-by-name ( elf: Elf32/64_Ehdr name: string -- header/f uchar-array/f ) + elf elf-section-headers :> sections + elf e_shstrndx>> :> ndx + elf ndx sections nth elf-section-data >c-ptr :> section-names + + sections 1 tail [ + sh_name>> section-names ascii alien>string name = + ] find nip + + [ dup elf swap elf-section-data ] + [ f f ] if* ; + +TYPED:: elf-section-names ( elf: Elf32/64_Ehdr -- names ) + elf elf-section-headers :> sections + elf ".shstrtab" elf-section-data-by-name nip >c-ptr :> section-names + sections 1 tail [ + sh_name>> section-names + ascii alien>string + ] { } map-as ; From e6b4e54e2c07465784ef933fe2656f8f50eac2d8 Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Tue, 6 Apr 2010 13:12:10 -0700 Subject: [PATCH 045/157] More work on fluids --- extra/fluids/fluids.factor | 59 +++++++++--------------------- extra/gpu/effects/step/step.factor | 19 +++++++++- extra/gpu/util/util.factor | 34 ++++++++++++++--- 3 files changed, 65 insertions(+), 47 deletions(-) diff --git a/extra/fluids/fluids.factor b/extra/fluids/fluids.factor index 1b4f1524de..1fff38b079 100644 --- a/extra/fluids/fluids.factor +++ b/extra/fluids/fluids.factor @@ -1,12 +1,12 @@ ! Copyright (C) 2010 Erik Charlebois. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays classes.struct destructors game.loop -game.worlds gpu gpu.buffers gpu.framebuffers gpu.render gpu.shaders -gpu.state gpu.textures gpu.util images images.loader kernel literals -locals make math math.rectangles math.vectors namespaces opengl.gl -sequences specialized-arrays ui.gadgets.worlds images.ppm -ui.gestures ui.pixel-formats images.pgm gpu.effects.blur -gpu.effects.step ; +game.worlds gpu gpu.buffers gpu.effects.blur gpu.framebuffers +gpu.render gpu.shaders gpu.state gpu.textures gpu.util images +images.loader kernel literals locals make math math.rectangles +math.vectors namespaces opengl.gl sequences specialized-arrays +ui.gadgets.worlds ui.gestures ui.pixel-formats gpu.effects.step +images.pgm images.ppm ; FROM: alien.c-types => float ; SPECIALIZED-ARRAY: float IN: fluids @@ -65,7 +65,7 @@ particle_t-array{ [ verlet-integrate-particle ] curry map! ; TUPLE: fluids-world < game-world - particles texture framebuffer color-texture ramp { paused boolean initial: f } ; + particles texture ramp { paused boolean initial: f } ; : make-texture ( pathname -- texture ) load-image @@ -100,50 +100,27 @@ M: fluids-world begin-game-world initial-particles clone >>particles "resource:extra/fluids/particle2.pgm" make-texture >>texture "resource:extra/fluids/colors.ppm" make-texture >>ramp - - RGB float-components T{ texture-parameters - { wrap clamp-texcoord-to-edge } - { min-filter filter-linear } - { min-mipmap-filter f } } - >>color-texture - - dup color-texture>> 0 1array f f { 320 240 } >>framebuffer drop ; M: fluids-world end-game-world - framebuffer>> dispose ; + drop ; M: fluids-world tick-game-world dup paused>> [ drop ] [ integrate ] if ; M:: fluids-world draw-world* ( world -- ) - world framebuffer>> { { default-attachment { 0 0 0 } } } clear-framebuffer - system-framebuffer { { default-attachment { 0 0 0 } } } clear-framebuffer - - f eq-add func-one func-one dup set-gpu-state - f origin-upper-left 1.0 set-gpu-state world particles>> [ [ p>> [ x>> , ] [ y>> , ] bi ] each ] curry float-array{ } make :> verts - { 0 0 } { 320 240 } set-gpu-state - GL_POINT_SPRITE glEnable - world verts { - { "primitive-mode" [ 2drop points-mode ] } - { "uniforms" [ drop texture>> 50.0 window-point-uniforms boa ] } - { "vertex-array" [ nip stream-upload draw-usage vertex-buffer byte-array>buffer &dispose window-point-program &dispose &dispose ] } - { "indexes" [ nip length 2 / 0 swap ] } - { "framebuffer" [ drop framebuffer>> ] } - } 2 render - - world color-texture>> gaussian-blur - { 0 0 } { 640 480 } set-gpu-state - world ramp>> { - { "primitive-mode" [ 2drop triangle-strip-mode ] } - { "uniforms" [ step-uniforms boa ] } - { "vertex-array" [ 2drop step-program ] } - { "indexes" [ 2drop T{ index-range f 0 4 } ] } - } 2 render + [ + verts world texture>> 50.0 { 320 240 } blended-point-sprite-batch &dispose + + blend-state new set-gpu-state + + gaussian-blur &dispose world ramp>> { 1024 768 } step-texture &dispose + { 1024 768 } draw-texture + ] with-destructors ; GAME: fluids { @@ -151,7 +128,7 @@ GAME: fluids { { title "Fluids Test" } { pixel-format-attributes { windowed double-buffered T{ depth-bits { value 24 } } } } - { pref-dim { 640 480 } } + { pref-dim { 1024 768 } } { tick-interval-micros $[ 60 fps ] } } ; @@ -159,7 +136,7 @@ MAIN: fluids fluids-world H{ { T{ button-down } [ [ - hand-loc get { 640 480 } v/ 2 v*n 1 v-n { 1 -1 } v* first2 float2_t + hand-loc get { 1024 768 } v/ 2 v*n 1 v-n { 1 -1 } v* first2 float2_t dup 2.0 particle_t suffix ] change-particles drop ] } } set-gestures diff --git a/extra/gpu/effects/step/step.factor b/extra/gpu/effects/step/step.factor index f50c0c3cc1..bd3b013b4a 100644 --- a/extra/gpu/effects/step/step.factor +++ b/extra/gpu/effects/step/step.factor @@ -1,6 +1,7 @@ ! Copyright (C) 2010 Erik Charlebois. ! See http://factorcode.org/license.txt for BSD license. -USING: gpu.render gpu.shaders gpu.util ; +USING: destructors gpu.render gpu.shaders gpu.state gpu.textures +gpu.util images kernel locals math.rectangles ; IN: gpu.effects.step GLSL-SHADER: step-fragment-shader fragment-shader @@ -21,3 +22,19 @@ UNIFORM-TUPLE: step-uniforms { "ramp" texture-uniform f } ; GLSL-PROGRAM: step-program window-vertex-shader step-fragment-shader window-vertex-format ; + +: (step-texture) ( texture ramp texture dim -- ) + { 0 0 } swap set-gpu-state + [ step-uniforms boa ] dip { + { "primitive-mode" [ 2drop triangle-strip-mode ] } + { "uniforms" [ drop ] } + { "vertex-array" [ 2drop step-program ] } + { "indexes" [ 2drop T{ index-range f 0 4 } ] } + { "framebuffer" [ nip ] } + } 2 render ; + +:: step-texture ( texture ramp dim -- texture ) + dim RGB float-components <2d-render-texture> :> ( target-framebuffer target-texture ) + texture ramp target-framebuffer dim (step-texture) + target-framebuffer dispose + target-texture ; diff --git a/extra/gpu/util/util.factor b/extra/gpu/util/util.factor index 29fe5f1314..2678f0452c 100644 --- a/extra/gpu/util/util.factor +++ b/extra/gpu/util/util.factor @@ -1,7 +1,7 @@ ! (c)2009 Joe Groff bsd license -USING: accessors arrays gpu.buffers gpu.framebuffers gpu.render -gpu.shaders gpu.textures images kernel locals opengl.framebuffers -specialized-arrays ; +USING: arrays destructors gpu.buffers gpu.framebuffers gpu.render +gpu.shaders gpu.state gpu.textures images kernel locals math +math.rectangles opengl.gl sequences specialized-arrays ; FROM: alien.c-types => float ; SPECIALIZED-ARRAY: float IN: gpu.util @@ -125,10 +125,34 @@ CONSTANT: window-vertexes dup { { default-attachment { 0 0 0 } } } clear-framebuffer ] keep ; -: draw-texture ( texture -- ) +: draw-texture ( texture dim -- ) + { 0 0 } swap set-gpu-state { { "primitive-mode" [ drop triangle-strip-mode ] } { "uniforms" [ window-uniforms boa ] } - { "vertex-array" [ drop window-program ] } + { "vertex-array" [ drop window-program &dispose ] } { "indexes" [ drop T{ index-range f 0 4 } ] } } render ; + +:: ( verts program-instance -- vertex-array ) + verts stream-upload draw-usage vertex-buffer byte-array>buffer &dispose + program-instance &dispose ; + +: (blended-point-sprite-batch) ( verts framebuffer texture point-size dim -- ) + f eq-add func-one func-one dup set-gpu-state + f origin-upper-left 1.0 set-gpu-state + GL_POINT_SPRITE glEnable + { 0 0 } swap set-gpu-state + window-point-uniforms boa { + { "primitive-mode" [ 3drop points-mode ] } + { "uniforms" [ 2nip ] } + { "vertex-array" [ 2drop window-point-program ] } + { "indexes" [ 2drop length 2 / 0 swap ] } + { "framebuffer" [ drop nip ] } + } 3 render ; + +:: blended-point-sprite-batch ( verts texture point-size dim -- texture ) + dim RGB float-components <2d-render-texture> :> ( target-framebuffer target-texture ) + verts target-framebuffer texture point-size dim (blended-point-sprite-batch) + target-framebuffer dispose + target-texture ; From c3f8f5067e49756b64c44b2241963db5b88dc482 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Tue, 6 Apr 2010 13:34:26 -0700 Subject: [PATCH 046/157] catch merge conflicts in source and report them as such --- basis/debugger/debugger.factor | 3 +++ core/bootstrap/syntax.factor | 6 ++++++ core/parser/parser.factor | 2 ++ core/syntax/syntax.factor | 8 ++++++++ 4 files changed, 19 insertions(+) diff --git a/basis/debugger/debugger.factor b/basis/debugger/debugger.factor index 8f448ff237..468b5dcf2b 100644 --- a/basis/debugger/debugger.factor +++ b/basis/debugger/debugger.factor @@ -306,6 +306,9 @@ M: bad-inheritance summary M: not-in-a-method-error summary drop "call-next-method can only be called in a method definition" ; +M: version-control-merge-conflict summary + drop "Version control merge conflict in source code" ; + GENERIC: expected>string ( obj -- str ) M: f expected>string drop "end of input" ; diff --git a/core/bootstrap/syntax.factor b/core/bootstrap/syntax.factor index c13f9f9026..9395447aa6 100644 --- a/core/bootstrap/syntax.factor +++ b/core/bootstrap/syntax.factor @@ -89,6 +89,12 @@ IN: bootstrap.syntax "read-only" "call(" "execute(" + "<<<<<<" + "======" + ">>>>>>" + "<<<<<<<" + "=======" + ">>>>>>>" } [ "syntax" create drop ] each "t" "syntax" lookup define-symbol diff --git a/core/parser/parser.factor b/core/parser/parser.factor index 3257bd69a4..be43979b31 100644 --- a/core/parser/parser.factor +++ b/core/parser/parser.factor @@ -207,3 +207,5 @@ print-use-hook [ [ ] ] initialize : ?run-file ( path -- ) dup exists? [ run-file ] [ drop ] if ; + +ERROR: version-control-merge-conflict ; diff --git a/core/syntax/syntax.factor b/core/syntax/syntax.factor index bd70b0be62..de719c7272 100644 --- a/core/syntax/syntax.factor +++ b/core/syntax/syntax.factor @@ -257,4 +257,12 @@ IN: bootstrap.syntax "call(" [ \ call-effect parse-call( ] define-core-syntax "execute(" [ \ execute-effect parse-call( ] define-core-syntax + + "<<<<<<<" [ version-control-merge-conflict ] define-core-syntax + "=======" [ version-control-merge-conflict ] define-core-syntax + ">>>>>>>" [ version-control-merge-conflict ] define-core-syntax + + "<<<<<<" [ version-control-merge-conflict ] define-core-syntax + "======" [ version-control-merge-conflict ] define-core-syntax + ">>>>>>" [ version-control-merge-conflict ] define-core-syntax ] with-compilation-unit From e0196da1c8a3dd0af3a71d39ba720b83e8f8e251 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 6 Apr 2010 16:42:30 -0400 Subject: [PATCH 047/157] combinators: call( now throws an error if a quotation that was declared as never returning actually returns --- core/combinators/combinators-tests.factor | 18 ++++++++++++++++++ core/combinators/combinators.factor | 9 +++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/core/combinators/combinators-tests.factor b/core/combinators/combinators-tests.factor index b239b1eac9..1e7a61daaa 100644 --- a/core/combinators/combinators-tests.factor +++ b/core/combinators/combinators-tests.factor @@ -35,6 +35,24 @@ IN: combinators.tests [ 7 ] [ 1 3 [ 2 * ] [ + ] compose compile-call(-test-1 ] unit-test [ 4 ] [ 1 3 [ { + } [ ] like call ] compile-call(-test-1 ] unit-test +[ [ ] call( -- * ) ] must-fail + +: compile-call(-test-2 ( -- ) [ ] call( -- * ) ; + +[ compile-call(-test-2 ] [ wrong-values? ] must-fail-with + +: compile-call(-test-3 ( quot -- ) call( -- * ) ; + +[ [ ] compile-call(-test-3 ] [ wrong-values? ] must-fail-with + +: compile-execute(-test-3 ( a -- ) \ . execute( value -- * ) ; + +[ 10 compile-execute(-test-3 ] [ wrong-values? ] must-fail-with + +: compile-execute(-test-4 ( a word -- ) execute( value -- * ) ; + +[ 10 \ . compile-execute(-test-4 ] [ wrong-values? ] must-fail-with + ! Compiled : cond-test-1 ( obj -- str ) { diff --git a/core/combinators/combinators.factor b/core/combinators/combinators.factor index 7ef2ed5f9f..7ef8ef68ea 100644 --- a/core/combinators/combinators.factor +++ b/core/combinators/combinators.factor @@ -30,11 +30,12 @@ SLOT: out : call-effect ( quot effect -- ) ! Don't use fancy combinators here, since this word always ! runs unoptimized - [ datastack ] 2dip 2dup [ - [ dip ] dip - dup in>> length swap out>> length - check-datastack + [ [ datastack ] dip dip ] dip + dup terminated?>> [ 2drop f ] [ + dup in>> length swap out>> length + check-datastack + ] if ] 2dip rot [ 2drop ] [ wrong-values ] if ; From 0d00160f4c03ec3c89d400487f4c8bd5479e28c5 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 6 Apr 2010 16:48:30 -0400 Subject: [PATCH 048/157] combinators: fix load error --- core/combinators/combinators.factor | 1 + 1 file changed, 1 insertion(+) diff --git a/core/combinators/combinators.factor b/core/combinators/combinators.factor index 7ef8ef68ea..bbfee30b3d 100644 --- a/core/combinators/combinators.factor +++ b/core/combinators/combinators.factor @@ -26,6 +26,7 @@ ERROR: wrong-values quot call-site ; ! We can't USE: effects here so we forward reference slots instead SLOT: in SLOT: out +SLOT: terminated? : call-effect ( quot effect -- ) ! Don't use fancy combinators here, since this word always From fe085c96d6af4f026caf9854b51b50baf3b1076c Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Tue, 6 Apr 2010 13:56:35 -0700 Subject: [PATCH 049/157] =?UTF-8?q?debugger:=20``=20''=20->=20=E2=80=9C=20?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- basis/debugger/debugger.factor | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/basis/debugger/debugger.factor b/basis/debugger/debugger.factor index 468b5dcf2b..8856871f11 100644 --- a/basis/debugger/debugger.factor +++ b/basis/debugger/debugger.factor @@ -270,20 +270,20 @@ M: no-current-vocab summary M: no-word-error summary name>> - "No word named ``" - "'' found in current vocabulary search path" surround ; + "No word named “" + "” found in current vocabulary search path" surround ; M: no-word-error error. summary print ; M: no-word-in-vocab summary [ vocab>> ] [ word>> ] bi - [ "No word named ``" % % "'' found in ``" % % "'' vocabulary" % ] "" make ; + [ "No word named “" % % "” found in “" % % "” vocabulary" % ] "" make ; M: no-word-in-vocab error. summary print ; M: ambiguous-use-error summary words>> first name>> - "More than one vocabulary defines a word named ``" "''" surround ; + "More than one vocabulary defines a word named “" "”" surround ; M: ambiguous-use-error error. summary print ; From c931870cd741d3d85f4f9010e43b6782080b8fa8 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 6 Apr 2010 16:30:41 -0500 Subject: [PATCH 050/157] vm: fix compile error under Cygwin --- vm/os-windows-nt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm/os-windows-nt.cpp b/vm/os-windows-nt.cpp index b7f86233a1..0d43cdecc2 100755 --- a/vm/os-windows-nt.cpp +++ b/vm/os-windows-nt.cpp @@ -84,7 +84,7 @@ LONG factor_vm::exception_handler(PEXCEPTION_RECORD e, void *frame, PCONTEXT c, break; } - return ExceptionContinueExecution; + return 0; } VM_C_API LONG exception_handler(PEXCEPTION_RECORD e, void *frame, PCONTEXT c, void *dispatch) From aa7bf38e3864fe2069d4a496e20851b9034953de Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Tue, 6 Apr 2010 15:20:56 -0700 Subject: [PATCH 051/157] cursors: unify input-cursor and assoc-cursor, give all cursors a "key" concept --- extra/cursors/cursors-tests.factor | 24 ++++++---------- extra/cursors/cursors.factor | 46 ++++++++++++------------------ 2 files changed, 27 insertions(+), 43 deletions(-) diff --git a/extra/cursors/cursors-tests.factor b/extra/cursors/cursors-tests.factor index d71999ab87..44eb6bc16c 100644 --- a/extra/cursors/cursors-tests.factor +++ b/extra/cursors/cursors-tests.factor @@ -21,20 +21,6 @@ IN: cursors.tests [ B{ } ] [ [ { } [ , ] each ] B{ } make ] unit-test [ { 2 4 6 8 10 } ] [ { 1 2 3 4 5 } [ 2 * ] map ] unit-test -[ { "roses: lutefisk" "tulips: lox" } ] -[ - [ - { { "roses" "lutefisk" } { "tulips" "lox" } } - [ ": " glue , ] assoc-each - ] { } make -] unit-test - -[ { "roses: lutefisk" "tulips: lox" } ] -[ - { { "roses" "lutefisk" } { "tulips" "lox" } } - [ ": " glue ] { } assoc>map -] unit-test - [ { "roses: lutefisk" "tulips: lox" } ] [ [ @@ -65,8 +51,14 @@ IN: cursors.tests [ { 2 4 6 8 10 } ] [ { 1 2 3 4 5 } compile-test-map ] unit-test [ { "roses: lutefisk" "tulips: lox" } ] -[ [ { { "roses" "lutefisk" } { "tulips" "lox" } } compile-test-assoc-each ] { } make ] unit-test +[ + [ H{ { "roses" "lutefisk" } { "tulips" "lox" } } compile-test-assoc-each ] + { } make natural-sort +] unit-test [ { "roses: lutefisk" "tulips: lox" } ] -[ { { "roses" "lutefisk" } { "tulips" "lox" } } compile-test-assoc>map ] unit-test +[ + H{ { "roses" "lutefisk" } { "tulips" "lox" } } compile-test-assoc>map + natural-sort +] unit-test diff --git a/extra/cursors/cursors.factor b/extra/cursors/cursors.factor index d7fe5fb893..776a5523c4 100644 --- a/extra/cursors/cursors.factor +++ b/extra/cursors/cursors.factor @@ -61,13 +61,19 @@ ERROR: invalid-cursor cursor ; MIXIN: input-cursor -GENERIC: cursor-value ( cursor -- value ) +GENERIC: cursor-key-value ( cursor -- key value ) -M: input-cursor cursor-value-unsafe cursor-value ; inline -M: input-cursor cursor-value - dup cursor-valid? [ cursor-value-unsafe ] [ invalid-cursor ] if ; inline +M: input-cursor cursor-key-value-unsafe cursor-key-value ; inline +M: input-cursor cursor-key-value + dup cursor-valid? [ cursor-key-value-unsafe ] [ invalid-cursor ] if ; inline + +: cursor-key ( cursor -- key ) cursor-key-value drop ; +: cursor-value ( cursor -- key ) cursor-key-value nip ; + +: cursor-key-unsafe ( cursor -- key ) cursor-key-value-unsafe drop ; +: cursor-value-unsafe ( cursor -- key ) cursor-key-value-unsafe nip ; ! ! output cursors @@ -155,7 +161,7 @@ M: numeric-cursor cursor>= [ value>> ] bi@ >= ; inline INSTANCE: numeric-cursor input-cursor -M: numeric-cursor cursor-value value>> ; inline +M: numeric-cursor cursor-key-value value>> dup ; inline ! ! linear cursor @@ -278,8 +284,8 @@ M: sequence-cursor cursor-distance ( cursor cursor -- n ) INSTANCE: sequence-cursor input-cursor -M: sequence-cursor cursor-value-unsafe [ n>> ] [ seq>> ] bi nth-unsafe ; inline -M: sequence-cursor cursor-value [ n>> ] [ seq>> ] bi nth ; inline +M: sequence-cursor cursor-key-value-unsafe [ n>> dup ] [ seq>> ] bi nth-unsafe ; inline +M: sequence-cursor cursor-key-value [ n>> dup ] [ seq>> ] bi nth ; inline INSTANCE: sequence-cursor output-cursor @@ -362,13 +368,9 @@ M: forward-cursor new-sequence-cursor over map-as ; inline ! -! assoc cursors +! assoc combinators ! -MIXIN: assoc-cursor - -GENERIC: cursor-key-value ( cursor -- key value ) - : -assoc- ( quot -- quot' ) '[ cursor-key-value @ ] ; inline @@ -380,11 +382,6 @@ GENERIC: cursor-key-value ( cursor -- key value ) : assoc>map ( ... assoc quot: ( ... k v -- ... newx ) exemplar -- ... newcontainer ) [ assoc- ] dip -map-as ; inline -INSTANCE: input-cursor assoc-cursor - -M: input-cursor cursor-key-value - cursor-value-unsafe first2 ; inline - ! ! hashtable cursor ! @@ -421,16 +418,11 @@ M: hashtable-cursor inc-cursor ( cursor -- cursor' ) [ hashtable>> dup array>> ] [ n>> 2 + ] bi (inc-hashtable-cursor) ; inline -INSTANCE: hashtable-cursor assoc-cursor - -M: hashtable-cursor cursor-key-value - [ n>> ] [ hashtable>> array>> ] bi - [ nth-unsafe ] [ [ 1 + ] dip nth-unsafe ] 2bi ; inline - INSTANCE: hashtable-cursor input-cursor -M: hashtable-cursor cursor-value-unsafe - cursor-key-value 2array ; inline +M: hashtable-cursor cursor-key-value-unsafe + [ n>> ] [ hashtable>> array>> ] bi + [ nth-unsafe ] [ [ 1 + ] dip nth-unsafe ] 2bi ; inline INSTANCE: hashtable container @@ -472,7 +464,7 @@ M: zip-cursor cursor-distance-hint ( cursor cursor -- n ) M: zip-cursor inc-cursor ( cursor -- cursor' ) [ keys>> inc-cursor ] [ values>> inc-cursor ] bi ; inline -INSTANCE: zip-cursor assoc-cursor +INSTANCE: zip-cursor input-cursor M: zip-cursor cursor-key-value [ keys>> cursor-value-unsafe ] [ values>> cursor-value-unsafe ] bi ; inline From 181c45209f0640986effb890f444affff1cbe0e0 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 7 Apr 2010 15:33:19 -0700 Subject: [PATCH 052/157] gpu.shaders: use "counter" instead of reinventing it --- extra/gpu/shaders/shaders.factor | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/extra/gpu/shaders/shaders.factor b/extra/gpu/shaders/shaders.factor index 69f6ba2253..974f2f8070 100755 --- a/extra/gpu/shaders/shaders.factor +++ b/extra/gpu/shaders/shaders.factor @@ -301,13 +301,11 @@ M: f (verify-feedback-format) dup 1 = [ drop ] [ 2array ] if ; SYMBOL: padding-no -padding-no [ 0 ] initialize : padding-name ( -- name ) "padding-" - padding-no get number>string append - "(" ")" surround - padding-no inc ; + padding-no counter number>string append + "(" ")" surround ; : vertex-attribute>struct-slot ( vertex-attribute -- struct-slot-spec ) [ name>> [ padding-name ] unless* ] From 85f3c69c70b28912c6b8f2b62ecc82bbefdff98b Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 7 Apr 2010 20:40:13 -0400 Subject: [PATCH 053/157] io.monitors.recursive: don't bomb if a dsubordinate monitor is disposed of --- basis/io/monitors/recursive/recursive.factor | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/basis/io/monitors/recursive/recursive.factor b/basis/io/monitors/recursive/recursive.factor index b573e2fa2b..70daed9018 100644 --- a/basis/io/monitors/recursive/recursive.factor +++ b/basis/io/monitors/recursive/recursive.factor @@ -1,9 +1,10 @@ -! Copyright (C) 2008, 2009 Slava Pestov. +! Copyright (C) 2008, 2010 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors sequences assocs arrays continuations destructors combinators kernel threads concurrency.messaging concurrency.mailboxes concurrency.promises io.files io.files.info -io.directories io.pathnames io.monitors debugger fry ; +io.directories io.pathnames io.monitors io.monitors.private +debugger fry ; IN: io.monitors.recursive ! Simulate recursive monitors on platforms that don't have them @@ -71,12 +72,14 @@ M: recursive-monitor dispose* ] with with each ; : pump-loop ( -- ) - receive dup +stop+ eq? [ - drop stop-pump - ] [ - [ '[ _ update-hierarchy ] ignore-errors ] [ pump-step ] bi - pump-loop - ] if ; + receive { + { [ dup +stop+ eq? ] [ drop stop-pump ] } + { [ dup monitor-disposed eq? ] [ drop ] } + [ + [ '[ _ update-hierarchy ] ignore-errors ] [ pump-step ] bi + pump-loop + ] + } cond ; : monitor-ready ( error/t -- ) monitor tget ready>> fulfill ; From b330595c3b1c25c1fde61d5ffbdd9a12bd5d0d0d Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 8 Apr 2010 10:22:59 -0700 Subject: [PATCH 054/157] ui.gadgets.grids: clarify docs --- basis/ui/gadgets/grids/grids-docs.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/ui/gadgets/grids/grids-docs.factor b/basis/ui/gadgets/grids/grids-docs.factor index 10b3bb7259..1632072ca2 100644 --- a/basis/ui/gadgets/grids/grids-docs.factor +++ b/basis/ui/gadgets/grids/grids-docs.factor @@ -2,7 +2,7 @@ USING: ui.gadgets help.markup help.syntax arrays ; IN: ui.gadgets.grids ARTICLE: "ui-grid-layout" "Grid layouts" -"Grid gadgets layout their children in a rectangular grid." +"Grid gadgets layout their children in a rectangular grid. The grid is represented as a sequence of sequences of gadgets. Every child sequence is a row of gadgets. Every row must have an equal number of gadgets in it." { $subsections grid } "Creating grids from a fixed set of gadgets:" { $subsections } From e5e51c40a1917e5676062b37c4a9e63b6caf63d8 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 8 Apr 2010 10:32:14 -0700 Subject: [PATCH 055/157] vm: implement frame-based SEH for 64-bit Windows --- Nmakefile | 1 + vm/Config.windows.nt.x86.32 | 1 + vm/Config.windows.nt.x86.64 | 1 + vm/code_heap.cpp | 10 ++++- vm/code_heap.hpp | 9 ++++ vm/image.cpp | 4 +- vm/os-windows-nt-x86.32.cpp | 12 ++++++ vm/os-windows-nt-x86.64.cpp | 85 +++++++++++++++++++++++++++++++++++++ vm/os-windows-nt.cpp | 5 --- 9 files changed, 119 insertions(+), 9 deletions(-) create mode 100644 vm/os-windows-nt-x86.32.cpp create mode 100644 vm/os-windows-nt-x86.64.cpp diff --git a/Nmakefile b/Nmakefile index 02d2b5f1ed..b85197a776 100755 --- a/Nmakefile +++ b/Nmakefile @@ -11,6 +11,7 @@ ML_FLAGS = /nologo /safeseh EXE_OBJS = vm\main-windows-nt.obj vm\factor.res DLL_OBJS = vm\os-windows-nt.obj \ + vm\os-windows-nt-x86.32.obj \ vm\os-windows.obj \ vm\aging_collector.obj \ vm\alien.obj \ diff --git a/vm/Config.windows.nt.x86.32 b/vm/Config.windows.nt.x86.32 index d27629fe83..73bf064ce5 100644 --- a/vm/Config.windows.nt.x86.32 +++ b/vm/Config.windows.nt.x86.32 @@ -1,3 +1,4 @@ +PLAF_DLL_OBJS += vm/os-windows-nt-x86.32.o DLL_PATH=http://factorcode.org/dlls WINDRES=windres include vm/Config.windows.nt diff --git a/vm/Config.windows.nt.x86.64 b/vm/Config.windows.nt.x86.64 index ddb61480e5..495a3ccac9 100644 --- a/vm/Config.windows.nt.x86.64 +++ b/vm/Config.windows.nt.x86.64 @@ -1,3 +1,4 @@ +PLAF_DLL_OBJS += vm/os-windows-nt-x86.64.o DLL_PATH=http://factorcode.org/dlls/64 CC=$(WIN64_PATH)-gcc.exe WINDRES=$(WIN64_PATH)-windres.exe diff --git a/vm/code_heap.cpp b/vm/code_heap.cpp index 40fe00b0e9..96d9541665 100755 --- a/vm/code_heap.cpp +++ b/vm/code_heap.cpp @@ -7,8 +7,14 @@ code_heap::code_heap(cell size) { if(size > ((u64)1 << (sizeof(cell) * 8 - 6))) fatal_error("Heap too large",size); seg = new segment(align_page(size),true); - if(!seg) fatal_error("Out of memory in heap allocator",size); - allocator = new free_list_allocator(size,seg->start); + if(!seg) fatal_error("Out of memory in code_heap constructor",size); + + cell start = seg->start + seh_area_size; + + allocator = new free_list_allocator(seg->end - start,start); + + /* See os-windows-nt-x86.64.cpp for seh_area usage */ + seh_area = (char *)seg->start; } code_heap::~code_heap() diff --git a/vm/code_heap.hpp b/vm/code_heap.hpp index 78ffa6c76a..20ce03c835 100755 --- a/vm/code_heap.hpp +++ b/vm/code_heap.hpp @@ -1,10 +1,19 @@ namespace factor { +#if defined(WINDOWS) && defined(FACTOR_64) + const cell seh_area_size = 1024; +#else + const cell seh_area_size = 0; +#endif + struct code_heap { /* The actual memory area */ segment *seg; + /* Memory area reserved for SEH. Only used on Windows */ + char *seh_area; + /* Memory allocator */ free_list_allocator *allocator; diff --git a/vm/image.cpp b/vm/image.cpp index c74351c191..ccce96a952 100755 --- a/vm/image.cpp +++ b/vm/image.cpp @@ -258,7 +258,7 @@ void factor_vm::load_image(vm_parameters *p) init_objects(&h); cell data_offset = data->tenured->start - h.data_relocation_base; - cell code_offset = code->seg->start - h.code_relocation_base; + cell code_offset = code->allocator->start - h.code_relocation_base; fixup_data(data_offset,code_offset); fixup_code(data_offset,code_offset); @@ -285,7 +285,7 @@ bool factor_vm::save_image(const vm_char *saving_filename, const vm_char *filena h.version = image_version; h.data_relocation_base = data->tenured->start; h.data_size = data->tenured->occupied_space(); - h.code_relocation_base = code->seg->start; + h.code_relocation_base = code->allocator->start; h.code_size = code->allocator->occupied_space(); h.true_object = true_object; diff --git a/vm/os-windows-nt-x86.32.cpp b/vm/os-windows-nt-x86.32.cpp new file mode 100644 index 0000000000..61cf9f6c4e --- /dev/null +++ b/vm/os-windows-nt-x86.32.cpp @@ -0,0 +1,12 @@ +#include "master.hpp" + +namespace factor +{ + +void factor_vm::c_to_factor_toplevel(cell quot) +{ + /* 32-bit Windows SEH is set up in basis/cpu/x86/32/winnt/bootstrap.factor */ + c_to_factor(quot); +} + +} diff --git a/vm/os-windows-nt-x86.64.cpp b/vm/os-windows-nt-x86.64.cpp new file mode 100644 index 0000000000..876d0c5771 --- /dev/null +++ b/vm/os-windows-nt-x86.64.cpp @@ -0,0 +1,85 @@ +#include "master.hpp" + +namespace factor { + +typedef unsigned char UBYTE; + +const UBYTE UNW_FLAG_EHANDLER = 0x1; + +struct UNWIND_INFO { + UBYTE Version:3; + UBYTE Flags:5; + UBYTE SizeOfProlog; + UBYTE CountOfCodes; + UBYTE FrameRegister:4; + UBYTE FrameOffset:4; + ULONG ExceptionHandler; + ULONG ExceptionData[1]; +}; + +struct seh_data { + UNWIND_INFO unwind_info; + RUNTIME_FUNCTION func; + UBYTE handler[32]; +}; + +void factor_vm::c_to_factor_toplevel(cell quot) +{ + /* The annoying thing about Win64 SEH is that the offsets in + * function tables are 32-bit integers, and the exception handler + * itself must reside between the start and end pointers, so + * we stick everything at the beginning of the code heap and + * generate a small trampoline that jumps to the real + * exception handler. */ + + seh_data *seh_area = (seh_data *)code->seh_area; + cell base = code->seg->start; + + /* Should look at generating this with the Factor assembler */ + + /* mov rax,0 */ + seh_area->handler[0] = 0x48; + seh_area->handler[1] = 0xb8; + seh_area->handler[2] = 0x0; + seh_area->handler[3] = 0x0; + seh_area->handler[4] = 0x0; + seh_area->handler[5] = 0x0; + seh_area->handler[6] = 0x0; + seh_area->handler[7] = 0x0; + seh_area->handler[8] = 0x0; + seh_area->handler[9] = 0x0; + + /* jmp rax */ + seh_area->handler[10] = 0x48; + seh_area->handler[11] = 0xff; + seh_area->handler[12] = 0xe0; + + /* Store address of exception handler in the operand of the 'mov' */ + cell handler = (cell)&factor::exception_handler; + memcpy(&seh_area->handler[2],&handler,sizeof(cell)); + + UNWIND_INFO *unwind_info = &seh_area->unwind_info; + unwind_info->Version = 1; + unwind_info->Flags = UNW_FLAG_EHANDLER; + unwind_info->SizeOfProlog = 0; + unwind_info->CountOfCodes = 0; + unwind_info->FrameRegister = 0; + unwind_info->FrameOffset = 0; + unwind_info->ExceptionHandler = (DWORD)((cell)&seh_area->handler[0] - base); + unwind_info->ExceptionData[0] = 0; + + RUNTIME_FUNCTION *func = &seh_area->func; + func->BeginAddress = 0; + func->EndAddress = (DWORD)(code->seg->end - base); + func->UnwindData = (DWORD)((cell)&seh_area->unwind_info - base); + + if(!RtlAddFunctionTable(func,1,base)) + fatal_error("RtlAddFunctionTable() failed",0); + + c_to_factor(quot); + + if(!RtlDeleteFunctionTable(func)) + fatal_error("RtlDeleteFunctionTable() failed",0); +} + +} diff --git a/vm/os-windows-nt.cpp b/vm/os-windows-nt.cpp index 0d43cdecc2..4fea294a12 100755 --- a/vm/os-windows-nt.cpp +++ b/vm/os-windows-nt.cpp @@ -92,11 +92,6 @@ VM_C_API LONG exception_handler(PEXCEPTION_RECORD e, void *frame, PCONTEXT c, vo return current_vm()->exception_handler(e,frame,c,dispatch); } -void factor_vm::c_to_factor_toplevel(cell quot) -{ - c_to_factor(quot); -} - void factor_vm::open_console() { } From 1019278474c767d93e3c1bdbb8b308f05b518973 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 8 Apr 2010 18:00:00 -0500 Subject: [PATCH 056/157] Nmakefile: support both 32-bit and 64-bit builds again --- Nmakefile | 46 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/Nmakefile b/Nmakefile index b85197a776..c8dd98917d 100755 --- a/Nmakefile +++ b/Nmakefile @@ -1,18 +1,27 @@ -!IF DEFINED(DEBUG) -LINK_FLAGS = /nologo /safeseh /DEBUG shell32.lib -CL_FLAGS = /nologo /Zi /O2 /W3 /DFACTOR_DEBUG -!ELSE -LINK_FLAGS = /nologo /safeseh shell32.lib +!IF DEFINED(PLATFORM) + +LINK_FLAGS = /nologo shell32.lib CL_FLAGS = /nologo /O2 /W3 + +!IF DEFINED(DEBUG) +LINK_FLAGS = $(LINK_FLAGS) /DEBUG +CL_FLAGS = $(CL_FLAGS) /Zi /DFACTOR_DEBUG !ENDIF -ML_FLAGS = /nologo /safeseh +!IF "$(PLATFORM)" == "x86-32" +LINK_FLAGS = $(LINK_FLAGS) /safeseh +PLAF_DLL_OBJS = vm\os-windows-nt-x86.32.obj vm\safeseh.obj +!ELSEIF "$(PLATFORM)" == "x86-64" +PLAF_DLL_OBJS = vm\os-windows-nt-x86.64.obj +!ENDIF + +ML_FLAGS = /nologo EXE_OBJS = vm\main-windows-nt.obj vm\factor.res -DLL_OBJS = vm\os-windows-nt.obj \ - vm\os-windows-nt-x86.32.obj \ +DLL_OBJS = $(PLAF_DLL_OBJS) \ vm\os-windows.obj \ + vm\os-windows-nt.obj \ vm\aging_collector.obj \ vm\alien.obj \ vm\arrays.obj \ @@ -50,7 +59,6 @@ DLL_OBJS = vm\os-windows-nt.obj \ vm\profiler.obj \ vm\quotations.obj \ vm\run.obj \ - vm\safeseh.obj \ vm\strings.obj \ vm\to_tenured_collector.obj \ vm\tuples.obj \ @@ -70,8 +78,6 @@ DLL_OBJS = vm\os-windows-nt.obj \ .rs.res: rc $< -all: factor.com factor.exe factor.dll.lib libfactor-ffi-test.dll - libfactor-ffi-test.dll: vm/ffi_test.obj link $(LINK_FLAGS) /out:libfactor-ffi-test.dll /dll vm/ffi_test.obj @@ -84,6 +90,22 @@ factor.com: $(EXE_OBJS) $(DLL_OBJS) factor.exe: $(EXE_OBJS) $(DLL_OBJS) link $(LINK_FLAGS) /out:factor.exe /SUBSYSTEM:windows $(EXE_OBJS) $(DLL_OBJS) +all: factor.com factor.exe factor.dll.lib libfactor-ffi-test.dll + +!ENDIF + +default: + @echo Usage: nmake /f Nmakefile platform + @echo Where platform is one of: + @echo x86-32 + @echo x86-64 + +x86-32: + nmake PLATFORM=x86-32 /f Nmakefile all + +x86-64: + nmake PLATFORM=x86-64 /f Nmakefile all + clean: del vm\*.obj del factor.lib @@ -92,6 +114,6 @@ clean: del factor.dll del factor.dll.lib -.PHONY: all clean +.PHONY: all default x86-32 x86-64 clean .SUFFIXES: .rs From ea81faffca3a8d68ad78eea4d4d0ee3f6e70c254 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 8 Apr 2010 18:06:22 -0500 Subject: [PATCH 057/157] Nmakefile: fix 32-bit build --- Nmakefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Nmakefile b/Nmakefile index c8dd98917d..1edc14199d 100755 --- a/Nmakefile +++ b/Nmakefile @@ -15,7 +15,7 @@ PLAF_DLL_OBJS = vm\os-windows-nt-x86.32.obj vm\safeseh.obj PLAF_DLL_OBJS = vm\os-windows-nt-x86.64.obj !ENDIF -ML_FLAGS = /nologo +ML_FLAGS = /nologo /safeseh EXE_OBJS = vm\main-windows-nt.obj vm\factor.res @@ -99,6 +99,7 @@ default: @echo Where platform is one of: @echo x86-32 @echo x86-64 + @exit 1 x86-32: nmake PLATFORM=x86-32 /f Nmakefile all From 618915a084a186ac21fb5864d95ee25e37fc082c Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 8 Apr 2010 16:40:51 -0700 Subject: [PATCH 058/157] mason.child: update for Nmakefile change --- extra/mason/child/child-tests.factor | 2 +- extra/mason/child/child.factor | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/extra/mason/child/child-tests.factor b/extra/mason/child/child-tests.factor index f8046ac8e5..1018a1ec40 100644 --- a/extra/mason/child/child-tests.factor +++ b/extra/mason/child/child-tests.factor @@ -1,7 +1,7 @@ IN: mason.child.tests USING: mason.child mason.config tools.test namespaces io kernel sequences ; -[ { "nmake" "/f" "nmakefile" } ] [ +[ { "nmake" "/f" "nmakefile" "x86-32" } ] [ [ "winnt" target-os set "x86.32" target-cpu set diff --git a/extra/mason/child/child.factor b/extra/mason/child/child.factor index 017e4401d8..d9821f8fcc 100644 --- a/extra/mason/child/child.factor +++ b/extra/mason/child/child.factor @@ -4,13 +4,20 @@ USING: accessors arrays calendar combinators.short-circuit fry continuations debugger io.directories io.files io.launcher io.pathnames io.encodings.ascii kernel make mason.common mason.config mason.platform mason.report mason.notify namespaces sequences -quotations macros system combinators ; +quotations macros system combinators splitting ; IN: mason.child +: nmake-cmd ( -- args ) + { "nmake" "/f" "nmakefile" } + target-cpu get "." split "-" join suffix ; + +: gnu-make-cmd ( -- args ) + gnu-make platform 2array ; + : make-cmd ( -- args ) { - { [ target-os get "winnt" = ] [ { "nmake" "/f" "nmakefile" } ] } - [ gnu-make platform 2array ] + { [ target-os get "winnt" = ] [ nmake-cmd ] } + [ gnu-make-cmd ] } cond ; : make-vm ( -- ) From b86abfb70c35f2909a4d9c0c377e2e256d03984b Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Fri, 9 Apr 2010 23:45:21 -0700 Subject: [PATCH 059/157] Helper words for elf --- extra/elf/elf.factor | 131 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 120 insertions(+), 11 deletions(-) diff --git a/extra/elf/elf.factor b/extra/elf/elf.factor index 539939856d..bf4de754d1 100644 --- a/extra/elf/elf.factor +++ b/extra/elf/elf.factor @@ -1,10 +1,11 @@ ! Copyright (C) 2010 Erik Charlebois. ! See http://factorcode.org/license.txt for BSD license. USING: accessors alien alien.c-types alien.strings alien.syntax arrays -classes.struct io.encodings.ascii kernel locals sequences -specialized-arrays strings typed ; +classes.struct io.encodings.ascii kernel locals math math.intervals +sequences specialized-arrays strings typed ; IN: elf +! FFI data CONSTANT: EI_NIDENT 16 CONSTANT: EI_MAG0 0 CONSTANT: EI_MAG1 1 @@ -459,10 +460,15 @@ STRUCT: Elf64_Dyn { d_tag Elf64_Sxword } { d_val Elf64_Xword } ; -SPECIALIZED-ARRAYS: Elf32_Shdr Elf64_Shdr uchar ; +! Low-level interface +SPECIALIZED-ARRAYS: Elf32_Shdr Elf64_Shdr Elf32_Sym Elf64_Sym Elf32_Phdr Elf64_Phdr uchar ; UNION: Elf32/64_Ehdr Elf32_Ehdr Elf64_Ehdr ; UNION: Elf32/64_Shdr Elf32_Shdr Elf64_Shdr ; UNION: Elf32/64_Shdr-array Elf32_Shdr-array Elf64_Shdr-array ; +UNION: Elf32/64_Sym Elf32_Sym Elf64_Sym ; +UNION: Elf32/64_Sym-array Elf32_Sym-array Elf64_Sym-array ; +UNION: Elf32/64_Phdr Elf32_Phdr Elf64_Phdr ; +UNION: Elf32/64_Phdr-array Elf32_Phdr-array Elf64_Phdr-array ; TYPED: 64-bit? ( elf: Elf32/64_Ehdr -- ? ) e_ident>> EI_CLASS swap nth ELFCLASS64 = ; @@ -479,25 +485,128 @@ TYPED:: elf-section-headers ( elf: Elf32/64_Ehdr -- headers: Elf32/64_Shdr-array [ ] [ ] if ; +TYPED:: elf-program-headers ( elf: Elf32/64_Ehdr -- headers: Elf32/64_Phdr-array ) + elf [ e_phoff>> ] [ e_phnum>> ] bi :> ( off num ) + off elf >c-ptr num + elf 64-bit? + [ ] + [ ] if ; + +TYPED: elf-loadable-segments ( headers: Elf32/64_Phdr-array -- headers: Elf32/64_Phdr-array ) + [ p_type>> PT_LOAD = ] filter ; + +TYPED:: elf-segment-sections ( segment: Elf32/64_Phdr sections: Elf32/64_Shdr-array -- sections ) + segment [ p_offset>> dup ] [ p_filesz>> + ] bi [a,b) :> segment-interval + sections [ dup [ sh_offset>> dup ] [ sh_size>> + ] bi [a,b) 2array ] { } map-as :> section-intervals + section-intervals [ second segment-interval interval-intersect empty-interval = not ] + filter [ first ] map ; + +TYPED:: virtual-address-segment ( elf: Elf32/64_Ehdr address -- program-header/f ) + elf elf-program-headers elf-loadable-segments [ + [ p_vaddr>> dup ] [ p_memsz>> + ] bi [a,b) + address swap interval-contains? + ] filter [ f ] [ first ] if-empty ; + +TYPED:: virtual-address-section ( elf: Elf32/64_Ehdr address -- section-header/f ) + elf address virtual-address-segment :> segment + segment elf elf-section-headers elf-segment-sections :> sections + address segment p_vaddr>> - segment p_offset>> + :> faddress + sections [ + [ sh_offset>> dup ] [ sh_size>> + ] bi [a,b) + faddress swap interval-contains? + ] filter [ f ] [ first ] if-empty ; + +TYPED:: elf-segment-data ( elf: Elf32/64_Ehdr header: Elf32/64_Phdr -- uchar-array/f ) + header [ p_offset>> elf >c-ptr ] [ p_filesz>> ] bi ; + TYPED:: elf-section-data ( elf: Elf32/64_Ehdr header: Elf32/64_Shdr -- uchar-array/f ) header [ sh_offset>> elf >c-ptr ] [ sh_size>> ] bi ; +TYPED:: elf-section-data-by-index ( elf: Elf32/64_Ehdr index -- header/f uchar-array/f ) + elf elf-section-headers :> sections + index sections nth :> header + elf header elf-section-data :> data + header data ; + +TYPED:: elf-section-name ( elf: Elf32/64_Ehdr header: Elf32/64_Shdr -- name: string ) + elf elf e_shstrndx>> elf-section-data-by-index nip >c-ptr :> section-names + header sh_name>> section-names ascii alien>string ; + TYPED:: elf-section-data-by-name ( elf: Elf32/64_Ehdr name: string -- header/f uchar-array/f ) elf elf-section-headers :> sections elf e_shstrndx>> :> ndx elf ndx sections nth elf-section-data >c-ptr :> section-names - sections 1 tail [ sh_name>> section-names ascii alien>string name = ] find nip - [ dup elf swap elf-section-data ] [ f f ] if* ; -TYPED:: elf-section-names ( elf: Elf32/64_Ehdr -- names ) - elf elf-section-headers :> sections - elf ".shstrtab" elf-section-data-by-name nip >c-ptr :> section-names - sections 1 tail [ - sh_name>> section-names - ascii alien>string +TYPED:: elf-sections ( elf: Elf32/64_Ehdr -- sections ) + elf elf-section-headers :> sections + elf elf e_shstrndx>> elf-section-data-by-index nip >c-ptr :> section-names + sections [ + [ sh_name>> section-names + ascii alien>string ] keep 2array ] { } map-as ; + +TYPED:: elf-symbols ( elf: Elf32/64_Ehdr section-data: uchar-array -- symbols ) + elf ".strtab" elf-section-data-by-name nip >c-ptr :> strings + section-data [ >c-ptr ] [ length ] bi + elf 64-bit? + [ Elf64_Sym heap-size / ] + [ Elf32_Sym heap-size / ] if + [ [ st_name>> strings ascii alien>string ] keep 2array ] { } map-as ; + +! High level interface +TUPLE: elf elf-header ; +TUPLE: section name elf-header section-header data ; +TUPLE: segment elf-header program-header data ; +TUPLE: symbol name elf-header sym data ; + +GENERIC: sections ( obj -- sections ) + +: ( c-ptr -- elf ) + elf-header elf boa ; + +M:: elf sections ( elf -- sections ) + elf elf-header>> elf-sections + [ + first2 :> ( name header ) + elf elf-header>> header elf-section-data :> data + name elf elf-header>> header data section boa + ] { } map-as ; + +:: segments ( elf -- segments ) + elf elf-header>> elf-program-headers + [| header | + elf elf-header>> header elf-segment-data :> data + elf elf-header>> header data segment boa + ] { } map-as ; + +M:: segment sections ( segment -- sections ) + segment program-header>> + segment elf-header>> elf-section-headers + elf-segment-sections + + [| header | + segment elf-header>> header elf-section-name :> name + segment elf-header>> header elf-section-data :> data + name segment elf-header>> header data section boa + ] { } map-as ; + +:: symbols ( section -- symbols ) + section elf-header>> + section data>> + elf-symbols + [ + first2 :> ( name sym ) + name section elf-header>> sym f symbol boa + ] { } map-as ; + +:: symbol-data ( symbol -- data ) + symbol [ elf-header>> ] [ sym>> st_value>> ] bi virtual-address-segment :> segment + symbol sym>> st_value>> segment p_vaddr>> - segment p_offset>> + :> faddress + faddress symbol elf-header>> >c-ptr + symbol sym>> st_size>> ; + From edc489f4c1d4027bce84c658332ec565fdd7289a Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Fri, 9 Apr 2010 23:48:22 -0700 Subject: [PATCH 060/157] Change C-ENUM: to always take a type. Use f for anonymous enums. Update all uses. --- basis/alien/data/data-docs.factor | 2 +- basis/alien/parser/parser.factor | 21 ++- basis/alien/syntax/syntax-docs.factor | 17 +-- basis/alien/syntax/syntax.factor | 18 +-- basis/cairo/ffi/ffi.factor | 39 ++---- basis/core-graphics/core-graphics.factor | 3 +- basis/pango/fonts/fonts.factor | 3 +- basis/windows/advapi32/advapi32.factor | 3 +- basis/windows/ddk/winusb/winusb.factor | 3 +- .../directx/d3d11shader/d3d11shader.factor | 10 +- .../directx/d3d9types/d3d9types.factor | 3 +- basis/windows/directx/d3dcsx/d3dcsx.factor | 3 +- .../directx/d3dx9shader/d3dx9shader.factor | 6 +- basis/windows/directx/dcommon/dcommon.factor | 8 +- basis/windows/directx/dwrite/dwrite.factor | 126 ++++++++---------- .../windows/directx/dxgitype/dxgitype.factor | 30 ++--- basis/windows/directx/xapo/xapo.factor | 7 +- basis/windows/kernel32/kernel32.factor | 4 +- basis/windows/usp10/usp10.factor | 33 ++--- basis/x11/constants/constants.factor | 2 +- extra/chipmunk/ffi/ffi.factor | 6 +- extra/freetype/freetype.factor | 4 +- extra/libusb/libusb.factor | 3 +- extra/llvm/core/core.factor | 72 +++++----- extra/macho/macho.factor | 9 +- extra/tokyo/alien/tcadb/tcadb.factor | 2 +- extra/tokyo/alien/tcbdb/tcbdb.factor | 2 +- extra/tokyo/alien/tcrdb/tcrdb.factor | 2 +- extra/tokyo/alien/tctdb/tctdb.factor | 6 +- extra/tokyo/alien/tcutil/tcutil.factor | 2 +- unmaintained/cryptlib/libcl/libcl.factor | 2 +- unmaintained/pdf/libhpdf/libhpdf.factor | 2 +- 32 files changed, 200 insertions(+), 253 deletions(-) diff --git a/basis/alien/data/data-docs.factor b/basis/alien/data/data-docs.factor index e34b1ba4fa..d36a4d5fd2 100644 --- a/basis/alien/data/data-docs.factor +++ b/basis/alien/data/data-docs.factor @@ -105,7 +105,7 @@ $nl "Important guidelines for passing data in byte arrays:" { $subsections "byte-arrays-gc" } "C-style enumerated types are supported:" -{ $subsections POSTPONE: C-ENUM: POSTPONE: C-TYPED-ENUM: } +{ $subsections POSTPONE: C-ENUM: } "C types can be aliased for convenience and consistency with native library documentation:" { $subsections POSTPONE: TYPEDEF: } "A utility for defining " { $link "destructors" } " for deallocating memory:" diff --git a/basis/alien/parser/parser.factor b/basis/alien/parser/parser.factor index 4c5f5dbd6a..0891caa04a 100644 --- a/basis/alien/parser/parser.factor +++ b/basis/alien/parser/parser.factor @@ -4,7 +4,7 @@ USING: accessors alien alien.c-types alien.libraries arrays assocs classes combinators combinators.short-circuit compiler.units effects grouping kernel parser sequences splitting words fry locals lexer namespaces summary math -vocabs.parser ; +vocabs.parser words.constant ; IN: alien.parser : parse-c-type-name ( name -- word ) @@ -51,14 +51,17 @@ ERROR: *-in-c-type-name name ; dup "*" tail? [ *-in-c-type-name ] when ; -: CREATE-C-TYPE ( -- word ) - scan validate-c-type-name current-vocab create { +: (CREATE-C-TYPE) ( word -- word ) + validate-c-type-name current-vocab create { [ fake-definition ] [ set-word ] [ reset-c-type ] [ ] } cleave ; +: CREATE-C-TYPE ( -- word ) + scan (CREATE-C-TYPE) ; + > return-type-name CHAR: * suffix ; PRIVATE> +: define-enum-member ( word-string value -- next-value ) + [ create-in ] dip [ define-constant ] keep 1 + ; + +: parse-enum-member ( word-string value -- next-value ) + over "{" = + [ 2drop scan scan-object define-enum-member "}" expect ] + [ define-enum-member ] if ; + +: parse-enum-members ( counter -- ) + scan dup ";" = not + [ swap parse-enum-member parse-enum-members ] [ 2drop ] if ; + : scan-function-name ( -- return function ) scan-c-type scan parse-pointers ; diff --git a/basis/alien/syntax/syntax-docs.factor b/basis/alien/syntax/syntax-docs.factor index 2a8e1b2714..df20926480 100644 --- a/basis/alien/syntax/syntax-docs.factor +++ b/basis/alien/syntax/syntax-docs.factor @@ -58,28 +58,17 @@ HELP: TYPEDEF: { $notes "This word differs from " { $link typedef } " in that it runs at parse time, to ensure correct ordering of operations when loading source files. Words defined in source files are compiled before top-level forms are run, so if a source file defines C binding words and uses " { $link typedef } ", the type alias won't be available at compile time." } ; HELP: C-ENUM: -{ $syntax "C-ENUM: words... ;" } -{ $values { "words" "a sequence of word names" } } +{ $syntax "C-ENUM: type/f words... ;" } +{ $values { "type" "a name to typedef to int or f" } { "words" "a sequence of word names" } } { $description "Creates a sequence of word definitions in the current vocabulary. Each word pushes an integer according to the rules of C enums." } { $notes "This word emulates a C-style " { $snippet "enum" } " in Factor. While this feature can be used for any purpose, using integer constants is discouraged unless it is for interfacing with C libraries. Factor code should use " { $link "words.symbol" } " or " { $link "singletons" } " instead." } { $examples "Here is an example enumeration definition:" - { $code "C-ENUM: red { green 3 } blue ;" } + { $code "C-ENUM: color_t red { green 3 } blue ;" } "It is equivalent to the following series of definitions:" { $code "CONSTANT: red 0" "CONSTANT: green 3" "CONSTANT: blue 4" } } ; -HELP: C-TYPED-ENUM: -{ $syntax "C-TYPED-ENUM: foo_t FOO BAR { BAZ 4 } BOL ;" } -{ $description "Typedefs the first word as an int and creates a sequence of word definitions in the current vocabulary. Each word pushes an integer according to the rules of C enums." } -{ $notes "This word emulates a C-style " { $snippet "enum" } " in Factor. While this feature can be used for any purpose, using integer constants is discouraged unless it is for interfacing with C libraries. Factor code should use " { $link "words.symbol" } " or " { $link "singletons" } " instead." } -{ $examples - "Here is an example enumeration definition:" - { $code "C-TYPED-ENUM: color_t red { green 3 } blue ;" } - "It is equivalent to the following series of definitions:" - { $code "TYPEDEF: int color_t" "CONSTANT: red 0" "CONSTANT: green 3" "CONSTANT: blue 4" } -} ; - HELP: C-TYPE: { $syntax "C-TYPE: type" } { $values { "type" "a new C type" } } diff --git a/basis/alien/syntax/syntax.factor b/basis/alien/syntax/syntax.factor index f7cff225c5..00148a82d4 100644 --- a/basis/alien/syntax/syntax.factor +++ b/basis/alien/syntax/syntax.factor @@ -24,19 +24,11 @@ SYNTAX: CALLBACK: SYNTAX: TYPEDEF: scan-c-type CREATE-C-TYPE dup save-location typedef ; -: define-enum-members ( counter -- ) - scan dup ";" = not [ - dup "{" = - [ 2drop scan create-in scan-word [ define-constant ] keep "}" expect ] - [ create-in swap [ define-constant ] keep ] - if 1 + define-enum-members - ] [ 2drop ] if ; - -SYNTAX: C-ENUM: 0 define-enum-members ; - -SYNTAX: C-TYPED-ENUM: - int CREATE-C-TYPE dup save-location typedef - 0 define-enum-members ; +SYNTAX: C-ENUM: + scan dup "f" = + [ drop ] + [ (CREATE-C-TYPE) dup save-location int swap typedef ] if + 0 parse-enum-members ; SYNTAX: C-TYPE: void CREATE-C-TYPE typedef ; diff --git a/basis/cairo/ffi/ffi.factor b/basis/cairo/ffi/ffi.factor index c4700d2dad..42b281c33c 100644 --- a/basis/cairo/ffi/ffi.factor +++ b/basis/cairo/ffi/ffi.factor @@ -44,8 +44,7 @@ TYPEDEF: void* cairo_destroy_func_t STRUCT: cairo_user_data_key_t { unused int } ; -TYPEDEF: int cairo_status_t -C-ENUM: +C-ENUM: cairo_status_t CAIRO_STATUS_SUCCESS CAIRO_STATUS_NO_MEMORY CAIRO_STATUS_INVALID_RESTORE @@ -125,8 +124,7 @@ FUNCTION: void cairo_pop_group_to_source ( cairo_t* cr ) ; ! Modify state -TYPEDEF: int cairo_operator_t -C-ENUM: +C-ENUM: cairo_operator_t CAIRO_OPERATOR_CLEAR CAIRO_OPERATOR_SOURCE @@ -163,8 +161,7 @@ cairo_set_source_surface ( cairo_t* cr, cairo_surface_t* surface, double x, doub FUNCTION: void cairo_set_tolerance ( cairo_t* cr, double tolerance ) ; -TYPEDEF: int cairo_antialias_t -C-ENUM: +C-ENUM: cairo_antialias_t CAIRO_ANTIALIAS_DEFAULT CAIRO_ANTIALIAS_NONE CAIRO_ANTIALIAS_GRAY @@ -173,8 +170,7 @@ C-ENUM: FUNCTION: void cairo_set_antialias ( cairo_t* cr, cairo_antialias_t antialias ) ; -TYPEDEF: int cairo_fill_rule_t -C-ENUM: +C-ENUM: cairo_fill_rule_t CAIRO_FILL_RULE_WINDING CAIRO_FILL_RULE_EVEN_ODD ; @@ -184,8 +180,7 @@ cairo_set_fill_rule ( cairo_t* cr, cairo_fill_rule_t fill_rule ) ; FUNCTION: void cairo_set_line_width ( cairo_t* cr, double width ) ; -TYPEDEF: int cairo_line_cap_t -C-ENUM: +C-ENUM: cairo_line_cap_t CAIRO_LINE_CAP_BUTT CAIRO_LINE_CAP_ROUND CAIRO_LINE_CAP_SQUARE ; @@ -193,8 +188,7 @@ C-ENUM: FUNCTION: void cairo_set_line_cap ( cairo_t* cr, cairo_line_cap_t line_cap ) ; -TYPEDEF: int cairo_line_join_t -C-ENUM: +C-ENUM: cairo_line_join_t CAIRO_LINE_JOIN_MITER CAIRO_LINE_JOIN_ROUND CAIRO_LINE_JOIN_BEVEL ; @@ -379,35 +373,30 @@ STRUCT: cairo_font_extents_t { max_x_advance double } { max_y_advance double } ; -TYPEDEF: int cairo_font_slant_t -C-ENUM: +C-ENUM: cairo_font_slant_t CAIRO_FONT_SLANT_NORMAL CAIRO_FONT_SLANT_ITALIC CAIRO_FONT_SLANT_OBLIQUE ; -TYPEDEF: int cairo_font_weight_t -C-ENUM: +C-ENUM: cairo_font_weight_t CAIRO_FONT_WEIGHT_NORMAL CAIRO_FONT_WEIGHT_BOLD ; -TYPEDEF: int cairo_subpixel_order_t -C-ENUM: +C-ENUM: cairo_subpixel_order_t CAIRO_SUBPIXEL_ORDER_DEFAULT CAIRO_SUBPIXEL_ORDER_RGB CAIRO_SUBPIXEL_ORDER_BGR CAIRO_SUBPIXEL_ORDER_VRGB CAIRO_SUBPIXEL_ORDER_VBGR ; -TYPEDEF: int cairo_hint_style_t -C-ENUM: +C-ENUM: cairo_hint_Style_t CAIRO_HINT_STYLE_DEFAULT CAIRO_HINT_STYLE_NONE CAIRO_HINT_STYLE_SLIGHT CAIRO_HINT_STYLE_MEDIUM CAIRO_HINT_STYLE_FULL ; -TYPEDEF: int cairo_hint_metrics_t -C-ENUM: +C-ENUM: cairo_hint_metrics_t CAIRO_HINT_METRICS_DEFAULT CAIRO_HINT_METRICS_OFF CAIRO_HINT_METRICS_ON ; @@ -527,8 +516,7 @@ cairo_font_face_get_reference_count ( cairo_font_face_t* font_face ) ; FUNCTION: cairo_status_t cairo_font_face_status ( cairo_font_face_t* font_face ) ; -TYPEDEF: int cairo_font_type_t -C-ENUM: +C-ENUM: cairo_font_type_t CAIRO_FONT_TYPE_TOY CAIRO_FONT_TYPE_FT CAIRO_FONT_TYPE_WIN32 @@ -640,8 +628,7 @@ cairo_get_target ( cairo_t* cr ) ; FUNCTION: cairo_surface_t* cairo_get_group_target ( cairo_t* cr ) ; -TYPEDEF: int cairo_path_data_type_t -C-ENUM: +C-ENUM: cairo_path_data_type_t CAIRO_PATH_MOVE_TO CAIRO_PATH_LINE_TO CAIRO_PATH_CURVE_TO diff --git a/basis/core-graphics/core-graphics.factor b/basis/core-graphics/core-graphics.factor index 1b7693da14..92925f5d64 100644 --- a/basis/core-graphics/core-graphics.factor +++ b/basis/core-graphics/core-graphics.factor @@ -6,8 +6,7 @@ images images.memory core-graphics.types core-foundation.utilities opengl.gl literals ; IN: core-graphics -! CGImageAlphaInfo -C-ENUM: +C-ENUM: CGImageAlphaInfo kCGImageAlphaNone kCGImageAlphaPremultipliedLast kCGImageAlphaPremultipliedFirst diff --git a/basis/pango/fonts/fonts.factor b/basis/pango/fonts/fonts.factor index c2a7ef128d..7ea4e0a0c2 100644 --- a/basis/pango/fonts/fonts.factor +++ b/basis/pango/fonts/fonts.factor @@ -8,8 +8,7 @@ IN: pango.fonts LIBRARY: pango -TYPEDEF: int PangoStyle -C-ENUM: +C-ENUM: PangoStyle PANGO_STYLE_NORMAL PANGO_STYLE_OBLIQUE PANGO_STYLE_ITALIC ; diff --git a/basis/windows/advapi32/advapi32.factor b/basis/windows/advapi32/advapi32.factor index 72769971e6..1e6a1c0b0b 100755 --- a/basis/windows/advapi32/advapi32.factor +++ b/basis/windows/advapi32/advapi32.factor @@ -146,8 +146,7 @@ CONSTANT: TokenSessionReference 14 CONSTANT: TokenSandBoxInert 15 ! } TOKEN_INFORMATION_CLASS; -TYPEDEF: DWORD ACCESS_MODE -C-ENUM: +C-ENUM: ACCESS_MODE NOT_USED_ACCESS GRANT_ACCESS SET_ACCESS diff --git a/basis/windows/ddk/winusb/winusb.factor b/basis/windows/ddk/winusb/winusb.factor index 3b98e7e8ca..5e43b7f884 100644 --- a/basis/windows/ddk/winusb/winusb.factor +++ b/basis/windows/ddk/winusb/winusb.factor @@ -22,12 +22,11 @@ STRUCT: USB_INTERFACE_DESCRIPTOR { iInterface UCHAR } ; TYPEDEF: USB_INTERFACE_DESCRIPTOR* PUSB_INTERFACE_DESCRIPTOR -C-ENUM: +C-ENUM: USBD_PIPE_TYPE UsbdPipeTypeControl UsbdPipeTypeIsochronous UsbdPipeTypeBulk UsbdPipeTypeInterrupt ; -TYPEDEF: int USBD_PIPE_TYPE STRUCT: WINUSB_PIPE_INFORMATION { PipeType USBD_PIPE_TYPE } diff --git a/basis/windows/directx/d3d11shader/d3d11shader.factor b/basis/windows/directx/d3d11shader/d3d11shader.factor index 02ab9bb177..08146300f2 100644 --- a/basis/windows/directx/d3d11shader/d3d11shader.factor +++ b/basis/windows/directx/d3d11shader/d3d11shader.factor @@ -24,11 +24,11 @@ CONSTANT: D3D11_RETURN_TYPE_DOUBLE 7 CONSTANT: D3D11_RETURN_TYPE_CONTINUED 8 TYPEDEF: int D3D11_RESOURCE_RETURN_TYPE -C-ENUM: D3D11_CT_CBUFFER - D3D11_CT_TBUFFER - D3D11_CT_INTERFACE_POINTERS - D3D11_CT_RESOURCE_BIND_INFO ; -TYPEDEF: int D3D11_CBUFFER_TYPE +C-ENUM: D3D11_CBUFFER_TYPE + D3D11_CT_CBUFFER + D3D11_CT_TBUFFER + D3D11_CT_INTERFACE_POINTERS + D3D11_CT_RESOURCE_BIND_INFO ; TYPEDEF: D3D11_CBUFFER_TYPE* LPD3D11_CBUFFER_TYPE STRUCT: D3D11_SIGNATURE_PARAMETER_DESC diff --git a/basis/windows/directx/d3d9types/d3d9types.factor b/basis/windows/directx/d3d9types/d3d9types.factor index 618d3c79e5..ad2d4a8279 100644 --- a/basis/windows/directx/d3d9types/d3d9types.factor +++ b/basis/windows/directx/d3d9types/d3d9types.factor @@ -502,8 +502,7 @@ CONSTANT: MAXD3DDECLUSAGE 13 CONSTANT: MAXD3DDECLUSAGEINDEX 15 CONSTANT: MAXD3DDECLLENGTH 64 -TYPEDEF: int D3DDECLMETHOD -C-ENUM: +C-ENUM: D3DDECLMETHOD D3DDECLMETHOD_DEFAULT D3DDECLMETHOD_PARTIALU D3DDECLMETHOD_PARTIALV diff --git a/basis/windows/directx/d3dcsx/d3dcsx.factor b/basis/windows/directx/d3dcsx/d3dcsx.factor index c2d3af8cf3..c6d0105fdc 100644 --- a/basis/windows/directx/d3dcsx/d3dcsx.factor +++ b/basis/windows/directx/d3dcsx/d3dcsx.factor @@ -48,10 +48,9 @@ COM-INTERFACE: ID3DX11FFT IUnknown {b3f7a938-4c93-4310-a675-b30d6de50553} HRESULT ForwardTransform ( ID3D11UnorderedAccessView* pInputBuffer, ID3D11UnorderedAccessView** ppOutputBuffer ) HRESULT InverseTransform ( ID3D11UnorderedAccessView* pInputBuffer, ID3D11UnorderedAccessView** ppOutputBuffer ) ; -C-ENUM: +C-ENUM: D3DX11_FFT_DATA_TYPE D3DX11_FFT_DATA_TYPE_REAL D3DX11_FFT_DATA_TYPE_COMPLEX ; -TYPEDEF: int D3DX11_FFT_DATA_TYPE CONSTANT: D3DX11_FFT_DIM_MASK_1D 1 CONSTANT: D3DX11_FFT_DIM_MASK_2D 3 diff --git a/basis/windows/directx/d3dx9shader/d3dx9shader.factor b/basis/windows/directx/d3dx9shader/d3dx9shader.factor index 12ba902fc5..4490acc7c9 100644 --- a/basis/windows/directx/d3dx9shader/d3dx9shader.factor +++ b/basis/windows/directx/d3dx9shader/d3dx9shader.factor @@ -41,22 +41,20 @@ STRUCT: D3DXSEMANTIC { UsageIndex UINT } ; TYPEDEF: D3DXSEMANTIC* LPD3DXSEMANTIC -C-ENUM: +C-ENUM: D3DXREGISTER_SET D3DXRS_BOOL D3DXRS_INT4 D3DXRS_FLOAT4 D3DXRS_SAMPLER ; -TYPEDEF: int D3DXREGISTER_SET TYPEDEF: D3DXREGISTER_SET* LPD3DXREGISTER_SET -C-ENUM: +C-ENUM: D3DXPARAMETER_CLASS D3DXPC_SCALAR D3DXPC_VECTOR D3DXPC_MATRIX_ROWS D3DXPC_MATRIX_COLUMNS D3DXPC_OBJECT D3DXPC_STRUCT ; -TYPEDEF: int D3DXPARAMETER_CLASS TYPEDEF: D3DXPARAMETER_CLASS* LPD3DXPARAMETER_CLASS C-ENUM: diff --git a/basis/windows/directx/dcommon/dcommon.factor b/basis/windows/directx/dcommon/dcommon.factor index 3b80bd4509..32d69f924c 100644 --- a/basis/windows/directx/dcommon/dcommon.factor +++ b/basis/windows/directx/dcommon/dcommon.factor @@ -1,7 +1,7 @@ USING: alien.c-types alien.syntax ; IN: windows.directx.dcommon -C-ENUM: DWRITE_MEASURING_MODE_NATURAL - DWRITE_MEASURING_MODE_GDI_CLASSIC - DWRITE_MEASURING_MODE_GDI_NATURAL ; -TYPEDEF: int DWRITE_MEASURING_MODE +C-ENUM: DWRITE_MEASURING_MODE + DWRITE_MEASURING_MODE_NATURAL + DWRITE_MEASURING_MODE_GDI_CLASSIC + DWRITE_MEASURING_MODE_GDI_NATURAL ; diff --git a/basis/windows/directx/dwrite/dwrite.factor b/basis/windows/directx/dwrite/dwrite.factor index 3e4167ebad..3d635a0dc4 100644 --- a/basis/windows/directx/dwrite/dwrite.factor +++ b/basis/windows/directx/dwrite/dwrite.factor @@ -5,7 +5,7 @@ IN: windows.directx.dwrite LIBRARY: dwrite -C-ENUM: +C-ENUM: DWRITE_FONT_FILE_TYPE DWRITE_FONT_FILE_TYPE_UNKNOWN DWRITE_FONT_FILE_TYPE_CFF DWRITE_FONT_FILE_TYPE_TRUETYPE @@ -14,9 +14,8 @@ C-ENUM: DWRITE_FONT_FILE_TYPE_TYPE1_PFB DWRITE_FONT_FILE_TYPE_VECTOR DWRITE_FONT_FILE_TYPE_BITMAP ; -TYPEDEF: int DWRITE_FONT_FILE_TYPE -C-ENUM: +C-ENUM: DWRITE_FONT_FACE_TYPE DWRITE_FONT_FACE_TYPE_CFF DWRITE_FONT_FACE_TYPE_TRUETYPE DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION @@ -24,51 +23,49 @@ C-ENUM: DWRITE_FONT_FACE_TYPE_VECTOR DWRITE_FONT_FACE_TYPE_BITMAP DWRITE_FONT_FACE_TYPE_UNKNOWN ; -TYPEDEF: int DWRITE_FONT_FACE_TYPE -CONSTANT: DWRITE_FONT_SIMULATIONS_NONE 0 -CONSTANT: DWRITE_FONT_SIMULATIONS_BOLD 1 -CONSTANT: DWRITE_FONT_SIMULATIONS_OBLIQUE 2 -TYPEDEF: int DWRITE_FONT_SIMULATIONS +C-ENUM: DWRITE_FONT_SIMULATIONS + DWRITE_FONT_SIMULATIONS_NONE + DWRITE_FONT_SIMULATIONS_BOLD + DWRITE_FONT_SIMULATIONS_OBLIQUE ; -CONSTANT: DWRITE_FONT_WEIGHT_THIN 100 -CONSTANT: DWRITE_FONT_WEIGHT_EXTRA_LIGHT 200 -CONSTANT: DWRITE_FONT_WEIGHT_ULTRA_LIGHT 200 -CONSTANT: DWRITE_FONT_WEIGHT_LIGHT 300 -CONSTANT: DWRITE_FONT_WEIGHT_NORMAL 400 -CONSTANT: DWRITE_FONT_WEIGHT_REGULAR 400 -CONSTANT: DWRITE_FONT_WEIGHT_MEDIUM 500 -CONSTANT: DWRITE_FONT_WEIGHT_DEMI_BOLD 600 -CONSTANT: DWRITE_FONT_WEIGHT_SEMI_BOLD 600 -CONSTANT: DWRITE_FONT_WEIGHT_BOLD 700 -CONSTANT: DWRITE_FONT_WEIGHT_EXTRA_BOLD 800 -CONSTANT: DWRITE_FONT_WEIGHT_ULTRA_BOLD 800 -CONSTANT: DWRITE_FONT_WEIGHT_BLACK 900 -CONSTANT: DWRITE_FONT_WEIGHT_HEAVY 900 -CONSTANT: DWRITE_FONT_WEIGHT_EXTRA_BLACK 950 -CONSTANT: DWRITE_FONT_WEIGHT_ULTRA_BLACK 950 -TYPEDEF: int DWRITE_FONT_WEIGHT +C-ENUM: DWRITE_FONT_WEIGHT + { DWRITE_FONT_WEIGHT_THIN 100 } + { DWRITE_FONT_WEIGHT_EXTRA_LIGHT 200 } + { DWRITE_FONT_WEIGHT_ULTRA_LIGHT 200 } + { DWRITE_FONT_WEIGHT_LIGHT 300 } + { DWRITE_FONT_WEIGHT_NORMAL 400 } + { DWRITE_FONT_WEIGHT_REGULAR 400 } + { DWRITE_FONT_WEIGHT_MEDIUM 500 } + { DWRITE_FONT_WEIGHT_DEMI_BOLD 600 } + { DWRITE_FONT_WEIGHT_SEMI_BOLD 600 } + { DWRITE_FONT_WEIGHT_BOLD 700 } + { DWRITE_FONT_WEIGHT_EXTRA_BOLD 800 } + { DWRITE_FONT_WEIGHT_ULTRA_BOLD 800 } + { DWRITE_FONT_WEIGHT_BLACK 900 } + { DWRITE_FONT_WEIGHT_HEAVY 900 } + { DWRITE_FONT_WEIGHT_EXTRA_BLACK 950 } + { DWRITE_FONT_WEIGHT_ULTRA_BLACK 950 } ; -CONSTANT: DWRITE_FONT_STRETCH_UNDEFINED 0 -CONSTANT: DWRITE_FONT_STRETCH_ULTRA_CONDENSED 1 -CONSTANT: DWRITE_FONT_STRETCH_EXTRA_CONDENSED 2 -CONSTANT: DWRITE_FONT_STRETCH_CONDENSED 3 -CONSTANT: DWRITE_FONT_STRETCH_SEMI_CONDENSED 4 -CONSTANT: DWRITE_FONT_STRETCH_NORMAL 5 -CONSTANT: DWRITE_FONT_STRETCH_MEDIUM 5 -CONSTANT: DWRITE_FONT_STRETCH_SEMI_EXPANDED 6 -CONSTANT: DWRITE_FONT_STRETCH_EXPANDED 7 -CONSTANT: DWRITE_FONT_STRETCH_EXTRA_EXPANDED 8 -CONSTANT: DWRITE_FONT_STRETCH_ULTRA_EXPANDED 9 -TYPEDEF: int DWRITE_FONT_STRETCH +C-ENUM: DWRITE_FONT_STRETCH + { DWRITE_FONT_STRETCH_UNDEFINED 0 } + { DWRITE_FONT_STRETCH_ULTRA_CONDENSED 1 } + { DWRITE_FONT_STRETCH_EXTRA_CONDENSED 2 } + { DWRITE_FONT_STRETCH_CONDENSED 3 } + { DWRITE_FONT_STRETCH_SEMI_CONDENSED 4 } + { DWRITE_FONT_STRETCH_NORMAL 5 } + { DWRITE_FONT_STRETCH_MEDIUM 5 } + { DWRITE_FONT_STRETCH_SEMI_EXPANDED 6 } + { DWRITE_FONT_STRETCH_EXPANDED 7 } + { DWRITE_FONT_STRETCH_EXTRA_EXPANDED 8 } + { DWRITE_FONT_STRETCH_ULTRA_EXPANDED 9 } ; -C-ENUM: +C-ENUM: DWRITE_FONT_STYLE DWRITE_FONT_STYLE_NORMAL DWRITE_FONT_STYLE_OBLIQUE DWRITE_FONT_STYLE_ITALIC ; -TYPEDEF: int DWRITE_FONT_STYLE -C-ENUM: +C-ENUM: DWRITE_INFORMATIONAL_STRING_ID DWRITE_INFORMATIONAL_STRING_NONE DWRITE_INFORMATIONAL_STRING_COPYRIGHT_NOTICE DWRITE_INFORMATIONAL_STRING_VERSION_STRINGS @@ -85,7 +82,6 @@ C-ENUM: DWRITE_INFORMATIONAL_STRING_PREFERRED_FAMILY_NAMES DWRITE_INFORMATIONAL_STRING_PREFERRED_SUBFAMILY_NAMES DWRITE_INFORMATIONAL_STRING_SAMPLE_TEXT ; -TYPEDEF: int DWRITE_INFORMATIONAL_STRING_ID STRUCT: DWRITE_FONT_METRICS { designUnitsPerEm USHORT } @@ -112,10 +108,9 @@ STRUCT: DWRITE_GLYPH_OFFSET { advanceOffset FLOAT } { ascenderOffset FLOAT } ; -C-ENUM: +C-ENUM: DWRITE_FACTORY_TYPE DWRITE_FACTORY_TYPE_SHARED DWRITE_FACTORY_TYPE_ISOLATED ; -TYPEDEF: int DWRITE_FACTORY_TYPE C-TYPE: IDWriteFontFileStream @@ -138,14 +133,12 @@ COM-INTERFACE: IDWriteFontFile IUnknown {739d886a-cef5-47dc-8769-1a8b41bebbb0} HRESULT GetLoader ( IDWriteFontFileLoader** fontFileLoader ) HRESULT Analyze ( BOOL* isSupportedFontType, DWRITE_FONT_FILE_TYPE* fontFileType, DWRITE_FONT_FACE_TYPE* fontFaceType, UINT32* numberOfFaces ) ; -TYPEDEF: int DWRITE_PIXEL_GEOMETRY -C-ENUM: +C-ENUM: DWRITE_PIXEL_GEOMETRY DWRITE_PIXEL_GEOMETRY_FLAT DWRITE_PIXEL_GEOMETRY_RGB DWRITE_PIXEL_GEOMETRY_BGR ; -TYPEDEF: int DWRITE_RENDERING_MODE -C-ENUM: +C-ENUM: DWRITE_RENDERING_MODE DWRITE_RENDERING_MODE_DEFAULT DWRITE_RENDERING_MODE_ALIASED DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC @@ -240,39 +233,32 @@ COM-INTERFACE: IDWriteFont IUnknown {acd16696-8c14-4f5d-877e-fe3fc1d32737} HRESULT HasCharacter ( UINT32 unicodeValue, BOOL* exists ) HRESULT CreateFontFace ( IDWriteFontFace** fontFace ) ; -TYPEDEF: int DWRITE_READING_DIRECTION -C-ENUM: +C-ENUM: DWRITE_READING_DRECTION DWRITE_READING_DIRECTION_LEFT_TO_RIGHT DWRITE_READING_DIRECTION_RIGHT_TO_LEFT ; -TYPEDEF: int DWRITE_FLOW_DIRECTION -C-ENUM: +C-ENUM: DWRITE_FLOW_DIRECTION DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM ; -TYPEDEF: int DWRITE_TEXT_ALIGNMENT -C-ENUM: +C-ENUM: DWRITE_TEXT_ALIGNMENT DWRITE_TEXT_ALIGNMENT_LEADING DWRITE_TEXT_ALIGNMENT_TRAILING DWRITE_TEXT_ALIGNMENT_CENTER ; -TYPEDEF: int DWRITE_PARAGRAPH_ALIGNMENT -C-ENUM: +C-ENUM: DWRITE_PARAGRAPH_ALIGNMENT DWRITE_PARAGRAPH_ALIGNMENT_NEAR DWRITE_PARAGRAPH_ALIGNMENT_FAR DWRITE_PARAGRAPH_ALIGNMENT_CENTER ; -TYPEDEF: int DWRITE_WORD_WRAPPING -C-ENUM: +C-ENUM: DWRITE_WORD_WRAPPING DWRITE_WORD_WRAPPING_WRAP DWRITE_WORD_WRAPPING_NO_WRAP ; -TYPEDEF: int DWRITE_LINE_SPACING_METHOD -C-ENUM: +C-ENUM: DWRITE_LINE_SPACING_METHOD DWRITE_LINE_SPACING_METHOD_DEFAULT DWRITE_LINE_SPACING_METHOD_UNIFORM ; -TYPEDEF: int DWRITE_TRIMMING_GRANULARITY -C-ENUM: +C-ENUM: DWRITE_TRIMMING_GRANULARITY DWRITE_TRIMMING_GRANULARITY_NONE DWRITE_TRIMMING_GRANULARITY_CHARACTER DWRITE_TRIMMING_GRANULARITY_WORD ; @@ -410,31 +396,29 @@ COM-INTERFACE: IDWriteTypography IUnknown {55f1112b-1dc2-4b3c-9541-f46894ed85b6} UINT32 GetFontFeatureCount ( ) HRESULT GetFontFeature ( UINT32 fontFeatureIndex, DWRITE_FONT_FEATURE* fontFeature ) ; -CONSTANT: DWRITE_SCRIPT_SHAPES_DEFAULT 0 -CONSTANT: DWRITE_SCRIPT_SHAPES_NO_VISUAL 1 -TYPEDEF: int DWRITE_SCRIPT_SHAPES +C-ENUM: DWRITE_SCRIPT_SHAPES + DWRITE_SCRIPT_SHAPES_DEFAULT + DWRITE_SCRIPT_SHAPES_NO_VISUAL ; STRUCT: DWRITE_SCRIPT_ANALYSIS { script USHORT } { shapes DWRITE_SCRIPT_SHAPES } ; -C-ENUM: +C-ENUM: DWRITE_BREAK_CONDITION DWRITE_BREAK_CONDITION_NEUTRAL DWRITE_BREAK_CONDITION_CAN_BREAK DWRITE_BREAK_CONDITION_MAY_NOT_BREAK DWRITE_BREAK_CONDITION_MUST_BREAK ; -TYPEDEF: int DWRITE_BREAK_CONDITION STRUCT: DWRITE_LINE_BREAKPOINT { data BYTE } ; -C-ENUM: +C-ENUM: DWRITE_NUMBER_SUBSTITUTION_METHOD DWRITE_NUMBER_SUBSTITUTION_METHOD_FROM_CULTURE DWRITE_NUMBER_SUBSTITUTION_METHOD_CONTEXTUAL DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE DWRITE_NUMBER_SUBSTITUTION_METHOD_NATIONAL DWRITE_NUMBER_SUBSTITUTION_METHOD_TRADITIONAL ; -TYPEDEF: int DWRITE_NUMBER_SUBSTITUTION_METHOD COM-INTERFACE: IDWriteNumberSubstitution IUnknown {14885CC9-BAB0-4f90-B6ED-5C366A2CD03D} ; @@ -628,9 +612,9 @@ COM-INTERFACE: IDWriteGdiInterop IUnknown {1edd9491-9853-4299-898f-6432983b6f3a} HRESULT CreateFontFaceFromHdc ( HDC hdc, IDWriteFontFace** fontFace ) HRESULT CreateBitmapRenderTarget ( HDC hdc, UINT32 width, UINT32 height, IDWriteBitmapRenderTarget** renderTarget ) ; -C-ENUM: DWRITE_TEXTURE_ALIASED_1x1 - DWRITE_TEXTURE_CLEARTYPE_3x1 ; -TYPEDEF: int DWRITE_TEXTURE_TYPE +C-ENUM: DWRITE_TEXTURE_TYPE + DWRITE_TEXTURE_ALIASED_1x1 + DWRITE_TEXTURE_CLEARTYPE_3x1 ; CONSTANT: DWRITE_ALPHA_MAX 255 diff --git a/basis/windows/directx/dxgitype/dxgitype.factor b/basis/windows/directx/dxgitype/dxgitype.factor index 0b318f7af1..bdab49e652 100644 --- a/basis/windows/directx/dxgitype/dxgitype.factor +++ b/basis/windows/directx/dxgitype/dxgitype.factor @@ -47,23 +47,23 @@ STRUCT: DXGI_RATIONAL { Numerator UINT } { Denominator UINT } ; -C-ENUM: DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED - DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE - DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST - DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST ; -TYPEDEF: int DXGI_MODE_SCANLINE_ORDER +C-ENUM: DXGI_MODE_SCANLINE_ORDER + DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED + DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE + DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST + DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST ; -C-ENUM: DXGI_MODE_SCALING_UNSPECIFIED - DXGI_MODE_SCALING_CENTERED - DXGI_MODE_SCALING_STRETCHED ; -TYPEDEF: int DXGI_MODE_SCALING +C-ENUM: DXGI_MODE_SCALING + DXGI_MODE_SCALING_UNSPECIFIED + DXGI_MODE_SCALING_CENTERED + DXGI_MODE_SCALING_STRETCHED ; -C-ENUM: DXGI_MODE_ROTATION_UNSPECIFIED - DXGI_MODE_ROTATION_IDENTITY - DXGI_MODE_ROTATION_ROTATE90 - DXGI_MODE_ROTATION_ROTATE180 - DXGI_MODE_ROTATION_ROTATE270 ; -TYPEDEF: int DXGI_MODE_ROTATION +C-ENUM: DXGI_MODE_ROTATION + DXGI_MODE_ROTATION_UNSPECIFIED + DXGI_MODE_ROTATION_IDENTITY + DXGI_MODE_ROTATION_ROTATE90 + DXGI_MODE_ROTATION_ROTATE180 + DXGI_MODE_ROTATION_ROTATE270 ; STRUCT: DXGI_MODE_DESC { Width UINT } diff --git a/basis/windows/directx/xapo/xapo.factor b/basis/windows/directx/xapo/xapo.factor index 5878af80e0..f071ea08d5 100644 --- a/basis/windows/directx/xapo/xapo.factor +++ b/basis/windows/directx/xapo/xapo.factor @@ -39,10 +39,9 @@ STRUCT: XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS { pFormat WAVEFORMATEX* } { MaxFrameCount UINT32 } ; -C-ENUM: - XAPO_BUFFER_SILENT - XAPO_BUFFER_VALID ; -TYPEDEF: int XAPO_BUFFER_FLAGS +C-ENUM: XAPO_BUFFER_FLAGS + XAPO_BUFFER_SILENT + XAPO_BUFFER_VALID ; STRUCT: XAPO_PROCESS_BUFFER_PARAMETERS { pBuffer void* } diff --git a/basis/windows/kernel32/kernel32.factor b/basis/windows/kernel32/kernel32.factor index c2622cbf48..a7c460f525 100644 --- a/basis/windows/kernel32/kernel32.factor +++ b/basis/windows/kernel32/kernel32.factor @@ -199,7 +199,7 @@ CONSTANT: THREAD_PRIORITY_LOWEST -2 CONSTANT: THREAD_PRIORITY_NORMAL 0 CONSTANT: THREAD_PRIORITY_TIME_CRITICAL 15 -C-ENUM: +C-ENUM: COMPUTER_NAME_FORMAT ComputerNameNetBIOS ComputerNameDnsHostname ComputerNameDnsDomain @@ -210,8 +210,6 @@ C-ENUM: ComputerNamePhysicalDnsFullyQualified ComputerNameMax ; -TYPEDEF: uint COMPUTER_NAME_FORMAT - STRUCT: OVERLAPPED { internal UINT_PTR } { internal-high UINT_PTR } diff --git a/basis/windows/usp10/usp10.factor b/basis/windows/usp10/usp10.factor index 1c33aaf940..21b4f77434 100644 --- a/basis/windows/usp10/usp10.factor +++ b/basis/windows/usp10/usp10.factor @@ -37,22 +37,23 @@ FUNCTION: HRESULT ScriptLayout ( int* piLogicalToVisual ) ; -C-ENUM: SCRIPT_JUSTIFY_NONE -SCRIPT_JUSTIFY_ARABIC_BLANK -SCRIPT_JUSTIFY_CHARACTER -SCRIPT_JUSTIFY_RESERVED1 -SCRIPT_JUSTIFY_BLANK -SCRIPT_JUSTIFY_RESERVED2 -SCRIPT_JUSTIFY_RESERVED3 -SCRIPT_JUSTIFY_ARABIC_NORMAL -SCRIPT_JUSTIFY_ARABIC_KASHIDA -SCRIPT_JUSTIFY_ALEF -SCRIPT_JUSTIFY_HA -SCRIPT_JUSTIFY_RA -SCRIPT_JUSTIFY_BA -SCRIPT_JUSTIFY_BARA -SCRIPT_JUSTIFY_SEEN -SCRIPT_JUSTIFFY_RESERVED4 ; +C-ENUM: f + SCRIPT_JUSTIFY_NONE + SCRIPT_JUSTIFY_ARABIC_BLANK + SCRIPT_JUSTIFY_CHARACTER + SCRIPT_JUSTIFY_RESERVED1 + SCRIPT_JUSTIFY_BLANK + SCRIPT_JUSTIFY_RESERVED2 + SCRIPT_JUSTIFY_RESERVED3 + SCRIPT_JUSTIFY_ARABIC_NORMAL + SCRIPT_JUSTIFY_ARABIC_KASHIDA + SCRIPT_JUSTIFY_ALEF + SCRIPT_JUSTIFY_HA + SCRIPT_JUSTIFY_RA + SCRIPT_JUSTIFY_BA + SCRIPT_JUSTIFY_BARA + SCRIPT_JUSTIFY_SEEN + SCRIPT_JUSTIFFY_RESERVED4 ; STRUCT: SCRIPT_VISATTR { flags WORD } ; diff --git a/basis/x11/constants/constants.factor b/basis/x11/constants/constants.factor index 763cddaaf1..64c7e2f8dd 100644 --- a/basis/x11/constants/constants.factor +++ b/basis/x11/constants/constants.factor @@ -406,4 +406,4 @@ CONSTANT: MSBFirst 1 ! * EXTENDED WINDOW MANAGER HINTS ! ***************************************************************** -C-ENUM: _NET_WM_STATE_REMOVE _NET_WM_STATE_ADD _NET_WM_STATE_TOGGLE ; +C-ENUM: f _NET_WM_STATE_REMOVE _NET_WM_STATE_ADD _NET_WM_STATE_TOGGLE ; diff --git a/extra/chipmunk/ffi/ffi.factor b/extra/chipmunk/ffi/ffi.factor index 0142b57a77..7e46baf551 100644 --- a/extra/chipmunk/ffi/ffi.factor +++ b/extra/chipmunk/ffi/ffi.factor @@ -348,12 +348,11 @@ STRUCT: cpSegmentQueryInfo { t cpFloat } { n cpVect } ; -C-ENUM: +C-ENUM: cpShapeType CP_CIRCLE_SHAPE CP_SEGMENT_SHAPE CP_POLY_SHAPE CP_NUM_SHAPES ; -TYPEDEF: int cpShapeType CALLBACK: cpBB cacheData_cb ( cpShape* shape, cpVect p, cpVect rot ) ; CALLBACK: void destroy_cb ( cpShape* shape ) ; @@ -482,11 +481,10 @@ STRUCT: cpContact FUNCTION: cpContact* cpContactInit ( cpContact* con, cpVect p, cpVect n, cpFloat dist, cpHashValue hash ) ; -C-ENUM: +C-ENUM: cpArbiterState cpArbiterStateNormal cpArbiterStateFirstColl cpArbiterStateIgnore ; -TYPEDEF: int cpArbiterState STRUCT: cpArbiter { numContacts int } diff --git a/extra/freetype/freetype.factor b/extra/freetype/freetype.factor index d131d2eb35..588f1670c2 100644 --- a/extra/freetype/freetype.factor +++ b/extra/freetype/freetype.factor @@ -176,14 +176,14 @@ FUNCTION: FT_Error FT_Set_Char_Size ( face* face, FT_F26Dot6 char_width, FT_F26D FUNCTION: FT_Error FT_Load_Char ( face* face, FT_ULong charcode, FT_Int32 load_flags ) ; -C-ENUM: +C-ENUM: f FT_RENDER_MODE_NORMAL FT_RENDER_MODE_LIGHT FT_RENDER_MODE_MONO FT_RENDER_MODE_LCD FT_RENDER_MODE_LCD_V ; -C-ENUM: +C-ENUM: f FT_PIXEL_MODE_NONE FT_PIXEL_MODE_MONO FT_PIXEL_MODE_GRAY diff --git a/extra/libusb/libusb.factor b/extra/libusb/libusb.factor index d521015d6f..e2ef40d81e 100644 --- a/extra/libusb/libusb.factor +++ b/extra/libusb/libusb.factor @@ -191,7 +191,7 @@ CONSTANT: LIBUSB_ERROR_NOT_SUPPORTED -12 CONSTANT: LIBUSB_ERROR_OTHER -99 TYPEDEF: int libusb_error -C-ENUM: +C-ENUM: libusb_transfer_status LIBUSB_TRANSFER_COMPLETED LIBUSB_TRANSFER_ERROR LIBUSB_TRANSFER_TIMED_OUT @@ -199,7 +199,6 @@ C-ENUM: LIBUSB_TRANSFER_STALL LIBUSB_TRANSFER_NO_DEVICE LIBUSB_TRANSFER_OVERFLOW ; -TYPEDEF: int libusb_transfer_status CONSTANT: LIBUSB_TRANSFER_SHORT_NOT_OK 1 CONSTANT: LIBUSB_TRANSFER_FREE_BUFFER 2 diff --git a/extra/llvm/core/core.factor b/extra/llvm/core/core.factor index f0a3cafe33..b15a7150bf 100644 --- a/extra/llvm/core/core.factor +++ b/extra/llvm/core/core.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2009 Matthew Willis. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.libraries alien.syntax system sequences combinators kernel ; +USING: alien.libraries alien.syntax system sequences combinators kernel alien.c-types ; IN: llvm.core @@ -28,20 +28,20 @@ LIBRARY: LLVMCore TYPEDEF: uint unsigned TYPEDEF: unsigned enum -CONSTANT: LLVMZExtAttribute BIN: 1 -CONSTANT: LLVMSExtAttribute BIN: 10 -CONSTANT: LLVMNoReturnAttribute BIN: 100 -CONSTANT: LLVMInRegAttribute BIN: 1000 -CONSTANT: LLVMStructRetAttribute BIN: 10000 -CONSTANT: LLVMNoUnwindAttribute BIN: 100000 -CONSTANT: LLVMNoAliasAttribute BIN: 1000000 -CONSTANT: LLVMByValAttribute BIN: 10000000 -CONSTANT: LLVMNestAttribute BIN: 100000000 -CONSTANT: LLVMReadNoneAttribute BIN: 1000000000 -CONSTANT: LLVMReadOnlyAttribute BIN: 10000000000 -TYPEDEF: enum LLVMAttribute; +C-ENUM: LLVMAttribute + { LLVMZExtAttribute BIN: 1 } + { LLVMSExtAttribute BIN: 10 } + { LLVMNoReturnAttribute BIN: 100 } + { LLVMInRegAttribute BIN: 1000 } + { LLVMStructRetAttribute BIN: 10000 } + { LLVMNoUnwindAttribute BIN: 100000 } + { LLVMNoAliasAttribute BIN: 1000000 } + { LLVMByValAttribute BIN: 10000000 } + { LLVMNestAttribute BIN: 100000000 } + { LLVMReadNoneAttribute BIN: 1000000000 } + { LLVMReadOnlyAttribute BIN: 10000000000 } ; -C-ENUM: +C-ENUM: LLVMTypeKind LLVMVoidTypeKind LLVMFloatTypeKind LLVMDoubleTypeKind @@ -57,9 +57,8 @@ C-ENUM: LLVMPointerTypeKind LLVMOpaqueTypeKind LLVMVectorTypeKind ; -TYPEDEF: enum LLVMTypeKind -C-ENUM: +C-ENUM: LLVMLinkage LLVMExternalLinkage LLVMLinkOnceLinkage LLVMWeakLinkage @@ -69,34 +68,32 @@ C-ENUM: LLVMDLLExportLinkage LLVMExternalWeakLinkage LLVMGhostLinkage ; -TYPEDEF: enum LLVMLinkage -C-ENUM: +C-ENUM: LLVMVisibility LLVMDefaultVisibility LLVMHiddenVisibility LLVMProtectedVisibility ; -TYPEDEF: enum LLVMVisibility -CONSTANT: LLVMCCallConv 0 -CONSTANT: LLVMFastCallConv 8 -CONSTANT: LLVMColdCallConv 9 -CONSTANT: LLVMX86StdcallCallConv 64 -CONSTANT: LLVMX86FastcallCallConv 65 -TYPEDEF: enum LLVMCallConv +C-ENUM: LLVMCallConv + { LLVMCCallConv 0 } + { LLVMFastCallConv 8 } + { LLVMColdCallConv 9 } + { LLVMX86StdcallCallConv 64 } + { LLVMX86FastcallCallConv 65 } ; -CONSTANT: LLVMIntEQ 32 -CONSTANT: LLVMIntNE 33 -CONSTANT: LLVMIntUGT 34 -CONSTANT: LLVMIntUGE 35 -CONSTANT: LLVMIntULT 36 -CONSTANT: LLVMIntULE 37 -CONSTANT: LLVMIntSGT 38 -CONSTANT: LLVMIntSGE 39 -CONSTANT: LLVMIntSLT 40 -CONSTANT: LLVMIntSLE 41 -TYPEDEF: enum LLVMIntPredicate +C-ENUM: LLVMIntPredicate + { LLVMIntEQ 32 } + { LLVMIntNE 33 } + { LLVMIntUGT 34 } + { LLVMIntUGE 35 } + { LLVMIntULT 36 } + { LLVMIntULE 37 } + { LLVMIntSGT 38 } + { LLVMIntSGE 39 } + { LLVMIntSLT 40 } + { LLVMIntSLE 41 } ; -C-ENUM: +C-ENUM: LLVMRealPredicate LLVMRealPredicateFalse LLVMRealOEQ LLVMRealOGT @@ -113,7 +110,6 @@ C-ENUM: LLVMRealULE LLVMRealUNE LLVMRealPredicateTrue ; -TYPEDEF: enum LLVMRealPredicate ! Opaque Types diff --git a/extra/macho/macho.factor b/extra/macho/macho.factor index fbccab35a4..ea71583072 100644 --- a/extra/macho/macho.factor +++ b/extra/macho/macho.factor @@ -770,16 +770,14 @@ STRUCT: scattered_relocation_info_little_endian { r_address_type_length_pcrel_scattered uint32_t } { r_value int32_t } ; -TYPEDEF: int reloc_type_generic -C-ENUM: +C-ENUM: reloc_type_generic GENERIC_RELOC_VANILLA GENERIC_RELOC_PAIR GENERIC_RELOC_SECTDIFF GENERIC_RELOC_PB_LA_PTR GENERIC_RELOC_LOCAL_SECTDIFF ; -TYPEDEF: int reloc_type_x86_64 -C-ENUM: +C-ENUM: reloc_type_x86_64 X86_64_RELOC_UNSIGNED X86_64_RELOC_SIGNED X86_64_RELOC_BRANCH @@ -790,8 +788,7 @@ C-ENUM: X86_64_RELOC_SIGNED_2 X86_64_RELOC_SIGNED_4 ; -TYPEDEF: int reloc_type_ppc -C-ENUM: +C-ENUM: reloc_type_ppc PPC_RELOC_VANILLA PPC_RELOC_PAIR PPC_RELOC_BR14 diff --git a/extra/tokyo/alien/tcadb/tcadb.factor b/extra/tokyo/alien/tcadb/tcadb.factor index 7e3a2d47c2..6107111be2 100644 --- a/extra/tokyo/alien/tcadb/tcadb.factor +++ b/extra/tokyo/alien/tcadb/tcadb.factor @@ -9,7 +9,7 @@ LIBRARY: tokyocabinet TYPEDEF: void* TCADB -C-ENUM: +C-ENUM: f ADBOVOID ADBOMDB ADBONDB diff --git a/extra/tokyo/alien/tcbdb/tcbdb.factor b/extra/tokyo/alien/tcbdb/tcbdb.factor index 6454e6b2fa..04913eba73 100644 --- a/extra/tokyo/alien/tcbdb/tcbdb.factor +++ b/extra/tokyo/alien/tcbdb/tcbdb.factor @@ -27,7 +27,7 @@ CONSTANT: BDBOTSYNC 64 TYPEDEF: void* BDBCUR -C-ENUM: +C-ENUM: f BDBCPCURRENT BDBCPBEFORE BDBCPAFTER ; diff --git a/extra/tokyo/alien/tcrdb/tcrdb.factor b/extra/tokyo/alien/tcrdb/tcrdb.factor index da4a750444..32938264ae 100644 --- a/extra/tokyo/alien/tcrdb/tcrdb.factor +++ b/extra/tokyo/alien/tcrdb/tcrdb.factor @@ -25,7 +25,7 @@ C-TYPE: TCRDB ! { timeout double } ! { opts int } ; -C-ENUM: +C-ENUM: f TTESUCCESS TTEINVALID TTENOHOST diff --git a/extra/tokyo/alien/tctdb/tctdb.factor b/extra/tokyo/alien/tctdb/tctdb.factor index 82100e23c8..e5a278e1b9 100644 --- a/extra/tokyo/alien/tctdb/tctdb.factor +++ b/extra/tokyo/alien/tctdb/tctdb.factor @@ -27,7 +27,7 @@ CONSTANT: TDBONOLCK 16 CONSTANT: TDBOLCKNB 32 CONSTANT: TDBOTSYNC 64 -C-ENUM: +C-ENUM: f TDBITLEXICAL TDBITDECIMAL ; @@ -38,7 +38,7 @@ CONSTANT: TDBITKEEP 16777216 C-TYPE: TDBCOND C-TYPE: TDBQRY -C-ENUM: +C-ENUM: f TDBQCSTREQ TDBQCSTRINC TDBQCSTRBW @@ -58,7 +58,7 @@ C-ENUM: CONSTANT: TDBQCNEGATE 16777216 CONSTANT: TDBQCNOIDX 33554432 -C-ENUM: +C-ENUM: f TDBQOSTRASC TDBQOSTRDESC TDBQONUMASC diff --git a/extra/tokyo/alien/tcutil/tcutil.factor b/extra/tokyo/alien/tcutil/tcutil.factor index afb78dba22..14ddbe99d1 100644 --- a/extra/tokyo/alien/tcutil/tcutil.factor +++ b/extra/tokyo/alien/tcutil/tcutil.factor @@ -12,7 +12,7 @@ IN: tokyo.alien.tcutil LIBRARY: tokyocabinet -C-ENUM: +C-ENUM: f TCDBTHASH TCDBTBTREE TCDBTFIXED diff --git a/unmaintained/cryptlib/libcl/libcl.factor b/unmaintained/cryptlib/libcl/libcl.factor index 38e6817f6c..946364efc1 100644 --- a/unmaintained/cryptlib/libcl/libcl.factor +++ b/unmaintained/cryptlib/libcl/libcl.factor @@ -878,7 +878,7 @@ TYPEDEF: int CRYPT_KEYID_TYPE ! Internal keyset options ! (As _NONE but open for exclusive access, _CRYPT_DEFINED ! Last possible key option type, _CRYPT_DEFINED Last external keyset option) -C-ENUM: +C-ENUM: f CRYPT_KEYOPT_NONE CRYPT_KEYOPT_READONLY CRYPT_KEYOPT_CREATE diff --git a/unmaintained/pdf/libhpdf/libhpdf.factor b/unmaintained/pdf/libhpdf/libhpdf.factor index a40b7cddee..c980ab0baf 100644 --- a/unmaintained/pdf/libhpdf/libhpdf.factor +++ b/unmaintained/pdf/libhpdf/libhpdf.factor @@ -24,7 +24,7 @@ IN: pdf.libhpdf : HPDF_COMP_MASK HEX: FF ; inline ! page mode -C-ENUM: +C-ENUM: f HPDF_PAGE_MODE_USE_NONE HPDF_PAGE_MODE_USE_OUTLINE HPDF_PAGE_MODE_USE_THUMBS From faf0418a125f2c99c0705e07c48e3a6935071684 Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Sat, 10 Apr 2010 00:02:44 -0700 Subject: [PATCH 061/157] Remove empty quad vocabulary --- extra/gpu/effects/quad/authors.txt | 1 - extra/gpu/effects/quad/quad.factor | 4 ---- extra/gpu/effects/quad/summary.txt | 1 - 3 files changed, 6 deletions(-) delete mode 100644 extra/gpu/effects/quad/authors.txt delete mode 100644 extra/gpu/effects/quad/quad.factor delete mode 100644 extra/gpu/effects/quad/summary.txt diff --git a/extra/gpu/effects/quad/authors.txt b/extra/gpu/effects/quad/authors.txt deleted file mode 100644 index 6f03a12101..0000000000 --- a/extra/gpu/effects/quad/authors.txt +++ /dev/null @@ -1 +0,0 @@ -Erik Charlebois diff --git a/extra/gpu/effects/quad/quad.factor b/extra/gpu/effects/quad/quad.factor deleted file mode 100644 index 5a770ba838..0000000000 --- a/extra/gpu/effects/quad/quad.factor +++ /dev/null @@ -1,4 +0,0 @@ -! Copyright (C) 2010 Erik Charlebois. -! See http://factorcode.org/license.txt for BSD license. -USING: ; -IN: gpu.effects.quad diff --git a/extra/gpu/effects/quad/summary.txt b/extra/gpu/effects/quad/summary.txt deleted file mode 100644 index 8952404931..0000000000 --- a/extra/gpu/effects/quad/summary.txt +++ /dev/null @@ -1 +0,0 @@ -Render a screen-aligned quad. From f828f9fdaad5b0855952f6a0451d789cb2ba3453 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 9 Apr 2010 21:13:48 -0700 Subject: [PATCH 062/157] Fiddle with register assignments in non-optimizing x86-32 backend --- basis/cpu/x86/32/32.factor | 2 +- basis/cpu/x86/32/bootstrap.factor | 53 ++++++++++++++++--------------- basis/cpu/x86/64/bootstrap.factor | 7 ++-- basis/cpu/x86/bootstrap.factor | 33 +++++++++---------- 4 files changed, 50 insertions(+), 45 deletions(-) diff --git a/basis/cpu/x86/32/32.factor b/basis/cpu/x86/32/32.factor index 97f0cfb668..10b49f5e97 100755 --- a/basis/cpu/x86/32/32.factor +++ b/basis/cpu/x86/32/32.factor @@ -67,7 +67,7 @@ M:: x86.32 %dispatch ( src temp -- ) [ align-code ] bi ; -M: x86.32 pic-tail-reg EBX ; +M: x86.32 pic-tail-reg EDX ; M: x86.32 reserved-stack-space 4 cells ; diff --git a/basis/cpu/x86/32/bootstrap.factor b/basis/cpu/x86/32/bootstrap.factor index b2cd241df1..4eb8335b67 100644 --- a/basis/cpu/x86/32/bootstrap.factor +++ b/basis/cpu/x86/32/bootstrap.factor @@ -13,15 +13,16 @@ IN: bootstrap.x86 : div-arg ( -- reg ) EAX ; : mod-arg ( -- reg ) EDX ; : temp0 ( -- reg ) EAX ; -: temp1 ( -- reg ) EDX ; -: temp2 ( -- reg ) ECX ; -: temp3 ( -- reg ) EBX ; +: temp1 ( -- reg ) ECX ; +: temp2 ( -- reg ) EBX ; +: temp3 ( -- reg ) EDX ; +: pic-tail-reg ( -- reg ) EDX ; : stack-reg ( -- reg ) ESP ; : frame-reg ( -- reg ) EBP ; -: vm-reg ( -- reg ) ECX ; +: vm-reg ( -- reg ) EBX ; : ctx-reg ( -- reg ) EBP ; : nv-regs ( -- seq ) { ESI EDI EBX } ; -: nv-reg ( -- reg ) EBX ; +: nv-reg ( -- reg ) ESI ; : ds-reg ( -- reg ) ESI ; : rs-reg ( -- reg ) EDI ; : fixnum>slot@ ( -- ) temp0 2 SAR ; @@ -40,7 +41,7 @@ IN: bootstrap.x86 ] jit-prolog jit-define [ - temp3 0 MOV rc-absolute-cell rt-here jit-rel + pic-tail-reg 0 MOV rc-absolute-cell rt-here jit-rel 0 JMP rc-relative rt-entry-point-pic-tail jit-rel ] jit-word-jump jit-define @@ -53,8 +54,8 @@ IN: bootstrap.x86 : jit-save-context ( -- ) jit-load-context - EDX ESP -4 [+] LEA - ctx-reg context-callstack-top-offset [+] EDX MOV + ECX ESP -4 [+] LEA + ctx-reg context-callstack-top-offset [+] ECX MOV ctx-reg context-datastack-offset [+] ds-reg MOV ctx-reg context-retainstack-offset [+] rs-reg MOV ; @@ -135,25 +136,25 @@ IN: bootstrap.x86 [ ! Load callstack object - EBX ds-reg [] MOV + temp3 ds-reg [] MOV ds-reg bootstrap-cell SUB ! Get ctx->callstack_bottom jit-load-vm jit-load-context - EAX ctx-reg context-callstack-bottom-offset [+] MOV + temp0 ctx-reg context-callstack-bottom-offset [+] MOV ! Get top of callstack object -- 'src' for memcpy - EBP EBX callstack-top-offset [+] LEA + temp1 temp3 callstack-top-offset [+] LEA ! Get callstack length, in bytes --- 'len' for memcpy - EDX EBX callstack-length-offset [+] MOV - EDX tag-bits get SHR + temp2 temp3 callstack-length-offset [+] MOV + temp2 tag-bits get SHR ! Compute new stack pointer -- 'dst' for memcpy - EAX EDX SUB + temp0 temp2 SUB ! Install new stack pointer - ESP EAX MOV + ESP temp0 MOV ! Call memcpy - EDX PUSH - EBP PUSH - EAX PUSH + temp2 PUSH + temp1 PUSH + temp0 PUSH "factor_memcpy" jit-call ESP 12 ADD ! Return with new callstack @@ -177,7 +178,7 @@ IN: bootstrap.x86 ! Inline cache miss entry points : jit-load-return-address ( -- ) - EBX ESP stack-frame-size bootstrap-cell - [+] MOV ; + pic-tail-reg ESP stack-frame-size bootstrap-cell - [+] MOV ; ! These are always in tail position with an existing stack ! frame, and the stack. The frame setup takes this into account. @@ -185,7 +186,7 @@ IN: bootstrap.x86 jit-load-vm jit-save-context ESP 4 [+] vm-reg MOV - ESP [] EBX MOV + ESP [] pic-tail-reg MOV "inline_cache_miss" jit-call jit-restore-context ; @@ -213,6 +214,7 @@ IN: bootstrap.x86 [ ESP [] EAX MOV ESP 4 [+] EDX MOV + jit-load-vm ESP 8 [+] vm-reg MOV jit-call ] @@ -237,6 +239,7 @@ IN: bootstrap.x86 EBX tag-bits get SAR ESP [] EBX MOV ESP 4 [+] EBP MOV + jit-load-vm ESP 8 [+] vm-reg MOV "overflow_fixnum_multiply" jit-call ] @@ -266,7 +269,7 @@ IN: bootstrap.x86 ! Load context and parameter from datastack EAX ds-reg [] MOV EAX EAX alien-offset [+] MOV - EBX ds-reg -4 [+] MOV + EDX ds-reg -4 [+] MOV ds-reg 8 SUB ! Make the new context active @@ -280,7 +283,7 @@ IN: bootstrap.x86 ! Store parameter to datastack ds-reg 4 ADD - ds-reg [] EBX MOV ; + ds-reg [] EDX MOV ; [ jit-set-context ] \ (set-context) define-sub-primitive @@ -291,14 +294,14 @@ IN: bootstrap.x86 "new_context" jit-call ! Save pointer to quotation and parameter - EBX ds-reg MOV + EDX ds-reg MOV ds-reg 8 SUB ! Make the new context active EAX jit-switch-context ! Push parameter - EAX EBX -4 [+] MOV + EAX EDX -4 [+] MOV ds-reg 4 ADD ds-reg [] EAX MOV @@ -309,7 +312,7 @@ IN: bootstrap.x86 0 PUSH ! Jump to initial quotation - EAX EBX [] MOV + EAX EDX [] MOV jit-jump-quot ; [ jit-start-context ] \ (start-context) define-sub-primitive diff --git a/basis/cpu/x86/64/bootstrap.factor b/basis/cpu/x86/64/bootstrap.factor index 68c3d8b702..39046bce6a 100644 --- a/basis/cpu/x86/64/bootstrap.factor +++ b/basis/cpu/x86/64/bootstrap.factor @@ -11,10 +11,11 @@ IN: bootstrap.x86 : shift-arg ( -- reg ) RCX ; : div-arg ( -- reg ) RAX ; : mod-arg ( -- reg ) RDX ; -: temp0 ( -- reg ) RDI ; -: temp1 ( -- reg ) RSI ; +: temp0 ( -- reg ) RAX ; +: temp1 ( -- reg ) RCX ; : temp2 ( -- reg ) RDX ; : temp3 ( -- reg ) RBX ; +: pic-tail-reg ( -- reg ) RBX ; : return-reg ( -- reg ) RAX ; : nv-reg ( -- reg ) RBX ; : stack-reg ( -- reg ) RSP ; @@ -42,7 +43,7 @@ IN: bootstrap.x86 ] jit-prolog jit-define [ - temp3 5 [RIP+] LEA + pic-tail-reg 5 [RIP+] LEA 0 JMP rc-relative rt-entry-point-pic-tail jit-rel ] jit-word-jump jit-define diff --git a/basis/cpu/x86/bootstrap.factor b/basis/cpu/x86/bootstrap.factor index 80b56f9f91..b1866e110a 100644 --- a/basis/cpu/x86/bootstrap.factor +++ b/basis/cpu/x86/bootstrap.factor @@ -12,8 +12,9 @@ big-endian off [ ! Optimizing compiler's side of callback accesses ! arguments that are on the stack via the frame pointer. - ! On x86-64, some arguments are passed in registers, and - ! so the only register that is safe for use here is nv-reg. + ! On x86-32 fastcall, and x86-64, some arguments are passed + ! in registers, and so the only registers that are safe for + ! use here are frame-reg, nv-reg and vm-reg. frame-reg PUSH frame-reg stack-reg MOV @@ -73,15 +74,15 @@ big-endian off [ ! Load word - nv-reg 0 MOV rc-absolute-cell rt-literal jit-rel + temp0 0 MOV rc-absolute-cell rt-literal jit-rel ! Bump profiling counter - nv-reg profile-count-offset [+] 1 tag-fixnum ADD + temp0 profile-count-offset [+] 1 tag-fixnum ADD ! Load word->code - nv-reg nv-reg word-code-offset [+] MOV + temp0 temp0 word-code-offset [+] MOV ! Compute word entry point - nv-reg compiled-header-size ADD + temp0 compiled-header-size ADD ! Jump to entry point - nv-reg JMP + temp0 JMP ] jit-profiling jit-define [ @@ -200,7 +201,7 @@ big-endian off ! ! ! Polymorphic inline caches -! The PIC stubs are not permitted to touch temp3. +! The PIC stubs are not permitted to touch pic-tail-reg. ! Load a value from a stack position [ @@ -477,23 +478,23 @@ big-endian off ! load value temp3 ds-reg [] MOV ! make a copy - temp1 temp3 MOV - ! compute positive shift value in temp1 - temp1 CL SHL + temp2 temp3 MOV + ! compute positive shift value in temp2 + temp2 CL SHL shift-arg NEG ! compute negative shift value in temp3 temp3 CL SAR temp3 tag-mask get bitnot AND shift-arg 0 CMP - ! if shift count was negative, move temp0 to temp1 - temp1 temp3 CMOVGE + ! if shift count was negative, move temp0 to temp2 + temp2 temp3 CMOVGE ! push to stack - ds-reg [] temp1 MOV + ds-reg [] temp2 MOV ] \ fixnum-shift-fast define-sub-primitive : jit-fixnum-/mod ( -- ) ! load second parameter - temp3 ds-reg [] MOV + temp1 ds-reg [] MOV ! load first parameter div-arg ds-reg bootstrap-cell neg [+] MOV ! make a copy @@ -501,7 +502,7 @@ big-endian off ! sign-extend mod-arg bootstrap-cell-bits 1 - SAR ! divide - temp3 IDIV ; + temp1 IDIV ; [ jit-fixnum-/mod From 5768ae0af4db3311539c463e5d467639cfd7db4d Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Sat, 10 Apr 2010 00:12:59 -0700 Subject: [PATCH 063/157] Forget to save some files for enum change --- basis/cairo/ffi/ffi.factor | 15 +++++---------- basis/cocoa/application/application.factor | 2 +- basis/unicode/breaks/breaks.factor | 4 ++-- basis/vm/vm.factor | 2 +- basis/windows/advapi32/advapi32.factor | 12 ++++-------- basis/windows/ddk/hid/hid.factor | 6 ++---- basis/windows/ddk/setupapi/setupapi.factor | 3 +-- .../directx/d3dx9shader/d3dx9shader.factor | 6 ++---- basis/windows/directx/xaudio2/xaudio2.factor | 3 +-- 9 files changed, 19 insertions(+), 34 deletions(-) diff --git a/basis/cairo/ffi/ffi.factor b/basis/cairo/ffi/ffi.factor index 42b281c33c..01e89aaf3c 100644 --- a/basis/cairo/ffi/ffi.factor +++ b/basis/cairo/ffi/ffi.factor @@ -694,8 +694,7 @@ cairo_surface_get_reference_count ( cairo_surface_t* surface ) ; FUNCTION: cairo_status_t cairo_surface_status ( cairo_surface_t* surface ) ; -TYPEDEF: int cairo_surface_type_t -C-ENUM: +C-ENUM: cairo_surface_type_t CAIRO_SURFACE_TYPE_IMAGE CAIRO_SURFACE_TYPE_PDF CAIRO_SURFACE_TYPE_PS @@ -758,8 +757,7 @@ cairo_surface_show_page ( cairo_surface_t* surface ) ; ! Image-surface functions -TYPEDEF: int cairo_format_t -C-ENUM: +C-ENUM: cairo_format_t CAIRO_FORMAT_ARGB32 CAIRO_FORMAT_RGB24 CAIRO_FORMAT_A8 @@ -831,8 +829,7 @@ cairo_pattern_get_user_data ( cairo_pattern_t* pattern, cairo_user_data_key_t* k FUNCTION: cairo_status_t cairo_pattern_set_user_data ( cairo_pattern_t* pattern, cairo_user_data_key_t* key, void* user_data, cairo_destroy_func_t destroy ) ; -TYPEDEF: int cairo_pattern_type_t -C-ENUM: +C-ENUM: cairo_pattern_type_t CAIRO_PATTERN_TYPE_SOLID CAIRO_PATTERN_TYPE_SURFACE CAIRO_PATTERN_TYPE_LINEAR @@ -853,8 +850,7 @@ cairo_pattern_set_matrix ( cairo_pattern_t* pattern, cairo_matrix_t* matrix ) ; FUNCTION: void cairo_pattern_get_matrix ( cairo_pattern_t* pattern, cairo_matrix_t* matrix ) ; -TYPEDEF: int cairo_extend_t -C-ENUM: +C-ENUM: cairo_extend_t CAIRO_EXTEND_NONE CAIRO_EXTEND_REPEAT CAIRO_EXTEND_REFLECT @@ -866,8 +862,7 @@ cairo_pattern_set_extend ( cairo_pattern_t* pattern, cairo_extend_t extend ) ; FUNCTION: cairo_extend_t cairo_pattern_get_extend ( cairo_pattern_t* pattern ) ; -TYPEDEF: int cairo_filter_t -C-ENUM: +C-ENUM: cairo_filter_t CAIRO_FILTER_FAST CAIRO_FILTER_GOOD CAIRO_FILTER_BEST diff --git a/basis/cocoa/application/application.factor b/basis/cocoa/application/application.factor index df56ce5c4c..6768e1471d 100644 --- a/basis/cocoa/application/application.factor +++ b/basis/cocoa/application/application.factor @@ -8,7 +8,7 @@ IN: cocoa.application : ( str -- alien ) -> autorelease ; -C-ENUM: +C-ENUM: f NSApplicationDelegateReplySuccess NSApplicationDelegateReplyCancel NSApplicationDelegateReplyFailure ; diff --git a/basis/unicode/breaks/breaks.factor b/basis/unicode/breaks/breaks.factor index 46651bd7de..2ab8b27cc7 100644 --- a/basis/unicode/breaks/breaks.factor +++ b/basis/unicode/breaks/breaks.factor @@ -12,7 +12,7 @@ IN: unicode.breaks Date: Sat, 10 Apr 2010 00:41:20 -0700 Subject: [PATCH 064/157] compiler.tests.alien: fix typo --- basis/compiler/tests/alien.factor | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index 5793482a27..a3df053ca2 100755 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -444,9 +444,8 @@ STRUCT: double-rect void { void* void* double-rect } cdecl [ "example" set-global 2drop ] alien-callback ; -: double-rect-test ( arg -- arg' ) +: double-rect-test ( arg callback -- arg' ) [ f f ] 2dip - double-rect-callback void { void* void* double-rect } cdecl alien-indirect "example" get-global ; From 2812830b443411b18bf030d7b10adc71a0fedf23 Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Sat, 10 Apr 2010 01:26:26 -0700 Subject: [PATCH 065/157] Typo in cairo ffi for C-ENUM change. --- basis/cairo/ffi/ffi.factor | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/basis/cairo/ffi/ffi.factor b/basis/cairo/ffi/ffi.factor index 01e89aaf3c..c357f856de 100644 --- a/basis/cairo/ffi/ffi.factor +++ b/basis/cairo/ffi/ffi.factor @@ -1,6 +1,8 @@ ! Copyright (c) 2007 Sampo Vuori ! Copyright (c) 2008 Matthew Willis ! + + ! Adapted from cairo.h, version 1.5.14 ! License: http://factorcode.org/license.txt @@ -389,7 +391,7 @@ C-ENUM: cairo_subpixel_order_t CAIRO_SUBPIXEL_ORDER_VRGB CAIRO_SUBPIXEL_ORDER_VBGR ; -C-ENUM: cairo_hint_Style_t +C-ENUM: cairo_hint_style_t CAIRO_HINT_STYLE_DEFAULT CAIRO_HINT_STYLE_NONE CAIRO_HINT_STYLE_SLIGHT From ed40eb42395e8cd460f494a19cfb19b1b2b43b4f Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 10 Apr 2010 16:54:17 -0700 Subject: [PATCH 066/157] cpu.x86.32: cleanups and fixes to make fastcall and thiscall callbacks work --- basis/cpu/architecture/architecture.factor | 4 +-- basis/cpu/x86/32/32.factor | 36 ++++++++-------------- basis/cpu/x86/bootstrap.factor | 7 +++-- basis/stack-checker/alien/alien.factor | 3 +- 4 files changed, 20 insertions(+), 30 deletions(-) diff --git a/basis/cpu/architecture/architecture.factor b/basis/cpu/architecture/architecture.factor index 7abf1673d4..1aaf1bf2ea 100644 --- a/basis/cpu/architecture/architecture.factor +++ b/basis/cpu/architecture/architecture.factor @@ -595,6 +595,6 @@ HOOK: %end-callback cpu ( -- ) HOOK: %end-callback-value cpu ( c-type -- ) -HOOK: callback-return-rewind cpu ( params -- n ) +HOOK: stack-cleanup cpu ( params -- n ) -M: object callback-return-rewind drop 0 ; +M: object stack-cleanup drop 0 ; diff --git a/basis/cpu/x86/32/32.factor b/basis/cpu/x86/32/32.factor index 37177abbcd..f08a03d8be 100755 --- a/basis/cpu/x86/32/32.factor +++ b/basis/cpu/x86/32/32.factor @@ -129,8 +129,7 @@ M: stack-params copy-register* { [ over integer? ] [ EAX swap MOV param@ EAX MOV ] } } cond ; -M: x86.32 %save-param-reg - dup stack-params? [ 3drop ] [ [ param@ ] 2dip %copy ] if ; +M: x86.32 %save-param-reg [ local@ ] 2dip %copy ; M: x86.32 %load-param-reg [ swap local@ ] dip %copy ; @@ -139,7 +138,7 @@ M: x86.32 %load-param-reg [ swap local@ ] dip %copy ; #! are boxing a return value of a C function. If n is an #! integer, push [ESP+n] on the stack; we are boxing a #! parameter being passed to a callback from C. - over [ [ next-stack@ ] dip load-return-reg ] [ 2drop ] if ; + over [ [ local@ ] dip load-return-reg ] [ 2drop ] if ; M:: x86.32 %box ( n rep func -- ) n rep (%box) @@ -327,18 +326,20 @@ M:: x86.32 %binary-float-function ( dst src1 src2 func -- ) stack-params get ] with-param-regs ; -M: x86.32 %cleanup ( params -- ) - #! a) If we just called a stdcall function in Windows, it - #! cleaned up the stack frame for us. But we don't want that - #! so we 'undo' the cleanup since we do that in %epilogue. - #! b) If we just called a function returning a struct, we - #! have to fix ESP. +M: x86.32 stack-cleanup ( params -- n ) + #! a) Functions which are stdcall/fastcall/thiscall have to + #! clean up the caller's stack frame. + #! b) Functions returning large structs on MINGW have to + #! fix ESP. { - { [ dup abi>> callee-cleanup? ] [ stack-arg-size ESP swap SUB ] } - { [ dup funny-large-struct-return? ] [ drop EAX PUSH ] } - [ drop ] + { [ dup abi>> callee-cleanup? ] [ stack-arg-size ] } + { [ dup funny-large-struct-return? ] [ drop 4 ] } + [ drop 0 ] } cond ; +M: x86.32 %cleanup ( params -- ) + stack-cleanup [ ESP swap SUB ] unless-zero ; + M:: x86.32 %call-gc ( gc-root-count temp -- ) temp gc-root-base special@ LEA 8 save-vm-ptr @@ -352,17 +353,6 @@ M: x86.32 dummy-int-params? f ; M: x86.32 dummy-fp-params? f ; -M: x86.32 callback-return-rewind ( params -- n ) - #! a) If the callback is stdcall, we have to clean up the - #! caller's stack frame. - #! b) If the callback is returning a large struct, we have - #! to fix ESP. - { - { [ dup stdcall? ] [ [ params>> ] [ return>> ] bi + ] } - { [ dup funny-large-struct-return? ] [ drop 4 ] } - [ drop 0 ] - } cond ; - ! Dreadful M: object flatten-value-type (flatten-stack-type) ; M: struct-c-type flatten-value-type (flatten-stack-type) ; diff --git a/basis/cpu/x86/bootstrap.factor b/basis/cpu/x86/bootstrap.factor index b1866e110a..7accc4b1cb 100644 --- a/basis/cpu/x86/bootstrap.factor +++ b/basis/cpu/x86/bootstrap.factor @@ -66,9 +66,10 @@ big-endian off frame-reg POP - ! Callbacks which return structs, or use stdcall, need a - ! parameter here. See the comment in callback-return-rewind - ! in cpu.x86.32 + ! Callbacks which return structs, or use stdcall/fastcall/thiscall, + ! need a parameter here. + + ! See the comment for M\ x86.32 stack-cleanup in cpu.x86.32 HEX: ffff RET rc-absolute-2 rt-untagged jit-rel ] callback-stub jit-define diff --git a/basis/stack-checker/alien/alien.factor b/basis/stack-checker/alien/alien.factor index 9039c5d3f0..1c6b37b7df 100644 --- a/basis/stack-checker/alien/alien.factor +++ b/basis/stack-checker/alien/alien.factor @@ -107,8 +107,7 @@ TUPLE: alien-callback-params < alien-node-params quot xt ; [ callbacks get ] dip '[ _ ] cache ; : callback-bottom ( params -- ) - [ xt>> ] [ callback-return-rewind ] bi - '[ _ _ callback-xt ] infer-quot-here ; + [ xt>> ] [ stack-cleanup ] bi '[ _ _ callback-xt ] infer-quot-here ; : infer-alien-callback ( -- ) alien-callback-params new From 0202c35d2af1aea3fd9525e7f2b0c6166c21e160 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 10 Apr 2010 16:56:00 -0700 Subject: [PATCH 067/157] alien: now that fastcall works better it doesn't need to be private --- basis/cpu/x86/32/32.factor | 1 - core/alien/alien.factor | 12 ++++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/basis/cpu/x86/32/32.factor b/basis/cpu/x86/32/32.factor index f08a03d8be..0127d55997 100755 --- a/basis/cpu/x86/32/32.factor +++ b/basis/cpu/x86/32/32.factor @@ -10,7 +10,6 @@ compiler.cfg.intrinsics compiler.cfg.stack-frame cpu.x86.assembler cpu.x86.assembler.operands cpu.x86 cpu.architecture vm ; FROM: layouts => cell ; -FROM: alien.private => fastcall ; IN: cpu.x86.32 M: x86.32 machine-registers diff --git a/core/alien/alien.factor b/core/alien/alien.factor index 194e4201d2..27e326a557 100644 --- a/core/alien/alien.factor +++ b/core/alien/alien.factor @@ -5,14 +5,6 @@ kernel.private byte-arrays byte-vectors arrays init continuations.private ; IN: alien -SINGLETONS: stdcall thiscall cdecl mingw ; - - - -UNION: abi stdcall thiscall fastcall cdecl mingw ; - PREDICATE: pinned-alien < alien underlying>> not ; UNION: pinned-c-ptr pinned-alien POSTPONE: f ; @@ -72,6 +64,10 @@ M: alien equal? M: pinned-alien hashcode* nip dup expired>> [ drop 1234 ] [ alien-address ] if ; +SINGLETONS: stdcall thiscall fastcall cdecl mingw ; + +UNION: abi stdcall thiscall fastcall cdecl mingw ; + ERROR: alien-callback-error ; : alien-callback ( return parameters abi quot -- alien ) From f6d8c0ad22dc1e640c339dec90ce20cb263207e8 Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Sat, 10 Apr 2010 17:07:05 -0700 Subject: [PATCH 068/157] Convert image to binary form and remove debug code. --- basis/images/pgm/pgm.factor | 1 - extra/fluids/particle2.pgm | Bin 50100 -> 16438 bytes 2 files changed, 1 deletion(-) diff --git a/basis/images/pgm/pgm.factor b/basis/images/pgm/pgm.factor index e673565fc9..52e594ddff 100644 --- a/basis/images/pgm/pgm.factor +++ b/basis/images/pgm/pgm.factor @@ -29,7 +29,6 @@ SINGLETON: pgm-image n 1 + lim read-numbers ] unless ; -ERROR: INSPECT a ; :: read-pgm ( -- image ) read-token :> type read-number :> width diff --git a/extra/fluids/particle2.pgm b/extra/fluids/particle2.pgm index 99bf7a40573ba50791bd0c595632f522ca5a1fa1..a45dc41082a45292dcb6c4ed9c56c665468aad3f 100644 GIT binary patch literal 16438 zcmcJW2UONqw)P{aC{`?pNE5N4qExY=f*^vTUvY%G1kN+ zChDj$CZ^q(axidlX(+DSMyY&)(1O6zW{VCn_nrb(fAw zO?}$7>(I%kQ$h!yn2cd#(=&a#rDu-G7&*cxFd)!5Feu!IFXy1pQ0LeF$SG39!NJkd zv8e4h7UdTQhd=UvdiDRNhzJ)eUfhXO!gidTiWe_dtY}dOha#{3KYWG%qKHFLNQ|C-0Y!oZz_+n;>3N9|?4HJ?>@jqD#$X&!smFCjrT|~HY zSU?J>;T25lrT=OXhhm~G;<|Sgx2o>Y^ziiZ^7i)jvHkJ(^7MocckxgO zDWHi`B@x1ZE(6D+P9;!!x$@lHwTfs%*~h1Pbzk2aI)3`*Tf?_{bsrxuFNEP<6)_-% za%GGf{xc379E&@Nx=RJb?gnu#?Ni;ihF{H^HEY$XUAsLa|O=fB$-%`uwR^&%a*Xx^?P^iyFSZ z5<|7BZU{j#DCtz}kD5Ud%uduRU~yHU?o+)+jheMYx?cST4H^VA)M;eC2k<*=zy*Tv zMGEM_&9xGSfF%|$`iDf|SgeF|DOsJXTh(fw-afv5eh~Nfhjzn8jRFIMf`fvCLxOdJ zf`S5JB%pqMcz}f()qT8;3@TMHW>DNJvO%SXfwN z>x6}chJ}WNz(m7<24bN$Lh$kStX8#(QGzp8@QM+!2xecZj6`oFkJf9~<>n0=1qB6% zif(w5rcIkRYub#%4^5gh32$t8Kn?-*5rV~mr39>?c+pp4z@ey9$j(9E z^#dAl@lZp$S+nLXA|fJMn!^tfEt)rP*3{x57%9}RXK~==VTqu$v(u~SK&r>-D!IBL z`s%uSy#@h|baSrV9MUaYwrU+285tE7WxgU?w{F#{Wkib>@PHVCg961tZR`LgV23W4 z;VbxoAz$8p`I@z$j^Md^lcwAo(ygP~w26+6(P`VZZA{yk=r(PlA|qSF17Zko92#Oc zz!LFB5BDmSE0ix&szmYMX@!u-?kiMwbLaAYHS72z`Jmvi#^Fs3@u;Y1sK&Ny7srX$ ziHmF3F1Bq9T-aEEgW#Y>0rf2rc(}V&u2`O6^!pfaEJn;JkJq_N^N8L^p1U`XXxTcl zO-u}=(s^*(1DGC-w}!&2|8s(zM7X$ z4cp}<`4$naT66Q*c5(5d+^JJyVp394XHHU5Vq#(^_~;NHhaAvEtB4lOnlv^_@W%?! zftzbZm)|7;$KoYRVfe09Jup0J9>s@++o-pV74eRp5|cW2>C&}px9;7$nbWmvmo9Jt z5A9*0EqZ7b(Y$GRSO_AhSEp8u>R#2Vx>ouM9#3@vq$w^3G+-S0dKzg~B|^M=j~+c!QhKGP_SWgcS88f6ae+9xbWWt`k8c+f9o5>1Ah=OL zJ^xyE2JnJ^#Q;&yxs18JS9L6}enZK=S&LR!U2I(Y4qUw}7f`WKPVu{gJ{SQ*n3`34PxFg#=* z6)ox=6Ont*ibNk$Q!lR75E$F+@)Y~8ZC z7-(4E-!Om?mMcvtep%kf_Daj|t9i-q>Ng66e2bP`9?^G9OzNtur}h!;^nrs056;LK zVot`8!Gi}69GE_!f4{zcQd3gI0d^1{+cpXYnl=uF0hore9)kbAw!1^8$Nva2y=!HA2xKzkc`2Gg+9HJLAS0+os1Pk z7G}V$QiZamUt$6%AJeZ?#obemXCvP#62t3|kl49fckbR7>H`O53>`Xb#E6ljMvoqy zslR+1HEP6&VZ+3NgwVTJa*wWE5<9k+4)6n;1Zwzrx>u>>@-h>!luyF*v608?jq15P zicdlE{nG~x9x`kgv@FZsss$~Md zt_B>PN|izS*j~-rg!~Yr`{-Cy-??iKb9tx_9Win=#3xM5nlyQGcJ`DhQ>OAYB|Cc( zOpG5lc8oYc3lafV&>17J7zhg?4#){ehSI>V1mGasC+vFq)Tr&>piyvGljbcWb$e9b zGr4!)v~=`7T-3);$eNTrW$LtPIXTm(PoKfp^qgr^r)E!{G-<;4v6-Vs4Ii2@C_Sxj zY6=V_A^~gwHwuCkq=^%d!3Zg#f4|-sL1(GJFkrl}mamV8 zG*If7Q3%&3?jrr_C_f-5G`v|v>o&1*9d!F%z55Lqm@#BHdND{mYpp0Q7MvoacA#3s!sORR*&Yx2-ciy~t^L6+vD1e8& zTyZctYr?oOqel$O7&HJYG&TSOts}6(Mh%FA-k$hCxl$zxg<*UT*H_@HX-OZ?i)q&$ z#}j#O5Bag^OS2Z^UfkMR)Sy#U2>Enm(BYkWyI<|cRAy?!F4H-5v zbL@ny?5R03a%bfi%$vV(;iAP$mM&YiTxZ#`Ww5bm!Th-e`LmG0R74;hWEdOh(Um}C zOu*8BOz@Wi!1#^t$@s8+BYi0!@~M6Mzd(LwUjCf9^A|3H_KKA&SFP4rwR+Xcl`EDn zU9x!L{CRWoXU&{GH5&$u3i|iM3%VpG#KpF0ttfyGC`UaST&{&E%2K3UH{AQ0Pc z6&Zu_yL3y2Ji;G2dhCQrQ>N+iP+u(Kt5>gGyKdcjoptNhu35c$<%(rX7A=@JR}4(c zo-|=x=Ez}4pl@o=Ze2PV4KxoA3sMm9@vQ1vp)4+7&w~!d@cl||?pz<&4{40;6L>nx z^!ua@96Z#J&(4{VhvFA3S|aLe)~(;Lant6_{N221)5ZTJ)w|4ca6-yT{m|u{eH$xJT5e`l#44?s=FshYI zu%V(L#TWvxyI>JrzhV{AE}=)-kBE%M_B$Kt55n)qjF<59@(boKTC#k_sx|93Y}&GQ z`;HwuckSA}d)Mw=J9qAYhfN#SuU)-j`I1HR=NbmG@Pgq(EDaC^+C>ut8V4H}@Kz8c z4_jHlfvU$vp|6H9eo78pKOwPek6wMGe8^{U``r8jWWRjnn)MquZP~Vc=dRs*Uf;{v zw{P#>*Wtl%ux`z&<>&wgW=_k_8lO38ScWu!44}J9hl|@e?PGA3t{N=;1>Lk-@GVh5=MCZ_cclIa9L6j~O`( zALyOj9UqL1#sy@7b#Os9rC}2T9i5!z{K`ByUwAXFkM_G5?Q{Kc6SJqzm^EkK!X<|M zwjEslAk^PHe)80*Q>V|IIeqHX$>VPxJ@UqZ{jcvf46I(hWZ}Fyc{8R?o`??&8Pp#O z=#rGsE+(>NGsPejU<&~%1B$Bdsp9TU%}MBOLga6Y@9X+#f7BQP&-7fBzj)ayZZGot z4?_LK$|+N#hlTNJKrmkp^Ue z3c~)i6$2}lH%SQZBlEgZ_0_J|Fo@9GI-1did>`%O`Z7MQzjzszziI1^-FpulI&$p9 z$unoqU$}VbEzYG&7cZPUd-~MzV@D2I5?H@_19{I1*3KUVR4)vS~jzAL%b&y>8PM-Tu&#H&2{CbN=F`%Wq$~ za+P!C?aP-g!odj`IDiDUZd|u|1sXsAQ)K}|Nrb6AjSErEN?Z%CpH*em!e*Nl|%a<;k zJ$>>`NnqFZEgRM%fCUA!W=@+-6eJO1f!#VkQvijSuRO4<>Og|8f}c@8-iP>OCH`I{ z9>hOxQZ~LfSH_3*ckbB-`ID#5U3}}x)f+e8y>;t7&b#m4ym9UAw=SMLV;I=8bK9o% zMgX&Oae;BqEKnZMDxyhfP=LRc1E@kADg5O99^Pbrysue=#Ej9=Q{ zw(Ir%ZyY^-irZhk{?2@#sG;xL?7yIa-YmEB%HD{w!PHfr~e>AKe2B{o@IS#U)Miz=KQ6%A%FYMz55Rz zJ$n4f<4-<*c>mroxc;8UeFXt~S+h#0~7=!^#wmh&eIe;=Ky0x9YXEjm~4uJbr zbfxe$(T~(0(~i2&sDJpVu@fd+*1vMihRs;tp`*CoTUTzp`~HV_A3S>e*%x1NzWm~| z#~(kq_u>2R-neq<-09=^;GP|F!6h;PdEltwHUm@$j-Uv!M?l^ohJKZ5-oE61B_HTx ze#$-ae$3CPAM3~Y4!m*f#2K#t&aK;b?|=O1lP|vh=IPU?-+cY$lTSasf7b}$!Wk5B zU=J~9?JBYm9%u|OBV7>)1EdIP8Ws%w8j8TsFX}|?W2-%k`78Q~{=f{pKWobLy!?51 z-@1)ki9J}~xr=E3{g3WFeEj6g|9bk}4?q0y-P5nX{Os|=zkKxmJJ;U6c=jX;zyLO_ zTeWP_{5j+R3~)GANbh9P=l;e4pzi_w(oR{p!KlSF3gBXD5FP=X~1}ORi z(^8X3LGgA6H1rh!O!y)D_|>-DKPn~;_oMKHe&#rGUtYm{dH?3^yY?PDa@?XX?SJ;= zH{bpEx1az1^WXmayKlaH^60_c58u0a^{w-#j~_j_Z`XE0APxY1?w>hgh!ugULF@s5 z`@3;}i@pheHu_4w-BPH#p+7!L(NFZ(Z<6^PIdS^JTUT$Q{s*5t`TFS(KmGiV|NsB~ z{?iXnzk2e?Lp%KwM-LGJZ~)Ptr4(e*Pay+X^g~nxL;v~xk-v%`Du2nJ>|>)(^tJB4 zUgm%B=MN6@$*mLKmF?S z$1lkL(B56P``ZJM$(xqnC5UmEsrg}>+eKV;}*f5`vQ zlV|$>@w;!n`s|VAfJ8t`|Cam<@@7oo{uH5B21fqR?O!FR(SJq!->QB@Kkga*(S%>w z|KjDw{_Xa6{T9*hW94|_W!yvkj?%nLhbZr|1bLAbNSoo z+tP1R*W}bR#UG^~%m3FZ{G04^@$GBx%KtyX|G)k2`yaml?%V(R67wSfzH?pvPYSmC zze*sx|ML#D`G1(?ulQ5R_&@R2ihm7*toYY~>Z@@4TSodL{_Q9J5&o~?00e-?CjNb^ z`1kqa=kf34F%pnf0W7rQAO6oX5c-J;dW7)?c^3alEB=<%+s_vNTSP|dN&+JMUB80+pEz<*6$nM}l7))@R{XUW zAmksO02DyvzbX|~02VjpAB`8Q`lk9N|62J^#rM>i%74ZIO!_~0_M-CN2Y1B4r%%X# zpM6UD`OBRTZr!{_{-Xq=0I(`BRe)0`Pf!KgpZupbfbw5hU;}^U-zvO;op}9Nk3Tve zDnFI~J5qg<|A&msgucxHWdJ4tkpSPmrt-t&|4$x2e)Qx&QFt!~6H|-4S^TFx5Z0{`M^!*Q_M{aP;2zf1z) z?Qa~=mVkJAlYpnG{<9RYlj{2@DF6*zf9KZws{d2~-uckfe^ei2|D#mkJGX7t3qaz} z;R$9Q;d%ij*wRm<`d0YS1H?2R=)740K(9|aKYII9|ML2>A|M%fCH3!)-TO$vlpyx{ z_XE|xw?BCQmaYChgY%i|>jAKM9?{39{sFXssDIEDFkG9`+>=1Bc*0+3$c zD!^#GVSp*>dzlDG1!NwdrvBfL22}rFe*4;WTm66Q);l+ET)jg5fBFQ{-@j)k+F!GL zDb{a!KiSVJ|Jt{s3#Jx?9)Os?-2XL4Ie;9nrVN1RXB(3NiNNU@!|cz$=kFgqzfPVp z@1JYet@qE3>lFW&E}XN!f3{igACjMX5H|6v{Eas)5Xw(~%#ZSu^2hNthhnroRe?>QcyZ}a@SW`F;k;R$S>UpuyJTDRJM{Yeve z01vXnZ!7<0el@KYl-_@O|El|=zPs8Fwg*@bJkY!V%=?$-$Fdc+_b)2o{d=1C?7wyRX=LNVt#u6n+KqmFMWU0do&MF>jgv! zZUkW7|0~y$gPvfa!l6GyRX#I;T#m|8e+@1N-QI(0-r` zN9fI`_P1Rh>od=9^*`kOb)Pk$)c>&ce@yRLDF_8v-9Np+hpPWW5|~v$5K;q%7KHjg z2M--SLJP(^Zyqhw|55ve1{7~U)BjQXBbgp-ycK-)`m3SWr@jAU`d^j@@&r-{w)el( z`_&`lS^o_^`eIr6%OsRcb-1|24%tJ#aoX0Li^3_&pQ9 zlE2k}e4ztjYEa%FgaC>_k}!`jRRNS?`KAG<{vW+hII#MEGyv8A+o%5D_N`ksu7|wZ zZ$#eb{lDJCUaS3O8lY-F8Sg70@nZn;K&t~p4z#s@6OxEQxBx+zETHByt#3MjE7z<; z2lPL8tN*!=L;G_N)OYCe>u5dE1-Ca~trj>PXj(krI5`S5H2i~+GObx&rm=2u1 z|7%)c1i?{EK1c&r|99C+bg*&r=B?Ye@1zI2dlzTtjvd^66PKs)Wc7b%PNVlV2H%tK zQ~B!pw(c9bPctC3AI3>gA`@MkX|FY$))>!>- z8sOVGG{Hrj7W`^tPv6P(zo)4GJzTA)-pTgub3znOvAf}h2JJb)IQra%5B2GRm; z*Pb#|Em+e7)%bzg%k%#KTGRhm_n%{kuYtOmK&b!E?I(`q-LKXgLoj-OvCP2K{Z;qX z+f0D$;)e&#KPpyc@~c-!P?%hREND#7n83))aWBq4%mjiF1WY`ef2>*w^~DRBLTUbC z$lK;0>b-VQ=S9~Kp!rJaQJK=`g$bA$Ju3;5gs=d`08QVRKrs2#^vjxnOq)JaBM@u; zvwX$MRki`pD#ky{mM&Su{0G@<{K5=Qwny1zrVscYq0d}jt+!tfz$^hgpMTMYVgf@O z(v07j{=oo7Xy#wD3mCp>{I%2?e=z`CD&pMTHvfV=!e1w$~>r|%`-r|>kDN1+kCNdjOW=!01kNX@|7 zYWQxO{|+9?{8!UwCa^g(m_5&i2MvIk0O#k=o|Tu!{CBFE|BlJj2;AHr@@Dua>4yfY z?`QeGt@Zz00CEBPaH<2P0fK-rfjGbi)&w{m=m8>tgRIHfQ(<97Zf-79Xa?ZSzh};v zVVi#ohA@(_0}8^Le}e!Z@-%1mCkTWuiC?p?=fgi651`I$^M7WLn*YlLz}+za?+W&! zZyH8`2sHl}_`uBnHT{S1^c>Cq8NO#R{}*)(pZPy=hua(S6#bh2`)mF$9F%Fizi@f| z2=vGrL2C%w0Nj&>{t)z~YmemAK50UpfW9yY1hJ4k#o!+VfXD`XkTt=e4@Qmv1Cl;~ z**h2%Yx+;mlhJEn15N(C+)d*B)%7U@G=eu8u;D*61(p{Y?2U#00DU411T2965CCM7 zIayiYKLB533W73Zu(`a*gTb)@P#{m_Vf1Sv?{8gSS%6M-MOSx0AP9qik1Pqqb?BJX z1tSphNcb1PH(+nTpa6go{KWuZz`uaOvCt>a@GpiullP|K&%qB!UtQl{2;cl_z+b}u z_y9et4+BELfd7eW&p4_Zm@^CiGdROQa7K;-0F)7zgh6NfddDCe@g>=)*A>O=(8^1-`WF0jA|9pOwgl-!hKXH>$-x2E$Q@f zEHq(Q06a;+Am9uG7XGgtRsaW}&;)`L4}kE}()#l!4J07=KN0WQ9m#`01b7AL1=$0? z3vAfHLcamO1A_TWr%81cLe!@SB|rVerU=mJQ&Bz)yui#1EtdgF+Pcv|G0x zfG~l7rof58e?q%!m(EEBf{N(d2=^ukEU>FW0MuUspX`L~pI|XS|H6O=Mpz5%v7pCB z1d(k(-#*8`0)Ksex^xAGEBtGR_8@ShF?$RAiR}IB0K+!;*MEO|F+mtACHyZo-~$v5 z@N-}gX4niRv~Ghdzyi?Yj(~7&_}?TbCw4NlrS=#L|0@(Wm&fwJ|ANE^e*3%dzhc0s zpmNn}o)-SO0l0URVDQgT;Ge->$G4B~(7^&g3;vwYK>%pL$G~2rxI3Z;{|pWu5W1hQ z!JrF%T;gTOOS|x`Ph$fX{u>?G@!z2a{~ggP5=$^V#DRp4kJBH6|Bj8}=7xB4f#9Y2 z`bPE^d0~HlJM0!FuHTFVU;sBT5b!#}{tN#e4*oqt(EBI=@CN-3_8s6ku;$h_;*B);rStZRsdK8`8UYl!b~6m@c$L$1~&XZ(NJ0t2wtlP!vDjC!2g^`NDF)4 z!t5Xj|1aunAPE0&Rv^j&IsA8){~`+xEZ%7U0T4VZKW6(v8wgk;D+u9DwEoZnF3bW1 zA8a19U=PFEf6x}l3;Pdltbmkd{ovJ>U|2ta0dxQk9wo4FREG@=2_YyXg#C~3@TM#y zumNI@7C^!qHx3OA31}*)?dv2 z3wtM=P&Q(M0?qPCJ^wnQUfs*ue_;hk4ZU2kyGqZsu7TAK)4i<9I0vJTi{ui59hPEN@?df4{ zph@)F|9W-V+c|J3Dn}@z4K!{3Rr6#MsyaJpETPq6-Av1GT7j#@=2=ZYcF(GNd$aEX z^~#khxUd80?DWcpXD4laYV%Uthvi&cv;?OWJWnrg_WyjX{Xak30w6N?@%GjdB0GrM z|1(RFQ2!4uZ{vWiSKIz$g-S*W?(VEV!iCl!t#4jlUY;HnZ7qVbe5kui@qb+OFUY~H zzG@8-TQvKhZY*KCYyXo)Otb%44Vjz$&q^Y$71Tdx`_j$?8_%p^IFN8=jI6h zRl{8&TEG1Z926~%DU>ukl-2$->(3ms{;d6HXtR8*J@7w8?Z0NDh=W$oo!~)R*zjTP gfb$a~H~Zg+{r`%%jUB^7;r(|fHm=PA{2!qGzewm#bN~PV literal 50100 zcmdVj&5kTbk{#gveToLO7g(2MH>sTlVoSBym1jvmoEx<%W! z@6Hh`{QPitk9p*04;P@o^ZmaL-D4+ed{4KIe!=n`I+>w59(B})%s6g-W;sQq0by&zx(of?A=`G+y{%> z6|Mjkdy2FDE!$FEDDE@hKnpk&xgv7~M1Kd3u7^nSdI&D<(?`I5#tCj~b%-$InAT5& zR>IQXnpqta`Y8rfjK~cpYSeCi9$TU6s{Nzn_vPy!&+(@(U-ys~UHjXMwr|fq2nO&O zZQy&iwwhW|tC1y^fB!cV#fdvX=sMh3`|sv}c@JUD#p_>< zh621}frO$l7ra_s?QH|v+xTWY^KZe@5}cB{-UAasv8<&=Rg1bJwHN`#p{Q{%0*7dG zJ^pzA+7ABqkv=|fzguGwJhu04c%;JR#Zmty!6W%Z^c!g7i4XGv8Y7^~*j7wxjj32c z2{?Z`$4_6rcL4V1FF)u!7tdeY$0Hu>aYeE)qO6XLuVPpeBwOvT#@D3q`&WjqGo(aF zun&{?tgSs6+G0kh+E)#yXdQ&$^uybiACzDYR=kIj%ys{^u^n`Fc&Y#|oWL-?!(2tN z?p#Nn5EwHogkys#LIUBddcS82;Tavjyh2CRjrs&$=!zR59dH}tdPl7Ih}=E?_~nN` z-H)H{U)|Mb`!A{o(u`ljtVs@%kEqBVxdIqj;zmNwo9tmwLGbqk?K*aBuYnGNn>`s{ zy|wUhy@q?5)XNsTni|6@5I_NwgGK)Q<;U;7{P=eMx{!way&gKuk^YM>1PoYXHU1dr z15M0{6`(}$lSLNFTSz4RUjfLg4dRdl+ya8lsILgp;R@f{U9l^01q)sd6j@L8unu}X zdaK?1?NbZu+UW(*gweIlqDf$mLRuk`DO{cVI~GFd-?;<~jFWWh%9Cy%eq0QJ*5Jnq z>%p+{6cefa4S=<$7+C>XxD*#66is@tP8a^}vA1;V;SrC6_k!xXrPfT>Kwt5E_3}rg zjEnz%^)!i^P8g$kuEt2BD~ipwMX_c`vT@$vSJNwg3*Mmh$M3%U@$JhWzn(+le>(P- z3qAE`kA)nxPq^Zc47Jl5sTNdU5mi?5_gC|rplQh8$-An{@X{5Ybrr5?{=ti_U^+H+0D}sgW>z6-$KZp3ThtlPx@Cxi-CI~>`QKh%W zHpka5KlS+j%TIf>r5*f5&f;wxqZt#%W5o#(jSps@pqq#bU2F?V*MOj$+9!zh0e)4j~0sMv9 zfMd`xfXQZ(QwCKW>z}VE3h^aGJZu;;qR^kY1WUwyz}wnD6)m{4-6wbjtHQep zY-2(V_kt}QV^36W94N3gR;WU$r~;E4euv#TCF}3bnWFup^W5(<9?xMM11|Vue@!BvW1PIH#fE@4wYAi;Aos%-(<%}78be?;se?AW}8IQ-9 z(>!IswBSen2J(q5fxm$T6;x?dDfXg@s)M4cj$+?R`HH>xVKPgP2lmqCZ^HhT{}y*M z)XEJ9?k*>;R?ai8xL;!PBYZIN3CWMZQR4>2G3y`{v~wOL6VI|mnKS(!XT0#E^W2~Q zdG@fB@eUg|Ch7?51%eOTU?HN!Q*dWazn%m3Pef9i)M&pcX+GjOF+JQ(2dhchQfYau z>Nbei?u&mT_|_bBU|dX$Wzh}VjoM7FVda2-Og%saxCihHGHK?;Fmk5O$|vz&uCHyz zoM#?nEs-JRO32kMScP~Y84w#2Y=$9Gr#WDQ5hj`dKJ*4As$#Rw02=7bPo0?6Zwme9 z$Rl~sh0)4_1TNmy3s7}sVXNw`P#Wl&eG9$~@eFQ*PAE9G55BS4hs_WC2l_yp6Lb+M zI_;@{tZlwuuhS=ebLP36hr*0Yy_>IO{+I&!8mailgsCLw;~ejND0Rg4O~|czga(0m zqZ7P<)jfNB7@fl8X zl({$NaG^zt;>GJGOlt#{f|QCBRVQ6J*>!3wB$#!-3MXAbna)h04JST+MY@nv$@wTX z=@sYL)a-%<;KPJ$0v|-U<_8X4KI$3egJ#ce0gDOS@JU2kcL+`~<=~d~!$GhQ&hF0% zHx=5ORq^{7)4P7p_34*qb3S-lmpc5ocjLyhkF;`gmxeFyLa|LGue?kZwTpwtri=&= z%?2*&(2g<*T)*royfHfhgd}fwS$K)8(RhUtuBkRfNf%Wr3#P(FMAxf}Y`$oP#MlfR zTO`n?XOhK6$2YEg#GWI?;o{&Q+&wd=KD_shYC^I8^F|9UAA4aO6E4L0e>;MC!q(GN$6Wp z8PT|+SJ%7EBY2U`%L_VN!ajvAqT_|Dn)^{cMQ7MdtT>!#TOSFI!8f>F`AB`i=b2L#4*z)C6kUD@jr;7*uCno(uTA0#s6fs3Qx&vKylfZ_>`aF0;D$H0kh( zxR3d%@*38<7-^=_bu*0`3_PV1BhNkbytuH^fIaO<^9gamf+2~F{$z^6x-EW0t%`fMxZjc}}G%H(7o z)dXg?M!ryV_n|9CvD26ZJjQ;BI5{F%Y8!4yGyH^`@D^^u1#Fq*o8rBvXKDY&QhT27 zxu5Iw%`-XkJVj@`jO+gRXZVUNkxBd5OZd`v{mS=%G^;DmUAW>?4SZA0Ju2*OEXoGZ zg>hSmpc{n!quh1fIz@f&EYvXan4?fE=?JvVe_oI_hoAoIjbV$+#Flxdsl(D$iid|$deGv0;bN9FgR zYpcF)CrAsTAb4dfQIKanMZxu~u8=ONDm$4UIo2ug5UK#_>!NPg)TtESGL)pa)!l5= zB=&83G6sT#?sul3w7DsoMnjs9L%DZy($osRuQOd)iW59DbeM5Z_(%LzHgmz7^{OpLG9Q20w^#Nb*`~cDaN}jpTxo~ zF4nuOdCZYGV1_CGu0MLrb+!|Ts8>rqq0`grS-VQ=!gcGtU9}R8fLn(fED9KIirFak z5n04Zq#3dha7|1Tq1+$y*JoWRLjx#lqn$vJ-JUMcd$h zcydoxeY5a;lj84Zbjo?!^||r*5r5E_2<(|HQo>ziHP?DwbRom&<9fK$FG*&XX5EHr zq}<}M)kxRQJnrm1ne36<8YVHZTN}ZPYuz1=)0mEACq&}8B}jKMSi!G!wo65Cu-$l# zHqj8eQz=J^7z#uO1!yd5?yZ-_`tv=k1#$hyTOMAtOobV9$Qy4GeoxN{Nj*lUwd3=l+cn9p+jXnG zdmiW@MM6So!pW}B5-7F1+j2ypROt8BhCtbJ%yMy3j%NIw%e&Bc<+<`##;_!7w*sa znJ4pkej=#vx4ehXiJZ~Fz38z^0@quoxPFbA-4JPwa`n7jvq78Zbt{DD*}XW+>kXOi z?>@*U;c|A|RSGhuTrGH|FtOaweK!sjwJjuN;a2@nnJsq1-`3DHo%J(qhq+jX zu{#U9=wZC*HOm>-6FbeDXg0A^pGTD`G}ZfdT>w#$a5uBMD40?O{NmDM$t{aTYLgl3 zvWT0g8B3$)W8oIhf?xmk`g|GF}84m!%qj|;?^?TvaGsB^K zvp;h<)E>Q}-(&{Yr*4@AxprG!S&VP)1DjO>5A3>beq13#FkQZ$4KBc+=*hd8#(hzD zwu_Bp(&2AQObfZbo;MQOx^drHWmg3v=LgP5@LduZbV4-{x43jYVUt2h{*&$imo@N& zDAx&D<9N^H`99=@6d(@)u{vY1pf`5i(>T7 z81&RE+J`=UZjm$69r}zv^ac9R7wX&}di2R&PF5|>ujIL&ZO{GmJ9J*D)OMrM_nR|@ zy2wh-T@gkX?a^oIX!2}5W9(ZtH1Fl5ff7^@Q_Ls@x0snw3WS7Gg{U-!f@>;7kYSBP z>5~f2;vw=+8oVwZj3OGh05y7lGGIRL{}e_aD+j~RdXJ{Z3FG*?)^q<>znJwUgoZ)w zS!+-33zB3W2fQ#ij^z8YcUTi~Ak~xA3hO=7W`A~0h!4|;&5WZh;dsJw=JEaJknW9K zAr>39E z)Afx({U`B3Z~QM(ANImh7)w&f+mDXbekQpx;5Wz!w&R;DTr)uSZVA1nxpl3SPb*PTy5CMlY?KNbOW zbeml>&6ropcKc=56T+!EuHkf7f~u{EMun+oh@WEmR?oQqQjCJ*=7`{%O%~EkCJcq1 zORcf>i|cX1Kn|LrFwS@A3vFmMe^1V*V0%9kVnciS9Xdm0#?5$#N;*u~hRoDDWJ*E2 z8B+U%R_))+j^v;E#`uGW=XQy&zG3{5(uUR9R%5!=mga-B2nxgYMsXIwVV!}o6Q3B;zI0{iy*$ zq#3i%Kc#7mI^eiJ*~k4UOO3V8sPB}bo|_mL5}rv6L5I8$8^?4e(46ZO0HbR99YWv9 zjB(U4Gmq<8hyrb;}^a`N*&Z2`}qdy!1`{3gK;M8)pM9!X@S&|{eJw$f9 z)Pmz_$w+HTMSkK8b*XdCQa=WtTkmfp)JR+7%u?TiDTBAh=`T~d&>+uahm95q8kbYVItOdt5E9=U$i-&U$h|wZ_+k zqWRQ!n2oyWf7r~JSJ%uuSev>h^G7D~?tTD0bq{K@6=AF7i+#a=EZ|X5T9bu^haw0x{Vg zH}qrD?3nD1O&l@e9V)59Ii^&bZH$%-a zs;HTWdT2~ci35hhP=^-Ue6@!AD#Gw7nFx_jDc2bZG3wc3e6L_V@laE%GV-@%jH%**L}HGudRAoy-I&iTRO3h z7cQAAdik-=tz2=*G7R;^Wj6xE29jJVo>)lajofrfrk_M{xYV|b5Bi<(nlLq6m%%A` z8E3+4?9TOs*Wk+($0rjCUB{OuImYi?kI%(i!y|6!@fDu$XTGOBoTguVG-G&v#&P}P zo93NGN#wxmgxSbSe=wIm5*@SnT{#^tqoy>9BNCE{9y0E% zHiHwnXZwgACuh#K58iG$lYP#{oqoe5S)=E0X`JEGGv?VscDZaJE4X=mr3}G}LKeiI ztVo`?jH_p4JRUBSBTa6-9x(J(m1=R^UP)N$3x=Da7l&n$;44y509=zrmxiKXTH-j_b2|ko>-f)j5Fi8 zp4|g|rv@U+ma~zEtg|q|QRE%D!zDY7KDSa(qGT-Y?&xc(0oqxHUS~|;-kGRw}F%}l7N_zvzH5x(GS9pJi(E#Ya7n(~B2(L^ zT+(~}QopHXKjcy|SuXh{cd=}^a%q7njPB3hNS?qG7yQ&OTl;jkXMY9I7(1)i_ZTZ% z_a^|~;4*%BxWq@6TrYkZF6nryVdIzDrgp^dynDKGNsXyrwS|Mtm5HI@=x~X1wOjuG zBj$7b6K~_2o=rR+E@3i$scq_6_EOCUDJ)-T1_Coa#fPhzYTNb&@mZ*s{mH^x43xi7SuFLBx0N4|vjON@bp5p`{c~SWnwmz zelf;|OEPVY{fJ9#!zF#zFT*8VcDsO{a1+*2bkr}e`Ep)xDGc9VaIIgG^6r;%;?_Q~ zZ)%oH0l90E5A!81#n@}@L%!h>M^pR6?!qN~Qu|Dd{md`vvwrEBU^Ht>wmg2RZC*m^ zcdLEyurc=GU%x6}hVSr>zlpK22hUIK6E5AqtxL%Ni}~^wxQzZ&1BOd>5H6?oxpBFE zd5y8wm#saH>zQN%#WsO~kg3Uw+2rlV5(DON5#Fh0FLQRX*g>UI8wj z-g4n`f_(N0;+N!{^%9O|uK;i3mvrUrpRX_JI9$Rh>$O>51}o$2`jWu&1}b?heuFDm z+}D@%nmC*I;#yLv|Ao8QX+GnRY0rKA(mw_q-Lp=e_!@iRpNTUs>&w^~xn?gTT#|S8 z@xmpUZ|h5KySeU}@yl@Onc%Z)lKvdIdj(ySw2r;5FA;Ffm-WjiLr&8g{j4v|kU%oG zp7wpjSbq7s?_&>dxKt7Rx%)o&y}ckgToP`#)nS)?pRCoV{vrNw$>?_9C%%NIS(msT zexeIsn>dP>;V+-=PkVUGGwIJZK8>$%&%9Ij;3_{5xoxj&%Zr`tb;xP&Z!bOb>AugE z%f#C2z7H<@gOL8HXZL*+pWoj1374uSW@6^U<#liU`hz-qcnT|nH<))nR<^x!8QE~e zOy2ink6)TaYzP@X7;|dM_)X&MlW)crZ+ylNoo9^$P zET5WsHu2H*@NwlcTqTC)jBfd){^Zr;kKs}KJa3$>dB}QuPh$R&<8Vp7S&u|sZD(zn z_ddg=`%}Y4Ut`UB1n$9OaM5P2^TQC!0YT0dH#|RlO=6+16!pr>5`+I;sSKJ1<&sjM z5$EfnlHE!tBvGW~aaGj(4^)sj@6*o9%T%(a?yn@}O;XMqFXP2FW&&-8$!}IaSifb= zAg1lMyH4iW$qTDQok$xGa-C}B?97fu`W~~KGubfAI`teI`?4XP6|@WJ>x@Rp&m)Ussl%A13KHJ3f7R2|TNjE0b6e2KySiFE9Jc z<^E8MMoci4N}Qn%Gnh1vIgd}eUm`g(BF7pCDXTw-sp~s#Nut?WG1jg8(S8fF0Y7ea$n<^OGekL4(wuY1OFOm44M8#` z>mkwnQ?`<8QZv9m+=3<3$f^INNnSCbHL$v#G)d2t?a}*I^0+@GkNeUDn|UlNufHca zTLd5nJopvHp<;g+QX<)l8CgSq6yjtjL5)(w^L3lR!@~6S70E6~uCKc;+vn!XFHSa&l#-?%%o2or`}#S~2)$3ksxgwzK1`7K z2ani>Ic^+gPI64S>UvUkWOKc~7}?1*zUX>_YIJlxdb<8bdOSZP=n|yAW9B8|sYT!Q zKk4ZbM1I7hB?xU8UwI^<$8Ga))yGzkCi*kw<sk&P@PUu2H#+EcOF*}Ye*^n3}a#$!hNHblukFC&ER zTb09KuqXz~jjeL_rE`BkKtDs7m5^OXhDFj4K5`F>y8!9Wv^GJO#a22`??w8)61p+$ zsi|EjRP*uvj=(kZ`1sw3zNr$%uwCzu?p#lBeJ~kB2iY(gHGNR^52^7Xxbc&NnfNbQ0rJ zg|oG)Y)1p0hDC5if)JM_q!5$H3ZP&m=1h9rGH3s@5WSw>It#1PyNQb^K7Z(`s$Cn0x`zat@=-B4U?`1NvI5yQ6WgXH>;5_V$NYh`_!5VwF#d&JBMyH%1*QX3dw#Y@t@k31iq95u%s}1wSRZ=!gyz0vF8cugd=jmMz$I+a9Nqyv#kBFnvQpNpy8KJV7fE+M%x8`>qLnEF_Em|*H@V~#h*BF!>Z z>3Y&5on{qDuPN)BcL+=pJMeajlpO2->ZujQ%whClhq+lPz)eIa?- zEPqrsr$WvD*o{G;O+b3x<0((xta$z3CF;s?7aY>#>z)oxGw8Uy@nbqSPc+*WtB?&E zTjYer2n2;?(f47|bHk$V<1rT|H^#a*?@JD=`OKMi$mbm9%riwOglAO<60`4uf%0Mgv|Jv*L-6<`o)-*JkRWk z!u616yxE+h?^L6n`ON*cl)>NiKdgi6zIVJX5c@M_+b~kWM|rUSb5jH`H*q$M;_vB= z^6rpt7~P#X=Cm)BVYEe!>v2N*#2BYMjc%^9F|`|Vu^sIx?Y2aPO)uHkb^QK1MJ=3w5B1qIJaT}Dcig)VIJz5GiS%+#b6U0zle z#^T6NyKj~;tx2!dj0NXoabc_}OIdNo&A@T|38SuuLG7ctse{Ca3=(z{Vq}Bx6!lk6 zjK>&nSTs&Na=bEZo-?dQ@5jA)HDTQGw!@k}<8hfU^JG5Htk?Oz%(;JK&bnHw#(=IPOm;J24(>SxP*0#|UMicSE!{IV~ z=G1S_^F8;|&p7L889U>-H(qYM*+0v?+9JpB=KI(eoM!DFxs5Ztxwp#(*He6hI{Hsh zuDpX!f2uJ{hj<+fZI13To_F-^(^K8~vU*TnE_30Ikmib7an88tQvurlKA?+wPHQ<> z*Xu%pF^B?cs(THZQPDE4XY3n&+HdrM@ald;U(CsKQ?KhkE*Sc>T`3$Ii9d<)P#Jp8 znYNt9o4^|jK9r&0#nrUUy!zkV%@~{Lj2-#2y1fO<=;^tsRHDCNv@X|I1Oirf(RR^y ziWOPoQLONsZopjQCGIcbvLSQIPI3|XsqE}B-ewFxoqcXmgaahMUSB^wyB(cojbp$m zT#P+o1pe!Kbe_Z)4D`FXp6^?Qxn+&S}1 zo{!FCy}4QD3um6qKGC|GF-K1KC&3wSs_5vZ?^KuWZJ5mUS>rvD9GI@|wnYke>n=8+ z&+CX3Df}q=4umup-roObsG97~_6u`qvC?AmwOHwjfvI?6U5@{&T-W6uyW26lh)%ts z&h=17{arXvcij$@OP#*6s~G6?pU4^4(`S}j+LyvWpVKqzilOD4anEz6&y}i-L%y>F zzeUDS7CE4HjgISP#*ZGG+4LRCjCYphjgab+zCPk=v(d@(fk!ANWBRYClulgyyMH0`>;gqz*?dzW_1=^7<3tGg%xj9nd2 z`bJtv3OFH+@)LxBJBcoq?)eXib8i!$K1*VVyq=6??xoL#qzQtV=Ma^7GGAoTzT1^h z+1f*&i4s?`+}i^15vbv$!S^bCj3=ecL>^j~MnIOLdw6`tIGiGtdetH|m5L_*IFn!YbrDC!Ek z<>CgzE%m$EtnPU7t){U4HsbDE7^>U*x(H<@?Bgi1K|5vU^#})Go@lwr>vl8Vhc1<~f;zFeNvw29VxQ0jo)@~nGf5%P1iC;N$O4_V z@v}g#eS9Fa1#0(~zEJqldHSS(o(t_6-*}sxGEe5y9+TPPUEBDRwlS}m*`di?pVQQ2 z1(v7yCoah>*Hze)PtlezpZgREcT1TByCHd9mg&**o*zq)d|H{)YU3$)DLDG_T<#JS zLBF9e;lpIJMl(^?Xp_RIKg&^V165$uwsdK~QZ}9t?=jZW7YaT)^;yp`-;9&-z&_(= zZetBSnP2;cJHSo7j2>&(3EE2)Q|Poiq1xrhj}U&*#i|nJ@FYKl8c2b%XXHM_c6F z>fAUlK6D7Ol6h=FL1k;cM!W7pO`XoDh(rnk(D8kBMXqnT(LF^Gj4P=DRgDdMmf5W- z8upZdv*LQrQr+ihC0K8=)iErMHvwiy0?HJGKw6K|wnW9U2|Rfr0A9)R%ve9*<}-i? z{Og&voTtx&kRj!G%poT8=r`4Oh>0AC*c_z)<5zd{yJiK$?k_Djt?!s9Zscv5NG^a8 zdv1t>9pJWXfNXaxOl;2B!T8VJXP&=7Jnug}Lq`6$?_PE}+!tuPR;X*uchXWeGx%uv z;rF~qW}*y!ltJoMa!m0DkEtbKzK*1AFbOvLjWdO#;1>MgHHIFZ9$ZaiBJIIEpXYk+ zWt^PpA1-ocoWqClr*PBfLr%1hoROCj0yia?T35ArvL|6CI*( zB1PH&JgX{gSAr%r=|9EaA&Hf3Bnr^yyn=t)(l_Tb8JX`8606O;Au6&30AoFNVNaSN zJPb<;i$e-$>Be52Wj7o)*}w`ZTe&rssj4qaSQ94S9P~f`v@U+UEuq>|OzURES=uUU zElA!g1k7BE?;pNpbQ8B<4VqzAom8u+;@&QUC9bz&u6?Xr+(`d z83*8-O0HzYI1U++>*^s_J}A`S#eg?>QGM4utoBsW$t|)$w-jJ`EvA31pM=DBm8`v?9!8~8I`&X@xg$43th+CxJV2)7{U7GR9@m5J^YlnI#x5O8_QByzwq zVM23-Z2(_iTzu{xxpP972QQ_W7%hD!bm8N?n2L`OgD|b4XT_7~CD0niqNgty4auFdZneQVgJlMN3b%zr&73sg1{8Nz3ZeWrM4Cbm${0Hx zJZ+?1QPke0d2`DBA3>gVU#nMkLYqdNlLC^Ji@F&G^_$@nd9kktV4w#c%0|C}vj;>A zY7Mx!n#JH7JIqLoLQ4`zH-eCGBM7fm__wB!NukTQ7Tv~h#tdENFzCuDsWg8(ya727 zr&O4LREWhYb(8(67CY9}n_s;L=+bRd?2};^Wy^#~v=5Xw!o$MR2qVckzy#|aMcm(~ z!(H7R`pXwEZD=U6_}iqo$Zl+Aw;~?L-5RBrkmKz(c- z02lGBf#_&q5H;V$cWRGEET;29427vfVrmO?u?ATY2VW6f90$sG11*|{I)ODi`2giJ z4X-fWAh1<(jdfF4VP!xv&6B-CfY1CHb;AMk{uyYcwrg0BIXQ@FyRNxrH?_?~hM-G{ zmetUuU(q!jbm`hm$ACo%0CU&|<61J1iu9Ot4EyzHA3%D<0ZxM$%0$#Rg=4LhFm?Z~ z{?ve!cJ|kU6Eb6y z3#2K`1xudtgeBj_Dm@pG6v15M#P%AO%@k6l`6) zpfXr?UEKU#@41;@J;Ri%e(*IHpI{G5~f9fxmpA?pz;>NFw#OwNJdKFhE-2dggRGK zZCOC&T5Am!8g)^BYh}F{v>&)_I~E)TuqnJ=Z8{ioh?Yo=lubS;UKlrCZXH?=-;hb8 z-@Hcs9J<##L@Jm_gePyPeG;sZw0PF(oBwN~%~XYyom>r-BZAaXbA@dW`0TMJw|9$M zA2c}h7QnT`R+@6=V%S1{Ya=q(8s&r8R+&KQ`9E_l`U=>$S_psj^yZ|7&pP`xf^HCH zB=mK#nI?ZGx{x-e4j_$i`CEj0(Z4Ktjt6M^_IJ%J4Tw!H$<+q^ojv&qV6NlY4|8luU*Fz@zA$RJB3UP&xEW;& z=Hdwo2TTg=(?zi=T&&q~1#NAvxHa~f9d5Ne5uDthyLhkKmKuM~R^2lozx_K!4urgb z3?L*LwmEepBv#2jejOBnUVEe>APHWpr21f)zrE1;KpV5_(YyZY??8gbjpHz&!5z)K zFk9G2(prX>a9DC8JX!d!Z**6TiS_Vfj9yK!8K!ZO6>ex;LoA8~vf3|}MYO>5Z(FW7 zdC)OvWi{e3GKvbA>DXDbM3Zg3^bzNR*}sgn-LZ@FW<9>xVV3PR5W?=s0&5TS91tH4 zU4to_dwu=NJLh;{^orD^gP8gn7_crjb^_aaJoH418as_G)E88@IO837?A@bY63}nd^yn*yZ4acNs za1QOPaE^!B(YEl>ydW-=;3y*fTWGH6bg1>b8WUJ1W+mGHZFu145OScKjS<{YOIz6Z z>9}gZ8~kb;`*#t2zi7`s2=zMJ`dUq>{s!8=S}pcD4!?A#IK>+q#~R75P*JXc(RHn@ zHrKyx@85P7njJNlKoY-7fuO?soAj-3fs_PU-%G$ssL#KL57w%RR{v6ZkG<={I~4x{ pLwu*+qvO8<3;7J3cVLnO15W>Wd35;~$f|JyYfM0}`77xC{{hlv{JsDH From 145e6428baf9e91f71890a3047e76ddb26f6ca5c Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 10 Apr 2010 17:24:44 -0700 Subject: [PATCH 069/157] Fixing load errors --- basis/compiler/tests/alien.factor | 1 - basis/opengl/gl/unix/unix.factor | 2 +- basis/opengl/gl/windows/windows.factor | 2 +- core/alien/alien-docs.factor | 1 - extra/chipmunk/ffi/ffi.factor | 7 ++++--- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index a3df053ca2..8735d7cae4 100755 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -7,7 +7,6 @@ quotations sequences specialized-arrays stack-checker stack-checker.errors system threads tools.test words alien.complex concurrency.promises ; FROM: alien.c-types => float short ; -FROM: alien.private => fastcall ; SPECIALIZED-ARRAY: float SPECIALIZED-ARRAY: char IN: compiler.tests.alien diff --git a/basis/opengl/gl/unix/unix.factor b/basis/opengl/gl/unix/unix.factor index a9d3b42b53..c0a0218ed2 100644 --- a/basis/opengl/gl/unix/unix.factor +++ b/basis/opengl/gl/unix/unix.factor @@ -1,4 +1,4 @@ -USING: kernel x11.glx ; +USING: alien kernel x11.glx ; IN: opengl.gl.unix : gl-function-context ( -- context ) glXGetCurrentContext ; inline diff --git a/basis/opengl/gl/windows/windows.factor b/basis/opengl/gl/windows/windows.factor index 2ac9894b9a..eda1e3178e 100644 --- a/basis/opengl/gl/windows/windows.factor +++ b/basis/opengl/gl/windows/windows.factor @@ -1,4 +1,4 @@ -USING: alien.c-types alien.syntax kernel windows.types ; +USING: alien alien.c-types alien.syntax kernel windows.types ; IN: opengl.gl.windows LIBRARY: gl diff --git a/core/alien/alien-docs.factor b/core/alien/alien-docs.factor index 6c64b2fac3..96eb9002be 100644 --- a/core/alien/alien-docs.factor +++ b/core/alien/alien-docs.factor @@ -3,7 +3,6 @@ alien.syntax compiler definitions math libc eval debugger parser io io.backend system alien.accessors alien.libraries alien.c-types quotations kernel sequences ; -FROM: alien.private => fastcall ; IN: alien HELP: cdecl diff --git a/extra/chipmunk/ffi/ffi.factor b/extra/chipmunk/ffi/ffi.factor index b00f64339f..c1cfabe20c 100644 --- a/extra/chipmunk/ffi/ffi.factor +++ b/extra/chipmunk/ffi/ffi.factor @@ -1,8 +1,9 @@ ! Copyright (C) 2010 Erik Charlebois ! See http:// factorcode.org/license.txt for BSD license. -USING: accessors alien.c-types alien.syntax classes.struct combinators -combinators.short-circuit kernel math math.order sequences -typed specialized-arrays locals system alien.libraries ; +USING: accessors alien alien.c-types alien.libraries +alien.syntax classes.struct combinators combinators.short-circuit +kernel math math.order sequences typed specialized-arrays locals +system ; SPECIALIZED-ARRAY: void* IN: chipmunk.ffi From 4fb2acb65e102fc57bd7b30d1fe1213f8eb7876c Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 10 Apr 2010 17:26:56 -0700 Subject: [PATCH 070/157] vm: try a smaller call stack size on OpenBSD again, now that x86-32 stack frames are smaller --- vm/factor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vm/factor.cpp b/vm/factor.cpp index 89da7a2db7..60508e8a27 100755 --- a/vm/factor.cpp +++ b/vm/factor.cpp @@ -15,7 +15,9 @@ void factor_vm::default_parameters(vm_parameters *p) p->datastack_size = 32 * sizeof(cell); p->retainstack_size = 32 * sizeof(cell); -#ifdef FACTOR_PPC +#if defined(__OpenBSD__) && defined(FACTOR_X86) + p->callstack_size = 64 * sizeof(cell); +#elif defined(FACTOR_PPC) p->callstack_size = 256 * sizeof(cell); #else p->callstack_size = 128 * sizeof(cell); From e117300bb4df561851e790f689bde0ab08db69ac Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Sat, 10 Apr 2010 22:38:17 -0700 Subject: [PATCH 071/157] Fix build breaks --- extra/gpu/demos/bunny/bunny.factor | 4 ++-- extra/gpu/demos/raytrace/raytrace.factor | 2 +- extra/macho/macho.factor | 7 +++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/extra/gpu/demos/bunny/bunny.factor b/extra/gpu/demos/bunny/bunny.factor index bee94d302a..ae5757efcd 100644 --- a/extra/gpu/demos/bunny/bunny.factor +++ b/extra/gpu/demos/bunny/bunny.factor @@ -34,12 +34,12 @@ GLSL-SHADER-FILE: window-vertex-shader vertex-shader "window.v.glsl" GLSL-SHADER-FILE: sobel-fragment-shader fragment-shader "sobel.f.glsl" GLSL-PROGRAM: sobel-program window-vertex-shader sobel-fragment-shader - window-vertex ; + window-vertex-format ; GLSL-SHADER-FILE: loading-fragment-shader fragment-shader "loading.f.glsl" GLSL-PROGRAM: loading-program window-vertex-shader loading-fragment-shader - window-vertex ; + window-vertex-format ; TUPLE: bunny-state vertexes diff --git a/extra/gpu/demos/raytrace/raytrace.factor b/extra/gpu/demos/raytrace/raytrace.factor index 2ad6c82d7c..bdd1b51deb 100644 --- a/extra/gpu/demos/raytrace/raytrace.factor +++ b/extra/gpu/demos/raytrace/raytrace.factor @@ -10,7 +10,7 @@ GLSL-SHADER-FILE: raytrace-vertex-shader vertex-shader "raytrace.v.glsl" GLSL-SHADER-FILE: raytrace-fragment-shader fragment-shader "raytrace.f.glsl" GLSL-PROGRAM: raytrace-program raytrace-vertex-shader raytrace-fragment-shader - window-vertex ; + window-vertex-format ; UNIFORM-TUPLE: sphere-uniforms { "center" vec3-uniform f } diff --git a/extra/macho/macho.factor b/extra/macho/macho.factor index ea71583072..d371b3ac72 100644 --- a/extra/macho/macho.factor +++ b/extra/macho/macho.factor @@ -1,7 +1,6 @@ ! Copyright (C) 2010 Erik Charlebois. ! See http:// factorcode.org/license.txt for BSD license. -USING: alien.c-types alien.syntax classes.struct kernel literals math -unix.types ; +USING: alien.c-types alien.syntax classes.struct kernel literals math unix.types ; IN: macho TYPEDEF: int integer_t @@ -524,7 +523,7 @@ CONSTANT: CPU_TYPE_VAX 1 CONSTANT: CPU_TYPE_MC680x0 6 CONSTANT: CPU_TYPE_X86 7 CONSTANT: CPU_TYPE_I386 $ CPU_TYPE_X86 -CONSTANT: CPU_TYPE_X86_64 $[ CPU_TYPE_X86 CPU_ARCH_ABI64 bitor ] +CONSTANT: CPU_TYPE_X86_64 $[ $ CPU_TYPE_X86 $ CPU_ARCH_ABI64 bitor ] CONSTANT: CPU_TYPE_MC98000 10 CONSTANT: CPU_TYPE_HPPA 11 CONSTANT: CPU_TYPE_ARM 12 @@ -532,7 +531,7 @@ CONSTANT: CPU_TYPE_MC88000 13 CONSTANT: CPU_TYPE_SPARC 14 CONSTANT: CPU_TYPE_I860 15 CONSTANT: CPU_TYPE_POWERPC 18 -CONSTANT: CPU_TYPE_POWERPC64 $[ $ CPU_TYPE_POWERPC CPU_ARCH_ABI64 bitor ] +CONSTANT: CPU_TYPE_POWERPC64 $[ $ CPU_TYPE_POWERPC $ CPU_ARCH_ABI64 bitor ] CONSTANT: CPU_SUBTYPE_MASK HEX: ff000000 CONSTANT: CPU_SUBTYPE_LIB64 HEX: 80000000 From b34331431ef70476e43e039c54591db7bd22e911 Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Sun, 11 Apr 2010 01:46:00 -0700 Subject: [PATCH 072/157] Use vector operations instead of bespoke ones. Use different verlet integration for ease of use. --- extra/fluids/fluids.factor | 82 ++++++++++++++------------------------ 1 file changed, 30 insertions(+), 52 deletions(-) diff --git a/extra/fluids/fluids.factor b/extra/fluids/fluids.factor index 1fff38b079..f383534658 100644 --- a/extra/fluids/fluids.factor +++ b/extra/fluids/fluids.factor @@ -11,54 +11,34 @@ FROM: alien.c-types => float ; SPECIALIZED-ARRAY: float IN: fluids -STRUCT: float2_t - { x float } - { y float } ; - -: f2+ ( lhs rhs -- res ) - [ [ x>> ] bi@ + ] - [ [ y>> ] bi@ + ] - 2bi float2_t ; inline - -: f2- ( lhs rhs -- res ) - [ [ x>> ] bi@ - ] - [ [ y>> ] bi@ - ] - 2bi float2_t ; inline - -: f2*n ( lhs rhs -- res ) - [ [ x>> ] dip * ] - [ [ y>> ] dip * ] - 2bi float2_t ; inline - STRUCT: particle_t - { p float2_t } - { p' float2_t } - { m float } ; + { p float[2] } + { v float[2] } + { m float } ; SPECIALIZED-ARRAY: particle_t -CONSTANT: gravity S{ float2_t f 0.0 -0.1 } +CONSTANT: gravity { 0.0 -0.1 } -:: verlet-integrate-particle ( p dt -- p' ) - p p>> 2.0 f2*n :> v1 - p p'>> :> v2 - gravity dt dt * 1.0 p m>> 2.0 * / * f2*n :> v3 - v1 v2 f2- v3 f2+ - p p m>> particle_t ; inline +:: verlet-integrate-particle ( particle dt -- particle' ) + particle [ p>> ] [ v>> ] bi dt v*n v+ + gravity dt dt * particle m>> 2 * / v*n v+ :> p' + p' particle p>> v- dt v/n :> v' + p' v' particle m>> particle_t ; inline CONSTANT: initial-particles particle_t-array{ - S{ particle_t f S{ float2_t f 0.5 0.6 } S{ float2_t f 0.499 0.599 } 1.0 } - S{ particle_t f S{ float2_t f 0.5 0.6 } S{ float2_t f 0.501 0.599 } 3.0 } + S{ particle_t f float-array{ 0.5 0.6 } float-array{ 0 0.1 } 1.0 } + S{ particle_t f float-array{ 0.5 0.6 } float-array{ 0.1 0 } 3.0 } - S{ particle_t f S{ float2_t f 0.5 0.5 } S{ float2_t f 0.5 0.5 } 2.0 } - S{ particle_t f S{ float2_t f 0.5 0.6 } S{ float2_t f 0.5 0.599 } 1.0 } - S{ particle_t f S{ float2_t f 0.6 0.5 } S{ float2_t f 0.6 0.5 } 3.0 } - S{ particle_t f S{ float2_t f 0.7 0.5 } S{ float2_t f 0.7 0.5 } 1.0 } - S{ particle_t f S{ float2_t f 0.1 0.5 } S{ float2_t f 0.1 0.5 } 5.0 } - S{ particle_t f S{ float2_t f 0.2 0.5 } S{ float2_t f 0.2 0.5 } 1.0 } - S{ particle_t f S{ float2_t f 0.3 0.3 } S{ float2_t f 0.3 0.3 } 4.0 } - S{ particle_t f S{ float2_t f 0.5 0.15 } S{ float2_t f 0.5 0.15 } 1.0 } - S{ particle_t f S{ float2_t f 0.5 0.1 } S{ float2_t f 0.5 0.1 } 9.0 } + S{ particle_t f float-array{ 0.5 0.5 } float-array{ 0.1 0.1 } 2.0 } + S{ particle_t f float-array{ 0.5 0.6 } float-array{ -0.1 0 } 1.0 } + S{ particle_t f float-array{ 0.6 0.5 } float-array{ 0 -0.1 } 3.0 } + S{ particle_t f float-array{ 0.7 0.5 } float-array{ 0.1 0.1 } 1.0 } + S{ particle_t f float-array{ 0.1 0.5 } float-array{ -0.1 -0.1 } 5.0 } + S{ particle_t f float-array{ 0.2 0.5 } float-array{ 0 0 } 1.0 } + S{ particle_t f float-array{ 0.3 0.3 } float-array{ 0 0 } 4.0 } + S{ particle_t f float-array{ 0.5 0.15 } float-array{ 0 0 } 1.0 } + S{ particle_t f float-array{ 0.5 0.1 } float-array{ 0 0 } 9.0 } } : integrate-particles! ( particles dt -- particles ) @@ -110,18 +90,17 @@ M: fluids-world tick-game-world M:: fluids-world draw-world* ( world -- ) world particles>> [ - [ p>> [ x>> , ] [ y>> , ] bi ] each + [ p>> [ first , ] [ second , ] bi ] each ] curry float-array{ } make :> verts [ - verts world texture>> 50.0 { 320 240 } blended-point-sprite-batch &dispose - + verts world texture>> 30.0 world dim>> { 4 4 } v/ + blended-point-sprite-batch &dispose blend-state new set-gpu-state - - gaussian-blur &dispose world ramp>> { 1024 768 } step-texture &dispose - { 1024 768 } draw-texture - ] with-destructors - ; + gaussian-blur &dispose + world ramp>> world dim>> step-texture &dispose + world dim>> draw-texture + ] with-destructors ; GAME: fluids { { world-class fluids-world } @@ -132,11 +111,10 @@ GAME: fluids { { tick-interval-micros $[ 60 fps ] } } ; -MAIN: fluids - fluids-world H{ { T{ button-down } [ [ - hand-loc get { 1024 768 } v/ 2 v*n 1 v-n { 1 -1 } v* first2 float2_t - dup 2.0 particle_t suffix + hand-loc get >float-array + world get dim>> >float-array v/ 2 v*n 1 v-n { 1 -1 } v* + float-array{ 0 0.2 } 2.0 particle_t suffix ] change-particles drop ] } } set-gestures From a52103decd65299e3d4e516bbd495cbe390c1d50 Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Sun, 11 Apr 2010 02:57:37 -0700 Subject: [PATCH 073/157] Use the new C-ENUM for libusb --- extra/libusb/libusb.factor | 157 +++++++++++++++++++------------------ 1 file changed, 79 insertions(+), 78 deletions(-) diff --git a/extra/libusb/libusb.factor b/extra/libusb/libusb.factor index 10306c4816..b276a923b0 100644 --- a/extra/libusb/libusb.factor +++ b/extra/libusb/libusb.factor @@ -19,28 +19,28 @@ LIBRARY: libusb ALIAS: libusb_le16_to_cpu libusb_cpu_to_le16 -CONSTANT: LIBUSB_CLASS_PER_INTERFACE 0 -CONSTANT: LIBUSB_CLASS_AUDIO 1 -CONSTANT: LIBUSB_CLASS_COMM 2 -CONSTANT: LIBUSB_CLASS_HID 3 -CONSTANT: LIBUSB_CLASS_PRINTER 7 -CONSTANT: LIBUSB_CLASS_PTP 6 -CONSTANT: LIBUSB_CLASS_MASS_STORAGE 8 -CONSTANT: LIBUSB_CLASS_HUB 9 -CONSTANT: LIBUSB_CLASS_DATA 10 -CONSTANT: LIBUSB_CLASS_VENDOR_SPEC HEX: ff -TYPEDEF: int libusb_class_code +C-ENUM: libusb_class_code + { LIBUSB_CLASS_PER_INTERFACE 0 } + { LIBUSB_CLASS_AUDIO 1 } + { LIBUSB_CLASS_COMM 2 } + { LIBUSB_CLASS_HID 3 } + { LIBUSB_CLASS_PRINTER 7 } + { LIBUSB_CLASS_PTP 6 } + { LIBUSB_CLASS_MASS_STORAGE 8 } + { LIBUSB_CLASS_HUB 9 } + { LIBUSB_CLASS_DATA 10 } + { LIBUSB_CLASS_VENDOR_SPEC HEX: ff } ; -CONSTANT: LIBUSB_DT_DEVICE HEX: 01 -CONSTANT: LIBUSB_DT_CONFIG HEX: 02 -CONSTANT: LIBUSB_DT_STRING HEX: 03 -CONSTANT: LIBUSB_DT_INTERFACE HEX: 04 -CONSTANT: LIBUSB_DT_ENDPOINT HEX: 05 -CONSTANT: LIBUSB_DT_HID HEX: 21 -CONSTANT: LIBUSB_DT_REPORT HEX: 22 -CONSTANT: LIBUSB_DT_PHYSICAL HEX: 23 -CONSTANT: LIBUSB_DT_HUB HEX: 29 -TYPEDEF: int libusb_descriptor_type +C-ENUM: libusb_descriptor_type + { LIBUSB_DT_DEVICE HEX: 01 } + { LIBUSB_DT_CONFIG HEX: 02 } + { LIBUSB_DT_STRING HEX: 03 } + { LIBUSB_DT_INTERFACE HEX: 04 } + { LIBUSB_DT_ENDPOINT HEX: 05 } + { LIBUSB_DT_HID HEX: 21 } + { LIBUSB_DT_REPORT HEX: 22 } + { LIBUSB_DT_PHYSICAL HEX: 23 } + { LIBUSB_DT_HUB HEX: 29 } ; CONSTANT: LIBUSB_DT_DEVICE_SIZE 18 CONSTANT: LIBUSB_DT_CONFIG_SIZE 9 @@ -52,56 +52,57 @@ CONSTANT: LIBUSB_DT_HUB_NONVAR_SIZE 7 CONSTANT: LIBUSB_ENDPOINT_ADDRESS_MASK HEX: 0f CONSTANT: LIBUSB_ENDPOINT_DIR_MASK HEX: 80 -CONSTANT: LIBUSB_ENDPOINT_IN HEX: 80 -CONSTANT: LIBUSB_ENDPOINT_OUT HEX: 00 -TYPEDEF: int libusb_endpoint_direction +C-ENUM: libusb_endpoint_direction + { LIBUSB_ENDPOINT_IN HEX: 80 } + { LIBUSB_ENDPOINT_OUT HEX: 00 } ; CONSTANT: LIBUSB_TRANSFER_TYPE_MASK HEX: 03 -CONSTANT: LIBUSB_TRANSFER_TYPE_CONTROL 0 -CONSTANT: LIBUSB_TRANSFER_TYPE_ISOCHRONOUS 1 -CONSTANT: LIBUSB_TRANSFER_TYPE_BULK 2 -CONSTANT: LIBUSB_TRANSFER_TYPE_INTERRUPT 3 -TYPEDEF: int libusb_transfer_type +C-ENUM: libusb_transfer_type + { LIBUSB_TRANSFER_TYPE_CONTROL 0 } + { LIBUSB_TRANSFER_TYPE_ISOCHRONOUS 1 } + { LIBUSB_TRANSFER_TYPE_BULK 2 } + { LIBUSB_TRANSFER_TYPE_INTERRUPT 3 } ; -CONSTANT: LIBUSB_REQUEST_GET_STATUS HEX: 00 -CONSTANT: LIBUSB_REQUEST_CLEAR_FEATURE HEX: 01 -CONSTANT: LIBUSB_REQUEST_SET_FEATURE HEX: 03 -CONSTANT: LIBUSB_REQUEST_SET_ADDRESS HEX: 05 -CONSTANT: LIBUSB_REQUEST_GET_DESCRIPTOR HEX: 06 -CONSTANT: LIBUSB_REQUEST_SET_DESCRIPTOR HEX: 07 -CONSTANT: LIBUSB_REQUEST_GET_CONFIGURATION HEX: 08 -CONSTANT: LIBUSB_REQUEST_SET_CONFIGURATION HEX: 09 -CONSTANT: LIBUSB_REQUEST_GET_INTERFACE HEX: 0A -CONSTANT: LIBUSB_REQUEST_SET_INTERFACE HEX: 0B -CONSTANT: LIBUSB_REQUEST_SYNCH_FRAME HEX: 0C -TYPEDEF: int libusb_standard_request +C-ENUM: libusb_standard_request + { LIBUSB_REQUEST_GET_STATUS HEX: 00 } + { LIBUSB_REQUEST_CLEAR_FEATURE HEX: 01 } + { LIBUSB_REQUEST_SET_FEATURE HEX: 03 } + { LIBUSB_REQUEST_SET_ADDRESS HEX: 05 } + { LIBUSB_REQUEST_GET_DESCRIPTOR HEX: 06 } + { LIBUSB_REQUEST_SET_DESCRIPTOR HEX: 07 } + { LIBUSB_REQUEST_GET_CONFIGURATION HEX: 08 } + { LIBUSB_REQUEST_SET_CONFIGURATION HEX: 09 } + { LIBUSB_REQUEST_GET_INTERFACE HEX: 0A } + { LIBUSB_REQUEST_SET_INTERFACE HEX: 0B } + { LIBUSB_REQUEST_SYNCH_FRAME HEX: 0C } ; -CONSTANT: LIBUSB_REQUEST_TYPE_STANDARD HEX: 00 -CONSTANT: LIBUSB_REQUEST_TYPE_CLASS HEX: 20 -CONSTANT: LIBUSB_REQUEST_TYPE_VENDOR HEX: 40 -CONSTANT: LIBUSB_REQUEST_TYPE_RESERVED HEX: 60 +C-ENUM: libusb_request_type + { LIBUSB_REQUEST_TYPE_STANDARD HEX: 00 } + { LIBUSB_REQUEST_TYPE_CLASS HEX: 20 } + { LIBUSB_REQUEST_TYPE_VENDOR HEX: 40 } + { LIBUSB_REQUEST_TYPE_RESERVED HEX: 60 } ; -CONSTANT: LIBUSB_RECIPIENT_DEVICE HEX: 00 -CONSTANT: LIBUSB_RECIPIENT_INTERFACE HEX: 01 -CONSTANT: LIBUSB_RECIPIENT_ENDPOINT HEX: 02 -CONSTANT: LIBUSB_RECIPIENT_OTHER HEX: 03 -TYPEDEF: int libusb_request_recipient +C-ENUM: libusb_request_recipient + { LIBUSB_RECIPIENT_DEVICE HEX: 00 } + { LIBUSB_RECIPIENT_INTERFACE HEX: 01 } + { LIBUSB_RECIPIENT_ENDPOINT HEX: 02 } + { LIBUSB_RECIPIENT_OTHER HEX: 03 } ; CONSTANT: LIBUSB_ISO_SYNC_TYPE_MASK HEX: 0C -CONSTANT: LIBUSB_ISO_SYNC_TYPE_NONE 0 -CONSTANT: LIBUSB_ISO_SYNC_TYPE_ASYNC 1 -CONSTANT: LIBUSB_ISO_SYNC_TYPE_ADAPTIVE 2 -CONSTANT: LIBUSB_ISO_SYNC_TYPE_SYNC 3 -TYPEDEF: int libusb_iso_sync_type +C-ENUM: libusb_iso_sync_type + { LIBUSB_ISO_SYNC_TYPE_NONE 0 } + { LIBUSB_ISO_SYNC_TYPE_ASYNC 1 } + { LIBUSB_ISO_SYNC_TYPE_ADAPTIVE 2 } + { LIBUSB_ISO_SYNC_TYPE_SYNC 3 } ; CONSTANT: LIBUSB_ISO_USAGE_TYPE_MASK HEX: 30 -CONSTANT: LIBUSB_ISO_USAGE_TYPE_DATA 0 -CONSTANT: LIBUSB_ISO_USAGE_TYPE_FEEDBACK 1 -CONSTANT: LIBUSB_ISO_USAGE_TYPE_IMPLICIT 2 -TYPEDEF: int libusb_iso_usage_type +C-ENUM: libusb_iso_usage_type + { LIBUSB_ISO_USAGE_TYPE_DATA 0 } + { LIBUSB_ISO_USAGE_TYPE_FEEDBACK 1 } + { LIBUSB_ISO_USAGE_TYPE_IMPLICIT 2 } ; STRUCT: libusb_device_descriptor { bLength uint8_t } @@ -175,21 +176,21 @@ C-TYPE: libusb_context C-TYPE: libusb_device C-TYPE: libusb_device_handle -CONSTANT: LIBUSB_SUCCESS 0 -CONSTANT: LIBUSB_ERROR_IO -1 -CONSTANT: LIBUSB_ERROR_INVALID_PARAM -2 -CONSTANT: LIBUSB_ERROR_ACCESS -3 -CONSTANT: LIBUSB_ERROR_NO_DEVICE -4 -CONSTANT: LIBUSB_ERROR_NOT_FOUND -5 -CONSTANT: LIBUSB_ERROR_BUSY -6 -CONSTANT: LIBUSB_ERROR_TIMEOUT -7 -CONSTANT: LIBUSB_ERROR_OVERFLOW -8 -CONSTANT: LIBUSB_ERROR_PIPE -9 -CONSTANT: LIBUSB_ERROR_INTERRUPTED -10 -CONSTANT: LIBUSB_ERROR_NO_MEM -11 -CONSTANT: LIBUSB_ERROR_NOT_SUPPORTED -12 -CONSTANT: LIBUSB_ERROR_OTHER -99 -TYPEDEF: int libusb_error +C-ENUM: libusb_error + { LIBUSB_SUCCESS 0 } + { LIBUSB_ERROR_IO -1 } + { LIBUSB_ERROR_INVALID_PARAM -2 } + { LIBUSB_ERROR_ACCESS -3 } + { LIBUSB_ERROR_NO_DEVICE -4 } + { LIBUSB_ERROR_NOT_FOUND -5 } + { LIBUSB_ERROR_BUSY -6 } + { LIBUSB_ERROR_TIMEOUT -7 } + { LIBUSB_ERROR_OVERFLOW -8 } + { LIBUSB_ERROR_PIPE -9 } + { LIBUSB_ERROR_INTERRUPTED -10 } + { LIBUSB_ERROR_NO_MEM -11 } + { LIBUSB_ERROR_NOT_SUPPORTED -12 } + { LIBUSB_ERROR_OTHER -99 } ; C-ENUM: libusb_transfer_status LIBUSB_TRANSFER_COMPLETED @@ -200,10 +201,10 @@ C-ENUM: libusb_transfer_status LIBUSB_TRANSFER_NO_DEVICE LIBUSB_TRANSFER_OVERFLOW ; -CONSTANT: LIBUSB_TRANSFER_SHORT_NOT_OK 1 -CONSTANT: LIBUSB_TRANSFER_FREE_BUFFER 2 -CONSTANT: LIBUSB_TRANSFER_FREE_TRANSFER 4 -TYPEDEF: int libusb_transfer_flags +C-ENUM: libusb_transfer_flags + { LIBUSB_TRANSFER_SHORT_NOT_OK 1 } + { LIBUSB_TRANSFER_FREE_BUFFER 2 } + { LIBUSB_TRANSFER_FREE_TRANSFER 4 } ; STRUCT: libusb_iso_packet_descriptor { length uint } From ad0f697b145a4746928cf89b93fa30d43465a880 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 11 Apr 2010 11:49:14 -0700 Subject: [PATCH 074/157] macho: fix load errors --- extra/macho/macho.factor | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/extra/macho/macho.factor b/extra/macho/macho.factor index ea71583072..47d78569f8 100644 --- a/extra/macho/macho.factor +++ b/extra/macho/macho.factor @@ -523,8 +523,8 @@ CONSTANT: CPU_TYPE_ANY -1 CONSTANT: CPU_TYPE_VAX 1 CONSTANT: CPU_TYPE_MC680x0 6 CONSTANT: CPU_TYPE_X86 7 -CONSTANT: CPU_TYPE_I386 $ CPU_TYPE_X86 -CONSTANT: CPU_TYPE_X86_64 $[ CPU_TYPE_X86 CPU_ARCH_ABI64 bitor ] +ALIAS: CPU_TYPE_I386 CPU_TYPE_X86 +CONSTANT: CPU_TYPE_X86_64 flags{ CPU_TYPE_X86 CPU_ARCH_ABI64 } CONSTANT: CPU_TYPE_MC98000 10 CONSTANT: CPU_TYPE_HPPA 11 CONSTANT: CPU_TYPE_ARM 12 @@ -532,7 +532,7 @@ CONSTANT: CPU_TYPE_MC88000 13 CONSTANT: CPU_TYPE_SPARC 14 CONSTANT: CPU_TYPE_I860 15 CONSTANT: CPU_TYPE_POWERPC 18 -CONSTANT: CPU_TYPE_POWERPC64 $[ $ CPU_TYPE_POWERPC CPU_ARCH_ABI64 bitor ] +CONSTANT: CPU_TYPE_POWERPC64 flags{ CPU_TYPE_POWERPC CPU_ARCH_ABI64 } CONSTANT: CPU_SUBTYPE_MASK HEX: ff000000 CONSTANT: CPU_SUBTYPE_LIB64 HEX: 80000000 @@ -658,13 +658,13 @@ CONSTANT: CPUFAMILY_ARM_11 HEX: 8ff620d8 CONSTANT: CPUFAMILY_ARM_XSCALE HEX: 53b005f5 CONSTANT: CPUFAMILY_ARM_13 HEX: 0cc90e64 -CONSTANT: CPUFAMILY_INTEL_YONAH $ CPUFAMILY_INTEL_6_14 -CONSTANT: CPUFAMILY_INTEL_MEROM $ CPUFAMILY_INTEL_6_15 -CONSTANT: CPUFAMILY_INTEL_PENRYN $ CPUFAMILY_INTEL_6_23 -CONSTANT: CPUFAMILY_INTEL_NEHALEM $ CPUFAMILY_INTEL_6_26 +ALIAS: CPUFAMILY_INTEL_YONAH CPUFAMILY_INTEL_6_14 +ALIAS: CPUFAMILY_INTEL_MEROM CPUFAMILY_INTEL_6_15 +ALIAS: CPUFAMILY_INTEL_PENRYN CPUFAMILY_INTEL_6_23 +ALIAS: CPUFAMILY_INTEL_NEHALEM CPUFAMILY_INTEL_6_26 -CONSTANT: CPUFAMILY_INTEL_CORE $ CPUFAMILY_INTEL_6_14 -CONSTANT: CPUFAMILY_INTEL_CORE2 $ CPUFAMILY_INTEL_6_15 +ALIAS: CPUFAMILY_INTEL_CORE CPUFAMILY_INTEL_6_14 +ALIAS: CPUFAMILY_INTEL_CORE2 CPUFAMILY_INTEL_6_15 ! fat.h CONSTANT: FAT_MAGIC HEX: cafebabe From 328068b4809ca8723484e3363e369ea5c523dffb Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 11 Apr 2010 15:00:54 -0500 Subject: [PATCH 075/157] windows: fix load errors --- basis/windows/ddk/hid/hid.factor | 4 ++-- basis/windows/ddk/setupapi/setupapi.factor | 5 +++-- basis/windows/ddk/winusb/winusb.factor | 4 ++-- basis/windows/directx/dwrite/dwrite.factor | 2 +- basis/windows/dwmapi/dwmapi.factor | 5 +++-- 5 files changed, 11 insertions(+), 9 deletions(-) mode change 100644 => 100755 basis/windows/ddk/hid/hid.factor mode change 100644 => 100755 basis/windows/ddk/setupapi/setupapi.factor mode change 100644 => 100755 basis/windows/ddk/winusb/winusb.factor mode change 100644 => 100755 basis/windows/directx/dwrite/dwrite.factor mode change 100644 => 100755 basis/windows/dwmapi/dwmapi.factor diff --git a/basis/windows/ddk/hid/hid.factor b/basis/windows/ddk/hid/hid.factor old mode 100644 new mode 100755 index d832a9d405..0e1e8e208c --- a/basis/windows/ddk/hid/hid.factor +++ b/basis/windows/ddk/hid/hid.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2010 Erik Charlebois. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.c-types alien.libraries alien.syntax classes.struct -kernel math windows.types windows.ole32 ; +USING: alien alien.c-types alien.libraries alien.syntax +classes.struct kernel math windows.types windows.ole32 ; IN: windows.ddk.hid << "hid" "hid.dll" stdcall add-library >> diff --git a/basis/windows/ddk/setupapi/setupapi.factor b/basis/windows/ddk/setupapi/setupapi.factor old mode 100644 new mode 100755 index e4658b6e75..578a44a6d8 --- a/basis/windows/ddk/setupapi/setupapi.factor +++ b/basis/windows/ddk/setupapi/setupapi.factor @@ -1,7 +1,8 @@ ! Copyright (C) 2010 Erik Charlebois. ! See http://factorcode.org/license.txt for BSD license. -USING: literals windows.kernel32 math alien.syntax windows.types classes.struct -alien.c-types windows.errors windows.ole32 windows.advapi32 alien.libraries ; +USING: literals windows.kernel32 math alien.syntax windows.types +classes.struct alien alien.c-types windows.errors windows.ole32 +windows.advapi32 alien.libraries ; IN: windows.ddk.setupapi << "setupapi" "setupapi.dll" stdcall add-library >> diff --git a/basis/windows/ddk/winusb/winusb.factor b/basis/windows/ddk/winusb/winusb.factor old mode 100644 new mode 100755 index d40c994b19..328e16f5c9 --- a/basis/windows/ddk/winusb/winusb.factor +++ b/basis/windows/ddk/winusb/winusb.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2010 Erik Charlebois. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.c-types alien.syntax classes.struct windows.kernel32 -windows.types alien.libraries ; +USING: alien alien.c-types alien.syntax classes.struct +windows.kernel32 windows.types alien.libraries ; IN: windows.ddk.winusb << "winusb" "winusb.dll" stdcall add-library >> diff --git a/basis/windows/directx/dwrite/dwrite.factor b/basis/windows/directx/dwrite/dwrite.factor old mode 100644 new mode 100755 index 3d635a0dc4..91dd422667 --- a/basis/windows/directx/dwrite/dwrite.factor +++ b/basis/windows/directx/dwrite/dwrite.factor @@ -233,7 +233,7 @@ COM-INTERFACE: IDWriteFont IUnknown {acd16696-8c14-4f5d-877e-fe3fc1d32737} HRESULT HasCharacter ( UINT32 unicodeValue, BOOL* exists ) HRESULT CreateFontFace ( IDWriteFontFace** fontFace ) ; -C-ENUM: DWRITE_READING_DRECTION +C-ENUM: DWRITE_READING_DIRECTION DWRITE_READING_DIRECTION_LEFT_TO_RIGHT DWRITE_READING_DIRECTION_RIGHT_TO_LEFT ; diff --git a/basis/windows/dwmapi/dwmapi.factor b/basis/windows/dwmapi/dwmapi.factor old mode 100644 new mode 100755 index 8f68643e0a..60fa5b4d83 --- a/basis/windows/dwmapi/dwmapi.factor +++ b/basis/windows/dwmapi/dwmapi.factor @@ -1,6 +1,7 @@ ! (c)2009 Joe Groff bsd license -USING: alien.c-types alien.data alien.libraries alien.syntax -classes.struct kernel math system-info.windows windows.types ; +USING: alien alien.c-types alien.data alien.libraries +alien.syntax classes.struct kernel math system-info.windows +windows.types ; IN: windows.dwmapi STRUCT: MARGINS From 18814768920fa8123c75526017f9ce88fe659df2 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 11 Apr 2010 15:03:38 -0500 Subject: [PATCH 076/157] ui.backend.windows: fix icon name --- basis/ui/backend/windows/windows.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 basis/ui/backend/windows/windows.factor diff --git a/basis/ui/backend/windows/windows.factor b/basis/ui/backend/windows/windows.factor old mode 100644 new mode 100755 index e0be2e7c99..4e271a8280 --- a/basis/ui/backend/windows/windows.factor +++ b/basis/ui/backend/windows/windows.factor @@ -633,7 +633,7 @@ M: windows-ui-backend do-events 0 >>cbClsExtra 0 >>cbWndExtra f GetModuleHandle >>hInstance - f GetModuleHandle "fraptor" utf16n string>alien LoadIcon >>hIcon + f GetModuleHandle "APPICON" utf16n string>alien LoadIcon >>hIcon f IDC_ARROW LoadCursor >>hCursor class-name-ptr >>lpszClassName From a417b0e70dfc96dc6a20823df174c759c06f66fa Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 11 Apr 2010 20:26:11 -0700 Subject: [PATCH 077/157] vm: speed up nano-count primitive on Mac OS X --- vm/os-genunix.cpp | 3 +-- vm/os-macosx.mm | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/vm/os-genunix.cpp b/vm/os-genunix.cpp index c7449e867b..fb5ecf9f50 100644 --- a/vm/os-genunix.cpp +++ b/vm/os-genunix.cpp @@ -38,8 +38,7 @@ const char *default_image_path() u64 nano_count() { struct timespec t; - int ret; - ret = clock_gettime(CLOCK_MONOTONIC,&t); + int ret = clock_gettime(CLOCK_MONOTONIC,&t); if(ret != 0) fatal_error("clock_gettime failed", 0); return (u64)t.tv_sec * 1000000000 + t.tv_nsec; diff --git a/vm/os-macosx.mm b/vm/os-macosx.mm index 4a6a3cb2b4..05a9aef5c8 100644 --- a/vm/os-macosx.mm +++ b/vm/os-macosx.mm @@ -87,12 +87,19 @@ Protocol *objc_getProtocol(char *name) u64 nano_count() { - u64 t = mach_absolute_time(); - mach_timebase_info_data_t info; - kern_return_t ret = mach_timebase_info(&info); - if(ret != 0) - fatal_error("mach_timebase_info failed",ret); - return t * (info.numer/info.denom); + u64 time = mach_absolute_time(); + + static u64 scaling_factor = 0; + if(!scaling_factor) + { + mach_timebase_info_data_t info; + kern_return_t ret = mach_timebase_info(&info); + if(ret != 0) + fatal_error("mach_timebase_info failed",ret); + scaling_factor = info.numer/info.denom; + } + + return time * scaling_factor; } } From eaccd0b56ae2426eeea9a07f0df18a1f8b5cea12 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 11 Apr 2010 22:27:49 -0500 Subject: [PATCH 078/157] vm: speed up nano-count primitive on Windows --- vm/os-windows-nt.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/vm/os-windows-nt.cpp b/vm/os-windows-nt.cpp index 4fea294a12..97cd2146af 100755 --- a/vm/os-windows-nt.cpp +++ b/vm/os-windows-nt.cpp @@ -18,17 +18,24 @@ u64 system_micros() u64 nano_count() { - LARGE_INTEGER count; - LARGE_INTEGER frequency; + static double scale_factor; + static u32 hi = 0; static u32 lo = 0; - BOOL ret; - ret = QueryPerformanceCounter(&count); + + LARGE_INTEGER count; + BOOL ret = QueryPerformanceCounter(&count); if(ret == 0) fatal_error("QueryPerformanceCounter", 0); - ret = QueryPerformanceFrequency(&frequency); - if(ret == 0) - fatal_error("QueryPerformanceFrequency", 0); + + if(scale_factor == 0.0) + { + LARGE_INTEGER frequency; + BOOL ret = QueryPerformanceFrequency(&frequency); + if(ret == 0) + fatal_error("QueryPerformanceFrequency", 0); + scale_factor = (1000000000.0 / frequency.QuadPart); + } #ifdef FACTOR_64 hi = count.HighPart; @@ -40,7 +47,7 @@ u64 nano_count() #endif lo = count.LowPart; - return (u64)((((u64)hi << 32) | (u64)lo)*(1000000000.0/frequency.QuadPart)); + return (u64)((((u64)hi << 32) | (u64)lo) * scale_factor); } void sleep_nanos(u64 nsec) From 5478913e195bb0a0569c9c74c3eafc9838e4b547 Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Sun, 11 Apr 2010 23:51:50 -0700 Subject: [PATCH 079/157] Remove unix.types dependency from macho --- extra/macho/macho.factor | 442 +++++++++++++++++++-------------------- 1 file changed, 221 insertions(+), 221 deletions(-) diff --git a/extra/macho/macho.factor b/extra/macho/macho.factor index 57424cd243..e3765260bb 100644 --- a/extra/macho/macho.factor +++ b/extra/macho/macho.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2010 Erik Charlebois. ! See http:// factorcode.org/license.txt for BSD license. -USING: alien.c-types alien.syntax classes.struct kernel literals math unix.types ; +USING: alien.c-types alien.syntax classes.struct kernel literals math ; IN: macho TYPEDEF: int integer_t @@ -21,26 +21,26 @@ CONSTANT: VM_PROT_WANTS_COPY HEX: 10 ! loader.h STRUCT: mach_header - { magic uint32_t } + { magic uint } { cputype cpu_type_t } { cpusubtype cpu_subtype_t } - { filetype uint32_t } - { ncmds uint32_t } - { sizeofcmds uint32_t } - { flags uint32_t } ; + { filetype uint } + { ncmds uint } + { sizeofcmds uint } + { flags uint } ; CONSTANT: MH_MAGIC HEX: feedface CONSTANT: MH_CIGAM HEX: cefaedfe STRUCT: mach_header_64 - { magic uint32_t } + { magic uint } { cputype cpu_type_t } { cpusubtype cpu_subtype_t } - { filetype uint32_t } - { ncmds uint32_t } - { sizeofcmds uint32_t } - { flags uint32_t } - { reserved uint32_t } ; + { filetype uint } + { ncmds uint } + { sizeofcmds uint } + { flags uint } + { reserved uint } ; CONSTANT: MH_MAGIC_64 HEX: feedfacf CONSTANT: MH_CIGAM_64 HEX: cffaedfe @@ -82,8 +82,8 @@ CONSTANT: MH_NO_REEXPORTED_DYLIBS HEX: 100000 CONSTANT: MH_PIE HEX: 200000 STRUCT: load_command - { cmd uint32_t } - { cmdsize uint32_t } ; + { cmd uint } + { cmdsize uint } ; CONSTANT: LC_REQ_DYLD HEX: 80000000 @@ -124,35 +124,35 @@ CONSTANT: LC_DYLD_INFO HEX: 22 CONSTANT: LC_DYLD_INFO_ONLY HEX: 80000022 UNION-STRUCT: lc_str - { offset uint32_t } + { offset uint } { ptr char* } ; STRUCT: segment_command - { cmd uint32_t } - { cmdsize uint32_t } + { cmd uint } + { cmdsize uint } { segname char[16] } - { vmaddr uint32_t } - { vmsize uint32_t } - { fileoff uint32_t } - { filesize uint32_t } + { vmaddr uint } + { vmsize uint } + { fileoff uint } + { filesize uint } { maxprot vm_prot_t } { initprot vm_prot_t } - { nsects uint32_t } - { flags uint32_t } ; + { nsects uint } + { flags uint } ; STRUCT: segment_command_64 - { cmd uint32_t } - { cmdsize uint32_t } - { segname char[16] } - { vmaddr uint64_t } - { vmsize uint64_t } - { fileoff uint64_t } - { filesize uint64_t } - { maxprot vm_prot_t } - { initprot vm_prot_t } - { nsects uint32_t } - { flags uint32_t } ; - + { cmd uint } + { cmdsize uint } + { segname char[16] } + { vmaddr ulonglong } + { vmsize ulonglong } + { fileoff ulonglong } + { filesize ulonglong } + { maxprot vm_prot_t } + { initprot vm_prot_t } + { nsects uint } + { flags uint } ; + CONSTANT: SG_HIGHVM HEX: 1 CONSTANT: SG_FVMLIB HEX: 2 CONSTANT: SG_NORELOC HEX: 4 @@ -161,29 +161,29 @@ CONSTANT: SG_PROTECTED_VERSION_1 HEX: 8 STRUCT: section { sectname char[16] } { segname char[16] } - { addr uint32_t } - { size uint32_t } - { offset uint32_t } - { align uint32_t } - { reloff uint32_t } - { nreloc uint32_t } - { flags uint32_t } - { reserved1 uint32_t } - { reserved2 uint32_t } ; + { addr uint } + { size uint } + { offset uint } + { align uint } + { reloff uint } + { nreloc uint } + { flags uint } + { reserved1 uint } + { reserved2 uint } ; STRUCT: section_64 - { sectname char[16] } - { segname char[16] } - { addr uint64_t } - { size uint64_t } - { offset uint32_t } - { align uint32_t } - { reloff uint32_t } - { nreloc uint32_t } - { flags uint32_t } - { reserved1 uint32_t } - { reserved2 uint32_t } - { reserved3 uint32_t } ; + { sectname char[16] } + { segname char[16] } + { addr ulonglong } + { size ulonglong } + { offset uint } + { align uint } + { reloff uint } + { nreloc uint } + { flags uint } + { reserved1 uint } + { reserved2 uint } + { reserved3 uint } ; CONSTANT: SECTION_TYPE HEX: 000000ff CONSTANT: SECTION_ATTRIBUTES HEX: ffffff00 @@ -242,205 +242,205 @@ CONSTANT: SEG_IMPORT "__IMPORT" STRUCT: fvmlib { name lc_str } - { minor_version uint32_t } - { header_addr uint32_t } ; + { minor_version uint } + { header_addr uint } ; STRUCT: fvmlib_command - { cmd uint32_t } - { cmdsize uint32_t } + { cmd uint } + { cmdsize uint } { fvmlib fvmlib } ; STRUCT: dylib { name lc_str } - { timestamp uint32_t } - { current_version uint32_t } - { compatibility_version uint32_t } ; + { timestamp uint } + { current_version uint } + { compatibility_version uint } ; STRUCT: dylib_command - { cmd uint32_t } - { cmdsize uint32_t } + { cmd uint } + { cmdsize uint } { dylib dylib } ; STRUCT: sub_framework_command - { cmd uint32_t } - { cmdsize uint32_t } + { cmd uint } + { cmdsize uint } { umbrella lc_str } ; STRUCT: sub_client_command - { cmd uint32_t } - { cmdsize uint32_t } + { cmd uint } + { cmdsize uint } { client lc_str } ; STRUCT: sub_umbrella_command - { cmd uint32_t } - { cmdsize uint32_t } + { cmd uint } + { cmdsize uint } { sub_umbrella lc_str } ; STRUCT: sub_library_command - { cmd uint32_t } - { cmdsize uint32_t } + { cmd uint } + { cmdsize uint } { sub_library lc_str } ; STRUCT: prebound_dylib_command - { cmd uint32_t } - { cmdsize uint32_t } + { cmd uint } + { cmdsize uint } { name lc_str } - { nmodules uint32_t } + { nmodules uint } { linked_modules lc_str } ; STRUCT: dylinker_command - { cmd uint32_t } - { cmdsize uint32_t } + { cmd uint } + { cmdsize uint } { name lc_str } ; STRUCT: thread_command - { cmd uint32_t } - { cmdsize uint32_t } ; + { cmd uint } + { cmdsize uint } ; STRUCT: routines_command - { cmd uint32_t } - { cmdsize uint32_t } - { init_address uint32_t } - { init_module uint32_t } - { reserved1 uint32_t } - { reserved2 uint32_t } - { reserved3 uint32_t } - { reserved4 uint32_t } - { reserved5 uint32_t } - { reserved6 uint32_t } ; + { cmd uint } + { cmdsize uint } + { init_address uint } + { init_module uint } + { reserved1 uint } + { reserved2 uint } + { reserved3 uint } + { reserved4 uint } + { reserved5 uint } + { reserved6 uint } ; STRUCT: routines_command_64 - { cmd uint32_t } - { cmdsize uint32_t } - { init_address uint64_t } - { init_module uint64_t } - { reserved1 uint64_t } - { reserved2 uint64_t } - { reserved3 uint64_t } - { reserved4 uint64_t } - { reserved5 uint64_t } - { reserved6 uint64_t } ; + { cmd uint } + { cmdsize uint } + { init_address ulonglong } + { init_module ulonglong } + { reserved1 ulonglong } + { reserved2 ulonglong } + { reserved3 ulonglong } + { reserved4 ulonglong } + { reserved5 ulonglong } + { reserved6 ulonglong } ; STRUCT: symtab_command - { cmd uint32_t } - { cmdsize uint32_t } - { symoff uint32_t } - { nsyms uint32_t } - { stroff uint32_t } - { strsize uint32_t } ; + { cmd uint } + { cmdsize uint } + { symoff uint } + { nsyms uint } + { stroff uint } + { strsize uint } ; STRUCT: dysymtab_command - { cmd uint32_t } - { cmdsize uint32_t } - { ilocalsym uint32_t } - { nlocalsym uint32_t } - { iextdefsym uint32_t } - { nextdefsym uint32_t } - { iundefsym uint32_t } - { nundefsym uint32_t } - { tocoff uint32_t } - { ntoc uint32_t } - { modtaboff uint32_t } - { nmodtab uint32_t } - { extrefsymoff uint32_t } - { nextrefsyms uint32_t } - { indirectsymoff uint32_t } - { nindirectsyms uint32_t } - { extreloff uint32_t } - { nextrel uint32_t } - { locreloff uint32_t } - { nlocrel uint32_t } ; + { cmd uint } + { cmdsize uint } + { ilocalsym uint } + { nlocalsym uint } + { iextdefsym uint } + { nextdefsym uint } + { iundefsym uint } + { nundefsym uint } + { tocoff uint } + { ntoc uint } + { modtaboff uint } + { nmodtab uint } + { extrefsymoff uint } + { nextrefsyms uint } + { indirectsymoff uint } + { nindirectsyms uint } + { extreloff uint } + { nextrel uint } + { locreloff uint } + { nlocrel uint } ; CONSTANT: INDIRECT_SYMBOL_LOCAL HEX: 80000000 CONSTANT: INDIRECT_SYMBOL_ABS HEX: 40000000 STRUCT: dylib_table_of_contents - { symbol_index uint32_t } - { module_index uint32_t } ; + { symbol_index uint } + { module_index uint } ; STRUCT: dylib_module - { module_name uint32_t } - { iextdefsym uint32_t } - { nextdefsym uint32_t } - { irefsym uint32_t } - { nrefsym uint32_t } - { ilocalsym uint32_t } - { nlocalsym uint32_t } - { iextrel uint32_t } - { nextrel uint32_t } - { iinit_iterm uint32_t } - { ninit_nterm uint32_t } - { objc_module_info_addr uint32_t } - { objc_module_info_size uint32_t } ; + { module_name uint } + { iextdefsym uint } + { nextdefsym uint } + { irefsym uint } + { nrefsym uint } + { ilocalsym uint } + { nlocalsym uint } + { iextrel uint } + { nextrel uint } + { iinit_iterm uint } + { ninit_nterm uint } + { objc_module_info_addr uint } + { objc_module_info_size uint } ; STRUCT: dylib_module_64 - { module_name uint32_t } - { iextdefsym uint32_t } - { nextdefsym uint32_t } - { irefsym uint32_t } - { nrefsym uint32_t } - { ilocalsym uint32_t } - { nlocalsym uint32_t } - { iextrel uint32_t } - { nextrel uint32_t } - { iinit_iterm uint32_t } - { ninit_nterm uint32_t } - { objc_module_info_size uint32_t } - { objc_module_info_addr uint64_t } ; + { module_name uint } + { iextdefsym uint } + { nextdefsym uint } + { irefsym uint } + { nrefsym uint } + { ilocalsym uint } + { nlocalsym uint } + { iextrel uint } + { nextrel uint } + { iinit_iterm uint } + { ninit_nterm uint } + { objc_module_info_size uint } + { objc_module_info_addr ulonglong } ; STRUCT: dylib_reference - { isym_flags uint32_t } ; + { isym_flags uint } ; STRUCT: twolevel_hints_command - { cmd uint32_t } - { cmdsize uint32_t } - { offset uint32_t } - { nhints uint32_t } ; + { cmd uint } + { cmdsize uint } + { offset uint } + { nhints uint } ; STRUCT: twolevel_hint - { isub_image_itoc uint32_t } ; + { isub_image_itoc uint } ; STRUCT: prebind_cksum_command - { cmd uint32_t } - { cmdsize uint32_t } - { cksum uint32_t } ; + { cmd uint } + { cmdsize uint } + { cksum uint } ; STRUCT: uuid_command - { cmd uint32_t } - { cmdsize uint32_t } - { uuid uint8_t[16] } ; + { cmd uint } + { cmdsize uint } + { uuid uchar[16] } ; STRUCT: rpath_command - { cmd uint32_t } - { cmdsize uint32_t } + { cmd uint } + { cmdsize uint } { path lc_str } ; STRUCT: linkedit_data_command - { cmd uint32_t } - { cmdsize uint32_t } - { dataoff uint32_t } - { datasize uint32_t } ; + { cmd uint } + { cmdsize uint } + { dataoff uint } + { datasize uint } ; STRUCT: encryption_info_command - { cmd uint32_t } - { cmdsize uint32_t } - { cryptoff uint32_t } - { cryptsize uint32_t } - { cryptid uint32_t } ; + { cmd uint } + { cmdsize uint } + { cryptoff uint } + { cryptsize uint } + { cryptid uint } ; STRUCT: dyld_info_command - { cmd uint32_t } - { cmdsize uint32_t } - { rebase_off uint32_t } - { rebase_size uint32_t } - { bind_off uint32_t } - { bind_size uint32_t } - { weak_bind_off uint32_t } - { weak_bind_size uint32_t } - { lazy_bind_off uint32_t } - { lazy_bind_size uint32_t } - { export_off uint32_t } - { export_size uint32_t } ; + { cmd uint } + { cmdsize uint } + { rebase_off uint } + { rebase_size uint } + { bind_off uint } + { bind_size uint } + { weak_bind_off uint } + { weak_bind_size uint } + { lazy_bind_off uint } + { lazy_bind_size uint } + { export_off uint } + { export_size uint } ; CONSTANT: REBASE_TYPE_POINTER 1 CONSTANT: REBASE_TYPE_TEXT_ABSOLUTE32 2 @@ -493,20 +493,20 @@ CONSTANT: EXPORT_SYMBOL_FLAGS_INDIRECT_DEFINITION HEX: 08 CONSTANT: EXPORT_SYMBOL_FLAGS_HAS_SPECIALIZATIONS HEX: 10 STRUCT: symseg_command - { cmd uint32_t } - { cmdsize uint32_t } - { offset uint32_t } - { size uint32_t } ; + { cmd uint } + { cmdsize uint } + { offset uint } + { size uint } ; STRUCT: ident_command - { cmd uint32_t } - { cmdsize uint32_t } ; + { cmd uint } + { cmdsize uint } ; STRUCT: fvmfile_command - { cmd uint32_t } - { cmdsize uint32_t } + { cmd uint } + { cmdsize uint } { name lc_str } - { header_addr uint32_t } ; + { header_addr uint } ; ! machine.h CONSTANT: CPU_STATE_MAX 4 @@ -670,30 +670,30 @@ CONSTANT: FAT_MAGIC HEX: cafebabe CONSTANT: FAT_CIGAM HEX: bebafeca STRUCT: fat_header - { magic uint32_t } - { nfat_arch uint32_t } ; + { magic uint } + { nfat_arch uint } ; STRUCT: fat_arch { cputype cpu_type_t } { cpusubtype cpu_subtype_t } - { offset uint32_t } - { size uint32_t } - { align uint32_t } ; + { offset uint } + { size uint } + { align uint } ; ! nlist.h STRUCT: nlist - { n_strx int32_t } - { n_type uint8_t } - { n_sect uint8_t } - { n_desc int16_t } - { n_value uint32_t } ; + { n_strx int } + { n_type uchar } + { n_sect uchar } + { n_desc short } + { n_value uint } ; STRUCT: nlist_64 - { n_strx uint32_t } - { n_type uint8_t } - { n_sect uint8_t } - { n_desc uint16_t } - { n_value uint64_t } ; + { n_strx uint } + { n_type uchar } + { n_sect uchar } + { n_desc ushort } + { n_value ulonglong } ; CONSTANT: N_STAB HEX: e0 CONSTANT: N_PEXT HEX: 10 @@ -750,24 +750,24 @@ CONSTANT: SYMDEF "__.SYMDEF" CONSTANT: SYMDEF_SORTED "__.SYMDEF SORTED" STRUCT: ranlib - { ran_strx uint32_t } - { ran_off uint32_t } ; + { ran_strx uint } + { ran_off uint } ; ! reloc.h STRUCT: relocation_info - { r_address int32_t } - { r_symbolnum_pcrel_length_extern_type uint32_t } ; + { r_address int } + { r_symbolnum_pcrel_length_extern_type uint } ; CONSTANT: R_ABS 0 CONSTANT: R_SCATTERED HEX: 80000000 STRUCT: scattered_relocation_info_big_endian - { r_scattered_pcrel_length_type_address uint32_t } - { r_value int32_t } ; + { r_scattered_pcrel_length_type_address uint } + { r_value int } ; STRUCT: scattered_relocation_info_little_endian - { r_address_type_length_pcrel_scattered uint32_t } - { r_value int32_t } ; + { r_address_type_length_pcrel_scattered uint } + { r_value int } ; C-ENUM: reloc_type_generic GENERIC_RELOC_VANILLA From 3d4dadffe2728c8de93cc1c0af4e4e9246434246 Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Mon, 12 Apr 2010 00:49:16 -0700 Subject: [PATCH 080/157] Image encoding/decoding of PBM format --- basis/images/pbm/authors.txt | 1 + basis/images/pbm/pbm-tests.factor | 7 + basis/images/pbm/pbm.factor | 85 ++++++ basis/images/pbm/summary.txt | 1 + extra/images/testing/pbm/test.ascii.fig | Bin 0 -> 25659 bytes extra/images/testing/pbm/test.ascii.pbm | 369 +++++++++++++++++++++++ extra/images/testing/pbm/test.binary.fig | Bin 0 -> 25659 bytes extra/images/testing/pbm/test.binary.pbm | Bin 0 -> 3250 bytes 8 files changed, 463 insertions(+) create mode 100644 basis/images/pbm/authors.txt create mode 100644 basis/images/pbm/pbm-tests.factor create mode 100644 basis/images/pbm/pbm.factor create mode 100644 basis/images/pbm/summary.txt create mode 100644 extra/images/testing/pbm/test.ascii.fig create mode 100644 extra/images/testing/pbm/test.ascii.pbm create mode 100644 extra/images/testing/pbm/test.binary.fig create mode 100644 extra/images/testing/pbm/test.binary.pbm diff --git a/basis/images/pbm/authors.txt b/basis/images/pbm/authors.txt new file mode 100644 index 0000000000..6f03a12101 --- /dev/null +++ b/basis/images/pbm/authors.txt @@ -0,0 +1 @@ +Erik Charlebois diff --git a/basis/images/pbm/pbm-tests.factor b/basis/images/pbm/pbm-tests.factor new file mode 100644 index 0000000000..73558cc144 --- /dev/null +++ b/basis/images/pbm/pbm-tests.factor @@ -0,0 +1,7 @@ +! Copyright (C) 2010 Erik Charlebois. +! See http://factorcode.org/license.txt for BSD license. +USING: images.testing ; +IN: images.pbm.tests + +"vocab:images/testing/pbm/test.binary.pbm" decode-test +"vocab:images/testing/pbm/test.ascii.pbm" decode-test diff --git a/basis/images/pbm/pbm.factor b/basis/images/pbm/pbm.factor new file mode 100644 index 0000000000..ba27c545cf --- /dev/null +++ b/basis/images/pbm/pbm.factor @@ -0,0 +1,85 @@ +! Copyright (C) 2010 Erik Charlebois. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors alien.c-types arrays ascii bit-arrays byte-arrays +combinators continuations grouping images images.loader io +io.encodings.ascii io.encodings.string kernel locals make math +math.functions math.parser sequences specialized-arrays ; +SPECIALIZED-ARRAY: ushort +IN: images.pbm + +SINGLETON: pbm-image +"pbm" pbm-image register-image-class + +number ; + +: read-ascii-bits ( -- ) + read1 { + { CHAR: 1 [ 0 , read-ascii-bits ] } + { CHAR: 0 [ 255 , read-ascii-bits ] } + { f [ ] } + [ drop read-ascii-bits ] + } case ; + +:: read-binary-bits ( width height -- ) + width 8 align 8 / height * read + width 8 align 8 / [| row | + width iota [| n | + n 8 / floor row nth + n 8 mod 7 swap - bit? + [ 0 ] [ 255 ] if , + ] each + ] each ; + +:: write-binary-bits ( bitmap width -- ) + bitmap width [ + width 8 align 255 pad-tail + 8 [ + [ 255 = [ f ] [ t ] if ] { } map-as + >bit-array reverse bit-array>integer + 1array >byte-array write + ] each + ] each ; + +:: read-pbm ( -- image ) + read-token :> type + read-number :> width + read-number :> height + width height * :> npixels + width 8 mod :> leftover + + type { + { "P1" [ [ [ read-ascii-bits ] ignore-errors ] B{ } make ] } + { "P4" [ [ width height read-binary-bits ] B{ } make ] } + } case :> data + + image new + L >>component-order + { width height } >>dim + f >>upside-down? + data >>bitmap + ubyte-components >>component-type ; +PRIVATE> + +M: pbm-image stream>image + drop [ read-pbm ] with-input-stream ; + +M: pbm-image image>stream + drop { + [ drop "P4\n" ascii encode write ] + [ dim>> first number>string " " append ascii encode write ] + [ dim>> second number>string "\n" append ascii encode write ] + [ [ bitmap>> ] [ dim>> first ] bi write-binary-bits ] + } cleave ; diff --git a/basis/images/pbm/summary.txt b/basis/images/pbm/summary.txt new file mode 100644 index 0000000000..4f484f91a8 --- /dev/null +++ b/basis/images/pbm/summary.txt @@ -0,0 +1 @@ +Image loading for PBM image files. diff --git a/extra/images/testing/pbm/test.ascii.fig b/extra/images/testing/pbm/test.ascii.fig new file mode 100644 index 0000000000000000000000000000000000000000..aee805ec6985a325ad215ee428ef13f16dc889c4 GIT binary patch literal 25659 zcmeHO%WmaF5DokfAHkj_KM){7EG8K#gCdqe8rFOQe;T@NclW7hm+jlOK{p`XQ*|D7 zu9Hk=M)2d?>(}2tJ^uRi`q%vO`1SG6&)@u${(XCW|Ka8R?e*{9fBNIg(|13=eER(I z{Pg_g_2vEf`)_}FC?6kJ`zXcA>&5z&TJ`nn{T?n=us*g5E>-X2qxLG`-fz_tD37ha zu5uqBUWzTB=mQR}Jn=9$OJ9lUpG$sRw%8?~*1gpI3EZE+{R#YUpFsUdFTfRkfQeFU zaq_2ywb8~i8)|*T?!1DcioQ6lpk7C8@BQ>AARd&l(B0#=Mjf#p-$cD2dRPn9J$`A` z5&Q8~)C;1AwNTyTmsm$!b4j5dvT!T7B5KIOt>BVF>WEOcf=i01Aq%&H zOAe_cLfr~3DWZlf+zKu^q>c!6E4ZYH3N3Qvnm^LG6T&_dMc*&am}U}G2UW_KRh_^Zj%&RcZvgfzg#-Dh ze&hrhN(t{33_=E+c(y`pEii;(%L03JzWlc(MB2a_%?m{VYZ6-L1jiCr#+5ql^N{@R$Od_Mn>V6-x9+ZwnTN?Mv?1Aveh8lG;~g(ydza;->tE@%UB5|E7TJrH27}G z;%36#E9mHog}`@97B?A-K(RoFAiE3S%~_l$+|8#y2Lo~@!HbN_Bc*Ygv0~vXG;yv! zcie==VZ#0Rq(E25Ktvrk(h`#-Ye1W&vG*M}(j42Ngh3l2LPO7uJjJ2-Btloz({w#I z@&vaCAEC)ts%+1WJYqFWTW&J7pq?Fhz%8JMz!dn!T%`5v$X6^pT-;K3f7^?A|9oqL|?G(w>1f3o6 z?;NyK7^(5S9r|}-^%Q2Rg3c2CyRdNwGYyHmM*ntfo*&EYZ%1WL0Ak5Gg>nw|yM=n)GfrHe?Q$sV2m?rL1B&x3G<9ul5 z$AyUt>MWFWQFR4SIyx2i@+xeMFQd@$MG@9lE{M)GAOXdLbiw31NAaXpk+xS|*Wb2; zaJ_CQWER-)xn%8}{>-6T;KT$~5nFOknwjEu zBfAv{W{x}tTw5jNS}24#<{{+UCc1T;)I}~F zaF3M9d$O1YP@e#4AEn<3o$w^>Cnl7hgGD7=oKuNh#X15LiJq>03Rkvwkg8x(pT xxbvqtjT6^aFKFI8tqvguNF@7h1EdwWEeKpwknz{)AdA7$s=da1N2yA$e*tvWh=KqB literal 0 HcmV?d00001 diff --git a/extra/images/testing/pbm/test.ascii.pbm b/extra/images/testing/pbm/test.ascii.pbm new file mode 100644 index 0000000000..2cf2555793 --- /dev/null +++ b/extra/images/testing/pbm/test.ascii.pbm @@ -0,0 +1,369 @@ +P1 +# CREATOR: GIMP PNM Filter Version 1.1 +160 160 +1111111100000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000111111111111111100000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000011111111111111111000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000111111111111111111 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0111111111111111111000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000111111111111111110000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000001111111111111111100000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000011111111 +1111111110000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000111111101111110000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000001011111001010000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000101000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000001111 +1111111111111111111111010000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000011111111111111111111111111111111000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000001111111111111111111111111111111111100 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000111111111111111111 +1111111111111111111000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0111111111111111111111111111111111111111000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000001111111111111111111111111111111111111110000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000011111111111111111111111111111 +1111111111000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000001111111111 +1111111111111111111111111111110000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000111111111111111111111111111111111111111100000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000011111111111111111111111111111111111111111 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000111111111111111111111 +1111111111111111111100000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000001 +1111111111111111111111111111111111111111000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000111111111111000000000000000001111111111110000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000001111111111110000000000000000011 +1111111111000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000011111111111 +1000000000000000001111111111110000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000001111111111110000000000000000011111111111100000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000011111111111100000000000000000111111111111 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000111111111111000000000 +0000000011111111111100000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000001 +1111111111100000000000000000111111111111000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000111111111111000000000000000001111111111110000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000001111111111110000000000000000011 +1111111111000000000000000000000000000000000000000000000000000000000000 +0000000000011110100000000000000000000000000000000000000000011111111111 +1000000000000000001111111111110000000000000000000000000000000000000000 +0000000000000000000000000000111111111110000000000000000000000000000000 +0000000001111111111110000000000000000011111111111100000000000000000000 +0000000000000000000000000000000000000000000000111111111111110000000000 +0000000000000000000000000000011111111111100000000000000000111111111111 +0000000000000000000000000000000000000000000000000000000000000001111111 +1111111111100000000000000000000000000000000000000111111111111000000000 +0000000111111111111100000000000000000000000000000000000000000000000000 +0000000000111111111111111111111100000000000000000000000000000000000001 +1111111111100000000000000001111111111110000000000000000000000000000000 +0000000000000000000000000000011111111111111111111111000000000000000000 +0000000000000000001111111111111000000000000000011111111111100000000000 +0000000000000000000000000000000000000000000000011111111111111111111111 +1110000000000000000000000000000000000001111111111100000000000000000111 +1111111110000000000000000000000000000000000000000000000000000000001111 +1111111111111111111111100000000000000000000000000000000000111111111111 +0000000000000000011111111111100000000000000000000000000000000000000000 +0000000000000011111111111111111111111111111000000000000000000000000000 +0000000011111111111100000000000000000111111111110000000000000000000000 +0000000000000000000000000000000011111111111111111111111111111110000000 +0000000000000000000000000000111111111111000000000000000011111111111100 +0000000000000000000000000000000000000000000000000001111111111111111111 +1111111111111000000000000000000000000000000000001111111111110000000000 +0000001111111111110000000000000000000000000000000000000000000000000000 +1111111111111111111111111111111110000000000000000000000000000000000011 +1111111111000000000000000011111111111100000000000000000000000000000000 +0000000000000000000111111111111111111111111111111111110000000000000000 +0000000000000000001111111111110000000000000000111111111111000000000000 +0000000000000000000000000000000000000001111111111111111111111011111111 +1111000000000000000000000000000000000111111111111100000000000000001111 +1111111100000000000000000000000000000000000000000000000000011111111111 +1111110000001111111111110000000000000000000000000000000011111111111110 +0000000000000000111111111111000000000000000000000000000000000000000000 +0000000011111111111111111000000011111111111110000000000000000000000000 +0000011111111111111000000000000000001111111111110000000000000000000000 +0000000000000000000000000000111111111111111000000000011111111111000000 +0000000000000000000000000111111111111110000000000000000011111111111100 +0000000000000000000000000000000000000000000000001111111111111100000000 +0001111111111110000000000000000000000000000011111111111111000000000000 +0000001111111111110000000000000000000000000000000000000000000000000011 +1111111111000000000000011111111111100000000000000000000000000011111111 +1111111100000000000000000011111111111100000000000000000000000000000000 +0000000000000000001111111111100000000000000111111111111000000000000000 +0000000000001111111111111110000000000000000000111111111111000000000000 +0000000000000000000000000000000000000111111111111000000000000001111111 +1111100000000000000000000000000111111111111111000000000000000000001111 +1111111100000000000000000000000000000000000000000000000001111111111110 +0000000000000111111111111000000000000000000000000011111111111111110000 +0000000000000000111111111111000000000000000000000000000000000000000000 +0000000111111111111000000000000001111111111110000000000000000000000001 +1111111111111110000000000000000000001111111111110000000000000000000000 +0000000000000000000000000001111111111110000000000000011111111111110000 +0000000000000000000111111111111111000000000000000000000011111111111100 +0000000000000000000000000000000000000000000000011111111111100000000000 +0000111111111111000000000000000000000111111111111111100000000000000000 +0000001111111111110000000000000000000000000000000000000000000000000111 +1111111110000000000000001111111111110000000000000000000011111111111111 +1100000000000000000000000011111111111100000000000000000000000000000000 +0000000000000000011111111111100000000000000011111111111110000000000000 +0000011111111111111110000000000000000000000000111111111111000000000000 +0000000000000000000000000000000000000111111111111000000000000000011111 +1111111000000000000000000111111111111111100000000000000000000000001111 +1111111100000000000000000000000000000000000000000000000001111111111110 +0000000000000001111111111110000000000000000111111111111111100000000000 +0000000000000000111111111110000000000000000000000000000000000000000000 +0000000111111111111000000000000000011111111111100000000000000001111111 +1111111110000000000000000000000000011111111111110000000000000000000000 +0000000000000000000000000001111111111110000000000000000111111111111000 +0000000000001111111111111111000000000000000000000000000111111111111000 +0000000000000000000000000000000000000000000000011111111111100000000000 +0000011111111111110000000000000111111111111111100000000000000000000000 +0000011111111111100000000000000000000000000000000000000000000000000111 +1111111110000000000000000011111111111100000000000011111111111111110000 +0000000000000000000000000111111111111000000000000000000000000000000000 +0000000000000000011111111111100000000000000000111111111111000000000001 +1111111111111100000000000000000000000000000001111111111110000000000000 +0000000000000000000000000000000000000111111111111000000000000000001111 +1111111110000000001111111111111111000000000000000000000000000000011111 +1111111000000000000000000000000000000000000000000000000001111111111110 +0000000000000000011111111111100000000111111111111111100000000000000000 +0000000000000001111111111110000000000000000000000000000000000000000000 +0000000111111111111000000000000000000111111111111000000111111111111111 +1100000000000000000000000000000000011111111111100000000000000000000000 +0000000000000000000000000001111111111110000000000000000001111111111110 +0000011111111111111110000000000000000000000000000000000111111111111000 +0000000000000000000000000000000000000000000000011111111111100000000000 +0000000111111111111000011111111111111111000000000000000000000000000000 +0000011111111111100000000000000000000000000000000000000000000000000111 +1111111110000000000000000000111111111111001111111111111111110000000000 +0000000000000000000000000111111111111000000000000000000000000000000000 +0000000000000000011111111111100000000000000000001111111111110111111111 +1111111100000000000000000000000000000000000001111111111110000000000000 +0000000000000000000000000000000000000111111111111000000000000000000011 +1111111111111111111111111111000000000000000000000000000000000000011111 +1111111000000000000000000000000000000000000000000000000001111111111110 +0000000000000000001111111111111111111111111111000000000000000000000000 +0000000000000001111111111110000000000000000000000000000000000000000000 +0000000111111111111000000000000000000001111111111111111111111111100000 +0000000000000000000000000000000000011111111111100000000000000000000000 +0000000000000000000000000001111111111110000000000000000000011111111111 +1111111111111100000000000000000000000000000000000000001111111111110000 +0000000000000000000000000000000000000000000000011111111111100000000000 +0000000001111111111111111111111110000000000000000000000000000000000000 +0000111111111111000000000000000000000000000000000000000000000000000111 +1111111110000000000000000000011111111111111111111111000000000000000000 +0000000000000000000000001111111111110000000000000000000000000000000000 +0000000000000000011111111111100000000000000000000111111111111111111111 +0000000000000000000000000000000000000000000011111111111100000000000000 +0000000000000000000000000000000000000111111111111000000000000000000001 +1111111111111111111000000000000000000000000000000000000000000000111111 +1111110000000000000000000000000000000000000000000000000001111111111110 +0000000000000000000111111111111111111100000000000000000000000000000000 +0000000000000011111111111100000000000000000000000000000000000000000000 +0000000111111111111000000000000000000000111111111111111110000000000000 +0000000000000000000000000000000000111111111111000000000000000000000000 +0000000000000000000000000001111111111110000000000000000000001111111111 +1111111000000000000000000000000000000000000000000000001111111111110000 +0000000000000000000000000000000000000000000000011111111111100000000000 +0000000000111111111111111000000000000000000000000000000000000000000000 +0000111111111111000000000000000000000000000000000000000000000000000111 +1111111110000000000000000000001111111111111000000000000000000000000000 +0000000000000000000000001111111111110000000000000000000000000000000000 +0000000000000000011111111111100000000000000000000001111111111110000000 +0000000000000000000000000000000000000000000011111111111100000000000000 +0000000000000000000000000000000000000111111111111000000000000000000000 +0011111111110000000000000000000000000000000000000000000000000000111111 +1111110000000000000000000000000000000000000000000000000001111111111110 +0000000000000000000000011111110000001011111111111110100000000000000000 +0000000000000011111111111100000000000000000000000000000000000000000000 +0000000111111111111000000000000000000000000000101010111111111111111111 +1111111111000000000000000000000000111111111111000000000000000000000000 +0000000000000000000000000001111111111110000000000000000000000000001111 +1111111111111111111111111111111100000000000000000000001111111111110000 +0000000000000000000000000000000000000000000000011111111111100000000000 +0000000101111111111111111111111111111111111111111111100000000000000000 +0000111111111111000000000000000000000000000000000000000000000000000111 +1111111110000000000000101111111111111111111111111111111111111111111111 +1110000000000000000000001111111111110000000000000000000000000000000000 +0000000000000000011111111111100000101111111111111111111111111111111111 +1111111111111111111111110000000000000000000011111111111100000000000000 +0000000000000000000000000000000000000111111111111000111111111111111111 +1111111111111111111111111111111111111111111100000000000000000000111111 +1111110000000000000000000000000000000000000000000000000001111111111110 +0011111111111111111111111111111111111111111111111111111111111111000000 +0000000000000011111111111100000000000000000000000000000000000000000000 +0000000111111111111111111111111111111111111111111111111111111111111111 +1111111111111100000000000000000000111111111111000000000000000000000000 +0000000000000000000000000001111111111111111111111111111111111111111111 +1111111111111111111111111111111110000000000000000000011111111111110000 +0000000000000000000000000000000000000000000000011111111111111111111111 +1111111111111111111111111111111111111111111111111111100000000000000000 +0001111111111110000000000000000000000000000000000000000000000000000111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1100000000000000000000011111111111100000000000000000000000000000000000 +0000000000000000011111111111111111111111111111111111111111111111111111 +1111111111111111111100000000000000000000000111111111111000000000000000 +0000000000000000000000000000000000000111111111111111111111111111111111 +1111111111111111111111111111111111111000000000000000000000000011111111 +1111100000000000000000000000000000000000000000000000000001111111111111 +1111111111111111111111111111111111111111111111111111110000000000000000 +0000000000011111111111110000000000000000000000000000000000000000000000 +0000000111111111111111111111111111110100000000111111111111111111111111 +1100000000000000000000000000000111111111111100000000000000000000000000 +0000000000000000000000000001111111111111111111111111010000000000011111 +1111111111111111111000000000000000000000000000000111111111111111000000 +0000000000000000000000000000000000000000000000111111111111111111111000 +0000000000000111111111111111111111111000000000000000000000000000000001 +1111111111111000000000000000000000000000000000000000000000000000001111 +1111111111111110000000000000000111111111111111111111111000000000000000 +0000000000000000011111111111111110000000000000000000000000000000000000 +0000000000000000111111111111111100000000000000000111111111111111111111 +1111000000000000000000000000000000011111111111111111000000000000000000 +0000000000000000000000000000000000001111111111111110000000000000000011 +1111111111111111111110000000000000000000000000000000001111111111111111 +1000000000000000000000000000000000000000000000000000000001111111111110 +0000000000000000001111111111111111111101000000000000000000000000000000 +0001111111111111111110000000000000000000000000000000000000000000000000 +0000000111111111110000000000000000000111111111111111111110000000000000 +0000000000000000000001111111111111111111000000000000000000000000000000 +0000000000000000000000000000111111111000000000000000000011111111111111 +1111110000000000000000000000000000000000011111111111111111100000000000 +0000000000000000000000000000000000000000000000000111111100000000000000 +0000001111111111111111100000000000000000000000000000000000011111111111 +1111111100000000000000000000000000000000000000000000000000000000000000 +0010100000000000000000000011111111111111110000000000000000000000000000 +0000000011111111111111111110000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000111111111111111000000000 +0000000000000000000000000011111111111111111110000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000001111 +1111111110000000000000000000000000000000000000111111111111111111100000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000111111111111000000000000000000000000000000000000011111 +1111111111110000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000001111111111110000000000000000000000 +0000000000000011111111111111111000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000011111111111100 +0000000000000000000000000000000001111111111111111100000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000001111111111110000000000000000000000000000000000111111111111111111 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000001111111111100000000000000000000000000000000 +1111111111111111110000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000011111111111100000000000 +0000000000000000000111111111111111111000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000111 +1111111110000000000000000000000000000111111111111111111100000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000011111111111110000000000000000000000000011111111111111 +1111000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000011111111111100000000000000000000 +0000111111111111111111110000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000111111111111 +1000000000000000000000011111111111111111110000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000011111111111110000000000000000000011111111111111111111000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000011111111111110000000000000000000111111111 +1111111111100000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000111111111111100000000 +0000000001111111111111111111100000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +1111111111110000000000000000111111111111111111110000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000011111111111110000000000000011111111111111111110000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000011111111111100000000000001111 +1111111111111110000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000111111111 +1111000000000001111111111111111110000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000011111111111110000000000111111111111111111000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000011111111111110000000011111111111111111 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000111111111111110000 +0011111111111111111100000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0001111111111111000011111111111111111100000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000001111111111111100111111111111111110000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000011111111111111111111111111 +1111100000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000011111 +1111111111111111111111110000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000001111111111111111111111111111100000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000001111111111111111111111111110000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000011111111111111 +1111111111110000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000111111111111111111111110000000000000000000000000000000000000000 +0000000000000000000000000101000000101000000000000000000000000000000000 +0000000000000000000000000000111111111111111111111000000000000000000000 +0000000000000000000000000000000000000000000011111100111111000000000000 +0000000000000000000000000000000000000000000000000111111111111111111110 +0000000000000000000000000000000000000000000000000000000000000001111111 +1111111110000000000000000000000000000000000000000000000000000000000000 +1111111111111111100000000000000000000000000000000000000000000000000000 +0000000000001111111111111111110000000000000000000000000000000000000000 +0000000000000000000001111111111111111000000000000000000000000000000000 +0000000000000000000000000000000011111111111111111100000000000000000000 +0000000000000000000000000000000000000000011111111111111000000000000000 +0000000000000000000000000000000000000000000000000001111111111111111111 +1000000000000000000000000000000000000000000000000000000000000001111111 +1111000000000000000000000000000000000000000000000000000000000000000000 +0111111111111111111100000000000000000000000000000000000000000000000000 +0000000000000001111101000000000000000000000000000000000000000000000000 +0000000000000000000000111111111111111111000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000011111111 \ No newline at end of file diff --git a/extra/images/testing/pbm/test.binary.fig b/extra/images/testing/pbm/test.binary.fig new file mode 100644 index 0000000000000000000000000000000000000000..aee805ec6985a325ad215ee428ef13f16dc889c4 GIT binary patch literal 25659 zcmeHO%WmaF5DokfAHkj_KM){7EG8K#gCdqe8rFOQe;T@NclW7hm+jlOK{p`XQ*|D7 zu9Hk=M)2d?>(}2tJ^uRi`q%vO`1SG6&)@u${(XCW|Ka8R?e*{9fBNIg(|13=eER(I z{Pg_g_2vEf`)_}FC?6kJ`zXcA>&5z&TJ`nn{T?n=us*g5E>-X2qxLG`-fz_tD37ha zu5uqBUWzTB=mQR}Jn=9$OJ9lUpG$sRw%8?~*1gpI3EZE+{R#YUpFsUdFTfRkfQeFU zaq_2ywb8~i8)|*T?!1DcioQ6lpk7C8@BQ>AARd&l(B0#=Mjf#p-$cD2dRPn9J$`A` z5&Q8~)C;1AwNTyTmsm$!b4j5dvT!T7B5KIOt>BVF>WEOcf=i01Aq%&H zOAe_cLfr~3DWZlf+zKu^q>c!6E4ZYH3N3Qvnm^LG6T&_dMc*&am}U}G2UW_KRh_^Zj%&RcZvgfzg#-Dh ze&hrhN(t{33_=E+c(y`pEii;(%L03JzWlc(MB2a_%?m{VYZ6-L1jiCr#+5ql^N{@R$Od_Mn>V6-x9+ZwnTN?Mv?1Aveh8lG;~g(ydza;->tE@%UB5|E7TJrH27}G z;%36#E9mHog}`@97B?A-K(RoFAiE3S%~_l$+|8#y2Lo~@!HbN_Bc*Ygv0~vXG;yv! zcie==VZ#0Rq(E25Ktvrk(h`#-Ye1W&vG*M}(j42Ngh3l2LPO7uJjJ2-Btloz({w#I z@&vaCAEC)ts%+1WJYqFWTW&J7pq?Fhz%8JMz!dn!T%`5v$X6^pT-;K3f7^?A|9oqL|?G(w>1f3o6 z?;NyK7^(5S9r|}-^%Q2Rg3c2CyRdNwGYyHmM*ntfo*&EYZ%1WL0Ak5Gg>nw|yM=n)GfrHe?Q$sV2m?rL1B&x3G<9ul5 z$AyUt>MWFWQFR4SIyx2i@+xeMFQd@$MG@9lE{M)GAOXdLbiw31NAaXpk+xS|*Wb2; zaJ_CQWER-)xn%8}{>-6T;KT$~5nFOknwjEu zBfAv{W{x}tTw5jNS}24#<{{+UCc1T;)I}~F zaF3M9d$O1YP@e#4AEn<3o$w^>Cnl7hgGD7=oKuNh#X15LiJq>03Rkvwkg8x(pT xxbvqtjT6^aFKFI8tqvguNF@7h1EdwWEeKpwknz{)AdA7$s=da1N2yA$e*tvWh=KqB literal 0 HcmV?d00001 diff --git a/extra/images/testing/pbm/test.binary.pbm b/extra/images/testing/pbm/test.binary.pbm new file mode 100644 index 0000000000000000000000000000000000000000..3a49dd760304edab6e9a9bc0e3cfefb76e6929cd GIT binary patch literal 3250 zcmdUxzit#U5XODlVx>#5O=`Rn4Wd9qLKHL(LVzd&QG{qyr9eU;1!}yH!lUe?Y)MCo z6jxkgzHj_zZSP7%RAA|J_RpWkV=_b<*~K7ar2>{xKn$t8A=wn|0k??Jafod%cBH=MR?baEbmi zVw}6KU3O>{Lxi0hOW2T2C2Ps9{*HAkYuA`w(cPKdDpmWZ|5C{Y0 zhgPshTnqL~O3~(Q-wDGBqpowij!(s=U{gz7$;OsCMr>Y-6N7a*yNzs0IvtqCx#HT$ z%nIXsR_I2hEF8)hyBh|gVvR#m3O2zXBs618*BaAIW5WZX!9VJRwILsY(PbDIDD%22 zxQAiJcva*nDA|VYmAaj{Trj&6_bR5P8gqMgC+<}`E8gZhvv*5&<6o*mhuY$qDkf!~ zGwm4BQU@lFmoG3SR}XBWu43Z~BdT;#6j& zmKe^qU<00=O2;hW*-2}UjW3RjUE{{^%J>TbrNQCx-q8}D9ccy~yki{s3xN(VAN*mh zXHRPDbnp z^mJ~1P%(Op-N#uLeooW2G9zb#E1Ase@bKr%(q1ReNy3&+=)x5x%*IH0spKI=z%zr` zV2ja@0z(Y52naM_x`+VB>&(Y`w#Yj6vCi2rCnI3oLAWx^BJ}VEx7D^}RRnm3Db+ Date: Mon, 12 Apr 2010 01:15:49 -0700 Subject: [PATCH 081/157] Fix indentation in read-token --- basis/images/pbm/pbm.factor | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/basis/images/pbm/pbm.factor b/basis/images/pbm/pbm.factor index ba27c545cf..7db7ccedc6 100644 --- a/basis/images/pbm/pbm.factor +++ b/basis/images/pbm/pbm.factor @@ -1,10 +1,9 @@ ! Copyright (C) 2010 Erik Charlebois. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors alien.c-types arrays ascii bit-arrays byte-arrays -combinators continuations grouping images images.loader io -io.encodings.ascii io.encodings.string kernel locals make math -math.functions math.parser sequences specialized-arrays ; -SPECIALIZED-ARRAY: ushort +USING: accessors arrays ascii bit-arrays byte-arrays combinators +continuations grouping images images.loader io io.encodings.ascii +io.encodings.string kernel locals make math math.functions math.parser +sequences ; IN: images.pbm SINGLETON: pbm-image @@ -12,12 +11,14 @@ SINGLETON: pbm-image height width height * :> npixels width 8 mod :> leftover - + type { { "P1" [ [ [ read-ascii-bits ] ignore-errors ] B{ } make ] } { "P4" [ [ width height read-binary-bits ] B{ } make ] } } case :> data - + image new L >>component-order { width height } >>dim From ef365bfa53c09a1cdb65c76d79b1d96a92d57bcd Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Mon, 12 Apr 2010 01:18:58 -0700 Subject: [PATCH 082/157] Remove unused locals. --- basis/images/pbm/pbm.factor | 2 -- 1 file changed, 2 deletions(-) diff --git a/basis/images/pbm/pbm.factor b/basis/images/pbm/pbm.factor index 7db7ccedc6..9b8c7c11f9 100644 --- a/basis/images/pbm/pbm.factor +++ b/basis/images/pbm/pbm.factor @@ -58,8 +58,6 @@ SINGLETON: pbm-image read-token :> type read-number :> width read-number :> height - width height * :> npixels - width 8 mod :> leftover type { { "P1" [ [ [ read-ascii-bits ] ignore-errors ] B{ } make ] } From 1434a305c876680e05d5c6045ac3686a65a51235 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 12 Apr 2010 14:22:41 -0700 Subject: [PATCH 083/157] vm: add a new rc-absolute-1 relocation class to allow storing values in 8-bit operands, and optimized code sequences for inline caches using this --- basis/compiler/constants/constants.factor | 61 +++++++++++++---------- basis/cpu/ppc/bootstrap.factor | 24 +++++---- basis/cpu/x86/32/bootstrap.factor | 4 ++ basis/cpu/x86/64/bootstrap.factor | 5 ++ basis/cpu/x86/bootstrap.factor | 52 +++++++++---------- vm/dispatch.cpp | 4 +- vm/inline_cache.cpp | 3 +- vm/instruction_operands.cpp | 5 ++ vm/instruction_operands.hpp | 12 +++-- vm/jit.cpp | 6 --- vm/jit.hpp | 2 - 11 files changed, 97 insertions(+), 81 deletions(-) diff --git a/basis/compiler/constants/constants.factor b/basis/compiler/constants/constants.factor index ac0fcff0ff..2fec5ca190 100644 --- a/basis/compiler/constants/constants.factor +++ b/basis/compiler/constants/constants.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008, 2010 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: math kernel layouts system strings words quotations byte-arrays -alien arrays literals sequences ; +alien alien.syntax arrays literals sequences ; IN: compiler.constants ! These constants must match vm/memory.h @@ -40,32 +40,41 @@ CONSTANT: deck-bits 18 : segment-end-offset ( -- n ) 2 bootstrap-cells ; inline ! Relocation classes -CONSTANT: rc-absolute-cell 0 -CONSTANT: rc-absolute 1 -CONSTANT: rc-relative 2 -CONSTANT: rc-absolute-ppc-2/2 3 -CONSTANT: rc-absolute-ppc-2 4 -CONSTANT: rc-relative-ppc-2 5 -CONSTANT: rc-relative-ppc-3 6 -CONSTANT: rc-relative-arm-3 7 -CONSTANT: rc-indirect-arm 8 -CONSTANT: rc-indirect-arm-pc 9 -CONSTANT: rc-absolute-2 10 +C-ENUM: f + rc-absolute-cell + rc-absolute + rc-relative + rc-absolute-ppc-2/2 + rc-absolute-ppc-2 + rc-relative-ppc-2 + rc-relative-ppc-3 + rc-relative-arm-3 + rc-indirect-arm + rc-indirect-arm-pc + rc-absolute-2 + rc-absolute-1 ; ! Relocation types -CONSTANT: rt-dlsym 0 -CONSTANT: rt-entry-point 1 -CONSTANT: rt-entry-point-pic 2 -CONSTANT: rt-entry-point-pic-tail 3 -CONSTANT: rt-here 4 -CONSTANT: rt-this 5 -CONSTANT: rt-literal 6 -CONSTANT: rt-untagged 7 -CONSTANT: rt-megamorphic-cache-hits 8 -CONSTANT: rt-vm 9 -CONSTANT: rt-cards-offset 10 -CONSTANT: rt-decks-offset 11 -CONSTANT: rt-exception-handler 12 +C-ENUM: f + rt-dlsym + rt-entry-point + rt-entry-point-pic + rt-entry-point-pic-tail + rt-here + rt-this + rt-literal + rt-untagged + rt-megamorphic-cache-hits + rt-vm + rt-cards-offset + rt-decks-offset + rt-exception-handler ; : rc-absolute? ( n -- ? ) - ${ rc-absolute-ppc-2/2 rc-absolute-cell rc-absolute } member? ; + ${ + rc-absolute-ppc-2/2 + rc-absolute-cell + rc-absolute + rc-absolute-2 + rc-absolute-1 + } member? ; diff --git a/basis/cpu/ppc/bootstrap.factor b/basis/cpu/ppc/bootstrap.factor index f7a1917d0e..4df7a487d4 100644 --- a/basis/cpu/ppc/bootstrap.factor +++ b/basis/cpu/ppc/bootstrap.factor @@ -286,25 +286,19 @@ CONSTANT: nv-reg 17 4 ds-reg 0 LWZ rc-absolute-ppc-2 rt-untagged jit-rel ] pic-load jit-define -! Tag -: load-tag ( -- ) - 4 4 tag-mask get ANDI - 4 4 tag-bits get SLWI ; +[ 4 4 tag-mask get ANDI ] pic-tag jit-define -[ load-tag ] pic-tag jit-define - -! Tuple [ 3 4 MR - load-tag - 0 4 tuple type-number tag-fixnum CMPI + 4 4 tag-mask get ANDI + 0 4 tuple type-number CMPI [ BNE ] - [ 4 3 tuple type-number neg 4 + LWZ ] + [ 4 3 tuple-class-offset LWZ ] jit-conditional* ] pic-tuple jit-define [ - 0 4 0 CMPI rc-absolute-ppc-2 rt-literal jit-rel + 0 4 0 CMPI rc-absolute-ppc-2 rt-untagged jit-rel ] pic-check-tag jit-define [ @@ -342,6 +336,14 @@ CONSTANT: nv-reg 17 ! ! ! Megamorphic caches [ + ! class = ... + 3 4 MR + 4 4 tag-mask get ANDI + 4 4 tag-bits get SLWI + 0 4 tuple type-number tag-fixnum CMPI + [ BNE ] + [ 4 3 tuple-class-offset LWZ ] + jit-conditional* ! cache = ... 0 3 LOAD32 rc-absolute-ppc-2/2 rt-literal jit-rel ! key = hashcode(class) diff --git a/basis/cpu/x86/32/bootstrap.factor b/basis/cpu/x86/32/bootstrap.factor index 4eb8335b67..a52a3390ac 100644 --- a/basis/cpu/x86/32/bootstrap.factor +++ b/basis/cpu/x86/32/bootstrap.factor @@ -176,6 +176,10 @@ IN: bootstrap.x86 [ jit-jump-quot ] \ lazy-jit-compile define-combinator-primitive +[ + temp1 HEX: ffffffff CMP rc-absolute-cell rt-literal jit-rel +] pic-check-tuple jit-define + ! Inline cache miss entry points : jit-load-return-address ( -- ) pic-tail-reg ESP stack-frame-size bootstrap-cell - [+] MOV ; diff --git a/basis/cpu/x86/64/bootstrap.factor b/basis/cpu/x86/64/bootstrap.factor index 39046bce6a..393d1c9b8b 100644 --- a/basis/cpu/x86/64/bootstrap.factor +++ b/basis/cpu/x86/64/bootstrap.factor @@ -160,6 +160,11 @@ IN: bootstrap.x86 [ jit-jump-quot ] \ lazy-jit-compile define-combinator-primitive +[ + temp2 HEX: ffffffff MOV rc-absolute-cell rt-literal jit-rel + temp1 temp2 CMP +] pic-check-tuple jit-define + ! Inline cache miss entry points : jit-load-return-address ( -- ) RBX RSP stack-frame-size bootstrap-cell - [+] MOV ; diff --git a/basis/cpu/x86/bootstrap.factor b/basis/cpu/x86/bootstrap.factor index 7accc4b1cb..969c02c910 100644 --- a/basis/cpu/x86/bootstrap.factor +++ b/basis/cpu/x86/bootstrap.factor @@ -206,43 +206,37 @@ big-endian off ! Load a value from a stack position [ - temp1 ds-reg HEX: ffffffff [+] MOV rc-absolute rt-untagged jit-rel + temp1 ds-reg HEX: 7f [+] MOV rc-absolute-1 rt-untagged jit-rel ] pic-load jit-define -! Tag -: load-tag ( -- ) - temp1 tag-mask get AND - temp1 tag-bits get SHL ; +[ temp1 tag-mask get AND ] pic-tag jit-define -[ load-tag ] pic-tag jit-define - -! The 'make' trick lets us compute the jump distance for the -! conditional branches there - -! Tuple [ temp0 temp1 MOV - load-tag - temp1 tuple type-number tag-fixnum CMP + temp1 tag-mask get AND + temp1 tuple type-number CMP [ JNE ] - [ temp1 temp0 tuple type-number neg bootstrap-cell + [+] MOV ] + [ temp1 temp0 tuple-class-offset [+] MOV ] jit-conditional ] pic-tuple jit-define [ - temp1 HEX: ffffffff CMP rc-absolute rt-literal jit-rel + temp1 HEX: 7f CMP rc-absolute-1 rt-untagged jit-rel ] pic-check-tag jit-define -[ - temp2 HEX: ffffffff MOV rc-absolute-cell rt-literal jit-rel - temp1 temp2 CMP -] pic-check-tuple jit-define - [ 0 JE rc-relative rt-entry-point jit-rel ] pic-hit jit-define ! ! ! Megamorphic caches [ + ! class = ... + temp0 temp1 MOV + temp1 tag-mask get AND + temp1 tag-bits get SHL + temp1 tuple type-number tag-fixnum CMP + [ JNE ] + [ temp1 temp0 tuple-class-offset [+] MOV ] + jit-conditional ! cache = ... temp0 0 MOV rc-absolute-cell rt-literal jit-rel ! key = hashcode(class) @@ -256,14 +250,16 @@ big-endian off temp0 temp2 ADD ! if(get(cache) == class) temp0 [] temp1 CMP - bootstrap-cell 4 = 14 22 ? JNE ! Yuck! - ! megamorphic_cache_hits++ - temp1 0 MOV rc-absolute-cell rt-megamorphic-cache-hits jit-rel - temp1 [] 1 ADD - ! goto get(cache + bootstrap-cell) - temp0 temp0 bootstrap-cell [+] MOV - temp0 word-entry-point-offset [+] JMP - ! fall-through on miss + [ JNE ] + [ + ! megamorphic_cache_hits++ + temp1 0 MOV rc-absolute-cell rt-megamorphic-cache-hits jit-rel + temp1 [] 1 ADD + ! goto get(cache + bootstrap-cell) + temp0 temp0 bootstrap-cell [+] MOV + temp0 word-entry-point-offset [+] JMP + ! fall-through on miss + ] jit-conditional ] mega-lookup jit-define ! ! ! Sub-primitives diff --git a/vm/dispatch.cpp b/vm/dispatch.cpp index b0f9159da7..480da1fd03 100755 --- a/vm/dispatch.cpp +++ b/vm/dispatch.cpp @@ -148,8 +148,8 @@ void quotation_jit::emit_mega_cache_lookup(cell methods_, fixnum index, cell cac data_root methods(methods_,parent); data_root cache(cache_,parent); - /* Generate machine code to determine the object's class. */ - emit_class_lookup(index,PIC_TUPLE); + /* Load the object from the datastack. */ + emit_with_literal(parent->special_objects[PIC_LOAD],tag_fixnum(-index * sizeof(cell))); /* Do a cache lookup. */ emit_with_literal(parent->special_objects[MEGA_LOOKUP],cache.value()); diff --git a/vm/inline_cache.cpp b/vm/inline_cache.cpp index c8a1b22879..b7cd7630ac 100755 --- a/vm/inline_cache.cpp +++ b/vm/inline_cache.cpp @@ -89,7 +89,8 @@ void inline_cache_jit::compile_inline_cache(fixnum index, parent->update_pic_count(inline_cache_type); /* Generate machine code to determine the object's class. */ - emit_class_lookup(index,inline_cache_type); + emit_with_literal(parent->special_objects[PIC_LOAD],tag_fixnum(-index * sizeof(cell))); + emit(parent->special_objects[inline_cache_type]); /* Generate machine code to check, in turn, if the class is one of the cached entries. */ cell i; diff --git a/vm/instruction_operands.cpp b/vm/instruction_operands.cpp index 59dbf1ef8e..b11db279a5 100644 --- a/vm/instruction_operands.cpp +++ b/vm/instruction_operands.cpp @@ -49,6 +49,8 @@ fixnum instruction_operand::load_value(cell relative_to) return load_value_masked(rel_indirect_arm_mask,20,0) + relative_to + sizeof(cell); case RC_ABSOLUTE_2: return *(u16 *)(pointer - sizeof(u16)); + case RC_ABSOLUTE_1: + return *(u8 *)(pointer - sizeof(u8)); default: critical_error("Bad rel class",rel.rel_class()); return 0; @@ -124,6 +126,9 @@ void instruction_operand::store_value(fixnum absolute_value) case RC_ABSOLUTE_2: *(u16 *)(pointer - sizeof(u16)) = (u16)absolute_value; break; + case RC_ABSOLUTE_1: + *(u8 *)(pointer - sizeof(u8)) = (u8)absolute_value; + break; default: critical_error("Bad rel class",rel.rel_class()); break; diff --git a/vm/instruction_operands.hpp b/vm/instruction_operands.hpp index 66ffddc24e..5dda411c8b 100644 --- a/vm/instruction_operands.hpp +++ b/vm/instruction_operands.hpp @@ -33,11 +33,11 @@ enum relocation_type { }; enum relocation_class { - /* absolute address in a 64-bit location */ + /* absolute address in a pointer-width location */ RC_ABSOLUTE_CELL, - /* absolute address in a 32-bit location */ + /* absolute address in a 4 byte location */ RC_ABSOLUTE, - /* relative address in a 32-bit location */ + /* relative address in a 4 byte location */ RC_RELATIVE, /* absolute address in a PowerPC LIS/ORI sequence */ RC_ABSOLUTE_PPC_2_2, @@ -53,8 +53,10 @@ enum relocation_class { RC_INDIRECT_ARM, /* pointer to address in an ARM LDR/STR instruction offset by 8 bytes */ RC_INDIRECT_ARM_PC, - /* absolute address in a 16-bit location */ - RC_ABSOLUTE_2 + /* absolute address in a 2 byte location */ + RC_ABSOLUTE_2, + /* absolute address in a 1 byte location */ + RC_ABSOLUTE_1, }; static const cell rel_absolute_ppc_2_mask = 0xffff; diff --git a/vm/jit.cpp b/vm/jit.cpp index 8d2f5abb9a..3324cfb366 100644 --- a/vm/jit.cpp +++ b/vm/jit.cpp @@ -103,12 +103,6 @@ bool jit::emit_subprimitive(cell word_, bool tail_call_p, bool stack_frame_p) return false; } -void jit::emit_class_lookup(fixnum index, cell type) -{ - emit_with_literal(parent->special_objects[PIC_LOAD],tag_fixnum(-index * sizeof(cell))); - emit(parent->special_objects[type]); -} - /* Facility to convert compiled code offsets to quotation offsets. Call jit_compute_offset() with the compiled code offset, then emit code, and at the end jit->position is the quotation position. */ diff --git a/vm/jit.hpp b/vm/jit.hpp index a9716cab79..963115d6ab 100644 --- a/vm/jit.hpp +++ b/vm/jit.hpp @@ -47,8 +47,6 @@ struct jit { bool emit_subprimitive(cell word_, bool tail_call_p, bool stack_frame_p); - void emit_class_lookup(fixnum index, cell type); - fixnum get_position() { if(computing_offset_p) From a7ee58dc83c119d02bcf6d44a919e03af28c7cb3 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 12 Apr 2010 14:45:43 -0700 Subject: [PATCH 084/157] mason.test: forget test vocabs right after each test, instead of at the end --- basis/tools/test/test.factor | 13 +++++++++++-- extra/mason/test/test.factor | 19 ++++++------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/basis/tools/test/test.factor b/basis/tools/test/test.factor index 8dda4fe16c..f3f53e43b7 100644 --- a/basis/tools/test/test.factor +++ b/basis/tools/test/test.factor @@ -1,4 +1,4 @@ -! Copyright (C) 2003, 2009 Slava Pestov. +! Copyright (C) 2003, 2010 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays assocs combinators compiler.units continuations debugger effects fry generalizations io io.files @@ -118,12 +118,21 @@ PRIVATE> '[ _ run-file ] [ file-failure ] recover ] with-variable ; +SYMBOL: forget-tests? + > [ - vocab-tests [ run-test-file ] each + vocab-tests + [ [ run-test-file ] each ] + [ forget-tests ] + bi ] [ drop ] if ] [ drop ] if ; diff --git a/extra/mason/test/test.factor b/extra/mason/test/test.factor index e99f76c8c4..8e248e861b 100644 --- a/extra/mason/test/test.factor +++ b/extra/mason/test/test.factor @@ -1,12 +1,11 @@ ! Copyright (C) 2008, 2010 Eduardo Cavazos, Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors assocs benchmark bootstrap.stage2 -compiler.errors source-files.errors generic help.html help.lint -io.directories io.encodings.utf8 io.files kernel mason.common -math namespaces prettyprint sequences sets sorting tools.test -tools.time words system io tools.errors vocabs vocabs.files -vocabs.hierarchy vocabs.errors vocabs.refresh locals -source-files compiler.units ; +compiler.errors generic help.html help.lint io io.directories +io.encodings.utf8 io.files kernel locals mason.common +namespaces sequences sets sorting source-files.errors system +tools.errors tools.test tools.time vocabs.errors +vocabs.hierarchy vocabs.refresh words ; IN: mason.test : do-load ( -- ) @@ -28,17 +27,12 @@ M: method word-vocabulary "method-generic" word-prop word-vocabulary ; errors details-file utf8 [ errors. ] with-file-writer ; : do-tests ( -- ) + forget-tests? on test-all test-failures get test-all-vocabs-file test-all-errors-file do-step ; -: cleanup-tests ( -- ) - ! Free up some code heap space - [ - vocabs [ vocab-tests [ forget-source ] each ] each - ] with-compilation-unit ; - : do-help-lint ( -- ) help-lint-all lint-failures get values help-lint-vocabs-file @@ -76,7 +70,6 @@ M: method word-vocabulary "method-generic" word-prop word-vocabulary ; [ do-load ] benchmark load-time-file to-file [ generate-help ] benchmark html-help-time-file to-file [ do-tests ] benchmark test-time-file to-file - cleanup-tests [ do-help-lint ] benchmark help-lint-time-file to-file [ do-benchmarks ] benchmark benchmark-time-file to-file do-compile-errors From 27124968805ceb14a27d8adbff42f6019e8b3145 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 12 Apr 2010 18:44:02 -0400 Subject: [PATCH 085/157] cpu.x86.32: fastcall struct returns are different on Linux than everywhere else for some unknown reason --- basis/cpu/x86/32/32.factor | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/basis/cpu/x86/32/32.factor b/basis/cpu/x86/32/32.factor index 0127d55997..40c6bd40db 100755 --- a/basis/cpu/x86/32/32.factor +++ b/basis/cpu/x86/32/32.factor @@ -359,6 +359,7 @@ M: long-long-type flatten-value-type (flatten-stack-type) ; M: c-type flatten-value-type dup rep>> int-rep? [ (flatten-int-type) ] [ (flatten-stack-type) ] if ; -M: x86.32 struct-return-pointer-type (stack-value) ; +M: x86.32 struct-return-pointer-type + os linux? void* (stack-value) ? ; check-sse From becb7c78b7cd99ccc82950950e8ad58da5cb2a07 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 12 Apr 2010 18:09:26 -0500 Subject: [PATCH 086/157] Move non-parsing words out of alien.syntax, and use a symbol instead of a string variable to store the current library in alien.parser --- basis/alien/fortran/fortran.factor | 6 +++--- basis/alien/libraries/libraries.factor | 5 +++++ basis/alien/parser/parser.factor | 13 +++++++++++-- basis/alien/syntax/syntax.factor | 26 +++++++------------------- 4 files changed, 26 insertions(+), 24 deletions(-) mode change 100644 => 100755 basis/alien/fortran/fortran.factor mode change 100644 => 100755 basis/alien/libraries/libraries.factor mode change 100644 => 100755 basis/alien/parser/parser.factor mode change 100644 => 100755 basis/alien/syntax/syntax.factor diff --git a/basis/alien/fortran/fortran.factor b/basis/alien/fortran/fortran.factor old mode 100644 new mode 100755 index 8c74aa102a..9f44dec80a --- a/basis/alien/fortran/fortran.factor +++ b/basis/alien/fortran/fortran.factor @@ -434,15 +434,15 @@ MACRO: fortran-invoke ( return library function parameters -- ) [ \ fortran-invoke 5 [ ] nsequence ] dip define-declared ; SYNTAX: SUBROUTINE: - f "c-library" get scan ";" parse-tokens + f current-library get scan ";" parse-tokens [ "()" subseq? not ] filter define-fortran-function ; SYNTAX: FUNCTION: - scan "c-library" get scan ";" parse-tokens + scan current-library get scan ";" parse-tokens [ "()" subseq? not ] filter define-fortran-function ; SYNTAX: LIBRARY: scan - [ "c-library" set ] + [ current-library set ] [ set-fortran-abi ] bi ; diff --git a/basis/alien/libraries/libraries.factor b/basis/alien/libraries/libraries.factor old mode 100644 new mode 100755 index 5a042fd436..86249436aa --- a/basis/alien/libraries/libraries.factor +++ b/basis/alien/libraries/libraries.factor @@ -38,6 +38,11 @@ M: library dispose dll>> [ dispose ] when* ; : library-abi ( library -- abi ) library [ abi>> ] [ cdecl ] if* ; +ERROR: no-such-symbol name library ; + +: address-of ( name library -- value ) + 2dup load-library dlsym [ 2nip ] [ no-such-symbol ] if* ; + SYMBOL: deploy-libraries deploy-libraries [ V{ } clone ] initialize diff --git a/basis/alien/parser/parser.factor b/basis/alien/parser/parser.factor old mode 100644 new mode 100755 index 0891caa04a..7b677c3581 --- a/basis/alien/parser/parser.factor +++ b/basis/alien/parser/parser.factor @@ -7,6 +7,8 @@ splitting words fry locals lexer namespaces summary math vocabs.parser words.constant ; IN: alien.parser +SYMBOL: current-library + : parse-c-type-name ( name -- word ) dup search [ ] [ no-word ] ?if ; @@ -117,7 +119,7 @@ PRIVATE> names return function-effect ; : (FUNCTION:) ( -- word quot effect ) - scan-function-name "c-library" get ";" scan-c-args make-function ; + scan-function-name current-library get ";" scan-c-args make-function ; : callback-quot ( return types abi -- quot ) '[ [ _ _ _ ] dip alien-callback ] ; @@ -131,7 +133,7 @@ PRIVATE> type-word return types lib library-abi callback-quot (( quot -- alien )) ; : (CALLBACK:) ( -- word quot effect ) - "c-library" get + current-library get scan-function-name ";" scan-c-args make-callback-type ; PREDICATE: alien-function-word < word @@ -142,3 +144,10 @@ PREDICATE: alien-function-word < word PREDICATE: alien-callback-type-word < typedef-word "callback-effect" word-prop ; + +: global-quot ( type word -- quot ) + name>> current-library get '[ _ _ address-of 0 ] + swap c-type-getter-boxer append ; + +: define-global ( type word -- ) + [ nip ] [ global-quot ] 2bi (( -- value )) define-declared ; diff --git a/basis/alien/syntax/syntax.factor b/basis/alien/syntax/syntax.factor old mode 100644 new mode 100755 index 00148a82d4..bc7e590cff --- a/basis/alien/syntax/syntax.factor +++ b/basis/alien/syntax/syntax.factor @@ -1,10 +1,10 @@ ! Copyright (C) 2005, 2010 Slava Pestov, Alex Chapman. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors arrays alien alien.c-types -alien.arrays alien.strings kernel math namespaces parser -sequences words quotations math.parser splitting grouping -effects assocs combinators lexer strings.parser alien.parser -fry vocabs.parser words.constant alien.libraries ; +USING: accessors arrays alien alien.c-types alien.arrays +alien.strings kernel math namespaces parser sequences words +quotations math.parser splitting grouping effects assocs +combinators lexer strings.parser alien.parser fry vocabs.parser +words.constant alien.libraries ; IN: alien.syntax SYNTAX: DLL" lexer get skip-blank parse-string dlopen suffix! ; @@ -13,7 +13,7 @@ SYNTAX: ALIEN: 16 scan-base suffix! ; SYNTAX: BAD-ALIEN suffix! ; -SYNTAX: LIBRARY: scan "c-library" set ; +SYNTAX: LIBRARY: scan current-library set ; SYNTAX: FUNCTION: (FUNCTION:) define-declared ; @@ -33,20 +33,8 @@ SYNTAX: C-ENUM: SYNTAX: C-TYPE: void CREATE-C-TYPE typedef ; -ERROR: no-such-symbol name library ; - -: address-of ( name library -- value ) - 2dup load-library dlsym [ 2nip ] [ no-such-symbol ] if* ; - SYNTAX: &: - scan "c-library" get '[ _ _ address-of ] append! ; - -: global-quot ( type word -- quot ) - name>> "c-library" get '[ _ _ address-of 0 ] - swap c-type-getter-boxer append ; - -: define-global ( type word -- ) - [ nip ] [ global-quot ] 2bi (( -- value )) define-declared ; + scan current-library get '[ _ _ address-of ] append! ; SYNTAX: C-GLOBAL: scan-c-type CREATE-WORD define-global ; From 67e24b1d2aecd885ec785f1f1e5f887931c00c27 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 12 Apr 2010 18:10:25 -0500 Subject: [PATCH 087/157] compiler.codegen: need to do name decoration with fastcall as well --- basis/compiler/codegen/codegen.factor | 14 ++++++++++---- basis/cpu/x86/32/32.factor | 3 --- core/alien/alien.factor | 3 +++ 3 files changed, 13 insertions(+), 7 deletions(-) mode change 100644 => 100755 core/alien/alien.factor diff --git a/basis/compiler/codegen/codegen.factor b/basis/compiler/codegen/codegen.factor index ffccf9f118..b16f471d11 100755 --- a/basis/compiler/codegen/codegen.factor +++ b/basis/compiler/codegen/codegen.factor @@ -18,6 +18,7 @@ compiler.cfg.builder compiler.codegen.fixup compiler.utilities ; FROM: namespaces => set ; +FROM: compiler.errors => no-such-symbol ; IN: compiler.codegen SYMBOL: insn-counts @@ -415,13 +416,18 @@ M: array dlsym-valid? '[ _ dlsym ] any? ; dll-path compiling-word get no-such-library drop ] if ; -: stdcall-mangle ( params -- symbols ) +: decorated-symbol ( params -- symbols ) [ function>> ] [ parameters>> parameter-offsets drop number>string ] bi - [ drop ] [ "@" glue ] [ "@" glue "_" prepend ] 2tri - 3array ; + { + [ drop ] + [ "@" glue ] + [ "@" glue "_" prepend ] + [ "@" glue "@" prepend ] + } 2cleave + 4array ; : alien-invoke-dlsym ( params -- symbols dll ) - [ dup abi>> stdcall = [ stdcall-mangle ] [ function>> ] if ] + [ dup abi>> callee-cleanup? [ decorated-symbol ] [ function>> ] if ] [ library>> load-library ] bi 2dup check-dlsym ; diff --git a/basis/cpu/x86/32/32.factor b/basis/cpu/x86/32/32.factor index 40c6bd40db..05c627fb99 100755 --- a/basis/cpu/x86/32/32.factor +++ b/basis/cpu/x86/32/32.factor @@ -315,9 +315,6 @@ M:: x86.32 %binary-float-function ( dst src1 src2 func -- ) [ abi>> mingw = os windows? not or ] bi and ; -: callee-cleanup? ( abi -- ? ) - { stdcall fastcall thiscall } member? ; - : stack-arg-size ( params -- n ) dup abi>> '[ alien-parameters flatten-value-types diff --git a/core/alien/alien.factor b/core/alien/alien.factor old mode 100644 new mode 100755 index 27e326a557..d67e0a12b9 --- a/core/alien/alien.factor +++ b/core/alien/alien.factor @@ -68,6 +68,9 @@ SINGLETONS: stdcall thiscall fastcall cdecl mingw ; UNION: abi stdcall thiscall fastcall cdecl mingw ; +: callee-cleanup? ( abi -- ? ) + { stdcall fastcall thiscall } member? ; + ERROR: alien-callback-error ; : alien-callback ( return parameters abi quot -- alien ) From 0d3861bb5d4deb7cbc656d40c34af0cf3bda013e Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 12 Apr 2010 18:12:55 -0500 Subject: [PATCH 088/157] vm: fix compiler warnings raised by CL --- vm/ffi_test.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/vm/ffi_test.c b/vm/ffi_test.c index 993ca18fa3..7d9abe2f87 100755 --- a/vm/ffi_test.c +++ b/vm/ffi_test.c @@ -56,7 +56,7 @@ int ffi_test_9(int a, int b, int c, int d, int e, int f, int g) int ffi_test_10(int a, int b, double c, int d, float e, int f, int g, int h) { - return a - b - c - d - e - f - g - h; + return (int)(a - b - c - d - e - f - g - h); } int ffi_test_11(int a, struct foo b, int c) @@ -66,7 +66,7 @@ int ffi_test_11(int a, struct foo b, int c) int ffi_test_12(int a, int b, struct rect c, int d, int e, int f) { - return a + b + c.x + c.y + c.w + c.h + d + e + f; + return (int)(a + b + c.x + c.y + c.w + c.h + d + e + f); } int ffi_test_13(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k) @@ -128,7 +128,7 @@ long long ffi_test_21(long x, long y) long ffi_test_22(long x, long long y, long long z) { - return x + y / z; + return (long)(x + y / z); } float ffi_test_23(float x[3], float y[3]) @@ -262,7 +262,7 @@ unsigned long long ffi_test_38(unsigned long long x, unsigned long long y) int ffi_test_39(long a, long b, struct test_struct_13 s) { assert(a == b); - return s.x1 + s.x2 + s.x3 + s.x4 + s.x5 + s.x6; + return (int)(s.x1 + s.x2 + s.x3 + s.x4 + s.x5 + s.x6); } struct test_struct_14 ffi_test_40(double x1, double x2) @@ -330,13 +330,29 @@ short ffi_test_48(struct bool_field_test x) #endif -FACTOR_FASTCALL(int) ffi_test_49(int x) { return x + 1; } -FACTOR_FASTCALL(int) ffi_test_50(int x, int y) { return x + y + 1; } -FACTOR_FASTCALL(int) ffi_test_51(int x, int y, int z) { return x + y + z + 1; } -FACTOR_FASTCALL(int) ffi_test_52(int x, float y, int z) { return x + y + z + 1; } +FACTOR_FASTCALL(int) ffi_test_49(int x) +{ + return x + 1; +} + +FACTOR_FASTCALL(int) ffi_test_50(int x, int y) +{ + return x + y + 1; +} + +FACTOR_FASTCALL(int) ffi_test_51(int x, int y, int z) +{ + return x + y + z + 1; +} + +FACTOR_FASTCALL(int) ffi_test_52(int x, float y, int z) +{ + return (int)(x + y + z + 1); +} + FACTOR_FASTCALL(int) ffi_test_53(int x, float y, int z, int w) { - return x + y + z + w + 1; + return (int)(x + y + z + w + 1); } FACTOR_FASTCALL(int) ffi_test_54(struct test_struct_11 x, int y) From 918b202b9a3e69d12b3f1afac3df97a2db425e65 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 12 Apr 2010 18:14:18 -0500 Subject: [PATCH 089/157] compiler.tests.alien: get it passing when VM is compiled with MINGW by disabling certain tests and using the MINGW ABI for others, and fix fastcall alien-indirect tests for name decoration --- basis/compiler/tests/alien.factor | 68 +++++++++++++++++++++++++++---- 1 file changed, 59 insertions(+), 9 deletions(-) diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index 8735d7cae4..279c6ef39f 100755 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -20,7 +20,9 @@ IN: compiler.tests.alien { [ os unix? ] [ "libfactor-ffi-test.so" ] } } cond append-path ; -"f-cdecl" libfactor-ffi-tests-path cdecl add-library +: mingw? ( -- ? ) os windows? vm-compiler "GCC" head? and ; + +"f-cdecl" libfactor-ffi-tests-path mingw? mingw cdecl ? add-library "f-stdcall" libfactor-ffi-tests-path stdcall add-library @@ -653,55 +655,103 @@ FUNCTION: void this_does_not_exist ( ) ; test-struct-11 "f-fastcall" "ffi_test_58" { int int int } alien-invoke gc ; -[ 13 ] [ 3 4.0 5 ffi_test_52 ] unit-test -[ 19 ] [ 3 4.0 5 6 ffi_test_53 ] unit-test +! GCC bugs +mingw? [ + [ 13 ] [ 3 4.0 5 ffi_test_52 ] unit-test + + [ 19 ] [ 3 4.0 5 6 ffi_test_53 ] unit-test +] unless + [ S{ test-struct-11 f 7 -1 } ] [ 3 4 ffi_test_57 ] unit-test + [ S{ test-struct-11 f 7 -3 } ] [ 3 4 7 ffi_test_58 ] unit-test : fastcall-ii-indirect ( x y ptr -- result ) int { int int } fastcall alien-indirect ; + : fastcall-iii-indirect ( x y z ptr -- result ) int { int int int } fastcall alien-indirect ; + : fastcall-ifi-indirect ( x y z ptr -- result ) int { int float int } fastcall alien-indirect ; + : fastcall-ifii-indirect ( x y z w ptr -- result ) int { int float int int } fastcall alien-indirect ; + : fastcall-struct-return-ii-indirect ( x y ptr -- result ) test-struct-11 { int int } fastcall alien-indirect ; + : fastcall-struct-return-iii-indirect ( x y z ptr -- result ) test-struct-11 { int int int } fastcall alien-indirect ; -[ 8 ] [ 3 4 &: ffi_test_50 fastcall-ii-indirect ] unit-test -[ 13 ] [ 3 4 5 &: ffi_test_51 fastcall-iii-indirect ] unit-test -[ 13 ] [ 3 4.0 5 &: ffi_test_52 fastcall-ifi-indirect ] unit-test -[ 19 ] [ 3 4.0 5 6 &: ffi_test_53 fastcall-ifii-indirect ] unit-test +[ 8 ] [ + 3 4 + os windows? [ &: @ffi_test_50@8 ] [ &: ffi_test_50 ] if + fastcall-ii-indirect +] unit-test + +[ 13 ] [ + 3 4 5 + os windows? [ &: @ffi_test_51@12 ] [ &: ffi_test_51 ] if + fastcall-iii-indirect +] unit-test + +mingw? [ + [ 13 ] [ + 3 4.0 5 + os windows? [ &: @ffi_test_52@12 ] [ &: ffi_test_52 ] if + fastcall-ifi-indirect + ] unit-test + + [ 19 ] [ + 3 4.0 5 6 + os windows? [ &: @ffi_test_53@16 ] [ &: ffi_test_53 ] if + fastcall-ifii-indirect + ] unit-test +] unless [ S{ test-struct-11 f 7 -1 } ] -[ 3 4 &: ffi_test_57 fastcall-struct-return-ii-indirect ] unit-test +[ + 3 4 + os windows? [ &: @ffi_test_57@8 ] [ &: ffi_test_57 ] if + fastcall-struct-return-ii-indirect +] unit-test [ S{ test-struct-11 f 7 -3 } ] -[ 3 4 7 &: ffi_test_58 fastcall-struct-return-iii-indirect ] unit-test +[ + 3 4 7 + os windows? [ &: @ffi_test_58@12 ] [ &: ffi_test_58 ] if + fastcall-struct-return-iii-indirect +] unit-test : fastcall-ii-callback ( -- ptr ) int { int int } fastcall [ + 1 + ] alien-callback ; + : fastcall-iii-callback ( -- ptr ) int { int int int } fastcall [ + + 1 + ] alien-callback ; + : fastcall-ifi-callback ( -- ptr ) int { int float int } fastcall [ [ >integer ] dip + + 1 + ] alien-callback ; + : fastcall-ifii-callback ( -- ptr ) int { int float int int } fastcall [ [ >integer ] 2dip + + + 1 + ] alien-callback ; + : fastcall-struct-return-ii-callback ( -- ptr ) test-struct-11 { int int } fastcall [ [ + ] [ - ] 2bi test-struct-11 ] alien-callback ; + : fastcall-struct-return-iii-callback ( -- ptr ) test-struct-11 { int int int } fastcall [ [ drop + ] [ - nip ] 3bi test-struct-11 ] alien-callback ; [ 8 ] [ 3 4 fastcall-ii-callback fastcall-ii-indirect ] unit-test + [ 13 ] [ 3 4 5 fastcall-iii-callback fastcall-iii-indirect ] unit-test + [ 13 ] [ 3 4.0 5 fastcall-ifi-callback fastcall-ifi-indirect ] unit-test + [ 19 ] [ 3 4.0 5 6 fastcall-ifii-callback fastcall-ifii-indirect ] unit-test [ S{ test-struct-11 f 7 -1 } ] From 0d5729b639afc0c89d801cede78a4dda63652134 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Mon, 12 Apr 2010 17:25:36 -0700 Subject: [PATCH 090/157] opencl.ffi: library isn't stdcall except on windows --- extra/opencl/ffi/ffi.factor | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extra/opencl/ffi/ffi.factor b/extra/opencl/ffi/ffi.factor index 9ee2135cb6..d3398f5c24 100644 --- a/extra/opencl/ffi/ffi.factor +++ b/extra/opencl/ffi/ffi.factor @@ -5,10 +5,10 @@ combinators system alien.accessors byte-arrays kernel ; IN: opencl.ffi << "opencl" { - { [ os windows? ] [ "OpenCL.dll" ] } - { [ os macosx? ] [ "/System/Library/Frameworks/OpenCL.framework/OpenCL" ] } - { [ os unix? ] [ "libOpenCL.so" ] } - } cond stdcall add-library >> + { [ os windows? ] [ "OpenCL.dll" stdcall ] } + { [ os macosx? ] [ "/System/Library/Frameworks/OpenCL.framework/OpenCL" cdecl ] } + { [ os unix? ] [ "libOpenCL.so" cdecl ] } + } cond add-library >> LIBRARY: opencl ! cl_platform.h From de50d0bfda2afa0512a1ebcca356bb9bd731e91c Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Mon, 12 Apr 2010 17:37:06 -0700 Subject: [PATCH 091/157] cuda.ffi binding --- extra/cuda/ffi/ffi.factor | 439 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 439 insertions(+) create mode 100644 extra/cuda/ffi/ffi.factor diff --git a/extra/cuda/ffi/ffi.factor b/extra/cuda/ffi/ffi.factor new file mode 100644 index 0000000000..3b59eb83e5 --- /dev/null +++ b/extra/cuda/ffi/ffi.factor @@ -0,0 +1,439 @@ +! (c)2010 Joe Groff bsd license +USING: alien alien.c-types alien.libraries alien.syntax +classes.struct combinators system ; +IN: cuda.ffi + +<< +"cuda" { + { [ os windows? ] [ "nvcuda.dll" stdcall ] } + { [ os macosx? ] [ "/usr/local/cuda/lib/libcuda.dylib" cdecl ] } + { [ os unix? ] [ "libcuda.so" cdecl ] } +} cond add-library +>> + +TYPEDEF: uint CUdeviceptr +TYPEDEF: int CUdevice +TYPEDEF: void* CUcontext +TYPEDEF: void* CUmodule +TYPEDEF: void* CUfunction +TYPEDEF: void* CUarray +TYPEDEF: void* CUtexref +TYPEDEF: void* CUevent +TYPEDEF: void* CUstream +TYPEDEF: void* CUgraphicsResource + +STRUCT: CUuuid + { bytes char[16] } ; + +C-ENUM: CUctx_flags + { CU_CTX_SCHED_AUTO 0 } + { CU_CTX_SCHED_SPIN 1 } + { CU_CTX_SCHED_YIELD 2 } + { CU_CTX_SCHED_MASK 3 } + { CU_CTX_BLOCKING_SYNC 4 } + { CU_CTX_MAP_HOST 8 } + { CU_CTX_LMEM_RESIZE_TO_MAX 16 } + { CU_CTX_FLAGS_MASK HEX: 1f } ; + +C-ENUM: CUevent_flags + { CU_EVENT_DEFAULT 0 } + { CU_EVENT_BLOCKING_SYNC 1 } ; + +C-ENUM: CUarray_format + { CU_AD_FORMAT_UNSIGNED_INT8 HEX: 01 } + { CU_AD_FORMAT_UNSIGNED_INT16 HEX: 02 } + { CU_AD_FORMAT_UNSIGNED_INT32 HEX: 03 } + { CU_AD_FORMAT_SIGNED_INT8 HEX: 08 } + { CU_AD_FORMAT_SIGNED_INT16 HEX: 09 } + { CU_AD_FORMAT_SIGNED_INT32 HEX: 0a } + { CU_AD_FORMAT_HALF HEX: 10 } + { CU_AD_FORMAT_FLOAT HEX: 20 } ; + +C-ENUM: CUaddress_mode + { CU_TR_ADDRESS_MODE_WRAP 0 } + { CU_TR_ADDRESS_MODE_CLAMP 1 } + { CU_TR_ADDRESS_MODE_MIRROR 2 } ; + +C-ENUM: CUfilter_mode + { CU_TR_FILTER_MODE_POINT 0 } + { CU_TR_FILTER_MODE_LINEAR 1 } ; + +C-ENUM: CUdevice_attribute + { CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK 1 } + { CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X 2 } + { CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y 3 } + { CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z 4 } + { CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X 5 } + { CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y 6 } + { CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z 7 } + { CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK 8 } + { CU_DEVICE_ATTRIBUTE_SHARED_MEMORY_PER_BLOCK 8 } + { CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY 9 } + { CU_DEVICE_ATTRIBUTE_WARP_SIZE 10 } + { CU_DEVICE_ATTRIBUTE_MAX_PITCH 11 } + { CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK 12 } + { CU_DEVICE_ATTRIBUTE_REGISTERS_PER_BLOCK 12 } + { CU_DEVICE_ATTRIBUTE_CLOCK_RATE 13 } + { CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT 14 } + + { CU_DEVICE_ATTRIBUTE_GPU_OVERLAP 15 } + { CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT 16 } + { CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT 17 } + { CU_DEVICE_ATTRIBUTE_INTEGRATED 18 } + { CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY 19 } + { CU_DEVICE_ATTRIBUTE_COMPUTE_MODE 20 } + { CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH 21 } + { CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH 22 } + { CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT 23 } + { CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH 24 } + { CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT 25 } + { CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH 26 } + { CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_WIDTH 27 } + { CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_HEIGHT 28 } + { CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES 29 } + { CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT 30 } + { CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS 31 } + { CU_DEVICE_ATTRIBUTE_ECC_ENABLED 32 } ; + +STRUCT: CUdevprop + { maxThreadsPerBlock int } + { maxThreadsDim int[3] } + { maxGridSize int[3] } + { sharedMemPerBlock int } + { totalConstantMemory int } + { SIMDWidth int } + { memPitch int } + { regsPerBlock int } + { clockRate int } + { textureAlign int } ; + +C-ENUM: CUfunction_attribute + { CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK 0 } + { CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES 1 } + { CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES 2 } + { CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES 3 } + { CU_FUNC_ATTRIBUTE_NUM_REGS 4 } + { CU_FUNC_ATTRIBUTE_PTX_VERSION 5 } + { CU_FUNC_ATTRIBUTE_BINARY_VERSION 6 } + CU_FUNC_ATTRIBUTE_MAX ; + +C-ENUM: CUfunc_cache + { CU_FUNC_CACHE_PREFER_NONE HEX: 00 } + { CU_FUNC_CACHE_PREFER_SHARED HEX: 01 } + { CU_FUNC_CACHE_PREFER_L1 HEX: 02 } ; + +C-ENUM: CUmemorytype + { CU_MEMORYTYPE_HOST HEX: 01 } + { CU_MEMORYTYPE_DEVICE HEX: 02 } + { CU_MEMORYTYPE_ARRAY HEX: 03 } ; + +C-ENUM: CUcomputemode + { CU_COMPUTEMODE_DEFAULT 0 } + { CU_COMPUTEMODE_EXCLUSIVE 1 } + { CU_COMPUTEMODE_PROHIBITED 2 } ; + +C-ENUM: CUjit_option + { CU_JIT_MAX_REGISTERS 0 } + CU_JIT_THREADS_PER_BLOCK + CU_JIT_WALL_TIME + CU_JIT_INFO_LOG_BUFFER + CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES + CU_JIT_ERROR_LOG_BUFFER + CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES + CU_JIT_OPTIMIZATION_LEVEL + CU_JIT_TARGET_FROM_CUCONTEXT + CU_JIT_TARGET + CU_JIT_FALLBACK_STRATEGY ; + +C-ENUM: CUjit_target + { CU_TARGET_COMPUTE_10 0 } + CU_TARGET_COMPUTE_11 + CU_TARGET_COMPUTE_12 + CU_TARGET_COMPUTE_13 + CU_TARGET_COMPUTE_20 ; + +C-ENUM: CUjit_fallback + { CU_PREFER_PTX 0 } + CU_PREFER_BINARY ; + +C-ENUM: CUgraphicsRegisterFlags + { CU_GRAPHICS_REGISTER_FLAGS_NONE 0 } ; + +C-ENUM: CUgraphicsMapResourceFlags + { CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE HEX: 00 } + { CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY HEX: 01 } + { CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD HEX: 02 } ; + +C-ENUM: CUarray_cubemap_face + { CU_CUBEMAP_FACE_POSITIVE_X HEX: 00 } + { CU_CUBEMAP_FACE_NEGATIVE_X HEX: 01 } + { CU_CUBEMAP_FACE_POSITIVE_Y HEX: 02 } + { CU_CUBEMAP_FACE_NEGATIVE_Y HEX: 03 } + { CU_CUBEMAP_FACE_POSITIVE_Z HEX: 04 } + { CU_CUBEMAP_FACE_NEGATIVE_Z HEX: 05 } ; + +C-ENUM: CUresult + { CUDA_SUCCESS 0 } + { CUDA_ERROR_INVALID_VALUE 1 } + { CUDA_ERROR_OUT_OF_MEMORY 2 } + { CUDA_ERROR_NOT_INITIALIZED 3 } + { CUDA_ERROR_DEINITIALIZED 4 } + + { CUDA_ERROR_NO_DEVICE 100 } + { CUDA_ERROR_INVALID_DEVICE 101 } + + { CUDA_ERROR_INVALID_IMAGE 200 } + { CUDA_ERROR_INVALID_CONTEXT 201 } + { CUDA_ERROR_CONTEXT_ALREADY_CURRENT 202 } + { CUDA_ERROR_MAP_FAILED 205 } + { CUDA_ERROR_UNMAP_FAILED 206 } + { CUDA_ERROR_ARRAY_IS_MAPPED 207 } + { CUDA_ERROR_ALREADY_MAPPED 208 } + { CUDA_ERROR_NO_BINARY_FOR_GPU 209 } + { CUDA_ERROR_ALREADY_ACQUIRED 210 } + { CUDA_ERROR_NOT_MAPPED 211 } + { CUDA_ERROR_NOT_MAPPED_AS_ARRAY 212 } + { CUDA_ERROR_NOT_MAPPED_AS_POINTER 213 } + { CUDA_ERROR_ECC_UNCORRECTABLE 214 } + + { CUDA_ERROR_INVALID_SOURCE 300 } + { CUDA_ERROR_FILE_NOT_FOUND 301 } + + { CUDA_ERROR_INVALID_HANDLE 400 } + + { CUDA_ERROR_NOT_FOUND 500 } + + { CUDA_ERROR_NOT_READY 600 } + + { CUDA_ERROR_LAUNCH_FAILED 700 } + { CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES 701 } + { CUDA_ERROR_LAUNCH_TIMEOUT 702 } + { CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING 703 } + + { CUDA_ERROR_POINTER_IS_64BIT 800 } + { CUDA_ERROR_SIZE_IS_64BIT 801 } + + { CUDA_ERROR_UNKNOWN 999 } ; + +CONSTANT: CU_MEMHOSTALLOC_PORTABLE HEX: 01 +CONSTANT: CU_MEMHOSTALLOC_DEVICEMAP HEX: 02 +CONSTANT: CU_MEMHOSTALLOC_WRITECOMBINED HEX: 04 + +STRUCT: CUDA_MEMCPY2D + { srcXInBytes uint } + { srcY uint } + { srcMemoryType CUmemorytype } + { srcHost void* } + { srcDevice CUdeviceptr } + { srcArray CUarray } + { srcPitch uint } + { dstXInBytes uint } + { dstY uint } + { dstMemoryType CUmemorytype } + { dstHost void* } + { dstDevice CUdeviceptr } + { dstArray CUarray } + { dstPitch uint } + { WidthInBytes uint } + { Height uint } ; + +STRUCT: CUDA_MEMCPY3D + { srcXInBytes uint } + { srcY uint } + { srcZ uint } + { srcLOD uint } + { srcMemoryType CUmemorytype } + { srcHost void* } + { srcDevice CUdeviceptr } + { srcArray CUarray } + { reserved0 void* } + { srcPitch uint } + { srcHeight uint } + { dstXInBytes uint } + { dstY uint } + { dstZ uint } + { dstLOD uint } + { dstMemoryType CUmemorytype } + { dstHost void* } + { dstDevice CUdeviceptr } + { dstArray CUarray } + { reserved1 void* } + { dstPitch uint } + { dstHeight uint } + { WidthInBytes uint } + { Height uint } + { Depth uint } ; + +STRUCT: CUDA_ARRAY_DESCRIPTOR + { Width uint } + { Height uint } + { Format CUarray_format } + { NumChannels uint } ; + +STRUCT: CUDA_ARRAY3D_DESCRIPTOR + { Width uint } + { Height uint } + { Depth uint } + { Format CUarray_format } + { NumChannels uint } + { Flags uint } ; + +CONSTANT: CUDA_ARRAY3D_2DARRAY HEX: 01 +CONSTANT: CU_TRSA_OVERRIDE_FORMAT HEX: 01 +CONSTANT: CU_TRSF_READ_AS_INTEGER HEX: 01 +CONSTANT: CU_TRSF_NORMALIZED_COORDINATES HEX: 02 +CONSTANT: CU_PARAM_TR_DEFAULT -1 + +FUNCTION: CUresult cuInit ( uint Flags ) ; + +FUNCTION: CUresult cuDriverGetVersion ( int* driverVersion ) ; + +FUNCTION: CUresult cuDeviceGet ( CUdevice* device, int ordinal ) ; +FUNCTION: CUresult cuDeviceGetCount ( int* count ) ; +FUNCTION: CUresult cuDeviceGetName ( char* name, int len, CUdevice dev ) ; +FUNCTION: CUresult cuDeviceComputeCapability ( int* major, int* minor, CUdevice dev ) ; +FUNCTION: CUresult cuDeviceTotalMem ( uint* bytes, CUdevice dev ) ; +FUNCTION: CUresult cuDeviceGetProperties ( CUdevprop* prop, CUdevice dev ) ; +FUNCTION: CUresult cuDeviceGetAttribute ( int* pi, CUdevice_attribute attrib, CUdevice dev ) ; + +FUNCTION: CUresult cuCtxCreate ( CUcontext* pctx, uint flags, CUdevice dev ) ; +FUNCTION: CUresult cuCtxDestroy ( CUcontext ctx ) ; +FUNCTION: CUresult cuCtxAttach ( CUcontext* pctx, uint flags ) ; +FUNCTION: CUresult cuCtxDetach ( CUcontext ctx ) ; +FUNCTION: CUresult cuCtxPushCurrent ( CUcontext ctx ) ; +FUNCTION: CUresult cuCtxPopCurrent ( CUcontext* pctx ) ; +FUNCTION: CUresult cuCtxGetDevice ( CUdevice* device ) ; +FUNCTION: CUresult cuCtxSynchronize ( ) ; + +FUNCTION: CUresult cuModuleLoad ( CUmodule* module, char* fname ) ; +FUNCTION: CUresult cuModuleLoadData ( CUmodule* module, void* image ) ; +FUNCTION: CUresult cuModuleLoadDataEx ( CUmodule* module, void* image, uint numOptions, CUjit_option* options, void** optionValues ) ; +FUNCTION: CUresult cuModuleLoadFatBinary ( CUmodule* module, void* fatCubin ) ; +FUNCTION: CUresult cuModuleUnload ( CUmodule hmod ) ; +FUNCTION: CUresult cuModuleGetFunction ( CUfunction* hfunc, CUmodule hmod, char* name ) ; +FUNCTION: CUresult cuModuleGetGlobal ( CUdeviceptr* dptr, uint* bytes, CUmodule hmod, char* name ) ; +FUNCTION: CUresult cuModuleGetTexRef ( CUtexref* pTexRef, CUmodule hmod, char* name ) ; + +FUNCTION: CUresult cuMemGetInfo ( uint* free, uint* total ) ; + +FUNCTION: CUresult cuMemAlloc ( CUdeviceptr* dptr, uint bytesize ) ; +FUNCTION: CUresult cuMemAllocPitch ( CUdeviceptr* dptr, + uint* pPitch, + uint WidthInBytes, + uint Height, + uint ElementSizeBytes + ) ; +FUNCTION: CUresult cuMemFree ( CUdeviceptr dptr ) ; +FUNCTION: CUresult cuMemGetAddressRange ( CUdeviceptr* pbase, uint* psize, CUdeviceptr dptr ) ; + +FUNCTION: CUresult cuMemAllocHost ( void** pp, uint bytesize ) ; +FUNCTION: CUresult cuMemFreeHost ( void* p ) ; + +FUNCTION: CUresult cuMemHostAlloc ( void** pp, size_t bytesize, uint Flags ) ; + +FUNCTION: CUresult cuMemHostGetDevicePointer ( CUdeviceptr* pdptr, void* p, uint Flags ) ; +FUNCTION: CUresult cuMemHostGetFlags ( uint* pFlags, void* p ) ; + +FUNCTION: CUresult cuMemcpyHtoD ( CUdeviceptr dstDevice, void* srcHost, uint ByteCount ) ; +FUNCTION: CUresult cuMemcpyDtoH ( void* dstHost, CUdeviceptr srcDevice, uint ByteCount ) ; + +FUNCTION: CUresult cuMemcpyDtoD ( CUdeviceptr dstDevice, CUdeviceptr srcDevice, uint ByteCount ) ; + +FUNCTION: CUresult cuMemcpyDtoA ( CUarray dstArray, uint dstIndex, CUdeviceptr srcDevice, uint ByteCount ) ; +FUNCTION: CUresult cuMemcpyAtoD ( CUdeviceptr dstDevice, CUarray hSrc, uint SrcIndex, uint ByteCount ) ; + +FUNCTION: CUresult cuMemcpyHtoA ( CUarray dstArray, uint dstIndex, void* pSrc, uint ByteCount ) ; +FUNCTION: CUresult cuMemcpyAtoH ( void* dstHost, CUarray srcArray, uint srcIndex, uint ByteCount ) ; + +FUNCTION: CUresult cuMemcpyAtoA ( CUarray dstArray, uint dstIndex, CUarray srcArray, uint srcIndex, uint ByteCount ) ; + +FUNCTION: CUresult cuMemcpy2D ( CUDA_MEMCPY2D* pCopy ) ; +FUNCTION: CUresult cuMemcpy2DUnaligned ( CUDA_MEMCPY2D* pCopy ) ; + +FUNCTION: CUresult cuMemcpy3D ( CUDA_MEMCPY3D* pCopy ) ; + +FUNCTION: CUresult cuMemcpyHtoDAsync ( CUdeviceptr dstDevice, + void* srcHost, uint ByteCount, CUstream hStream ) ; +FUNCTION: CUresult cuMemcpyDtoHAsync ( void* dstHost, + CUdeviceptr srcDevice, uint ByteCount, CUstream hStream ) ; + +FUNCTION: CUresult cuMemcpyDtoDAsync ( CUdeviceptr dstDevice, + CUdeviceptr srcDevice, uint ByteCount, CUstream hStream ) ; + +FUNCTION: CUresult cuMemcpyHtoAAsync ( CUarray dstArray, uint dstIndex, + void* pSrc, uint ByteCount, CUstream hStream ) ; +FUNCTION: CUresult cuMemcpyAtoHAsync ( void* dstHost, CUarray srcArray, uint srcIndex, + uint ByteCount, CUstream hStream ) ; + +FUNCTION: CUresult cuMemcpy2DAsync ( CUDA_MEMCPY2D* pCopy, CUstream hStream ) ; +FUNCTION: CUresult cuMemcpy3DAsync ( CUDA_MEMCPY3D* pCopy, CUstream hStream ) ; + +FUNCTION: CUresult cuMemsetD8 ( CUdeviceptr dstDevice, uchar uc, uint N ) ; +FUNCTION: CUresult cuMemsetD16 ( CUdeviceptr dstDevice, ushort us, uint N ) ; +FUNCTION: CUresult cuMemsetD32 ( CUdeviceptr dstDevice, uint ui, uint N ) ; + +FUNCTION: CUresult cuMemsetD2D8 ( CUdeviceptr dstDevice, uint dstPitch, uchar uc, uint Width, uint Height ) ; +FUNCTION: CUresult cuMemsetD2D16 ( CUdeviceptr dstDevice, uint dstPitch, ushort us, uint Width, uint Height ) ; +FUNCTION: CUresult cuMemsetD2D32 ( CUdeviceptr dstDevice, uint dstPitch, uint ui, uint Width, uint Height ) ; + +FUNCTION: CUresult cuFuncSetBlockShape ( CUfunction hfunc, int x, int y, int z ) ; +FUNCTION: CUresult cuFuncSetSharedSize ( CUfunction hfunc, uint bytes ) ; +FUNCTION: CUresult cuFuncGetAttribute ( int* pi, CUfunction_attribute attrib, CUfunction hfunc ) ; +FUNCTION: CUresult cuFuncSetCacheConfig ( CUfunction hfunc, CUfunc_cache config ) ; + +FUNCTION: CUresult cuArrayCreate ( CUarray* pHandle, CUDA_ARRAY_DESCRIPTOR* pAllocateArray ) ; +FUNCTION: CUresult cuArrayGetDescriptor ( CUDA_ARRAY_DESCRIPTOR* pArrayDescriptor, CUarray hArray ) ; +FUNCTION: CUresult cuArrayDestroy ( CUarray hArray ) ; + +FUNCTION: CUresult cuArray3DCreate ( CUarray* pHandle, CUDA_ARRAY3D_DESCRIPTOR* pAllocateArray ) ; +FUNCTION: CUresult cuArray3DGetDescriptor ( CUDA_ARRAY3D_DESCRIPTOR* pArrayDescriptor, CUarray hArray ) ; + +FUNCTION: CUresult cuTexRefCreate ( CUtexref* pTexRef ) ; +FUNCTION: CUresult cuTexRefDestroy ( CUtexref hTexRef ) ; + +FUNCTION: CUresult cuTexRefSetArray ( CUtexref hTexRef, CUarray hArray, uint Flags ) ; +FUNCTION: CUresult cuTexRefSetAddress ( uint* ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, uint bytes ) ; +FUNCTION: CUresult cuTexRefSetAddress2D ( CUtexref hTexRef, CUDA_ARRAY_DESCRIPTOR* desc, CUdeviceptr dptr, uint Pitch ) ; +FUNCTION: CUresult cuTexRefSetFormat ( CUtexref hTexRef, CUarray_format fmt, int NumPackedComponents ) ; +FUNCTION: CUresult cuTexRefSetAddressMode ( CUtexref hTexRef, int dim, CUaddress_mode am ) ; +FUNCTION: CUresult cuTexRefSetFilterMode ( CUtexref hTexRef, CUfilter_mode fm ) ; +FUNCTION: CUresult cuTexRefSetFlags ( CUtexref hTexRef, uint Flags ) ; + +FUNCTION: CUresult cuTexRefGetAddress ( CUdeviceptr* pdptr, CUtexref hTexRef ) ; +FUNCTION: CUresult cuTexRefGetArray ( CUarray* phArray, CUtexref hTexRef ) ; +FUNCTION: CUresult cuTexRefGetAddressMode ( CUaddress_mode* pam, CUtexref hTexRef, int dim ) ; +FUNCTION: CUresult cuTexRefGetFilterMode ( CUfilter_mode* pfm, CUtexref hTexRef ) ; +FUNCTION: CUresult cuTexRefGetFormat ( CUarray_format* pFormat, int* pNumChannels, CUtexref hTexRef ) ; +FUNCTION: CUresult cuTexRefGetFlags ( uint* pFlags, CUtexref hTexRef ) ; + +FUNCTION: CUresult cuParamSetSize ( CUfunction hfunc, uint numbytes ) ; +FUNCTION: CUresult cuParamSeti ( CUfunction hfunc, int offset, uint value ) ; +FUNCTION: CUresult cuParamSetf ( CUfunction hfunc, int offset, float value ) ; +FUNCTION: CUresult cuParamSetv ( CUfunction hfunc, int offset, void* ptr, uint numbytes ) ; +FUNCTION: CUresult cuParamSetTexRef ( CUfunction hfunc, int texunit, CUtexref hTexRef ) ; + +FUNCTION: CUresult cuLaunch ( CUfunction f ) ; +FUNCTION: CUresult cuLaunchGrid ( CUfunction f, int grid_width, int grid_height ) ; +FUNCTION: CUresult cuLaunchGridAsync ( CUfunction f, int grid_width, int grid_height, CUstream hStream ) ; + +FUNCTION: CUresult cuEventCreate ( CUevent* phEvent, uint Flags ) ; +FUNCTION: CUresult cuEventRecord ( CUevent hEvent, CUstream hStream ) ; +FUNCTION: CUresult cuEventQuery ( CUevent hEvent ) ; +FUNCTION: CUresult cuEventSynchronize ( CUevent hEvent ) ; +FUNCTION: CUresult cuEventDestroy ( CUevent hEvent ) ; +FUNCTION: CUresult cuEventElapsedTime ( float* pMilliseconds, CUevent hStart, CUevent hEnd ) ; + +FUNCTION: CUresult cuStreamCreate ( CUstream* phStream, uint Flags ) ; +FUNCTION: CUresult cuStreamQuery ( CUstream hStream ) ; +FUNCTION: CUresult cuStreamSynchronize ( CUstream hStream ) ; +FUNCTION: CUresult cuStreamDestroy ( CUstream hStream ) ; + +FUNCTION: CUresult cuGraphicsUnregisterResource ( CUgraphicsResource resource ) ; +FUNCTION: CUresult cuGraphicsSubResourceGetMappedArray ( CUarray* pArray, CUgraphicsResource resource, uint arrayIndex, uint mipLevel ) ; +FUNCTION: CUresult cuGraphicsResourceGetMappedPointer ( CUdeviceptr* pDevPtr, uint* pSize, CUgraphicsResource resource ) ; +FUNCTION: CUresult cuGraphicsResourceSetMapFlags ( CUgraphicsResource resource, uint flags ) ; +FUNCTION: CUresult cuGraphicsMapResources ( uint count, CUgraphicsResource* resources, CUstream hStream ) ; +FUNCTION: CUresult cuGraphicsUnmapResources ( uint count, CUgraphicsResource* resources, CUstream hStream ) ; + +FUNCTION: CUresult cuGetExportTable ( void** ppExportTable, CUuuid* pExportTableId ) ; + From a46c624123a5ece55c247d0176d9bc58fffbcdd8 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Mon, 12 Apr 2010 17:45:30 -0700 Subject: [PATCH 092/157] missed LIBRARY: cuda in cuda.ffi --- extra/cuda/ffi/ffi.factor | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extra/cuda/ffi/ffi.factor b/extra/cuda/ffi/ffi.factor index 3b59eb83e5..ce6f8cb8b8 100644 --- a/extra/cuda/ffi/ffi.factor +++ b/extra/cuda/ffi/ffi.factor @@ -11,6 +11,8 @@ IN: cuda.ffi } cond add-library >> +LIBRARY: cuda + TYPEDEF: uint CUdeviceptr TYPEDEF: int CUdevice TYPEDEF: void* CUcontext From 99a3b3c9f61a13ad3b514b883836a5f8b53063d2 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 12 Apr 2010 18:17:21 -0700 Subject: [PATCH 093/157] furnace: documentation improvements --- basis/furnace/actions/actions-docs.factor | 2 +- basis/html/components/components-docs.factor | 2 +- basis/html/components/components.factor | 9 ++++++++- basis/html/templates/chloe/chloe-docs.factor | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/basis/furnace/actions/actions-docs.factor b/basis/furnace/actions/actions-docs.factor index a49d6d54b3..862bdead72 100644 --- a/basis/furnace/actions/actions-docs.factor +++ b/basis/furnace/actions/actions-docs.factor @@ -31,7 +31,7 @@ HELP: new-action { $description "Constructs a subclass of " { $link action } "." } ; HELP: page-action -{ $class-description "The class of Chloe page actions. These are actions whose " { $slot "display" } " slot is pre-set to serve the Chloe template stored in the " { $slot "page" } " slot." } ; +{ $class-description "The class of Chloe page actions. These are actions whose " { $slot "display" } " slot is pre-set to serve the Chloe template stored in the " { $slot "template" } " slot. The " { $slot "template" } " slot contains a pair with shape " { $snippet "{ responder name }" } "." } ; HELP: validate-integer-id { $description "A utility word which validates an integer parameter named " { $snippet "id" } "." } diff --git a/basis/html/components/components-docs.factor b/basis/html/components/components-docs.factor index c35237b403..3b4f1d6ae3 100644 --- a/basis/html/components/components-docs.factor +++ b/basis/html/components/components-docs.factor @@ -29,7 +29,7 @@ HELP: textarea { $class-description "Text area components display a multi-line editor for a string value. The " { $slot "rows" } " and " { $slot "cols" } " properties determine the size of the text area." } ; HELP: link -{ $description "Link components render a link to an object stored at a value, with the link title and URL determined by the " { $link link-title } " and " { $link link-href } " generic words. The optional " { $slot "target" } " slot is a target frame to open the link in." } ; +{ $description "Link components render a value responding to the " { $link link-title } " and " { $link link-href } " generic words. The optional " { $slot "target" } " slot is a target frame to open the link in." } ; HELP: link-title { $values { "obj" object } { "string" string } } diff --git a/basis/html/components/components.factor b/basis/html/components/components.factor index 9dddb85619..5a2a55bfd0 100644 --- a/basis/html/components/components.factor +++ b/basis/html/components/components.factor @@ -1,4 +1,4 @@ -! Copyright (C) 2008, 2009 Slava Pestov, Daniel Ehrenberg +! Copyright (C) 2008, 2010 Slava Pestov, Daniel Ehrenberg ! See http://factorcode.org/license.txt for BSD license. USING: accessors kernel namespaces io math.parser assocs classes classes.tuple words arrays sequences splitting mirrors @@ -117,6 +117,13 @@ M: string link-href ; M: url link-title ; M: url link-href ; +TUPLE: simple-link title href ; + +C: simple-link + +M: simple-link link-title title>> ; +M: simple-link link-href href>> ; + TUPLE: link target ; M: link render* diff --git a/basis/html/templates/chloe/chloe-docs.factor b/basis/html/templates/chloe/chloe-docs.factor index 41653cb85a..a3032aba96 100644 --- a/basis/html/templates/chloe/chloe-docs.factor +++ b/basis/html/templates/chloe/chloe-docs.factor @@ -60,7 +60,7 @@ HELP: compile-with-scope { $description "Calls the quotation and wraps any output it compiles in a " { $link with-scope } " form." } ; ARTICLE: "html.templates.chloe.tags.component" "Component Chloe tags" -"The following Chloe tags correspond exactly to " { $link "html.components" } ". Singleton component tags do not allow any attributes. Attributes of tuple component tags are mapped to tuple slot values of the component instance." +"The following Chloe tags correspond exactly to " { $link "html.components" } ". The " { $snippet "name" } " attribute should be the name of a form value (see " { $link "html.forms.values" } "). Singleton component tags do not allow any other attributes. Tuple component tags map all other attributes to tuple slot values of the component instance." { $table { "Tag" "Component class" } { { $snippet "t:checkbox" } { $link checkbox } } From 3c11991843ef547fb2044bd38fa5b4950277db1b Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 12 Apr 2010 18:29:47 -0700 Subject: [PATCH 094/157] classes.struct, specialized-arrays: fix unit tests to work when forget-tests? is on --- basis/classes/struct/struct-tests.factor | 12 +++++-- .../specialized-arrays-tests.factor | 34 ++++++++++++++----- 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/basis/classes/struct/struct-tests.factor b/basis/classes/struct/struct-tests.factor index dafd31efde..13088e1469 100644 --- a/basis/classes/struct/struct-tests.factor +++ b/basis/classes/struct/struct-tests.factor @@ -4,9 +4,11 @@ assocs byte-arrays classes.struct classes.tuple.parser classes.tuple.private classes.tuple combinators compiler.tree.debugger compiler.units destructors io.encodings.utf8 io.pathnames io.streams.string kernel libc literals math mirrors namespaces -prettyprint prettyprint.config see sequences specialized-arrays system -tools.test parser lexer eval layouts generic.single classes ; +prettyprint prettyprint.config see sequences specialized-arrays +system tools.test parser lexer eval layouts generic.single classes +vocabs ; FROM: math => float ; +FROM: specialized-arrays.private => specialized-array-vocab ; QUALIFIED-WITH: alien.c-types c SPECIALIZED-ARRAY: char SPECIALIZED-ARRAY: int @@ -303,6 +305,12 @@ SPECIALIZED-ARRAY: struct-test-optimization { x>> } inlined? ] unit-test +[ ] [ + [ + struct-test-optimization specialized-array-vocab forget-vocab + ] with-compilation-unit +] unit-test + ! Test cloning structs STRUCT: clone-test-struct { x int } { y char[3] } ; diff --git a/basis/specialized-arrays/specialized-arrays-tests.factor b/basis/specialized-arrays/specialized-arrays-tests.factor index 645606edc5..2dee88df88 100644 --- a/basis/specialized-arrays/specialized-arrays-tests.factor +++ b/basis/specialized-arrays/specialized-arrays-tests.factor @@ -1,13 +1,13 @@ -IN: specialized-arrays.tests -USING: tools.test alien.syntax specialized-arrays -specialized-arrays.private sequences alien accessors -kernel arrays combinators compiler compiler.units classes.struct -combinators.smart compiler.tree.debugger math libc destructors -sequences.private multiline eval words vocabs namespaces -assocs prettyprint alien.data math.vectors definitions -compiler.test ; +USING: tools.test alien.syntax specialized-arrays sequences +alien accessors kernel arrays combinators compiler +compiler.units classes.struct combinators.smart +compiler.tree.debugger math libc destructors sequences.private +multiline eval words vocabs namespaces assocs prettyprint +alien.data math.vectors definitions compiler.test ; +FROM: specialized-arrays.private => specialized-array-vocab ; FROM: alien.c-types => int float bool char float ulonglong ushort uint heap-size little-endian? ; +IN: specialized-arrays.tests SPECIALIZED-ARRAY: int SPECIALIZED-ARRAYS: bool ushort char uint float ulonglong ; @@ -101,6 +101,12 @@ SPECIALIZED-ARRAY: test-struct } second ] unit-test +[ ] [ + [ + test-struct specialized-array-vocab forget-vocab + ] with-compilation-unit +] unit-test + ! Regression STRUCT: fixed-string { text char[64] } ; @@ -115,6 +121,12 @@ SPECIALIZED-ARRAY: fixed-string ALIEN: 123 100 byte-length ] unit-test +[ ] [ + [ + fixed-string specialized-array-vocab forget-vocab + ] with-compilation-unit +] unit-test + ! Test prettyprinting [ "int-array{ 1 2 3 }" ] [ int-array{ 1 2 3 } unparse ] unit-test [ "int-array@ f 100" ] [ f 100 unparse ] unit-test @@ -172,3 +184,9 @@ SPECIALIZED-ARRAY: struct-resize-test [ 80 ] [ 10 byte-length ] unit-test [ { 10 20 30 } ] [ { 10 20 30 } struct-resize-test-usage ] unit-test + +[ ] [ + [ + struct-resize-test specialized-array-vocab forget-vocab + ] with-compilation-unit +] unit-test From 03ec284c2e9601dd9856c6eb580b5f23235535e1 Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Mon, 12 Apr 2010 19:10:20 -0700 Subject: [PATCH 095/157] nm for ELF files --- extra/elf/elf.factor | 8 +++++--- extra/elf/nm/authors.txt | 1 + extra/elf/nm/nm-docs.factor | 22 ++++++++++++++++++++++ extra/elf/nm/nm.factor | 25 +++++++++++++++++++++++++ extra/elf/nm/summary.txt | 1 + 5 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 extra/elf/nm/authors.txt create mode 100644 extra/elf/nm/nm-docs.factor create mode 100644 extra/elf/nm/nm.factor create mode 100644 extra/elf/nm/summary.txt diff --git a/extra/elf/elf.factor b/extra/elf/elf.factor index bf4de754d1..b2fe7db8a4 100644 --- a/extra/elf/elf.factor +++ b/extra/elf/elf.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2010 Erik Charlebois. ! See http://factorcode.org/license.txt for BSD license. USING: accessors alien alien.c-types alien.strings alien.syntax arrays -classes.struct io.encodings.ascii kernel locals math math.intervals -sequences specialized-arrays strings typed ; +classes.struct fry io.encodings.ascii kernel locals math +math.intervals sequences specialized-arrays strings typed ; IN: elf ! FFI data @@ -609,4 +609,6 @@ M:: segment sections ( segment -- sections ) symbol sym>> st_value>> segment p_vaddr>> - segment p_offset>> + :> faddress faddress symbol elf-header>> >c-ptr symbol sym>> st_size>> ; - + +: find-section ( sections name -- section/f ) + '[ name>> _ = ] find nip ; diff --git a/extra/elf/nm/authors.txt b/extra/elf/nm/authors.txt new file mode 100644 index 0000000000..6f03a12101 --- /dev/null +++ b/extra/elf/nm/authors.txt @@ -0,0 +1 @@ +Erik Charlebois diff --git a/extra/elf/nm/nm-docs.factor b/extra/elf/nm/nm-docs.factor new file mode 100644 index 0000000000..f07af890c8 --- /dev/null +++ b/extra/elf/nm/nm-docs.factor @@ -0,0 +1,22 @@ +! Copyright (C) 2010 Erik Charlebois. +! See http://factorcode.org/license.txt for BSD license. +USING: elf help.markup help.syntax ; +IN: elf.nm + +HELP: nm +{ $values + { "path" "a pathname string" } +} +{ $description "Prints information about the symbols in the ELF object at the given path." } ; + +HELP: print-symbol +{ $values + { "sections" "sequence of section" } { "symbol" symbol } +} +{ $description "Prints the value, section and name of the given symbol." } ; + +ARTICLE: "elf.nm" "ELF nm" +{ $description "Utility to print the values, sections and names of the symbols in a given ELF file. In an ELF executable or shared library, the symbol values are typically their virtual addresses. In a relocatable ELF object, they are section-relative offsets." } +; + +ABOUT: "elf.nm" diff --git a/extra/elf/nm/nm.factor b/extra/elf/nm/nm.factor new file mode 100644 index 0000000000..f9df61249d --- /dev/null +++ b/extra/elf/nm/nm.factor @@ -0,0 +1,25 @@ +! Copyright (C) 2010 Erik Charlebois. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors combinators elf formatting io.mmap kernel sequences ; +IN: elf.nm + +: print-symbol ( sections symbol -- ) + [ sym>> st_value>> "%016d " printf ] + [ + sym>> st_shndx>> + { + { SHN_UNDEF [ drop "undefined" ] } + { SHN_ABS [ drop "absolute" ] } + { SHN_COMMON [ drop "common" ] } + [ swap nth name>> ] + } case "%-16s " printf + ] + [ name>> "%s\n" printf ] tri ; + +: nm ( path -- ) + [ + address>> sections + dup ".symtab" find-section + symbols [ name>> empty? not ] filter + [ print-symbol ] with each + ] with-mapped-file ; diff --git a/extra/elf/nm/summary.txt b/extra/elf/nm/summary.txt new file mode 100644 index 0000000000..7d378d3c38 --- /dev/null +++ b/extra/elf/nm/summary.txt @@ -0,0 +1 @@ +UNIX nm-like utility. From 904a2057282cb31af9511173cfa8f1f03d939e6a Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Mon, 12 Apr 2010 21:23:26 -0700 Subject: [PATCH 096/157] Test cases for ELF --- extra/elf/elf-tests.factor | 180 +++++++++++++++++++++++++++++++++++ extra/elf/elf.factor | 16 +++- extra/elf/nm/nm-docs.factor | 2 +- extra/elf/nm/nm-tests.factor | 51 ++++++++++ extra/elf/nm/nm.factor | 5 +- 5 files changed, 248 insertions(+), 6 deletions(-) create mode 100644 extra/elf/elf-tests.factor create mode 100644 extra/elf/nm/nm-tests.factor diff --git a/extra/elf/elf-tests.factor b/extra/elf/elf-tests.factor new file mode 100644 index 0000000000..c0ade1bcd1 --- /dev/null +++ b/extra/elf/elf-tests.factor @@ -0,0 +1,180 @@ +! Copyright (C) 2010 Erik Charlebois. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors byte-arrays elf kernel sequences tools.test ; +IN: elf.tests + +{ + { + "" + ".interp" + ".note.ABI-tag" + ".note.gnu.build-id" + ".hash" + ".gnu.hash" + ".dynsym" + ".dynstr" + ".gnu.version" + ".gnu.version_r" + ".rela.dyn" + ".rela.plt" + ".init" + ".plt" + ".text" + ".fini" + ".rodata" + ".eh_frame_hdr" + ".eh_frame" + ".ctors" + ".dtors" + ".jcr" + ".dynamic" + ".got" + ".got.plt" + ".data" + ".bss" + ".comment" + ".debug_aranges" + ".debug_pubnames" + ".debug_info" + ".debug_abbrev" + ".debug_line" + ".debug_str" + ".shstrtab" + ".symtab" + ".strtab" + } +} +[ + "resource:extra/elf/a.out" [ + sections [ name>> ] map + ] with-mapped-elf +] +unit-test + +{ + { + ".interp" + ".note.ABI-tag" + ".note.gnu.build-id" + ".hash" + ".gnu.hash" + ".dynsym" + ".dynstr" + ".gnu.version" + ".gnu.version_r" + ".rela.dyn" + ".rela.plt" + ".init" + ".plt" + ".text" + ".fini" + ".rodata" + ".eh_frame_hdr" + ".eh_frame" + } +} +[ + "resource:extra/elf/a.out" [ + segments [ program-header>> p_type>> PT_LOAD = ] find nip + sections [ name>> ] map + ] with-mapped-elf +] +unit-test + +{ + { + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "init.c" + "call_gmon_start" + "crtstuff.c" + "__CTOR_LIST__" + "__DTOR_LIST__" + "__JCR_LIST__" + "__do_global_dtors_aux" + "completed.7342" + "dtor_idx.7344" + "frame_dummy" + "crtstuff.c" + "__CTOR_END__" + "__FRAME_END__" + "__JCR_END__" + "__do_global_ctors_aux" + "test.c" + "_GLOBAL_OFFSET_TABLE_" + "__init_array_end" + "__init_array_start" + "_DYNAMIC" + "data_start" + "printf@@GLIBC_2.2.5" + "__libc_csu_fini" + "_start" + "__gmon_start__" + "_Jv_RegisterClasses" + "_fini" + "__libc_start_main@@GLIBC_2.2.5" + "_IO_stdin_used" + "__data_start" + "__dso_handle" + "__DTOR_END__" + "__libc_csu_init" + "__bss_start" + "_end" + "_edata" + "main" + "_init" + } +} +[ + "resource:extra/elf/a.out" [ + sections ".symtab" find-section symbols + [ name>> ] map + ] with-mapped-elf +] +unit-test + +{ + B{ + 85 72 137 229 184 44 6 64 0 72 137 199 184 0 0 0 0 232 222 + 254 255 255 201 195 + } +} +[ + "resource:extra/elf/a.out" [ + sections ".symtab" "main" find-section-symbol + symbol-data >byte-array + ] with-mapped-elf +] +unit-test diff --git a/extra/elf/elf.factor b/extra/elf/elf.factor index b2fe7db8a4..19bb3bfbf9 100644 --- a/extra/elf/elf.factor +++ b/extra/elf/elf.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2010 Erik Charlebois. ! See http://factorcode.org/license.txt for BSD license. USING: accessors alien alien.c-types alien.strings alien.syntax arrays -classes.struct fry io.encodings.ascii kernel locals math +classes.struct fry io.encodings.ascii io.mmap kernel locals math math.intervals sequences specialized-arrays strings typed ; IN: elf @@ -611,4 +611,16 @@ M:: segment sections ( segment -- sections ) symbol sym>> st_size>> ; : find-section ( sections name -- section/f ) - '[ name>> _ = ] find nip ; + '[ name>> _ = ] find nip ; inline + +: find-symbol ( symbols name -- symbol/f ) + '[ name>> _ = ] find nip ; inline + +: find-section-symbol ( sections section symbol -- symbol/f ) + [ find-section ] dip over [ + [ symbols ] dip find-symbol ] [ 2drop f ] if ; + +: with-mapped-elf ( path quot -- ) + '[ + address>> @ + ] with-mapped-file ; inline diff --git a/extra/elf/nm/nm-docs.factor b/extra/elf/nm/nm-docs.factor index f07af890c8..a7b7ad426e 100644 --- a/extra/elf/nm/nm-docs.factor +++ b/extra/elf/nm/nm-docs.factor @@ -16,7 +16,7 @@ HELP: print-symbol { $description "Prints the value, section and name of the given symbol." } ; ARTICLE: "elf.nm" "ELF nm" -{ $description "Utility to print the values, sections and names of the symbols in a given ELF file. In an ELF executable or shared library, the symbol values are typically their virtual addresses. In a relocatable ELF object, they are section-relative offsets." } +"The " { $vocab-link "elf.nm" } " vocab prints the values, sections and names of the symbols in a given ELF file. In an ELF executable or shared library, the symbol values are typically their virtual addresses. In a relocatable ELF object, they are section-relative offsets." ; ABOUT: "elf.nm" diff --git a/extra/elf/nm/nm-tests.factor b/extra/elf/nm/nm-tests.factor new file mode 100644 index 0000000000..e420976d9e --- /dev/null +++ b/extra/elf/nm/nm-tests.factor @@ -0,0 +1,51 @@ +! Copyright (C) 2010 Erik Charlebois. +! See http://factorcode.org/license.txt for BSD license. +USING: elf.nm io io.streams.string kernel multiline strings tools.test +literals ; +IN: elf.nm.tests + +STRING: validation-output +0000000000000000 absolute init.c +0000000004195436 .text call_gmon_start +0000000000000000 absolute crtstuff.c +0000000006295064 .ctors __CTOR_LIST__ +0000000006295080 .dtors __DTOR_LIST__ +0000000006295096 .jcr __JCR_LIST__ +0000000004195472 .text __do_global_dtors_aux +0000000006295584 .bss completed.7342 +0000000006295592 .bss dtor_idx.7344 +0000000004195584 .text frame_dummy +0000000000000000 absolute crtstuff.c +0000000006295072 .ctors __CTOR_END__ +0000000004196056 .eh_frame __FRAME_END__ +0000000006295096 .jcr __JCR_END__ +0000000004195808 .text __do_global_ctors_aux +0000000000000000 absolute test.c +0000000006295528 .got.plt _GLOBAL_OFFSET_TABLE_ +0000000006295060 .ctors __init_array_end +0000000006295060 .ctors __init_array_start +0000000006295104 .dynamic _DYNAMIC +0000000006295568 .data data_start +0000000000000000 undefined printf@@GLIBC_2.2.5 +0000000004195648 .text __libc_csu_fini +0000000004195392 .text _start +0000000000000000 undefined __gmon_start__ +0000000000000000 undefined _Jv_RegisterClasses +0000000004195864 .fini _fini +0000000000000000 undefined __libc_start_main@@GLIBC_2.2.5 +0000000004195880 .rodata _IO_stdin_used +0000000006295568 .data __data_start +0000000006295576 .data __dso_handle +0000000006295088 .dtors __DTOR_END__ +0000000004195664 .text __libc_csu_init +0000000006295584 absolute __bss_start +0000000006295600 absolute _end +0000000006295584 absolute _edata +0000000004195620 .text main +0000000004195312 .init _init + +; + +{ $ validation-output } +[ dup [ "resource:extra/elf/a.out" nm ] with-output-stream >string ] +unit-test diff --git a/extra/elf/nm/nm.factor b/extra/elf/nm/nm.factor index f9df61249d..87c9abf00b 100644 --- a/extra/elf/nm/nm.factor +++ b/extra/elf/nm/nm.factor @@ -18,8 +18,7 @@ IN: elf.nm : nm ( path -- ) [ - address>> sections - dup ".symtab" find-section + sections dup ".symtab" find-section symbols [ name>> empty? not ] filter [ print-symbol ] with each - ] with-mapped-file ; + ] with-mapped-elf ; From f31929ca5b5aa0076eeb9aa18b791d17bd36229f Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Mon, 12 Apr 2010 21:38:01 -0700 Subject: [PATCH 097/157] a.elf for elf tests --- extra/elf/a.elf | Bin 0 -> 9849 bytes extra/elf/elf-tests.factor | 8 ++++---- extra/elf/nm/nm-tests.factor | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) create mode 100755 extra/elf/a.elf diff --git a/extra/elf/a.elf b/extra/elf/a.elf new file mode 100755 index 0000000000000000000000000000000000000000..0f10a2fb3132b888ea405b8221886079dfa431a5 GIT binary patch literal 9849 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 WEM?m`JK~zj1}Ei_lKlV075NvT7Pr*^ literal 0 HcmV?d00001 diff --git a/extra/elf/elf-tests.factor b/extra/elf/elf-tests.factor index c0ade1bcd1..d68885e6b7 100644 --- a/extra/elf/elf-tests.factor +++ b/extra/elf/elf-tests.factor @@ -45,7 +45,7 @@ IN: elf.tests } } [ - "resource:extra/elf/a.out" [ + "resource:extra/elf/a.elf" [ sections [ name>> ] map ] with-mapped-elf ] @@ -74,7 +74,7 @@ unit-test } } [ - "resource:extra/elf/a.out" [ + "resource:extra/elf/a.elf" [ segments [ program-header>> p_type>> PT_LOAD = ] find nip sections [ name>> ] map ] with-mapped-elf @@ -158,7 +158,7 @@ unit-test } } [ - "resource:extra/elf/a.out" [ + "resource:extra/elf/a.elf" [ sections ".symtab" find-section symbols [ name>> ] map ] with-mapped-elf @@ -172,7 +172,7 @@ unit-test } } [ - "resource:extra/elf/a.out" [ + "resource:extra/elf/a.elf" [ sections ".symtab" "main" find-section-symbol symbol-data >byte-array ] with-mapped-elf diff --git a/extra/elf/nm/nm-tests.factor b/extra/elf/nm/nm-tests.factor index e420976d9e..2ecb499081 100644 --- a/extra/elf/nm/nm-tests.factor +++ b/extra/elf/nm/nm-tests.factor @@ -47,5 +47,5 @@ STRING: validation-output ; { $ validation-output } -[ dup [ "resource:extra/elf/a.out" nm ] with-output-stream >string ] +[ dup [ "resource:extra/elf/a.elf" nm ] with-output-stream >string ] unit-test From b5e99faf4fe33a1df0e15b31a230b1240fc337e3 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 12 Apr 2010 22:54:30 -0700 Subject: [PATCH 098/157] bit.ly: URL shortening web service --- extra/bit/ly/authors.txt | 1 + extra/bit/ly/ly.factor | 23 +++++++++++++++++++++++ extra/bit/ly/summary.txt | 1 + extra/bit/ly/tags.txt | 1 + 4 files changed, 26 insertions(+) create mode 100644 extra/bit/ly/authors.txt create mode 100644 extra/bit/ly/ly.factor create mode 100644 extra/bit/ly/summary.txt create mode 100644 extra/bit/ly/tags.txt diff --git a/extra/bit/ly/authors.txt b/extra/bit/ly/authors.txt new file mode 100644 index 0000000000..1901f27a24 --- /dev/null +++ b/extra/bit/ly/authors.txt @@ -0,0 +1 @@ +Slava Pestov diff --git a/extra/bit/ly/ly.factor b/extra/bit/ly/ly.factor new file mode 100644 index 0000000000..32d40786f7 --- /dev/null +++ b/extra/bit/ly/ly.factor @@ -0,0 +1,23 @@ +! Copyright (C) 2010 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: assocs http.client json.reader kernel namespaces urls ; +IN: bit.ly + +SYMBOLS: login api-key ; + +url + login get "login" set-query-param + api-key get "apiKey" set-query-param + "json" "format" set-query-param + swap "longUrl" set-query-param ; + +: parse-response ( response data -- short-url ) + nip json> "data" swap at "url" swap at ; + +PRIVATE> + +: shorten-url ( long-url -- short-url ) + make-request http-get parse-response ; diff --git a/extra/bit/ly/summary.txt b/extra/bit/ly/summary.txt new file mode 100644 index 0000000000..29020a649b --- /dev/null +++ b/extra/bit/ly/summary.txt @@ -0,0 +1 @@ +Wrapper for bit.ly URL shortening web service diff --git a/extra/bit/ly/tags.txt b/extra/bit/ly/tags.txt new file mode 100644 index 0000000000..0a8d552b33 --- /dev/null +++ b/extra/bit/ly/tags.txt @@ -0,0 +1 @@ +web services From ea3af2aef6ef885f8359a414a7e1f92e20184ea4 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 12 Apr 2010 22:54:35 -0700 Subject: [PATCH 099/157] twitter: add meta-data --- extra/twitter/summary.txt | 1 + extra/twitter/tags.txt | 1 + 2 files changed, 2 insertions(+) create mode 100644 extra/twitter/summary.txt create mode 100644 extra/twitter/tags.txt diff --git a/extra/twitter/summary.txt b/extra/twitter/summary.txt new file mode 100644 index 0000000000..ee9d6c703e --- /dev/null +++ b/extra/twitter/summary.txt @@ -0,0 +1 @@ +Wrapper for Twitter web service diff --git a/extra/twitter/tags.txt b/extra/twitter/tags.txt new file mode 100644 index 0000000000..0a8d552b33 --- /dev/null +++ b/extra/twitter/tags.txt @@ -0,0 +1 @@ +web services From 88f627a402cd7ee4e222aed746002e28a1f3217d Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 13 Apr 2010 01:24:04 -0500 Subject: [PATCH 100/157] compiler.tests.alien: fix tests on Win64 --- basis/compiler/tests/alien.factor | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index 279c6ef39f..7bbc0a904f 100755 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -684,28 +684,30 @@ mingw? [ : fastcall-struct-return-iii-indirect ( x y z ptr -- result ) test-struct-11 { int int int } fastcall alien-indirect ; +: win32? ( -- ? ) os windows? cpu x86.32? and ; + [ 8 ] [ 3 4 - os windows? [ &: @ffi_test_50@8 ] [ &: ffi_test_50 ] if + win32? [ &: @ffi_test_50@8 ] [ &: ffi_test_50 ] if fastcall-ii-indirect ] unit-test [ 13 ] [ 3 4 5 - os windows? [ &: @ffi_test_51@12 ] [ &: ffi_test_51 ] if + win32? [ &: @ffi_test_51@12 ] [ &: ffi_test_51 ] if fastcall-iii-indirect ] unit-test mingw? [ [ 13 ] [ 3 4.0 5 - os windows? [ &: @ffi_test_52@12 ] [ &: ffi_test_52 ] if + win32? [ &: @ffi_test_52@12 ] [ &: ffi_test_52 ] if fastcall-ifi-indirect ] unit-test [ 19 ] [ 3 4.0 5 6 - os windows? [ &: @ffi_test_53@16 ] [ &: ffi_test_53 ] if + win32? [ &: @ffi_test_53@16 ] [ &: ffi_test_53 ] if fastcall-ifii-indirect ] unit-test ] unless @@ -713,14 +715,14 @@ mingw? [ [ S{ test-struct-11 f 7 -1 } ] [ 3 4 - os windows? [ &: @ffi_test_57@8 ] [ &: ffi_test_57 ] if + win32? [ &: @ffi_test_57@8 ] [ &: ffi_test_57 ] if fastcall-struct-return-ii-indirect ] unit-test [ S{ test-struct-11 f 7 -3 } ] [ 3 4 7 - os windows? [ &: @ffi_test_58@12 ] [ &: ffi_test_58 ] if + win32? [ &: @ffi_test_58@12 ] [ &: ffi_test_58 ] if fastcall-struct-return-iii-indirect ] unit-test From c09f1567cb664641318d77850de53de363b4401a Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 13 Apr 2010 00:54:36 -0700 Subject: [PATCH 101/157] bit.ly: check response for errors --- extra/bit/ly/ly.factor | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/extra/bit/ly/ly.factor b/extra/bit/ly/ly.factor index 32d40786f7..1dcdf97dff 100644 --- a/extra/bit/ly/ly.factor +++ b/extra/bit/ly/ly.factor @@ -14,8 +14,16 @@ SYMBOLS: login api-key ; "json" "format" set-query-param swap "longUrl" set-query-param ; +ERROR: bad-response json status ; + +: check-response ( json -- json ) + dup "status_code" swap at 200 = [ + dup "status_txt" swap at + bad-response + ] unless ; + : parse-response ( response data -- short-url ) - nip json> "data" swap at "url" swap at ; + nip json> check-response "data" swap at "url" swap at ; PRIVATE> From 4f162128405f04095298bfa49aec938803cccfec Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 13 Apr 2010 00:56:48 -0700 Subject: [PATCH 102/157] compiler.tests.redefine23: test wasn't testing anything --- basis/compiler/tests/redefine23.factor | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/basis/compiler/tests/redefine23.factor b/basis/compiler/tests/redefine23.factor index e6061937b6..dafdc2d1af 100644 --- a/basis/compiler/tests/redefine23.factor +++ b/basis/compiler/tests/redefine23.factor @@ -1,6 +1,7 @@ IN: compiler.tests.redefine23 USING: classes.struct specialized-arrays alien.c-types sequences compiler.units vocabs tools.test ; +FROM: specialized-arrays.private => specialized-array-vocab ; STRUCT: my-struct { x int } ; SPECIALIZED-ARRAY: my-struct @@ -8,6 +9,6 @@ SPECIALIZED-ARRAY: my-struct [ ] [ [ - "specialized-arrays.instances.compiler.tests.redefine23" forget-vocab + my-struct specialized-array-vocab forget-vocab ] with-compilation-unit ] unit-test From 3e6c16ce36729a7ac2944abd926d5d6ec7511fc6 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 13 Apr 2010 01:43:10 -0700 Subject: [PATCH 103/157] bit.ly: some old-school newfx --- extra/bit/ly/ly.factor | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extra/bit/ly/ly.factor b/extra/bit/ly/ly.factor index 1dcdf97dff..0220fba264 100644 --- a/extra/bit/ly/ly.factor +++ b/extra/bit/ly/ly.factor @@ -7,6 +7,8 @@ SYMBOLS: login api-key ; url login get "login" set-query-param @@ -17,13 +19,13 @@ SYMBOLS: login api-key ; ERROR: bad-response json status ; : check-response ( json -- json ) - dup "status_code" swap at 200 = [ - dup "status_txt" swap at + dup "status_code" of 200 = [ + dup "status_txt" of bad-response ] unless ; : parse-response ( response data -- short-url ) - nip json> check-response "data" swap at "url" swap at ; + nip json> check-response "data" of "url" of ; PRIVATE> From 956ffa8946a93c1b6faf602c506601d5c7603455 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 13 Apr 2010 01:52:57 -0700 Subject: [PATCH 104/157] furnace.recaptcha: add new tag --- basis/furnace/recaptcha/tags.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/basis/furnace/recaptcha/tags.txt b/basis/furnace/recaptcha/tags.txt index c0772185a0..2b49742460 100644 --- a/basis/furnace/recaptcha/tags.txt +++ b/basis/furnace/recaptcha/tags.txt @@ -1 +1,2 @@ web +web services From 89560ee4d98358bee88dfeb60533590d6f2ee35e Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 11 Apr 2010 18:42:12 -0700 Subject: [PATCH 105/157] mason: big overhaul - add heartbeats for eventual notification of when build machines go down - mason.version: replaces mason.release, builds source package automatically, and tweets when new versions released - webapps.mason: new downloads action includes automatically-generated source download and release announcement links --- extra/mason/email/email-tests.factor | 2 +- extra/mason/email/email.factor | 37 +++++---- extra/mason/mason.factor | 5 +- extra/mason/notify/notify.factor | 5 +- extra/mason/server/notify/notify.factor | 4 + extra/mason/server/release/authors.txt | 1 - extra/mason/server/release/release.factor | 82 ------------------- extra/mason/server/server.factor | 5 +- extra/mason/source/authors.txt | 1 - extra/mason/source/source.factor | 49 ----------- extra/mason/version/authors.txt | 1 + extra/mason/version/binary/authors.txt | 1 + extra/mason/version/binary/binary.factor | 20 +++++ extra/mason/version/common/authors.txt | 1 + extra/mason/version/common/common.factor | 12 +++ extra/mason/version/data/authors.txt | 1 + extra/mason/version/data/data.factor | 54 ++++++++++++ extra/mason/version/files/authors.txt | 1 + extra/mason/version/files/files.factor | 39 +++++++++ extra/mason/version/source/authors.txt | 1 + extra/mason/version/source/source.factor | 51 ++++++++++++ extra/mason/version/version.factor | 52 ++++++++++++ extra/webapps/mason/download-package.xml | 1 + extra/webapps/mason/downloads.xml | 22 +++++ extra/webapps/mason/downloads/authors.txt | 1 + .../webapps/mason/downloads/downloads.factor | 25 ++++++ extra/webapps/mason/grids/grids.factor | 5 +- extra/webapps/mason/make-release.xml | 8 +- .../mason/make-release/make-release.factor | 5 +- extra/webapps/mason/mason.factor | 12 ++- extra/webapps/mason/package/package.factor | 10 ++- extra/webapps/mason/release/release.factor | 3 +- extra/webapps/mason/utils/utils.factor | 5 +- 33 files changed, 347 insertions(+), 175 deletions(-) delete mode 100644 extra/mason/server/release/authors.txt delete mode 100644 extra/mason/server/release/release.factor delete mode 100644 extra/mason/source/authors.txt delete mode 100644 extra/mason/source/source.factor create mode 100644 extra/mason/version/authors.txt create mode 100644 extra/mason/version/binary/authors.txt create mode 100644 extra/mason/version/binary/binary.factor create mode 100644 extra/mason/version/common/authors.txt create mode 100644 extra/mason/version/common/common.factor create mode 100644 extra/mason/version/data/authors.txt create mode 100644 extra/mason/version/data/data.factor create mode 100644 extra/mason/version/files/authors.txt create mode 100644 extra/mason/version/files/files.factor create mode 100644 extra/mason/version/source/authors.txt create mode 100644 extra/mason/version/source/source.factor create mode 100644 extra/mason/version/version.factor create mode 100644 extra/webapps/mason/downloads.xml create mode 100644 extra/webapps/mason/downloads/authors.txt create mode 100644 extra/webapps/mason/downloads/downloads.factor diff --git a/extra/mason/email/email-tests.factor b/extra/mason/email/email-tests.factor index 5f48ff0d4f..77f651feb9 100644 --- a/extra/mason/email/email-tests.factor +++ b/extra/mason/email/email-tests.factor @@ -6,6 +6,6 @@ USING: mason.email mason.common mason.config namespaces tools.test ; "linux" target-os set "x86.64" target-cpu set "12345" current-git-id set - status-error subject prefix-subject + status-error report-subject ] with-scope ] unit-test diff --git a/extra/mason/email/email.factor b/extra/mason/email/email.factor index 302df599b4..1389a2e27c 100644 --- a/extra/mason/email/email.factor +++ b/extra/mason/email/email.factor @@ -1,35 +1,42 @@ -! Copyright (C) 2008, 2009 Eduardo Cavazos, Slava Pestov. +! Copyright (C) 2008, 2010 Eduardo Cavazos, Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: kernel namespaces accessors combinators make smtp debugger prettyprint sequences io io.streams.string io.encodings.utf8 io.files io.sockets mason.common mason.platform mason.config ; IN: mason.email -: prefix-subject ( str -- str' ) - [ "mason on " % platform % ": " % % ] "" make ; - -: email-status ( body content-type subject -- ) +: mason-email ( body content-type subject -- ) builder-from get >>from builder-recipients get >>to - swap prefix-subject >>subject + swap >>subject swap >>content-type swap >>body send-email ; -: subject ( status -- str ) - [ current-git-id get 7 short head " -- " ] dip { - { status-clean [ "clean" ] } - { status-dirty [ "dirty" ] } - { status-error [ "error" ] } - } case 3append ; +: subject-prefix ( -- string ) + "mason on " platform ": " 3append ; + +: report-subject ( status -- string ) + [ + subject-prefix % + current-git-id get 7 short head % + " -- " % + { + { status-clean [ "clean" ] } + { status-dirty [ "dirty" ] } + { status-error [ "error" ] } + } case % + ] "" make ; : email-report ( report status -- ) - [ "text/html" ] dip subject email-status ; + [ "text/html" ] dip report-subject mason-email ; : email-error ( error callstack -- ) [ "Fatal error on " write host-name print nl [ error. ] [ callstack. ] bi* - ] with-string-writer "text/plain" "fatal error" - email-status ; + ] with-string-writer + "text/plain" + subject-prefix "fatal error" append + mason-email ; diff --git a/extra/mason/mason.factor b/extra/mason/mason.factor index 42f3737e11..9732c03dfa 100755 --- a/extra/mason/mason.factor +++ b/extra/mason/mason.factor @@ -1,8 +1,8 @@ -! Copyright (C) 2008 Eduardo Cavazos, Slava Pestov. +! Copyright (C) 2008, 2010 Eduardo Cavazos, Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors calendar continuations debugger io io.directories io.files kernel mason.common -mason.email mason.updates namespaces threads ; +mason.email mason.updates mason.notify namespaces threads ; FROM: mason.build => build ; IN: mason @@ -15,6 +15,7 @@ IN: mason error. flush ; : build-loop ( -- ) + notify-heartbeat ?prepare-build-machine [ [ diff --git a/extra/mason/notify/notify.factor b/extra/mason/notify/notify.factor index 122c8a47cd..d7319c0f20 100644 --- a/extra/mason/notify/notify.factor +++ b/extra/mason/notify/notify.factor @@ -1,4 +1,4 @@ -! Copyright (C) 2009 Slava Pestov. +! Copyright (C) 2009, 2010 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: arrays accessors io io.sockets io.encodings.utf8 io.files io.launcher kernel make mason.config mason.common mason.email @@ -22,6 +22,9 @@ IN: mason.notify ] retry ] [ 2drop ] if ; +: notify-heartbeat ( -- ) + f { "heartbeat" } status-notify ; + : notify-begin-build ( git-id -- ) [ "Starting build of GIT ID " write print flush ] [ f swap "git-id" swap 2array status-notify ] diff --git a/extra/mason/server/notify/notify.factor b/extra/mason/server/notify/notify.factor index 2c04a43016..3303749c4f 100644 --- a/extra/mason/server/notify/notify.factor +++ b/extra/mason/server/notify/notify.factor @@ -25,6 +25,9 @@ SYMBOLS: host-name target-os target-cpu message message-arg ; target-cpu get >>cpu dup select-tuple [ ] [ dup insert-tuple ] ?if ; +: heartbeat ( -- ) + now >>heartbeat-timestamp ; + : git-id ( builder id -- ) >>current-git-id +starting+ >>status drop ; @@ -51,6 +54,7 @@ SYMBOLS: host-name target-os target-cpu message message-arg ; : update-builder ( builder -- ) message get { + { "heartbeat" [ heartbeat ] } { "git-id" [ message-arg get git-id ] } { "make-vm" [ make-vm ] } { "boot" [ boot ] } diff --git a/extra/mason/server/release/authors.txt b/extra/mason/server/release/authors.txt deleted file mode 100644 index d4f5d6b3ae..0000000000 --- a/extra/mason/server/release/authors.txt +++ /dev/null @@ -1 +0,0 @@ -Slava Pestov \ No newline at end of file diff --git a/extra/mason/server/release/release.factor b/extra/mason/server/release/release.factor deleted file mode 100644 index 04ca2955a7..0000000000 --- a/extra/mason/server/release/release.factor +++ /dev/null @@ -1,82 +0,0 @@ -! Copyright (C) 2010 Slava Pestov. -! See http://factorcode.org/license.txt for BSD license. -USING: accessors calendar db db.tuples db.types grouping io -io.encodings.ascii io.launcher kernel locals make -mason.release.archive mason.config mason.platform mason.server -namespaces sequences ; -IN: mason.server.release - -: platform ( builder -- string ) - [ os>> ] [ cpu>> ] bi (platform) ; - -: package-name ( builder -- string ) - [ platform ] [ last-release>> ] bi "/" glue ; - -: release-name ( version builder -- string ) - [ - "releases/" % - over % "/" % - [ "factor-" % platform % "-" % % ] - [ os>> extension % ] - bi - ] "" make ; - -: release-command ( version builder -- command ) - [ - "cp " % - [ nip package-name % " " % ] [ release-name % ] 2bi - ] "" make ; - -TUPLE: release -host-name os cpu -last-release release-git-id ; - -release "RELEASES" { - { "host-name" "HOST_NAME" TEXT +user-assigned-id+ } - { "os" "OS" TEXT +user-assigned-id+ } - { "cpu" "CPU" TEXT +user-assigned-id+ } - { "last-release" "LAST_RELEASE" TEXT } - { "release-git-id" "RELEASE_GIT_ID" TEXT } -} define-persistent - -:: ( version builder -- release ) - release new - builder host-name>> >>host-name - builder os>> >>os - builder cpu>> >>cpu - builder release-git-id>> >>release-git-id - version builder release-name >>last-release ; - -: execute-on-server ( string -- ) - [ "ssh" , upload-host get , "-l" , upload-username get , ] { } make - - swap >>command - 5 minutes >>timeout - ascii [ write ] with-process-writer ; - -: release-script ( version builders -- string ) - [ upload-directory get "cd " "\n" surround ] 2dip - [ release-command ] with map "\n" join - append ; - -: create-releases ( version builders -- ) - release-script execute-on-server ; - -: update-releases ( version builders -- ) - [ - release new delete-tuples - [ insert-tuple ] with each - ] with-transaction ; - -: check-releases ( builders -- ) - [ release-git-id>> ] map all-equal? - [ "Not all builders are up to date" throw ] unless ; - -: do-release ( version -- ) - [ - builder new select-tuples - [ nip check-releases ] - [ create-releases ] - [ update-releases ] - 2tri - ] with-mason-db ; diff --git a/extra/mason/server/server.factor b/extra/mason/server/server.factor index d0fe29b917..26be4df57c 100644 --- a/extra/mason/server/server.factor +++ b/extra/mason/server/server.factor @@ -17,7 +17,8 @@ clean-git-id clean-timestamp last-release release-git-id last-git-id last-timestamp last-report current-git-id current-timestamp -status ; +status +heartbeat-timestamp ; builder "BUILDERS" { { "host-name" "HOST_NAME" TEXT +user-assigned-id+ } @@ -38,6 +39,8 @@ builder "BUILDERS" { ! Can't name it CURRENT_TIMESTAMP because of bug in db library { "current-timestamp" "CURR_TIMESTAMP" TIMESTAMP } { "status" "STATUS" TEXT } + + { "heartbeat-timestamp" "HEARTBEAT_TIMESTAMP" TIMESTAMP } } define-persistent : mason-db ( -- db ) "resource:mason.db" ; diff --git a/extra/mason/source/authors.txt b/extra/mason/source/authors.txt deleted file mode 100644 index d4f5d6b3ae..0000000000 --- a/extra/mason/source/authors.txt +++ /dev/null @@ -1 +0,0 @@ -Slava Pestov \ No newline at end of file diff --git a/extra/mason/source/source.factor b/extra/mason/source/source.factor deleted file mode 100644 index 72c63660e3..0000000000 --- a/extra/mason/source/source.factor +++ /dev/null @@ -1,49 +0,0 @@ -! Copyright (C) 2010 Slava Pestov. -! See http://factorcode.org/license.txt for BSD license. -USING: bootstrap.image bootstrap.image.download io io.directories -io.directories.hierarchy io.files.unique io.launcher -io.pathnames kernel sequences namespaces mason.common mason.config ; -IN: mason.source - -: clone-factor ( -- ) - { "git" "clone" } home "factor" append-path suffix try-process ; - -: save-git-id ( -- ) - git-id "git-id" to-file ; - -: delete-git-tree ( -- ) - ".git" delete-tree ; - -: download-images ( -- ) - images [ download-image ] each ; - -: prepare-source ( -- ) - "factor" [ save-git-id delete-git-tree download-images ] with-directory ; - -: package-name ( version -- string ) - "factor-src-" ".zip" surround ; - -: make-tarball ( version -- path ) - [ { "zip" "-qr9" } ] dip package-name - [ suffix "factor" suffix try-process ] keep ; - -: make-package ( version -- path ) - unique-directory - [ - clone-factor prepare-source make-tarball - "Package created: " write absolute-path dup print - ] with-directory ; - -: remote-location ( version -- dest ) - [ upload-directory get "/releases/" ] dip 3append ; - -: remote-archive-name ( version -- dest ) - [ remote-location ] [ package-name ] bi "/" glue ; - -: upload-package ( package version -- ) - [ upload-username get upload-host get ] dip - remote-archive-name - upload-safely ; - -: release-source-package ( version -- ) - [ make-package ] [ upload-package ] bi ; diff --git a/extra/mason/version/authors.txt b/extra/mason/version/authors.txt new file mode 100644 index 0000000000..1901f27a24 --- /dev/null +++ b/extra/mason/version/authors.txt @@ -0,0 +1 @@ +Slava Pestov diff --git a/extra/mason/version/binary/authors.txt b/extra/mason/version/binary/authors.txt new file mode 100644 index 0000000000..1901f27a24 --- /dev/null +++ b/extra/mason/version/binary/authors.txt @@ -0,0 +1 @@ +Slava Pestov diff --git a/extra/mason/version/binary/binary.factor b/extra/mason/version/binary/binary.factor new file mode 100644 index 0000000000..5273b644ee --- /dev/null +++ b/extra/mason/version/binary/binary.factor @@ -0,0 +1,20 @@ +! Copyright (C) 2010 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: io kernel make mason.version.common mason.version.files +sequences ; +IN: mason.version.binary + +: binary-release-command ( version builder -- command ) + [ + "cp " % + [ nip binary-package-name % " " % ] + [ remote-binary-release-name % ] + 2bi + ] "" make ; + +: binary-release-script ( version builders -- string ) + [ binary-release-command ] with map "\n" join ; + +: do-binary-release ( version builders -- ) + "Copying binary releases to release directory..." print flush + binary-release-script execute-on-server ; diff --git a/extra/mason/version/common/authors.txt b/extra/mason/version/common/authors.txt new file mode 100644 index 0000000000..1901f27a24 --- /dev/null +++ b/extra/mason/version/common/authors.txt @@ -0,0 +1 @@ +Slava Pestov diff --git a/extra/mason/version/common/common.factor b/extra/mason/version/common/common.factor new file mode 100644 index 0000000000..65d01c3f71 --- /dev/null +++ b/extra/mason/version/common/common.factor @@ -0,0 +1,12 @@ +! Copyright (C) 2010 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors calendar io io.encodings.ascii io.launcher +kernel make mason.config namespaces ; +IN: mason.version.common + +: execute-on-server ( string -- ) + [ "ssh" , upload-host get , "-l" , upload-username get , ] { } make + + swap >>command + 5 minutes >>timeout + ascii [ write ] with-process-writer ; diff --git a/extra/mason/version/data/authors.txt b/extra/mason/version/data/authors.txt new file mode 100644 index 0000000000..1901f27a24 --- /dev/null +++ b/extra/mason/version/data/authors.txt @@ -0,0 +1 @@ +Slava Pestov diff --git a/extra/mason/version/data/data.factor b/extra/mason/version/data/data.factor new file mode 100644 index 0000000000..eb735c918c --- /dev/null +++ b/extra/mason/version/data/data.factor @@ -0,0 +1,54 @@ +! Copyright (C) 2010 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors calendar db db.tuples db.types kernel locals +mason.version.files sequences ; +IN: mason.version.data + +TUPLE: release +host-name os cpu +last-release release-git-id ; + +release "RELEASES" { + { "host-name" "HOST_NAME" TEXT +user-assigned-id+ } + { "os" "OS" TEXT +user-assigned-id+ } + { "cpu" "CPU" TEXT +user-assigned-id+ } + { "last-release" "LAST_RELEASE" TEXT } + { "release-git-id" "RELEASE_GIT_ID" TEXT } +} define-persistent + +:: ( version builder -- release ) + release new + builder host-name>> >>host-name + builder os>> >>os + builder cpu>> >>cpu + builder release-git-id>> >>release-git-id + version builder binary-release-name >>last-release ; + +: update-binary-releases ( version builders -- ) + [ + release new delete-tuples + [ insert-tuple ] with each + ] with-transaction ; + +TUPLE: version +id version git-id timestamp source-path announcement-url ; + +version "VERSIONS" { + { "id" "ID" INTEGER +db-assigned-id+ } + { "version" "VERSION" TEXT } + { "git-id" "GIT_ID" TEXT } + { "timestamp" "TIMESTAMP" TIMESTAMP } + { "source-path" "SOURCE_PATH" TEXT } + { "announcement-url" "ANNOUNCEMENT_URL" TEXT } +} define-persistent + +: update-version ( version git-id announcement-url -- ) + version new + swap >>announcement-url + swap >>git-id + swap [ >>version ] [ source-release-name >>source-path ] bi + now >>timestamp + insert-tuple ; + +: latest-version ( -- version ) + version new select-tuples last ; diff --git a/extra/mason/version/files/authors.txt b/extra/mason/version/files/authors.txt new file mode 100644 index 0000000000..1901f27a24 --- /dev/null +++ b/extra/mason/version/files/authors.txt @@ -0,0 +1 @@ +Slava Pestov diff --git a/extra/mason/version/files/files.factor b/extra/mason/version/files/files.factor new file mode 100644 index 0000000000..1335885c3d --- /dev/null +++ b/extra/mason/version/files/files.factor @@ -0,0 +1,39 @@ +! Copyright (C) 2010 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors fry kernel make mason.config mason.platform +mason.release.archive namespaces sequences ; +IN: mason.version.files + +: release-directory ( string version -- string ) + [ "releases/" % % "/" % % ] "" make ; + +: remote-directory ( string -- string' ) + [ upload-directory get ] dip "/" glue ; + +: remote ( string version -- string ) + remote-directory swap "/" glue ; + +: platform ( builder -- string ) + [ os>> ] [ cpu>> ] bi (platform) ; + +: binary-package-name ( builder -- string ) + [ [ platform % "/" % ] [ last-release>> % ] bi ] "" make + remote-directory ; + +: binary-release-name ( version builder -- string ) + [ + [ + [ "factor-" % platform % "-" % % ] + [ os>> extension % ] + bi + ] "" make + ] [ drop ] 2bi release-directory ; + +: remote-binary-release-name ( version builder -- string ) + [ binary-release-name ] [ drop ] 2bi remote ; + +: source-release-name ( version -- string ) + [ "factor-src-" ".zip" surround ] keep release-directory ; + +: remote-source-release-name ( version -- string ) + [ source-release-name ] keep remote ; diff --git a/extra/mason/version/source/authors.txt b/extra/mason/version/source/authors.txt new file mode 100644 index 0000000000..1901f27a24 --- /dev/null +++ b/extra/mason/version/source/authors.txt @@ -0,0 +1 @@ +Slava Pestov diff --git a/extra/mason/version/source/source.factor b/extra/mason/version/source/source.factor new file mode 100644 index 0000000000..cc41ee3e6b --- /dev/null +++ b/extra/mason/version/source/source.factor @@ -0,0 +1,51 @@ +! Copyright (C) 2010 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: bootstrap.image bootstrap.image.download io +io.directories io.directories.hierarchy io.files.unique +io.launcher io.pathnames kernel mason.common mason.config +mason.version.files namespaces sequences ; +IN: mason.version.source + +: clone-factor ( -- ) + { "git" "clone" "git://factorcode.org/git/factor.git" } try-process ; + +: git-reset ( git-id -- ) + { "git" "reset" "--hard" } swap suffix try-process ; + +: save-git-id ( git-id -- ) + "git-id" to-file ; + +: delete-git-tree ( -- ) + ".git" delete-tree + ".gitignore" delete-file ; + +: download-images ( -- ) + images [ download-image ] each ; + +: prepare-source ( git-id -- ) + "factor" [ + [ git-reset ] [ save-git-id ] bi + delete-git-tree + download-images + ] with-directory ; + +: (make-source-release) ( version -- path ) + [ { "zip" "-qr9" } ] dip source-release-name file-name + [ suffix "factor" suffix try-process ] keep ; + +: make-source-release ( version git-id -- path ) + "Creating source release..." print flush + unique-directory + [ + clone-factor prepare-source (make-source-release) + "Package created: " write absolute-path dup print + ] with-directory ; + +: upload-source-release ( package version -- ) + "Uploading source release..." print flush + [ upload-username get upload-host get ] dip + remote-source-release-name + upload-safely ; + +: do-source-release ( version git-id -- ) + [ make-source-release ] [ drop upload-source-release ] 2bi ; diff --git a/extra/mason/version/version.factor b/extra/mason/version/version.factor new file mode 100644 index 0000000000..a2093124f7 --- /dev/null +++ b/extra/mason/version/version.factor @@ -0,0 +1,52 @@ +! Copyright (C) 2010 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors bit.ly combinators db.tuples debugger fry +grouping io io.streams.string kernel locals make mason.email +mason.server mason.twitter mason.version.binary +mason.version.common mason.version.data mason.version.files +mason.version.source sequences threads ; +IN: mason.version + +: check-releases ( builders -- ) + [ release-git-id>> ] map all-equal? + [ "Some builders are out of date" throw ] unless ; + +: make-release-directory ( version -- ) + "Creating release directory..." print flush + [ "mkdir -p " % "" release-directory % "\n" % ] "" make + execute-on-server ; + +: tweet-release ( version announcement-url -- ) + [ + "Factor " % + [ % " released -- " % ] [ shorten-url % ] bi* + ] "" make mason-tweet ; + +:: (do-release) ( version announcement-url -- ) + [ + builder new select-tuples :> builders + builders first release-git-id>> :> git-id + + builders check-releases + version make-release-directory + version builders do-binary-release + version builders update-binary-releases + version git-id do-source-release + version git-id announcement-url update-version + version announcement-url tweet-release + + "Done." print flush + ] with-mason-db ; + +: send-release-email ( string version -- ) + [ "text/plain" ] dip "Release output: " prepend mason-email ; + +:: do-release ( version announcement-url -- ) + [ + [ + [ + version announcement-url (do-release) + ] try + ] with-string-writer + version send-release-email + ] "Mason release" spawn drop ; diff --git a/extra/webapps/mason/download-package.xml b/extra/webapps/mason/download-package.xml index 7e50f958cd..cff9dbe789 100644 --- a/extra/webapps/mason/download-package.xml +++ b/extra/webapps/mason/download-package.xml @@ -28,6 +28,7 @@ + diff --git a/extra/webapps/mason/downloads.xml b/extra/webapps/mason/downloads.xml new file mode 100644 index 0000000000..82d6572579 --- /dev/null +++ b/extra/webapps/mason/downloads.xml @@ -0,0 +1,22 @@ + + + + + + +

Stable release:

+ +
Host name:
Last heartbeat:
Current status:
Last build:
Last clean build:
+ +
+ +

Source code:

+ +

Development release

+ + + +
+ + diff --git a/extra/webapps/mason/downloads/authors.txt b/extra/webapps/mason/downloads/authors.txt new file mode 100644 index 0000000000..1901f27a24 --- /dev/null +++ b/extra/webapps/mason/downloads/authors.txt @@ -0,0 +1 @@ +Slava Pestov diff --git a/extra/webapps/mason/downloads/downloads.factor b/extra/webapps/mason/downloads/downloads.factor new file mode 100644 index 0000000000..7ff9e64f6b --- /dev/null +++ b/extra/webapps/mason/downloads/downloads.factor @@ -0,0 +1,25 @@ +! Copyright (C) 2010 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors furnace.actions html.components html.forms +kernel mason.server mason.version.data webapps.mason.grids +webapps.mason.utils ; +IN: webapps.mason.downloads + +: stable-release ( version -- link ) + [ version>> ] [ announcement-url>> ] bi ; + +: source-release ( version -- link ) + [ version>> ] [ source-path>> download-url ] bi ; + +: ( -- action ) + + [ + [ + package-grid "package-grid" set-value + release-grid "release-grid" set-value + + latest-version + [ stable-release "stable-release" set-value ] + [ source-release "source-release" set-value ] bi + ] with-mason-db + ] >>init ; diff --git a/extra/webapps/mason/grids/grids.factor b/extra/webapps/mason/grids/grids.factor index 86d9ba38b3..d9d12ef745 100644 --- a/extra/webapps/mason/grids/grids.factor +++ b/extra/webapps/mason/grids/grids.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: accessors assocs db.tuples furnace.actions furnace.utilities http.server.responses kernel locals -mason.server mason.server.release sequences splitting urls +mason.server mason.version.data sequences splitting urls webapps.mason.utils xml.syntax xml.writer ; IN: webapps.mason.grids @@ -19,7 +19,6 @@ CONSTANT: oses { "macosx" "Mac OS X" } { "linux" "Linux" } { "freebsd" "FreeBSD" } - { "netbsd" "NetBSD" } { "openbsd" "OpenBSD" } } @@ -36,7 +35,7 @@ CONSTANT: cpus :: render-grid-row ( cpu quot -- xml ) cpu second oses keys [| os | cpu os quot render-grid-cell ] map [XML <-><-> XML] ; - + :: render-grid ( quot -- xml ) render-grid-header cpus [ quot render-grid-row ] map diff --git a/extra/webapps/mason/make-release.xml b/extra/webapps/mason/make-release.xml index f12ba014f2..7143d819ab 100644 --- a/extra/webapps/mason/make-release.xml +++ b/extra/webapps/mason/make-release.xml @@ -11,8 +11,12 @@ - Version: - + + + +
Version:
Announcement URL:
+ +

diff --git a/extra/webapps/mason/make-release/make-release.factor b/extra/webapps/mason/make-release/make-release.factor index 4cc3873d91..c90aaad297 100644 --- a/extra/webapps/mason/make-release/make-release.factor +++ b/extra/webapps/mason/make-release/make-release.factor @@ -1,8 +1,7 @@ ! Copyright (C) 2010 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors furnace.actions html.forms -http.server.responses mason.server mason.server.release -validators ; +http.server.responses mason.server mason.version validators ; IN: webapps.mason.make-release : ( -- action ) @@ -10,7 +9,7 @@ IN: webapps.mason.make-release [ { { "version" [ v-one-line ] } } validate-params ] >>validate [ [ - "version" value do-release + "version" value "announcement-url" value do-release "OK" "text/html" ] with-mason-db ] >>submit ; diff --git a/extra/webapps/mason/mason.factor b/extra/webapps/mason/mason.factor index e134778fc7..ecb1348532 100644 --- a/extra/webapps/mason/mason.factor +++ b/extra/webapps/mason/mason.factor @@ -3,7 +3,8 @@ USING: accessors furnace.auth furnace.db http.server.dispatchers mason.server webapps.mason.grids webapps.mason.make-release webapps.mason.package -webapps.mason.release webapps.mason.report ; +webapps.mason.release webapps.mason.report +webapps.mason.downloads ; IN: webapps.mason TUPLE: mason-app < dispatcher ; @@ -21,19 +22,16 @@ can-make-releases? define-capability { mason-app "download-package" } >>template "package" add-responder - - "packages" add-responder - { mason-app "download-release" } >>template "release" add-responder - - "releases" add-responder + + { mason-app "downloads" } >>template + "downloads" add-responder { mason-app "make-release" } >>template - "make releases" >>description { can-make-releases? } >>capabilities diff --git a/extra/webapps/mason/package/package.factor b/extra/webapps/mason/package/package.factor index d1ed03cbf4..5c36a7f23a 100644 --- a/extra/webapps/mason/package/package.factor +++ b/extra/webapps/mason/package/package.factor @@ -2,8 +2,9 @@ ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays combinators furnace.actions html.forms kernel mason.platform mason.report mason.server present -sequences webapps.mason webapps.mason.report -webapps.mason.utils xml.syntax ; +sequences webapps.mason webapps.mason.report webapps.mason.utils +xml.syntax ; +FROM: mason.version.files => platform ; IN: webapps.mason.package : building ( builder string -- xml ) @@ -31,7 +32,7 @@ IN: webapps.mason.package over [ [ git-link ] [ present ] bi* " (built on " ")" surround 2array ] [ 2drop f ] if ; : packages-url ( builder -- url ) - [ os>> ] [ cpu>> ] bi (platform) "http://downloads.factorcode.org/" prepend ; + platform download-url ; : package-link ( builder -- xml ) [ packages-url ] [ last-release>> ] bi [ "/" glue ] keep link ; @@ -40,7 +41,7 @@ IN: webapps.mason.package packages-url dup link ; : clean-image-url ( builder -- url ) - [ os>> ] [ cpu>> ] bi (platform) "http://factorcode.org/images/clean/" prepend ; + platform "http://factorcode.org/images/clean/" prepend ; : clean-image-link ( builder -- link ) clean-image-url dup link ; @@ -65,6 +66,7 @@ IN: webapps.mason.package [ current-status "status" set-value ] [ last-build-status "last-build" set-value ] [ clean-build-status "last-clean-build" set-value ] + [ heartbeat-timestamp>> "heartbeat-timestamp" set-value ] [ packages-link "binaries" set-value ] [ clean-image-link "clean-images" set-value ] [ report-link "last-report" set-value ] diff --git a/extra/webapps/mason/release/release.factor b/extra/webapps/mason/release/release.factor index a7c0f71154..98fa42b68c 100644 --- a/extra/webapps/mason/release/release.factor +++ b/extra/webapps/mason/release/release.factor @@ -6,8 +6,7 @@ webapps.mason.utils io.pathnames ; IN: webapps.mason.release : release-link ( builder -- xml ) - [ "http://downloads.factorcode.org/" ] dip - last-release>> [ "/" glue ] [ file-name ] bi link ; + last-release>> [ download-url ] [ file-name ] bi link ; : ( -- action ) diff --git a/extra/webapps/mason/utils/utils.factor b/extra/webapps/mason/utils/utils.factor index 8197cce820..ad56737bc1 100644 --- a/extra/webapps/mason/utils/utils.factor +++ b/extra/webapps/mason/utils/utils.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2010 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays assocs db.tuples furnace.actions -html.forms kernel mason.server mason.server.release sequences +html.forms kernel mason.server mason.version.data sequences validators xml.syntax ; IN: webapps.mason.utils @@ -38,3 +38,6 @@ IN: webapps.mason.utils ] [ drop f ] if ] bi 2array sift [ [XML
  • <->
  • XML] ] map [XML
      <->
    XML] ; + +: download-url ( string -- string' ) + "http://downloads.factorcode.org/" prepend ; From 81c1e9fcb49df30e1c260b7c09a511f0c15caf06 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Tue, 13 Apr 2010 02:30:31 -0700 Subject: [PATCH 106/157] Playing around with a higher-level CUDA api. Also, changed some char* to c-string in cuda.ffi --- extra/cuda/authors.txt | 1 + extra/cuda/cuda-tests.factor | 7 ++++ extra/cuda/cuda.factor | 77 ++++++++++++++++++++++++++++++++++++ extra/cuda/ffi/ffi.factor | 4 +- 4 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 extra/cuda/authors.txt create mode 100644 extra/cuda/cuda-tests.factor create mode 100644 extra/cuda/cuda.factor diff --git a/extra/cuda/authors.txt b/extra/cuda/authors.txt new file mode 100644 index 0000000000..7c1b2f2279 --- /dev/null +++ b/extra/cuda/authors.txt @@ -0,0 +1 @@ +Doug Coleman diff --git a/extra/cuda/cuda-tests.factor b/extra/cuda/cuda-tests.factor new file mode 100644 index 0000000000..28fe222dff --- /dev/null +++ b/extra/cuda/cuda-tests.factor @@ -0,0 +1,7 @@ +! Copyright (C) 2010 Doug Coleman. +! See http://factorcode.org/license.txt for BSD license. +USING: cuda kernel tools.test ; +IN: cuda.tests + +! [ ] [ [ 0 0 [ drop ] with-cuda-context ] with-cuda ] unit-test +! [ ] [ 100 cuda-malloc cuda-free ] unit-test diff --git a/extra/cuda/cuda.factor b/extra/cuda/cuda.factor new file mode 100644 index 0000000000..887740d542 --- /dev/null +++ b/extra/cuda/cuda.factor @@ -0,0 +1,77 @@ +! Copyright (C) 2010 Doug Coleman. +! See http://factorcode.org/license.txt for BSD license. +USING: alien.c-types alien.data assocs classes.struct +combinators continuations cuda.ffi fry io.backend kernel +sequences ; +IN: cuda + +ERROR: throw-cuda-error n ; + +: cuda-error ( n -- ) + { + { CUDA_SUCCESS [ ] } + [ throw-cuda-error ] + } case ; + +: cuda-version ( -- n ) + int [ cuDriverGetVersion cuda-error ] keep *int ; + +: init-cuda ( -- ) + 0 cuInit cuda-error ; + +: with-cuda ( quot -- ) + init-cuda [ ] [ ] cleanup ; inline + + [ cuDeviceGetCount cuda-error ] keep *int ; + +: n>cuda-device ( n -- device ) + [ CUdevice ] dip [ cuDeviceGet cuda-error ] 2keep drop *int ; + +: enumerate-cuda-devices ( -- devices ) + #cuda-devices iota [ n>cuda-device ] map ; + +: cuda-device>properties ( device -- properties ) + [ CUdevprop ] dip + [ cuDeviceGetProperties cuda-error ] 2keep drop + CUdevprop memory>struct ; + +: cuda-device-properties ( -- properties ) + enumerate-cuda-devices [ cuda-device>properties ] map ; + +PRIVATE> + +: cuda-devices ( -- assoc ) + enumerate-cuda-devices [ dup cuda-device>properties ] { } map>assoc ; + +: with-cuda-context ( flags device quot -- ) + [ + [ CUcontext ] 2dip + [ cuCtxCreate cuda-error ] 3keep 2drop *void* + ] dip + [ '[ _ @ ] ] + [ drop '[ _ cuCtxDestroy cuda-error ] ] 2bi + [ ] cleanup ; inline + +: with-cuda-module ( path quot -- ) + [ + normalize-path + [ CUmodule ] dip + [ cuModuleLoad cuda-error ] 2keep drop *void* + ] dip + [ '[ _ @ ] ] + [ drop '[ _ cuModuleUnload cuda-error ] ] 2bi + [ ] cleanup ; inline + +: get-cuda-function ( module string -- function ) + [ CUfunction ] 2dip + [ cuModuleGetFunction cuda-error ] 3keep 2drop *void* ; + +: cuda-malloc ( n -- ptr ) + [ CUdeviceptr ] dip + [ cuMemAlloc cuda-error ] 2keep drop *int ; + +: cuda-free ( ptr -- ) + cuMemFree cuda-error ; diff --git a/extra/cuda/ffi/ffi.factor b/extra/cuda/ffi/ffi.factor index ce6f8cb8b8..3d41f1e4c5 100644 --- a/extra/cuda/ffi/ffi.factor +++ b/extra/cuda/ffi/ffi.factor @@ -307,12 +307,12 @@ FUNCTION: CUresult cuCtxPopCurrent ( CUcontext* pctx ) ; FUNCTION: CUresult cuCtxGetDevice ( CUdevice* device ) ; FUNCTION: CUresult cuCtxSynchronize ( ) ; -FUNCTION: CUresult cuModuleLoad ( CUmodule* module, char* fname ) ; +FUNCTION: CUresult cuModuleLoad ( CUmodule* module, c-string fname ) ; FUNCTION: CUresult cuModuleLoadData ( CUmodule* module, void* image ) ; FUNCTION: CUresult cuModuleLoadDataEx ( CUmodule* module, void* image, uint numOptions, CUjit_option* options, void** optionValues ) ; FUNCTION: CUresult cuModuleLoadFatBinary ( CUmodule* module, void* fatCubin ) ; FUNCTION: CUresult cuModuleUnload ( CUmodule hmod ) ; -FUNCTION: CUresult cuModuleGetFunction ( CUfunction* hfunc, CUmodule hmod, char* name ) ; +FUNCTION: CUresult cuModuleGetFunction ( CUfunction* hfunc, CUmodule hmod, c-string name ) ; FUNCTION: CUresult cuModuleGetGlobal ( CUdeviceptr* dptr, uint* bytes, CUmodule hmod, char* name ) ; FUNCTION: CUresult cuModuleGetTexRef ( CUtexref* pTexRef, CUmodule hmod, char* name ) ; From 3e91a7f280c4f22889e2dddee6778cc9f56f6b85 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 13 Apr 2010 04:43:29 -0700 Subject: [PATCH 107/157] sets: fix performance regression in all-unique? word --- core/hash-sets/hash-sets.factor | 17 +++++++++++++---- core/sets/sets.factor | 3 --- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/core/hash-sets/hash-sets.factor b/core/hash-sets/hash-sets.factor index b4bf9a1aef..3ca2cce93c 100644 --- a/core/hash-sets/hash-sets.factor +++ b/core/hash-sets/hash-sets.factor @@ -16,13 +16,22 @@ M: hash-set in? table>> key? ; inline M: hash-set adjoin table>> dupd set-at ; inline M: hash-set delete table>> delete-at ; inline M: hash-set members table>> keys ; inline -M: hash-set set-like - drop dup hash-set? [ members ] unless ; -M: hash-set clone - table>> clone hash-set boa ; +M: hash-set set-like drop dup hash-set? [ members ] unless ; +M: hash-set clone table>> clone hash-set boa ; M: sequence fast-set ; M: f fast-set drop H{ } clone hash-set boa ; M: sequence duplicates f fast-set [ [ in? ] [ adjoin ] 2bi ] curry filter ; + + + +M: sequence all-unique? + dup length hash-set boa + [ (all-unique?) ] curry all? ; diff --git a/core/sets/sets.factor b/core/sets/sets.factor index 3f441f9239..d279f036d4 100644 --- a/core/sets/sets.factor +++ b/core/sets/sets.factor @@ -92,9 +92,6 @@ M: sequence set-like M: sequence members [ pruned ] keep like ; -M: sequence all-unique? - dup pruned sequence= ; - : combine ( sets -- set ) [ f ] [ [ [ members ] map concat ] [ first ] bi set-like ] From 572b71238ffdfff34d00ad2123520478250fb515 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 13 Apr 2010 05:24:49 -0700 Subject: [PATCH 108/157] stack-checker: calling 'dispatch' with unbalanced branches generated an error message that erroneously talked about 'if' --- basis/stack-checker/branches/branches.factor | 26 ++++++++++--------- .../row-polymorphism/row-polymorphism.factor | 3 +-- .../stack-checker/stack-checker-tests.factor | 5 ++++ 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/basis/stack-checker/branches/branches.factor b/basis/stack-checker/branches/branches.factor index 6f8d503c05..77e983eefb 100644 --- a/basis/stack-checker/branches/branches.factor +++ b/basis/stack-checker/branches/branches.factor @@ -1,9 +1,10 @@ -! Copyright (C) 2008 Slava Pestov. +! Copyright (C) 2008, 2010 Slava Pestov, Joe Groff. ! See http://factorcode.org/license.txt for BSD license. USING: arrays effects fry vectors sequences assocs math math.order accessors kernel combinators quotations namespaces grouping locals stack-checker.state stack-checker.backend stack-checker.errors stack-checker.visitor stack-checker.values stack-checker.recursive-state ; +FROM: sequences.private => dispatch ; IN: stack-checker.branches : balanced? ( pairs -- ? ) @@ -43,10 +44,9 @@ SYMBOLS: +bottom+ +top+ ; : phi-outputs ( phi-in -- stack ) flip [ unify-values ] map ; -SYMBOL: quotations +SYMBOLS: combinator quotations ; -: simple-unbalanced-branches-error ( branches quots -- * ) - [ \ if ] 2dip swap +: simple-unbalanced-branches-error ( word quots branches -- * ) [ length [ (( ..a -- ..b )) ] replicate ] [ [ length [ "x" ] bi@ ] { } assoc>map ] bi unbalanced-branches-error ; @@ -54,9 +54,10 @@ SYMBOL: quotations : unify-branches ( ins stacks -- in phi-in phi-out ) zip [ 0 { } { } ] [ [ keys supremum ] [ ] [ balanced? ] tri - [ dupd phi-inputs dup phi-outputs ] - [ quotations get simple-unbalanced-branches-error ] - if + [ dupd phi-inputs dup phi-outputs ] [ + [ combinator get quotations get ] dip + simple-unbalanced-branches-error + ] if ] if-empty ; : branch-variable ( seq symbol -- seq ) @@ -125,13 +126,13 @@ M: curried curried/composed? drop t ; M: composed curried/composed? drop t ; M: declared-effect curried/composed? known>> curried/composed? ; -:: declare-if-effects ( -- ) - H{ } clone :> variables - V{ } clone :> branches - \ if (( ..a -- ..b )) variables branches 0 declare-effect-d - \ if (( ..a -- ..b )) variables branches 1 declare-effect-d ; +: declare-if-effects ( -- ) + H{ } clone V{ } clone + [ [ \ if (( ..a -- ..b )) ] 2dip 0 declare-effect-d ] + [ [ \ if (( ..a -- ..b )) ] 2dip 1 declare-effect-d ] 2bi ; : infer-if ( -- ) + \ if combinator set 2 literals-available? [ (infer-if) ] [ @@ -148,5 +149,6 @@ M: declared-effect curried/composed? known>> curried/composed? ; ] if ; : infer-dispatch ( -- ) + \ dispatch combinator set pop-literal nip infer-branches [ #dispatch, ] dip compute-phi-function ; diff --git a/basis/stack-checker/row-polymorphism/row-polymorphism.factor b/basis/stack-checker/row-polymorphism/row-polymorphism.factor index 1b8bd8faed..ad4f92ced4 100644 --- a/basis/stack-checker/row-polymorphism/row-polymorphism.factor +++ b/basis/stack-checker/row-polymorphism/row-polymorphism.factor @@ -24,7 +24,7 @@ IN: stack-checker.row-polymorphism [ with-inner-d ] 2dip (effect-here) ; inline : (diff-variable) ( diff variable vars -- diff' ) - [ at* nip ] [ '[ _ _ at - ] ] [ '[ _ _ set-at 0 ] ] 2tri if ; + [ key? ] [ '[ _ _ at - ] ] [ '[ _ _ set-at 0 ] ] 2tri if ; : (check-variable) ( actual-count declared-count variable vars -- diff ? ) [ - ] 2dip dupd '[ _ _ (diff-variable) t ] [ dup 0 <= ] if ; @@ -63,4 +63,3 @@ IN: stack-checker.row-polymorphism [ >>actual ] keep 2dup [ [ variables>> ] [ effect>> ] bi ] dip check-variables [ 2drop ] [ drop combinator-unbalanced-branches-error ] if ; - diff --git a/basis/stack-checker/stack-checker-tests.factor b/basis/stack-checker/stack-checker-tests.factor index ce2c03264b..351cf5cde0 100644 --- a/basis/stack-checker/stack-checker-tests.factor +++ b/basis/stack-checker/stack-checker-tests.factor @@ -252,6 +252,11 @@ DEFER: blah4 ! A typo { 1 0 } [ { [ ] } dispatch ] must-infer-as +! Make sure the error is correct +[ + [ { [ drop ] [ dup ] } dispatch ] infer +] [ word>> \ dispatch eq? ] must-fail-with + DEFER: inline-recursive-2 : inline-recursive-1 ( -- ) inline-recursive-2 ; : inline-recursive-2 ( -- ) inline-recursive-1 ; From a47db60a745c7570964f95f12a0e10df2273ef8c Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 13 Apr 2010 05:25:13 -0700 Subject: [PATCH 109/157] mason.server.notify: fix heartbeat logic --- extra/mason/server/notify/notify.factor | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/extra/mason/server/notify/notify.factor b/extra/mason/server/notify/notify.factor index 3303749c4f..bfa1027d92 100644 --- a/extra/mason/server/notify/notify.factor +++ b/extra/mason/server/notify/notify.factor @@ -25,11 +25,9 @@ SYMBOLS: host-name target-os target-cpu message message-arg ; target-cpu get >>cpu dup select-tuple [ ] [ dup insert-tuple ] ?if ; -: heartbeat ( -- ) - now >>heartbeat-timestamp ; +: heartbeat ( builder -- ) now >>heartbeat-timestamp drop ; -: git-id ( builder id -- ) - >>current-git-id +starting+ >>status drop ; +: git-id ( builder id -- ) >>current-git-id +starting+ >>status drop ; : make-vm ( builder -- ) +make-vm+ >>status drop ; From a3e6de5e6a7422f780426f73808c2eac6ec2f7d1 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 13 Apr 2010 06:14:53 -0700 Subject: [PATCH 110/157] io.files: fix unit test for forget-tests? flag --- core/io/files/files-tests.factor | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/io/files/files-tests.factor b/core/io/files/files-tests.factor index 5db1822d9e..a308b9f0c3 100644 --- a/core/io/files/files-tests.factor +++ b/core/io/files/files-tests.factor @@ -3,7 +3,9 @@ debugger.threads destructors generic.single io io.directories io.encodings.8-bit.latin1 io.encodings.ascii io.encodings.binary io.encodings.string io.files io.files.private io.files.temp io.files.unique kernel make math -sequences specialized-arrays system threads tools.test ; +sequences specialized-arrays system threads tools.test vocabs +compiler.units ; +FROM: specialized-arrays.private => specialized-array-vocab ; SPECIALIZED-ARRAY: int IN: io.files.tests @@ -119,6 +121,12 @@ CONSTANT: pt-array-1 pt-array-1 rest-slice sequence= ] unit-test +[ ] [ + [ + pt specialized-array-vocab forget-vocab + ] with-compilation-unit +] unit-test + ! Writing strings to binary streams should fail [ "test.txt" temp-file binary [ From f652ee2b02b0a364901954e0272bc4fd84ed71f6 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 13 Apr 2010 06:15:08 -0700 Subject: [PATCH 111/157] classes.struct.vectored: fix unit test for forget-tests? flag --- extra/classes/struct/vectored/vectored-tests.factor | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/extra/classes/struct/vectored/vectored-tests.factor b/extra/classes/struct/vectored/vectored-tests.factor index 1b3aa86eff..4d083faa5d 100644 --- a/extra/classes/struct/vectored/vectored-tests.factor +++ b/extra/classes/struct/vectored/vectored-tests.factor @@ -1,6 +1,7 @@ ! (c)2009 Joe Groff bsd license USING: accessors alien.c-types classes.struct classes.struct.vectored -kernel sequences specialized-arrays tools.test ; +kernel sequences specialized-arrays tools.test vocabs compiler.units ; +FROM: specialized-arrays.private => specialized-array-vocab ; SPECIALIZED-ARRAYS: int ushort float ; IN: classes.struct.vectored.tests @@ -71,3 +72,9 @@ VECTORED-STRUCT: foo { w ushort-array{ 15 25 35 45 } } } third vectored-element> ] unit-test + +[ ] [ + [ + foo specialized-array-vocab forget-vocab + ] with-compilation-unit +] unit-test From 74075511c21f6ccc6f9e5959e8ce4ef1861902e9 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 13 Apr 2010 06:16:45 -0700 Subject: [PATCH 112/157] ui.tools.error-list: smaller default size --- basis/ui/tools/error-list/error-list.factor | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/basis/ui/tools/error-list/error-list.factor b/basis/ui/tools/error-list/error-list.factor index 34a5221307..eaa947b2d6 100644 --- a/basis/ui/tools/error-list/error-list.factor +++ b/basis/ui/tools/error-list/error-list.factor @@ -66,8 +66,8 @@ M: source-file-renderer filled-column drop 1 ; [ invoke-primary-operation ] >>action COLOR: dark-gray >>column-line-color 6 >>gap - 5 >>min-rows - 5 >>max-rows + 4 >>min-rows + 4 >>max-rows 60 >>min-cols 60 >>max-cols t >>selection-required? @@ -115,8 +115,8 @@ M: error-renderer column-alignment drop { 0 1 0 0 } ; [ invoke-primary-operation ] >>action COLOR: dark-gray >>column-line-color 6 >>gap - 5 >>min-rows - 5 >>max-rows + 4 >>min-rows + 4 >>max-rows 60 >>min-cols 60 >>max-cols t >>selection-required? From 017f772c4844d58d6d19d85f3eba8c49b2b66a53 Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Tue, 13 Apr 2010 17:58:45 -0700 Subject: [PATCH 113/157] Macho version of nm and testcase for it. --- extra/elf/nm/nm-tests.factor | 62 ++++++++-------- extra/elf/nm/nm.factor | 4 +- extra/macho/a.macho | Bin 0 -> 8792 bytes extra/macho/macho-tests.factor | 26 +++++++ extra/macho/macho.factor | 128 ++++++++++++++++++++++++++++++++- 5 files changed, 186 insertions(+), 34 deletions(-) create mode 100755 extra/macho/a.macho create mode 100644 extra/macho/macho-tests.factor diff --git a/extra/elf/nm/nm-tests.factor b/extra/elf/nm/nm-tests.factor index 2ecb499081..9e529ae43d 100644 --- a/extra/elf/nm/nm-tests.factor +++ b/extra/elf/nm/nm-tests.factor @@ -6,46 +6,46 @@ IN: elf.nm.tests STRING: validation-output 0000000000000000 absolute init.c -0000000004195436 .text call_gmon_start +000000000040046c .text call_gmon_start 0000000000000000 absolute crtstuff.c -0000000006295064 .ctors __CTOR_LIST__ -0000000006295080 .dtors __DTOR_LIST__ -0000000006295096 .jcr __JCR_LIST__ -0000000004195472 .text __do_global_dtors_aux -0000000006295584 .bss completed.7342 -0000000006295592 .bss dtor_idx.7344 -0000000004195584 .text frame_dummy +0000000000600e18 .ctors __CTOR_LIST__ +0000000000600e28 .dtors __DTOR_LIST__ +0000000000600e38 .jcr __JCR_LIST__ +0000000000400490 .text __do_global_dtors_aux +0000000000601020 .bss completed.7342 +0000000000601028 .bss dtor_idx.7344 +0000000000400500 .text frame_dummy 0000000000000000 absolute crtstuff.c -0000000006295072 .ctors __CTOR_END__ -0000000004196056 .eh_frame __FRAME_END__ -0000000006295096 .jcr __JCR_END__ -0000000004195808 .text __do_global_ctors_aux +0000000000600e20 .ctors __CTOR_END__ +00000000004006d8 .eh_frame __FRAME_END__ +0000000000600e38 .jcr __JCR_END__ +00000000004005e0 .text __do_global_ctors_aux 0000000000000000 absolute test.c -0000000006295528 .got.plt _GLOBAL_OFFSET_TABLE_ -0000000006295060 .ctors __init_array_end -0000000006295060 .ctors __init_array_start -0000000006295104 .dynamic _DYNAMIC -0000000006295568 .data data_start +0000000000600fe8 .got.plt _GLOBAL_OFFSET_TABLE_ +0000000000600e14 .ctors __init_array_end +0000000000600e14 .ctors __init_array_start +0000000000600e40 .dynamic _DYNAMIC +0000000000601010 .data data_start 0000000000000000 undefined printf@@GLIBC_2.2.5 -0000000004195648 .text __libc_csu_fini -0000000004195392 .text _start +0000000000400540 .text __libc_csu_fini +0000000000400440 .text _start 0000000000000000 undefined __gmon_start__ 0000000000000000 undefined _Jv_RegisterClasses -0000000004195864 .fini _fini +0000000000400618 .fini _fini 0000000000000000 undefined __libc_start_main@@GLIBC_2.2.5 -0000000004195880 .rodata _IO_stdin_used -0000000006295568 .data __data_start -0000000006295576 .data __dso_handle -0000000006295088 .dtors __DTOR_END__ -0000000004195664 .text __libc_csu_init -0000000006295584 absolute __bss_start -0000000006295600 absolute _end -0000000006295584 absolute _edata -0000000004195620 .text main -0000000004195312 .init _init +0000000000400628 .rodata _IO_stdin_used +0000000000601010 .data __data_start +0000000000601018 .data __dso_handle +0000000000600e30 .dtors __DTOR_END__ +0000000000400550 .text __libc_csu_init +0000000000601020 absolute __bss_start +0000000000601030 absolute _end +0000000000601020 absolute _edata +0000000000400524 .text main +00000000004003f0 .init _init ; { $ validation-output } -[ dup [ "resource:extra/elf/a.elf" nm ] with-output-stream >string ] +[ dup [ "resource:extra/elf/a.elf" elf-nm ] with-output-stream >string ] unit-test diff --git a/extra/elf/nm/nm.factor b/extra/elf/nm/nm.factor index 87c9abf00b..52e1c66902 100644 --- a/extra/elf/nm/nm.factor +++ b/extra/elf/nm/nm.factor @@ -4,7 +4,7 @@ USING: accessors combinators elf formatting io.mmap kernel sequences ; IN: elf.nm : print-symbol ( sections symbol -- ) - [ sym>> st_value>> "%016d " printf ] + [ sym>> st_value>> "%016x " printf ] [ sym>> st_shndx>> { @@ -16,7 +16,7 @@ IN: elf.nm ] [ name>> "%s\n" printf ] tri ; -: nm ( path -- ) +: elf-nm ( path -- ) [ sections dup ".symtab" find-section symbols [ name>> empty? not ] filter diff --git a/extra/macho/a.macho b/extra/macho/a.macho new file mode 100755 index 0000000000000000000000000000000000000000..bc233d70958e9d5652303936e0c97bd425b1f405 GIT binary patch literal 8792 zcmeHN-)me&6h1dun^co@+Xs!<=vG=9Y)L9YsbFCv4cX9A*Cv%9%D6vnvMV>c%iX)_ zMkoe?Vvs<<7r_@F{S$oXgH`YcKBy0U5ue0Lf(S)KVjqm(ckj&Z-Q706D89@gGiT1s zoHH}u%)Oa=&VFoDh3Q4KJZ3bEZ>$Z1e1dBoaobE!I>uOO#)>>s0 zl&Y^T=c}Ho2aWvGz4nraB74MzWaLN^8PxXL^P?eEa=n`Cqf__%j%s_ywE@Z<)HA#xgmNNou&b<;TT+XD zZrP0*y65+iwwKjxgghW?Z&U9?WJ@V%JF?@YeuE^bAM^}^2O;3v*wwFfsTEEOj^*3!D6zr^HokntxA$eQ3Z!#(*HGSBoU$3)%-$2pNK5{Z47IMzWVv*#%G z(1*}xziz^7Asm;_^<<;&PkQD2WO3Ci>W+_ra~@uDXLjc6&%YdcZ*KC<;qM>j9(;_% zF`q*EzsbDs{%IcJdmWv)CSoTCiON8G?O1<3C>Bngnm9WF9Ljli(*F;@jh-XdAvqm- zbF1~hU7mP8u18%<76FTZMZh9p5wHkY1paLVUYE?q?aca5cQWr@AIxkvk{fr|KXq>Y z*q?EJ%WQo2OCqy=b1<|1tTg^$X?qY8*!W_bSKHsOQg!qEd6apblWkrkzxqt}PV_l~ zJc0bu=Gbl2PR;F|xCOpdLMA&u@9piCc%9n$fhE`Ts;O&L-zz@IW~j+g%~P5m2M_OD z;7Q!ONzdu@C%%VBlzAT?LOvQ=5!oFPhu@o^!?a0q-pF1NrmLj!|b98yjr zah!3?iS!67NnD7GB;W2!(EPCZPG!@6bXtG6oz;B5z8t}PU(~QZ%1zDJG~Z9(wpj!$ z0u}*_fJML}U=gqgSOhEr76FTZMZhBP-y(20t(017HWk9v^=c*Om4j8aaz dup [ "resource:extra/macho/a.macho" macho-nm ] with-output-stream >string ] +unit-test diff --git a/extra/macho/macho.factor b/extra/macho/macho.factor index e3765260bb..b18ea57ce5 100644 --- a/extra/macho/macho.factor +++ b/extra/macho/macho.factor @@ -1,8 +1,13 @@ ! Copyright (C) 2010 Erik Charlebois. ! See http:// factorcode.org/license.txt for BSD license. -USING: alien.c-types alien.syntax classes.struct kernel literals math ; +USING: accessors alien alien.c-types alien.strings alien.syntax +classes classes.struct combinators io.encodings.ascii +io.encodings.string kernel literals make math sequences +specialized-arrays typed fry io.mmap formatting locals ; +FROM: alien.c-types => short ; IN: macho +! FFI data TYPEDEF: int integer_t TYPEDEF: int vm_prot_t TYPEDEF: integer_t cpu_type_t @@ -804,3 +809,124 @@ C-ENUM: reloc_type_ppc PPC_RELOC_JBSR PPC_RELOC_LO14_SECTDIFF PPC_RELOC_LOCAL_SECTDIFF ; + +! Low-level interface +SPECIALIZED-ARRAYS: section section_64 nlist nlist_64 ; +UNION: mach_header_32/64 mach_header mach_header_64 ; +UNION: segment_command_32/64 segment_command segment_command_64 ; +UNION: load-command segment_command segment_command_64 + dylib_command sub_framework_command + sub_client_command sub_umbrella_command sub_library_command + prebound_dylib_command dylinker_command thread_command + routines_command routines_command_64 symtab_command + dysymtab_command twolevel_hints_command uuid_command ; +UNION: section_32/64 section section_64 ; +UNION: section_32/64-array section-array section_64-array ; +UNION: nlist_32/64 nlist nlist_64 ; +UNION: nlist_32/64-array nlist-array nlist_64-array ; + +TYPED: 64-bit? ( macho: mach_header_32/64 -- ? ) + magic>> { + { MH_MAGIC_64 [ t ] } + { MH_CIGAM_64 [ t ] } + [ drop f ] + } case ; + +TYPED: macho-header ( c-ptr -- macho: mach_header_32/64 ) + dup mach_header_64 memory>struct 64-bit? + [ mach_header_64 memory>struct ] + [ mach_header memory>struct ] if ; + +: cmd>load-command ( cmd -- load-command ) + { + { LC_UUID [ uuid_command ] } + { LC_SEGMENT [ segment_command ] } + { LC_SEGMENT_64 [ segment_command_64 ] } + { LC_SYMTAB [ symtab_command ] } + { LC_DYSYMTAB [ dysymtab_command ] } + { LC_THREAD [ thread_command ] } + { LC_UNIXTHREAD [ thread_command ] } + { LC_LOAD_DYLIB [ dylib_command ] } + { LC_ID_DYLIB [ dylib_command ] } + { LC_PREBOUND_DYLIB [ prebound_dylib_command ] } + { LC_LOAD_DYLINKER [ dylinker_command ] } + { LC_ID_DYLINKER [ dylinker_command ] } + { LC_ROUTINES [ routines_command ] } + { LC_ROUTINES_64 [ routines_command_64 ] } + { LC_TWOLEVEL_HINTS [ twolevel_hints_command ] } + { LC_SUB_FRAMEWORK [ sub_framework_command ] } + { LC_SUB_UMBRELLA [ sub_umbrella_command ] } + { LC_SUB_LIBRARY [ sub_library_command ] } + { LC_SUB_CLIENT [ sub_client_command ] } + { LC_DYLD_INFO [ dyld_info_command ] } + { LC_DYLD_INFO_ONLY [ dyld_info_command ] } + } case ; + +: read-command ( cmd -- next-cmd ) + dup load_command memory>struct + [ cmd>> cmd>load-command memory>struct , ] + [ cmdsize>> swap ] 2bi ; + +TYPED: load-commands ( macho: mach_header_32/64 -- load-commands ) + [ + [ class heap-size ] + [ >c-ptr ] + [ ncmds>> ] tri iota [ + drop read-command + ] each drop + ] { } make ; + +: segment-commands ( load-commands -- segment-commands ) + [ segment_command_32/64? ] filter ; inline + +: symtab-commands ( load-commands -- segment-commands ) + [ symtab_command? ] filter ; inline + +: read-array-string ( uchar-array -- string ) + ascii decode [ 0 = not ] filter ; + +: segment-sections ( segment-command -- sections ) + { + [ class heap-size ] + [ >c-ptr ] + [ nsects>> ] + [ segment_command_64? ] + } cleave + [ ] + [ ] if ; + +: sections-array ( segment-commands -- sections-array ) + [ + dup first segment_command_64? + [ section_64 ] [ section ] if , + segment-commands [ segment-sections [ , ] each ] each + ] { } make ; + +: symbols ( mach-header symtab-command -- symbols string-table ) + [ symoff>> swap >c-ptr ] + [ nsyms>> swap 64-bit? + [ ] + [ ] if ] + [ stroff>> swap >c-ptr ] 2tri ; + +: symbol-name ( symbol string-table -- name ) + [ n_strx>> ] dip ascii alien>string ; + +: with-mapped-macho ( path quot -- ) + '[ + address>> macho-header @ + ] with-mapped-file ; inline + +: macho-nm ( path -- ) + [| macho | + macho load-commands segment-commands sections-array :> sections + + macho load-commands symtab-commands [| symtab | + macho symtab symbols [ + [ drop n_value>> "%016x " printf ] + [ drop n_sect>> sections nth sectname>> + read-array-string "%-16s" printf ] + [ symbol-name "%s\n" printf ] 2tri + ] curry each + ] each + ] with-mapped-macho ; From da6bcbedfc50a941b070fcd58af9e95e1c1b6598 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 13 Apr 2010 18:43:01 -0700 Subject: [PATCH 114/157] Replace 'untested' tag with 'not loaded' and 'not tested' tags --- basis/bootstrap/compiler/timing/tags.txt | 2 +- basis/cpu/ppc/linux/tags.txt | 2 +- basis/cpu/ppc/macosx/tags.txt | 2 +- basis/cpu/ppc/tags.txt | 2 +- basis/cpu/x86/32/tags.txt | 2 +- basis/cpu/x86/64/tags.txt | 2 +- basis/cpu/x86/64/unix/tags.txt | 2 +- basis/cpu/x86/64/winnt/tags.txt | 2 +- basis/cpu/x86/features/tags.txt | 2 +- basis/cpu/x86/tags.txt | 2 +- basis/editors/editpadlite/tags.txt | 2 +- basis/editors/editpadpro/tags.txt | 2 +- basis/editors/editplus/tags.txt | 2 +- basis/editors/emacs/tags.txt | 2 +- basis/editors/emacs/windows/tags.txt | 2 +- basis/editors/emeditor/tags.txt | 2 +- basis/editors/etexteditor/tags.txt | 2 +- basis/editors/gedit/tags.txt | 2 +- basis/editors/gvim/tags.txt | 2 +- basis/editors/gvim/unix/tags.txt | 2 +- basis/editors/gvim/windows/tags.txt | 2 +- basis/editors/jedit/tags.txt | 2 +- basis/editors/macvim/tags.txt | 2 +- basis/editors/notepad/tags.txt | 2 +- basis/editors/notepad2/tags.txt | 2 +- basis/editors/notepadpp/tags.txt | 2 +- basis/editors/scite/tags.txt | 2 +- basis/editors/ted-notepad/tags.txt | 2 +- basis/editors/textedit/tags.txt | 2 +- basis/editors/textmate/tags.txt | 2 +- basis/editors/textpad/tags.txt | 2 +- basis/editors/textwrangler/tags.txt | 2 +- basis/editors/ultraedit/tags.txt | 2 +- basis/editors/vim/generate-syntax/tags.txt | 1 - basis/editors/vim/tags.txt | 2 +- basis/editors/wordpad/tags.txt | 2 +- basis/math/floats/env/ppc/tags.txt | 2 +- basis/math/floats/env/x86/32/tags.txt | 2 +- basis/math/floats/env/x86/64/tags.txt | 2 +- basis/math/floats/env/x86/tags.txt | 2 +- basis/tools/disassembler/gdb/tags.txt | 2 +- basis/tools/disassembler/udis/tags.txt | 2 +- basis/ui/backend/x11/tags.txt | 2 +- basis/unix/stat/linux/32/tags.txt | 2 +- basis/unix/stat/linux/64/tags.txt | 2 +- basis/unix/stat/netbsd/32/tags.txt | 2 +- basis/unix/stat/netbsd/64/tags.txt | 2 +- basis/unix/types/netbsd/32/tags.txt | 2 +- basis/unix/types/netbsd/64/tags.txt | 2 +- core/vocabs/loader/test/a/tags.txt | 2 +- core/vocabs/loader/test/b/tags.txt | 2 +- core/vocabs/loader/test/c/tags.txt | 2 +- core/vocabs/loader/test/d/tags.txt | 2 +- core/vocabs/loader/test/e/tags.txt | 2 +- core/vocabs/loader/test/f/tags.txt | 2 +- core/vocabs/loader/test/g/tags.txt | 2 +- core/vocabs/loader/test/h/tags.txt | 2 +- core/vocabs/loader/test/i/tags.txt | 2 +- core/vocabs/loader/test/j/tags.txt | 2 +- core/vocabs/loader/test/k/tags.txt | 2 +- core/vocabs/loader/test/l/tags.txt | 2 +- core/vocabs/loader/test/m/tags.txt | 2 +- core/vocabs/loader/test/n/tags.txt | 2 +- core/vocabs/loader/test/o/tags.txt | 2 +- extra/couchdb/tags.txt | 2 +- extra/ecdsa/tags.txt | 2 +- extra/llvm/core/tags.txt | 2 +- extra/llvm/engine/tags.txt | 2 +- extra/llvm/invoker/tags.txt | 2 +- extra/llvm/jit/tags.txt | 2 +- extra/llvm/reader/tags.txt | 2 +- extra/llvm/tags.txt | 2 +- extra/llvm/types/tags.txt | 2 +- extra/llvm/wrappers/tags.txt | 2 +- extra/opencl/ffi/tags.txt | 2 +- extra/opencl/syntax/tags.txt | 2 +- extra/opencl/tags.txt | 2 +- 77 files changed, 76 insertions(+), 77 deletions(-) delete mode 100644 basis/editors/vim/generate-syntax/tags.txt diff --git a/basis/bootstrap/compiler/timing/tags.txt b/basis/bootstrap/compiler/timing/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/bootstrap/compiler/timing/tags.txt +++ b/basis/bootstrap/compiler/timing/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/cpu/ppc/linux/tags.txt b/basis/cpu/ppc/linux/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/cpu/ppc/linux/tags.txt +++ b/basis/cpu/ppc/linux/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/cpu/ppc/macosx/tags.txt b/basis/cpu/ppc/macosx/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/cpu/ppc/macosx/tags.txt +++ b/basis/cpu/ppc/macosx/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/cpu/ppc/tags.txt b/basis/cpu/ppc/tags.txt index 6c8f59c757..f5bb856b53 100644 --- a/basis/cpu/ppc/tags.txt +++ b/basis/cpu/ppc/tags.txt @@ -1,2 +1,2 @@ compiler -untested +not loaded diff --git a/basis/cpu/x86/32/tags.txt b/basis/cpu/x86/32/tags.txt index 50dfc5156e..44629a5876 100644 --- a/basis/cpu/x86/32/tags.txt +++ b/basis/cpu/x86/32/tags.txt @@ -1,2 +1,2 @@ -untested +not loaded compiler diff --git a/basis/cpu/x86/64/tags.txt b/basis/cpu/x86/64/tags.txt index 50dfc5156e..44629a5876 100644 --- a/basis/cpu/x86/64/tags.txt +++ b/basis/cpu/x86/64/tags.txt @@ -1,2 +1,2 @@ -untested +not loaded compiler diff --git a/basis/cpu/x86/64/unix/tags.txt b/basis/cpu/x86/64/unix/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/cpu/x86/64/unix/tags.txt +++ b/basis/cpu/x86/64/unix/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/cpu/x86/64/winnt/tags.txt b/basis/cpu/x86/64/winnt/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/cpu/x86/64/winnt/tags.txt +++ b/basis/cpu/x86/64/winnt/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/cpu/x86/features/tags.txt b/basis/cpu/x86/features/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/cpu/x86/features/tags.txt +++ b/basis/cpu/x86/features/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/cpu/x86/tags.txt b/basis/cpu/x86/tags.txt index 50dfc5156e..44629a5876 100644 --- a/basis/cpu/x86/tags.txt +++ b/basis/cpu/x86/tags.txt @@ -1,2 +1,2 @@ -untested +not loaded compiler diff --git a/basis/editors/editpadlite/tags.txt b/basis/editors/editpadlite/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/editpadlite/tags.txt +++ b/basis/editors/editpadlite/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/editpadpro/tags.txt b/basis/editors/editpadpro/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/editpadpro/tags.txt +++ b/basis/editors/editpadpro/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/editplus/tags.txt b/basis/editors/editplus/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/editplus/tags.txt +++ b/basis/editors/editplus/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/emacs/tags.txt b/basis/editors/emacs/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/emacs/tags.txt +++ b/basis/editors/emacs/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/emacs/windows/tags.txt b/basis/editors/emacs/windows/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/emacs/windows/tags.txt +++ b/basis/editors/emacs/windows/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/emeditor/tags.txt b/basis/editors/emeditor/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/emeditor/tags.txt +++ b/basis/editors/emeditor/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/etexteditor/tags.txt b/basis/editors/etexteditor/tags.txt index 5d77766703..ebb74b4d5f 100755 --- a/basis/editors/etexteditor/tags.txt +++ b/basis/editors/etexteditor/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/gedit/tags.txt b/basis/editors/gedit/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/gedit/tags.txt +++ b/basis/editors/gedit/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/gvim/tags.txt b/basis/editors/gvim/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/gvim/tags.txt +++ b/basis/editors/gvim/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/gvim/unix/tags.txt b/basis/editors/gvim/unix/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/gvim/unix/tags.txt +++ b/basis/editors/gvim/unix/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/gvim/windows/tags.txt b/basis/editors/gvim/windows/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/gvim/windows/tags.txt +++ b/basis/editors/gvim/windows/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/jedit/tags.txt b/basis/editors/jedit/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/jedit/tags.txt +++ b/basis/editors/jedit/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/macvim/tags.txt b/basis/editors/macvim/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/macvim/tags.txt +++ b/basis/editors/macvim/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/notepad/tags.txt b/basis/editors/notepad/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/notepad/tags.txt +++ b/basis/editors/notepad/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/notepad2/tags.txt b/basis/editors/notepad2/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/notepad2/tags.txt +++ b/basis/editors/notepad2/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/notepadpp/tags.txt b/basis/editors/notepadpp/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/notepadpp/tags.txt +++ b/basis/editors/notepadpp/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/scite/tags.txt b/basis/editors/scite/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/scite/tags.txt +++ b/basis/editors/scite/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/ted-notepad/tags.txt b/basis/editors/ted-notepad/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/ted-notepad/tags.txt +++ b/basis/editors/ted-notepad/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/textedit/tags.txt b/basis/editors/textedit/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/textedit/tags.txt +++ b/basis/editors/textedit/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/textmate/tags.txt b/basis/editors/textmate/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/textmate/tags.txt +++ b/basis/editors/textmate/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/textpad/tags.txt b/basis/editors/textpad/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/textpad/tags.txt +++ b/basis/editors/textpad/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/textwrangler/tags.txt b/basis/editors/textwrangler/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/textwrangler/tags.txt +++ b/basis/editors/textwrangler/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/ultraedit/tags.txt b/basis/editors/ultraedit/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/ultraedit/tags.txt +++ b/basis/editors/ultraedit/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/vim/generate-syntax/tags.txt b/basis/editors/vim/generate-syntax/tags.txt deleted file mode 100644 index 5d77766703..0000000000 --- a/basis/editors/vim/generate-syntax/tags.txt +++ /dev/null @@ -1 +0,0 @@ -untested diff --git a/basis/editors/vim/tags.txt b/basis/editors/vim/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/vim/tags.txt +++ b/basis/editors/vim/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/editors/wordpad/tags.txt b/basis/editors/wordpad/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/editors/wordpad/tags.txt +++ b/basis/editors/wordpad/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/math/floats/env/ppc/tags.txt b/basis/math/floats/env/ppc/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/math/floats/env/ppc/tags.txt +++ b/basis/math/floats/env/ppc/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/math/floats/env/x86/32/tags.txt b/basis/math/floats/env/x86/32/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/math/floats/env/x86/32/tags.txt +++ b/basis/math/floats/env/x86/32/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/math/floats/env/x86/64/tags.txt b/basis/math/floats/env/x86/64/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/math/floats/env/x86/64/tags.txt +++ b/basis/math/floats/env/x86/64/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/math/floats/env/x86/tags.txt b/basis/math/floats/env/x86/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/math/floats/env/x86/tags.txt +++ b/basis/math/floats/env/x86/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/tools/disassembler/gdb/tags.txt b/basis/tools/disassembler/gdb/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/tools/disassembler/gdb/tags.txt +++ b/basis/tools/disassembler/gdb/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/tools/disassembler/udis/tags.txt b/basis/tools/disassembler/udis/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/tools/disassembler/udis/tags.txt +++ b/basis/tools/disassembler/udis/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/ui/backend/x11/tags.txt b/basis/ui/backend/x11/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/ui/backend/x11/tags.txt +++ b/basis/ui/backend/x11/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/unix/stat/linux/32/tags.txt b/basis/unix/stat/linux/32/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/unix/stat/linux/32/tags.txt +++ b/basis/unix/stat/linux/32/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/unix/stat/linux/64/tags.txt b/basis/unix/stat/linux/64/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/unix/stat/linux/64/tags.txt +++ b/basis/unix/stat/linux/64/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/unix/stat/netbsd/32/tags.txt b/basis/unix/stat/netbsd/32/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/unix/stat/netbsd/32/tags.txt +++ b/basis/unix/stat/netbsd/32/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/unix/stat/netbsd/64/tags.txt b/basis/unix/stat/netbsd/64/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/unix/stat/netbsd/64/tags.txt +++ b/basis/unix/stat/netbsd/64/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/unix/types/netbsd/32/tags.txt b/basis/unix/types/netbsd/32/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/unix/types/netbsd/32/tags.txt +++ b/basis/unix/types/netbsd/32/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/basis/unix/types/netbsd/64/tags.txt b/basis/unix/types/netbsd/64/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/basis/unix/types/netbsd/64/tags.txt +++ b/basis/unix/types/netbsd/64/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/core/vocabs/loader/test/a/tags.txt b/core/vocabs/loader/test/a/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/core/vocabs/loader/test/a/tags.txt +++ b/core/vocabs/loader/test/a/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/core/vocabs/loader/test/b/tags.txt b/core/vocabs/loader/test/b/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/core/vocabs/loader/test/b/tags.txt +++ b/core/vocabs/loader/test/b/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/core/vocabs/loader/test/c/tags.txt b/core/vocabs/loader/test/c/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/core/vocabs/loader/test/c/tags.txt +++ b/core/vocabs/loader/test/c/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/core/vocabs/loader/test/d/tags.txt b/core/vocabs/loader/test/d/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/core/vocabs/loader/test/d/tags.txt +++ b/core/vocabs/loader/test/d/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/core/vocabs/loader/test/e/tags.txt b/core/vocabs/loader/test/e/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/core/vocabs/loader/test/e/tags.txt +++ b/core/vocabs/loader/test/e/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/core/vocabs/loader/test/f/tags.txt b/core/vocabs/loader/test/f/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/core/vocabs/loader/test/f/tags.txt +++ b/core/vocabs/loader/test/f/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/core/vocabs/loader/test/g/tags.txt b/core/vocabs/loader/test/g/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/core/vocabs/loader/test/g/tags.txt +++ b/core/vocabs/loader/test/g/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/core/vocabs/loader/test/h/tags.txt b/core/vocabs/loader/test/h/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/core/vocabs/loader/test/h/tags.txt +++ b/core/vocabs/loader/test/h/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/core/vocabs/loader/test/i/tags.txt b/core/vocabs/loader/test/i/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/core/vocabs/loader/test/i/tags.txt +++ b/core/vocabs/loader/test/i/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/core/vocabs/loader/test/j/tags.txt b/core/vocabs/loader/test/j/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/core/vocabs/loader/test/j/tags.txt +++ b/core/vocabs/loader/test/j/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/core/vocabs/loader/test/k/tags.txt b/core/vocabs/loader/test/k/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/core/vocabs/loader/test/k/tags.txt +++ b/core/vocabs/loader/test/k/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/core/vocabs/loader/test/l/tags.txt b/core/vocabs/loader/test/l/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/core/vocabs/loader/test/l/tags.txt +++ b/core/vocabs/loader/test/l/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/core/vocabs/loader/test/m/tags.txt b/core/vocabs/loader/test/m/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/core/vocabs/loader/test/m/tags.txt +++ b/core/vocabs/loader/test/m/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/core/vocabs/loader/test/n/tags.txt b/core/vocabs/loader/test/n/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/core/vocabs/loader/test/n/tags.txt +++ b/core/vocabs/loader/test/n/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/core/vocabs/loader/test/o/tags.txt b/core/vocabs/loader/test/o/tags.txt index 5d77766703..ebb74b4d5f 100644 --- a/core/vocabs/loader/test/o/tags.txt +++ b/core/vocabs/loader/test/o/tags.txt @@ -1 +1 @@ -untested +not loaded diff --git a/extra/couchdb/tags.txt b/extra/couchdb/tags.txt index 5d77766703..700f0dc9a5 100644 --- a/extra/couchdb/tags.txt +++ b/extra/couchdb/tags.txt @@ -1 +1 @@ -untested +not tested diff --git a/extra/ecdsa/tags.txt b/extra/ecdsa/tags.txt index 5d77766703..700f0dc9a5 100644 --- a/extra/ecdsa/tags.txt +++ b/extra/ecdsa/tags.txt @@ -1 +1 @@ -untested +not tested diff --git a/extra/llvm/core/tags.txt b/extra/llvm/core/tags.txt index 5d77766703..700f0dc9a5 100644 --- a/extra/llvm/core/tags.txt +++ b/extra/llvm/core/tags.txt @@ -1 +1 @@ -untested +not tested diff --git a/extra/llvm/engine/tags.txt b/extra/llvm/engine/tags.txt index 5d77766703..700f0dc9a5 100644 --- a/extra/llvm/engine/tags.txt +++ b/extra/llvm/engine/tags.txt @@ -1 +1 @@ -untested +not tested diff --git a/extra/llvm/invoker/tags.txt b/extra/llvm/invoker/tags.txt index 5d77766703..700f0dc9a5 100644 --- a/extra/llvm/invoker/tags.txt +++ b/extra/llvm/invoker/tags.txt @@ -1 +1 @@ -untested +not tested diff --git a/extra/llvm/jit/tags.txt b/extra/llvm/jit/tags.txt index 5d77766703..700f0dc9a5 100644 --- a/extra/llvm/jit/tags.txt +++ b/extra/llvm/jit/tags.txt @@ -1 +1 @@ -untested +not tested diff --git a/extra/llvm/reader/tags.txt b/extra/llvm/reader/tags.txt index 5d77766703..700f0dc9a5 100644 --- a/extra/llvm/reader/tags.txt +++ b/extra/llvm/reader/tags.txt @@ -1 +1 @@ -untested +not tested diff --git a/extra/llvm/tags.txt b/extra/llvm/tags.txt index a9d28becd8..ba3ee02ae4 100644 --- a/extra/llvm/tags.txt +++ b/extra/llvm/tags.txt @@ -1,2 +1,2 @@ bindings -untested +not tested diff --git a/extra/llvm/types/tags.txt b/extra/llvm/types/tags.txt index 5d77766703..700f0dc9a5 100644 --- a/extra/llvm/types/tags.txt +++ b/extra/llvm/types/tags.txt @@ -1 +1 @@ -untested +not tested diff --git a/extra/llvm/wrappers/tags.txt b/extra/llvm/wrappers/tags.txt index 5d77766703..700f0dc9a5 100644 --- a/extra/llvm/wrappers/tags.txt +++ b/extra/llvm/wrappers/tags.txt @@ -1 +1 @@ -untested +not tested diff --git a/extra/opencl/ffi/tags.txt b/extra/opencl/ffi/tags.txt index a9d28becd8..ba3ee02ae4 100644 --- a/extra/opencl/ffi/tags.txt +++ b/extra/opencl/ffi/tags.txt @@ -1,2 +1,2 @@ bindings -untested +not tested diff --git a/extra/opencl/syntax/tags.txt b/extra/opencl/syntax/tags.txt index 5d77766703..700f0dc9a5 100644 --- a/extra/opencl/syntax/tags.txt +++ b/extra/opencl/syntax/tags.txt @@ -1 +1 @@ -untested +not tested diff --git a/extra/opencl/tags.txt b/extra/opencl/tags.txt index a9d28becd8..ba3ee02ae4 100644 --- a/extra/opencl/tags.txt +++ b/extra/opencl/tags.txt @@ -1,2 +1,2 @@ bindings -untested +not tested From 7524007110757a4b3cf241501f672ca3782a18d0 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 13 Apr 2010 18:43:33 -0700 Subject: [PATCH 115/157] load-all now skips vocabs tagged 'not loaded', and test-all skips vocabs tagged 'not tested' --- basis/tools/test/test.factor | 20 +++++++++++--------- basis/vocabs/hierarchy/hierarchy.factor | 5 +---- basis/vocabs/metadata/metadata.factor | 13 +++++++++++-- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/basis/tools/test/test.factor b/basis/tools/test/test.factor index f3f53e43b7..95f1ad8e2c 100644 --- a/basis/tools/test/test.factor +++ b/basis/tools/test/test.factor @@ -2,11 +2,12 @@ ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays assocs combinators compiler.units continuations debugger effects fry generalizations io io.files -io.styles kernel lexer locals macros math.parser namespaces parser -vocabs.parser prettyprint quotations sequences source-files splitting -stack-checker summary unicode.case vectors vocabs vocabs.loader -vocabs.files words tools.errors source-files.errors io.streams.string -make compiler.errors ; +io.styles kernel lexer locals macros math.parser namespaces +parser vocabs.parser prettyprint quotations sequences +source-files splitting stack-checker summary unicode.case +vectors vocabs vocabs.loader vocabs.files vocabs.metadata words +tools.errors source-files.errors io.streams.string make +compiler.errors ; IN: tools.test TUPLE: test-failure < source-file-error continuation ; @@ -126,7 +127,7 @@ SYMBOL: forget-tests? forget-tests? get [ [ [ forget-source ] each ] with-compilation-unit ] [ drop ] if ; -: run-vocab-tests ( vocab -- ) +: test-vocab ( vocab -- ) vocab dup [ dup source-loaded?>> [ vocab-tests @@ -136,6 +137,8 @@ SYMBOL: forget-tests? ] [ drop ] if ] [ drop ] if ; +: test-vocabs ( vocabs -- ) [ test-vocab ] each ; + PRIVATE> TEST: unit-test @@ -154,7 +157,6 @@ M: test-failure error. ( error -- ) : :test-failures ( -- ) test-failures get errors. ; -: test ( prefix -- ) - child-vocabs [ run-vocab-tests ] each ; +: test ( prefix -- ) child-vocabs test-vocabs ; -: test-all ( -- ) "" test ; +: test-all ( -- ) vocabs filter-don't-test test-vocabs ; diff --git a/basis/vocabs/hierarchy/hierarchy.factor b/basis/vocabs/hierarchy/hierarchy.factor index 986091a543..609d485f0c 100644 --- a/basis/vocabs/hierarchy/hierarchy.factor +++ b/basis/vocabs/hierarchy/hierarchy.factor @@ -97,9 +97,6 @@ MEMO: all-vocabs-recursive ( -- assoc ) : (load) ( prefix -- failures ) [ child-vocabs-recursive no-roots no-prefixes ] [ dup find-vocab-root [ >vocab-link prefix ] [ drop ] if ] bi - filter-unportable + filter-don't-load require-all ; : load ( prefix -- ) diff --git a/basis/vocabs/metadata/metadata.factor b/basis/vocabs/metadata/metadata.factor index 5048b0edd0..bb14581f0d 100644 --- a/basis/vocabs/metadata/metadata.factor +++ b/basis/vocabs/metadata/metadata.factor @@ -103,12 +103,21 @@ ERROR: bad-platform name ; : supported-platform? ( platforms -- ? ) [ t ] [ [ os swap class<= ] any? ] if-empty ; -: unportable? ( vocab -- ? ) +: don't-load? ( vocab -- ? ) { - [ vocab-tags "untested" swap member? ] + [ vocab-tags "not loaded" swap member? ] [ vocab-platforms supported-platform? not ] } 1|| ; +: filter-don't-load ( vocabs -- vocabs' ) + [ vocab-name don't-load? not ] filter ; + +: don't-test? ( vocab -- ? ) + vocab-tags "not tested" swap member? ; + +: filter-don't-test ( vocabs -- vocabs' ) + [ don't-test? not ] filter ; + TUPLE: unsupported-platform vocab requires ; : unsupported-platform ( vocab requires -- ) From f6908f513fd2db17ad81a54b4a14194895e780ea Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 13 Apr 2010 18:43:48 -0700 Subject: [PATCH 116/157] llvm: fix load errors --- extra/llvm/core/core.factor | 2 +- extra/llvm/engine/engine.factor | 2 +- extra/llvm/invoker/invoker.factor | 2 +- extra/llvm/jit/jit.factor | 23 +++++++++++------------ extra/llvm/types/types.factor | 2 +- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/extra/llvm/core/core.factor b/extra/llvm/core/core.factor index 0ab43c6ab6..5778a00ffb 100644 --- a/extra/llvm/core/core.factor +++ b/extra/llvm/core/core.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2009 Matthew Willis. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.libraries alien.syntax system sequences combinators kernel alien.c-types ; +USING: alien alien.libraries alien.syntax system sequences combinators kernel alien.c-types ; IN: llvm.core diff --git a/extra/llvm/engine/engine.factor b/extra/llvm/engine/engine.factor index 95e425c425..bb39f86f73 100644 --- a/extra/llvm/engine/engine.factor +++ b/extra/llvm/engine/engine.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2009 Matthew Willis. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.libraries alien.syntax llvm.core ; +USING: alien.c-types alien.libraries alien.syntax llvm.core ; IN: llvm.engine << diff --git a/extra/llvm/invoker/invoker.factor b/extra/llvm/invoker/invoker.factor index cc3480fe49..27fdeeb618 100644 --- a/extra/llvm/invoker/invoker.factor +++ b/extra/llvm/invoker/invoker.factor @@ -45,7 +45,7 @@ TUPLE: function name alien return params ; ] [ ] make swap function-effect [ define-declared ] with-compilation-unit ; : install-module ( name -- ) - thejit get mps>> at [ + current-jit mps>> at [ module>> functions [ install-function ] each ] [ "no such module" throw ] if* ; diff --git a/extra/llvm/jit/jit.factor b/extra/llvm/jit/jit.factor index f58851fe6f..fc755fd00f 100644 --- a/extra/llvm/jit/jit.factor +++ b/extra/llvm/jit/jit.factor @@ -5,8 +5,6 @@ kernel llvm.core llvm.engine llvm.wrappers namespaces ; IN: llvm.jit -SYMBOL: thejit - TUPLE: jit ee mps ; : empty-engine ( -- engine ) @@ -15,8 +13,11 @@ TUPLE: jit ee mps ; : ( -- jit ) jit new empty-engine >>ee H{ } clone >>mps ; +: current-jit ( -- jit ) + \ current-jit global [ drop ] cache ; + : (remove-functions) ( function -- ) - thejit get ee>> value>> over LLVMFreeMachineCodeForFunction + current-jit ee>> value>> over LLVMFreeMachineCodeForFunction LLVMGetNextFunction dup ALIEN: 0 = [ drop ] [ (remove-functions) ] if ; : remove-functions ( module -- ) @@ -24,26 +25,24 @@ TUPLE: jit ee mps ; LLVMGetFirstFunction dup ALIEN: 0 = [ drop ] [ (remove-functions) ] if ; : remove-provider ( provider -- ) - thejit get ee>> value>> swap value>> f f + current-jit ee>> value>> swap value>> f f [ LLVMRemoveModuleProvider drop ] 2keep *void* [ llvm-throw ] when* *void* module new swap >>value [ value>> remove-functions ] with-disposal ; : remove-module ( name -- ) - dup thejit get mps>> at [ + dup current-jit mps>> at [ remove-provider - thejit get mps>> delete-at + current-jit mps>> delete-at ] [ drop ] if* ; : add-module ( module name -- ) [ ] dip [ remove-module ] keep - thejit get ee>> value>> pick + current-jit ee>> value>> pick [ [ value>> LLVMAddModuleProvider ] [ t >>disposed drop ] bi ] with-disposal - thejit get mps>> set-at ; + current-jit mps>> set-at ; : function-pointer ( name -- alien ) - thejit get ee>> value>> dup + current-jit ee>> value>> dup rot f [ LLVMFindFunction drop ] keep - *void* LLVMGetPointerToGlobal ; - -thejit [ ] initialize \ No newline at end of file + *void* LLVMGetPointerToGlobal ; \ No newline at end of file diff --git a/extra/llvm/types/types.factor b/extra/llvm/types/types.factor index e93cf7a44b..c312e7a173 100644 --- a/extra/llvm/types/types.factor +++ b/extra/llvm/types/types.factor @@ -229,7 +229,7 @@ NoFunctionParams = "(" WhiteSpace ")" => [[ drop { } ]] VarArgs = WhiteSpace "..." WhiteSpace => [[ drop ... ]] ParamListContinued = "," (Type | VarArgs):t => [[ t ]] ParamList = "(" Type:t (ParamListContinued*):ts ")" => [[ ts t prefix ]] -Function = T:t WhiteSpace ( ParamList | NoFunctionParams ):ts => [[ ... ts member? dup [ ... ts delete ] when t ts >array rot ]] +Function = T:t WhiteSpace ( ParamList | NoFunctionParams ):ts => [[ ... ts member? dup [ ... ts remove! drop ] when t ts >array rot ]] PackedStructure = "<" WhiteSpace "{" Type:ty (StructureTypesList)*:ts "}" WhiteSpace ">" => [[ ts ty prefix >array t ]] UpReference = "\\" Number:n => [[ n ]] Name = '%' ([a-zA-Z][a-zA-Z0-9]*):id => [[ id flatten >string ]] From 3f36a2dd2dbe58e324386710dfb82696a7ee73cb Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 13 Apr 2010 18:43:56 -0700 Subject: [PATCH 117/157] opencl.ffi: fix load error --- extra/opencl/ffi/ffi.factor | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extra/opencl/ffi/ffi.factor b/extra/opencl/ffi/ffi.factor index d3398f5c24..c3a053d6ae 100644 --- a/extra/opencl/ffi/ffi.factor +++ b/extra/opencl/ffi/ffi.factor @@ -1,7 +1,8 @@ ! Copyright (C) 2010 Erik Charlebois. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.c-types alien.libraries alien.syntax classes.struct -combinators system alien.accessors byte-arrays kernel ; +USING: alien alien.c-types alien.libraries alien.syntax +classes.struct combinators system alien.accessors byte-arrays +kernel ; IN: opencl.ffi << "opencl" { From e1ee2c82ea5b92d75848d8a4ffd293b612b6bad0 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 13 Apr 2010 18:44:10 -0700 Subject: [PATCH 118/157] cuda: 'not tested' tag --- extra/cuda/ffi/tags.txt | 1 + extra/cuda/tags.txt | 1 + 2 files changed, 2 insertions(+) create mode 100644 extra/cuda/ffi/tags.txt create mode 100644 extra/cuda/tags.txt diff --git a/extra/cuda/ffi/tags.txt b/extra/cuda/ffi/tags.txt new file mode 100644 index 0000000000..700f0dc9a5 --- /dev/null +++ b/extra/cuda/ffi/tags.txt @@ -0,0 +1 @@ +not tested diff --git a/extra/cuda/tags.txt b/extra/cuda/tags.txt new file mode 100644 index 0000000000..700f0dc9a5 --- /dev/null +++ b/extra/cuda/tags.txt @@ -0,0 +1 @@ +not tested From 288090d99346e28b4b64976a2c0a917abdfcad65 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 13 Apr 2010 21:21:28 -0700 Subject: [PATCH 119/157] math.parser: expose a format-float primitive for use by formatting vocabulary --- basis/stack-checker/known-words/known-words.factor | 2 +- core/bootstrap/primitives.factor | 2 +- core/math/parser/parser.factor | 13 +++++++------ vm/math.cpp | 8 +++++--- vm/primitives.hpp | 2 +- vm/vm.hpp | 2 +- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/basis/stack-checker/known-words/known-words.factor b/basis/stack-checker/known-words/known-words.factor index 15895184df..1fa9a94677 100644 --- a/basis/stack-checker/known-words/known-words.factor +++ b/basis/stack-checker/known-words/known-words.factor @@ -289,7 +289,7 @@ M: bad-executable summary \ (dlsym) { byte-array object } { c-ptr } define-primitive \ (exists?) { string } { object } define-primitive \ (exit) { integer } { } define-primitive -\ (float>string) { float } { byte-array } define-primitive \ (float>string) make-foldable +\ (format-float) { float byte-array } { byte-array } define-primitive \ (format-float) make-foldable \ (fopen) { byte-array byte-array } { alien } define-primitive \ (identity-hashcode) { object } { fixnum } define-primitive \ (save-image) { byte-array byte-array } { } define-primitive diff --git a/core/bootstrap/primitives.factor b/core/bootstrap/primitives.factor index 87963848bf..c466b0c1f8 100644 --- a/core/bootstrap/primitives.factor +++ b/core/bootstrap/primitives.factor @@ -470,7 +470,7 @@ tuple { "byte-array>bignum" "math" "primitive_byte_array_to_bignum" (( x -- y )) } { "double>bits" "math" "primitive_double_bits" (( x -- n )) } { "float>bits" "math" "primitive_float_bits" (( x -- n )) } - { "(float>string)" "math.parser.private" "primitive_float_to_str" (( n -- str )) } + { "(format-float)" "math.parser.private" "primitive_format_float" (( n format -- byte-array )) } { "bignum*" "math.private" "primitive_bignum_multiply" (( x y -- z )) } { "bignum+" "math.private" "primitive_bignum_add" (( x y -- z )) } { "bignum-" "math.private" "primitive_bignum_subtract" (( x y -- z )) } diff --git a/core/math/parser/parser.factor b/core/math/parser/parser.factor index 5bb024db9d..14fd6a2983 100644 --- a/core/math/parser/parser.factor +++ b/core/math/parser/parser.factor @@ -1,6 +1,7 @@ ! (c)2009 Joe Groff bsd license -USING: accessors combinators kernel kernel.private math -namespaces sequences sequences.private splitting strings make ; +USING: accessors byte-arrays combinators kernel kernel.private +math namespaces sequences sequences.private splitting strings +make ; IN: math.parser : digit> ( ch -- n ) @@ -356,15 +357,15 @@ M: ratio >base mantissa-expt [ float>hex-value ] [ float>hex-expt ] bi* ] bi 3append ; -: float>decimal ( n -- str ) - (float>string) - [ 0 = ] trim-tail >string +: format-float ( n format -- string ) + 0 suffix >byte-array (format-float) + dup [ 0 = ] find drop head >string fix-float ; : float>base ( n base -- str ) { { 16 [ float>hex ] } - [ drop float>decimal ] + [ drop "%.16g" format-float ] } case ; inline PRIVATE> diff --git a/vm/math.cpp b/vm/math.cpp index a462232344..e64db2690e 100755 --- a/vm/math.cpp +++ b/vm/math.cpp @@ -260,10 +260,12 @@ void factor_vm::primitive_bignum_to_float() ctx->replace(allot_float(bignum_to_float(ctx->peek()))); } -void factor_vm::primitive_float_to_str() +void factor_vm::primitive_format_float() { - byte_array *array = allot_byte_array(33); - SNPRINTF((char *)(array + 1),32,"%.16g",untag_float_check(ctx->pop())); + byte_array *array = allot_byte_array(100); + char *format = alien_offset(ctx->pop()); + double value = untag_float_check(ctx->pop()); + SNPRINTF(array->data(),99,format,value); ctx->push(tag(array)); } diff --git a/vm/primitives.hpp b/vm/primitives.hpp index ff0947912c..e98cf508b6 100644 --- a/vm/primitives.hpp +++ b/vm/primitives.hpp @@ -82,8 +82,8 @@ namespace factor _(float_subtract) \ _(float_to_bignum) \ _(float_to_fixnum) \ - _(float_to_str) \ _(fopen) \ + _(format_float) \ _(fputc) \ _(fread) \ _(fseek) \ diff --git a/vm/vm.hpp b/vm/vm.hpp index 36ec3260d6..dd1d48cf03 100755 --- a/vm/vm.hpp +++ b/vm/vm.hpp @@ -464,7 +464,7 @@ struct factor_vm cell unbox_array_size_slow(); void primitive_fixnum_to_float(); void primitive_bignum_to_float(); - void primitive_float_to_str(); + void primitive_format_float(); void primitive_float_eq(); void primitive_float_add(); void primitive_float_subtract(); From 8f4210436b489b626848d525a97e2ebcf988ffa8 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 13 Apr 2010 21:24:35 -0700 Subject: [PATCH 120/157] formatting: use the new format-float word to fix a failing test case --- basis/formatting/formatting-tests.factor | 1 + basis/formatting/formatting.factor | 46 +++++++++--------------- 2 files changed, 17 insertions(+), 30 deletions(-) diff --git a/basis/formatting/formatting-tests.factor b/basis/formatting/formatting-tests.factor index 5710ceb985..35b1dfff4a 100644 --- a/basis/formatting/formatting-tests.factor +++ b/basis/formatting/formatting-tests.factor @@ -16,6 +16,7 @@ IN: formatting.tests [ t ] [ "+0010" 10 "%+05d" sprintf = ] unit-test [ t ] [ "123.456000" 123.456 "%f" sprintf = ] unit-test [ t ] [ "2.44" 2.436 "%.2f" sprintf = ] unit-test +[ t ] [ "8.950" 8.950179003580072 "%.3f" sprintf = ] unit-test [ t ] [ "123.10" 123.1 "%01.2f" sprintf = ] unit-test [ t ] [ "1.2346" 1.23456789 "%.4f" sprintf = ] unit-test [ t ] [ " 1.23" 1.23456789 "%6.2f" sprintf = ] unit-test diff --git a/basis/formatting/formatting.factor b/basis/formatting/formatting.factor index ec3c9f1d8e..5abcb12916 100644 --- a/basis/formatting/formatting.factor +++ b/basis/formatting/formatting.factor @@ -3,7 +3,9 @@ USING: accessors arrays assocs calendar combinators fry kernel generalizations io io.streams.string macros math math.functions math.parser peg.ebnf quotations sequences splitting strings -unicode.categories unicode.case vectors combinators.smart ; +unicode.categories unicode.case vectors combinators.smart +present ; +FROM: math.parser.private => format-float ; IN: formatting digits ( string -- digits ) [ 0 ] [ string>number ] if-empty ; -: pad-digits ( string digits -- string' ) - [ "." split1 ] dip [ CHAR: 0 pad-tail ] [ head-slice ] bi "." glue ; +: format-simple ( x digits string -- string ) + [ [ >float ] [ number>string ] bi* "%." ] dip + surround format-float ; -: max-digits ( n digits -- n' ) - 10^ [ * round ] keep / ; inline +: format-scientific ( x digits -- string ) "e" format-simple ; -: >exp ( x -- exp base ) - [ - abs 0 swap - [ dup [ 10.0 >= ] [ 1.0 < ] bi or ] - [ dup 10.0 >= - [ 10.0 / [ 1 + ] dip ] - [ 10.0 * [ 1 - ] dip ] if - ] while - ] keep 0 < [ neg ] when ; +: format-decimal ( x digits -- string ) "f" format-simple ; -: exp>string ( exp base digits -- string ) - [ max-digits ] keep -rot - [ - [ 0 < "-" "+" ? ] - [ abs number>string 2 CHAR: 0 pad-head ] bi - "e" -rot 3append - ] - [ number>string ] bi* - rot pad-digits prepend ; +ERROR: unknown-printf-directive ; EBNF: parse-printf @@ -73,15 +59,15 @@ digits = (digits_)? => [[ 6 or ]] fmt-% = "%" => [[ [ "%" ] ]] fmt-c = "c" => [[ [ 1string ] ]] fmt-C = "C" => [[ [ 1string >upper ] ]] -fmt-s = "s" => [[ [ dup number? [ number>string ] when ] ]] -fmt-S = "S" => [[ [ dup number? [ number>string ] when >upper ] ]] -fmt-d = "d" => [[ [ >fixnum number>string ] ]] -fmt-e = digits "e" => [[ first '[ >exp _ exp>string ] ]] -fmt-E = digits "E" => [[ first '[ >exp _ exp>string >upper ] ]] -fmt-f = digits "f" => [[ first dup '[ >float _ max-digits number>string _ pad-digits ] ]] +fmt-s = "s" => [[ [ present ] ]] +fmt-S = "S" => [[ [ present >upper ] ]] +fmt-d = "d" => [[ [ >integer number>string ] ]] +fmt-e = digits "e" => [[ first '[ _ format-scientific ] ]] +fmt-E = digits "E" => [[ first '[ _ format-scientific >upper ] ]] +fmt-f = digits "f" => [[ first '[ _ format-decimal ] ]] fmt-x = "x" => [[ [ >hex ] ]] fmt-X = "X" => [[ [ >hex >upper ] ]] -unknown = (.)* => [[ "Unknown directive" throw ]] +unknown = (.)* => [[ unknown-printf-directive ]] strings_ = fmt-c|fmt-C|fmt-s|fmt-S strings = pad width strings_ => [[ reverse compose-all ]] From 216a05e68a4d9df1135837fd7306bf9285e3fa2b Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 13 Apr 2010 21:24:42 -0700 Subject: [PATCH 121/157] vm: small cleanup --- vm/callstack.cpp | 2 +- vm/io.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vm/callstack.cpp b/vm/callstack.cpp index ad7528ab84..eae976219f 100755 --- a/vm/callstack.cpp +++ b/vm/callstack.cpp @@ -122,7 +122,7 @@ cell factor_vm::frame_scan(stack_frame *frame) if(obj.type_p(QUOTATION_TYPE)) { char *return_addr = (char *)FRAME_RETURN_ADDRESS(frame,this); - char *quot_entry_point = (char *)(frame_code(frame) + 1); + char *quot_entry_point = (char *)frame_code(frame)->entry_point(); return tag_fixnum(quot_code_offset_to_scan( obj.value(),(cell)(return_addr - quot_entry_point))); diff --git a/vm/io.cpp b/vm/io.cpp index 8ce7ff5256..94e6e64d1d 100755 --- a/vm/io.cpp +++ b/vm/io.cpp @@ -216,7 +216,7 @@ void factor_vm::primitive_fread() if(feof(file)) { byte_array *new_buf = allot_byte_array(c); - memcpy(new_buf + 1, buf.untagged() + 1,c); + memcpy(new_buf->data(), buf->data(),c); buf = new_buf; } From bb0c4d94e05663e44af8e1da5abb1822bcb24a60 Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Wed, 14 Apr 2010 00:08:10 -0700 Subject: [PATCH 122/157] Replace info and 2info macros with simple inline words. --- extra/opencl/opencl.factor | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/extra/opencl/opencl.factor b/extra/opencl/opencl.factor index ddcf16a3b2..91a264e85c 100644 --- a/extra/opencl/opencl.factor +++ b/extra/opencl/opencl.factor @@ -1,10 +1,9 @@ ! Copyright (C) 2010 Erik Charlebois. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors alien alien.accessors alien.c-types arrays -byte-arrays combinators combinators.smart continuations destructors -fry io.encodings.ascii io.encodings.string kernel libc locals macros -math math.order multiline opencl.ffi prettyprint sequences -specialized-arrays typed variants namespaces ; +USING: accessors alien alien.c-types arrays byte-arrays combinators +combinators.smart destructors io.encodings.ascii io.encodings.string +kernel libc locals math namespaces opencl.ffi sequences shuffle +specialized-arrays variants ; IN: opencl SPECIALIZED-ARRAYS: void* char size_t ; @@ -16,17 +15,25 @@ ERROR: cl-error err ; : cl-not-null ( err -- ) dup f = [ cl-error ] [ drop ] if ; inline + +: info-data-size ( handle name info-quot -- size_t ) + [ 0 f 0 ] dip [ call cl-success ] 2keep drop *size_t ; inline -MACRO: info ( info-quot lift-quot -- quot ) - [ dup ] dip '[ 2dup 0 f 0 _ '[ _ call cl-success ] keep - *size_t dup _ '[ f _ call cl-success ] keep - _ call ] ; - -MACRO: 2info ( info-quot lift-quot -- quot ) - [ dup ] dip '[ 3dup 0 f 0 _ '[ _ call cl-success ] keep - *size_t dup _ '[ f _ call cl-success ] keep - _ call ] ; - +: info-data-bytes ( handle name info-quot size -- bytes ) + swap [ dup f ] dip [ call cl-success ] 3keep 2drop ; inline + +: info ( handle name info-quot lift-quot -- value ) + [ 3dup info-data-size info-data-bytes ] dip call ; inline + +: 2info-data-size ( handle1 handle2 name info-quot -- size_t ) + [ 0 f 0 ] dip [ call cl-success ] 2keep drop *size_t ; inline + +: 2info-data-bytes ( handle1 handle2 name info-quot size -- bytes ) + swap [ dup f ] dip [ call cl-success ] 3keep 2drop ; inline + +: 2info ( handle1 handle2 name info_quot lift_quot -- value ) + [ 4dup 2info-data-size 2info-data-bytes ] dip call ; inline + : info-bool ( handle name quot -- ? ) [ *uint CL_TRUE = ] info ; inline From b4a0fd8b17e1c8530067a33a7b24d389e8536bc2 Mon Sep 17 00:00:00 2001 From: Erik Charlebois Date: Wed, 14 Apr 2010 01:28:21 -0700 Subject: [PATCH 123/157] Remove some inline flags for info words to avoid out of memory on 32-bit archs. --- extra/opencl/opencl.factor | 44 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/extra/opencl/opencl.factor b/extra/opencl/opencl.factor index 91a264e85c..17f0143ae1 100644 --- a/extra/opencl/opencl.factor +++ b/extra/opencl/opencl.factor @@ -163,6 +163,7 @@ C: cl-buffer-range SYMBOLS: cl-current-context cl-current-queue cl-current-device ; char*-array ( strings -- char*-array ) [ ascii encode dup length dup malloc [ cl-not-null ] - keep &free [ -rot memcpy ] keep ] void*-array{ } map-as ; inline + keep &free [ -rot memcpy ] keep ] void*-array{ } map-as ; : (program) ( cl-context sources -- program-handle ) [ handle>> ] dip [ @@ -354,19 +355,19 @@ M: cl-filter-linear filter-mode-constant drop CL_FILTER_LINEAR ; } case ; : kernel-info-string ( handle name -- string ) - [ clGetKernelInfo ] info-string ; inline + [ clGetKernelInfo ] info-string ; : kernel-info-uint ( handle name -- uint ) - [ clGetKernelInfo ] info-uint ; inline + [ clGetKernelInfo ] info-uint ; : kernel-work-group-info-size_t ( handle1 handle2 name -- size_t ) - [ clGetKernelWorkGroupInfo ] 2info-size_t ; inline + [ clGetKernelWorkGroupInfo ] 2info-size_t ; : event-info-uint ( handle name -- uint ) - [ clGetEventInfo ] info-uint ; inline + [ clGetEventInfo ] info-uint ; : event-info-int ( handle name -- int ) - [ clGetEventInfo ] info-int ; inline + [ clGetEventInfo ] info-int ; : cl_command_type>command-type ( cl_command-type -- command-type ) { @@ -399,8 +400,7 @@ M: cl-filter-linear filter-mode-constant drop CL_FILTER_LINEAR ; } case ; inline : profiling-info-ulong ( handle name -- ulong ) - [ clGetEventProfilingInfo ] info-ulong ; inline - + [ clGetEventProfilingInfo ] info-ulong ; : bind-kernel-arg-buffer ( kernel index buffer -- ) [ handle>> ] [ cl_mem heap-size ] [ handle>> ] tri* @@ -535,10 +535,10 @@ PRIVATE> cl-kernel new-disposable swap >>handle ; inline : cl-kernel-name ( kernel -- string ) - handle>> CL_KERNEL_FUNCTION_NAME kernel-info-string ; inline + handle>> CL_KERNEL_FUNCTION_NAME kernel-info-string ; : cl-kernel-arity ( kernel -- arity ) - handle>> CL_KERNEL_NUM_ARGS kernel-info-uint ; inline + handle>> CL_KERNEL_NUM_ARGS kernel-info-uint ; : cl-kernel-local-size ( kernel -- size ) (current-cl-device) [ handle>> ] bi@ CL_KERNEL_WORK_GROUP_SIZE kernel-work-group-info-size_t ; inline From 5615671560811f8a287364bc89545c16ef9c1d54 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 14 Apr 2010 02:32:54 -0700 Subject: [PATCH 124/157] benchmark.knucleotide: some cleanups --- .../benchmark/knucleotide/knucleotide.factor | 57 +++++++------------ 1 file changed, 19 insertions(+), 38 deletions(-) diff --git a/extra/benchmark/knucleotide/knucleotide.factor b/extra/benchmark/knucleotide/knucleotide.factor index 70fa1bb061..f03e26675e 100644 --- a/extra/benchmark/knucleotide/knucleotide.factor +++ b/extra/benchmark/knucleotide/knucleotide.factor @@ -1,16 +1,9 @@ -USING: kernel locals io io.files splitting strings io.encodings.ascii - hashtables sequences assocs math namespaces prettyprint - math.parser combinators arrays sorting unicode.case ; - +USING: ascii kernel io io.files splitting strings +io.encodings.ascii hashtables sequences assocs math +math.statistics namespaces prettyprint math.parser combinators +arrays sorting formatting grouping fry ; IN: benchmark.knucleotide -: float>string ( float places -- string ) - swap >float number>string - "." split1 rot - over length over < - [ CHAR: 0 pad-tail ] - [ head ] if "." glue ; - : discard-lines ( -- ) readln [ ">THREE" head? [ discard-lines ] unless ] when* ; @@ -20,37 +13,25 @@ IN: benchmark.knucleotide ">" read-until drop CHAR: \n swap remove >upper ; -: tally ( x exemplar -- b ) - clone [ [ inc-at ] curry each ] keep ; - -: small-groups ( x n -- b ) - swap - [ length swap - 1 + iota ] 2keep - [ [ over + ] dip subseq ] 2curry map ; - : handle-table ( inputs n -- ) - small-groups - [ length ] keep - H{ } tally >alist - sort-values reverse - [ - dup first write bl - second 100 * over / 3 float>string print - ] each - drop ; + clump + [ histogram >alist sort-values reverse ] [ length ] bi + '[ + [ first write bl ] + [ second 100 * _ /f "%.3f" printf nl ] bi + ] each ; -:: handle-n ( inputs x -- ) - inputs x length small-groups :> groups - groups H{ } tally :> b - x b at [ 0 ] unless* - number>string 8 CHAR: \s pad-tail write ; +: handle-n ( input x -- ) + [ nip ] [ length clump histogram ] 2bi at 0 or "%d\t" printf ; : process-input ( input -- ) - dup 1 handle-table nl - dup 2 handle-table nl - { "GGT" "GGTA" "GGTATT" "GGTATTTTAATT" "GGTATTTTAATTTATAGT" } - [ [ dupd handle-n ] keep print ] each - drop ; + [ 1 handle-table nl ] + [ 2 handle-table nl ] + [ + { "GGT" "GGTA" "GGTATT" "GGTATTTTAATT" "GGTATTTTAATTTATAGT" } + [ [ handle-n ] keep print ] with each + ] + tri ; : knucleotide ( -- ) "resource:extra/benchmark/knucleotide/knucleotide-input.txt" From e5c1a82643876f0b210d80a8b9b28b04db009075 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 14 Apr 2010 12:06:45 -0700 Subject: [PATCH 125/157] alien.syntax: FUNCTION-ALIAS: syntax to define a C function binding with a different Factor name --- basis/alien/parser/parser.factor | 14 ++++++++++---- basis/alien/syntax/syntax.factor | 6 +++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/basis/alien/parser/parser.factor b/basis/alien/parser/parser.factor index 7b677c3581..27c3024056 100755 --- a/basis/alien/parser/parser.factor +++ b/basis/alien/parser/parser.factor @@ -113,13 +113,19 @@ PRIVATE> : function-effect ( names return -- effect ) [ { } ] [ return-type-name 1array ] if-void ; -:: make-function ( return function library types names -- word quot effect ) - function create-in dup reset-generic +: create-function ( name -- word ) + create-in dup reset-generic ; + +:: (make-function) ( return function library types names -- quot effect ) return library function types function-quot names return function-effect ; -: (FUNCTION:) ( -- word quot effect ) - scan-function-name current-library get ";" scan-c-args make-function ; +:: make-function ( return function library types names -- word quot effect ) + function create-function + return function library types names (make-function) ; + +: (FUNCTION:) ( -- return function library types names ) + scan-function-name current-library get ";" scan-c-args ; : callback-quot ( return types abi -- quot ) '[ [ _ _ _ ] dip alien-callback ] ; diff --git a/basis/alien/syntax/syntax.factor b/basis/alien/syntax/syntax.factor index bc7e590cff..41aed99446 100755 --- a/basis/alien/syntax/syntax.factor +++ b/basis/alien/syntax/syntax.factor @@ -16,7 +16,11 @@ SYNTAX: BAD-ALIEN suffix! ; SYNTAX: LIBRARY: scan current-library set ; SYNTAX: FUNCTION: - (FUNCTION:) define-declared ; + (FUNCTION:) make-function define-declared ; + +SYNTAX: FUNCTION-ALIAS: + scan create-function + (FUNCTION:) (make-function) define-declared ; SYNTAX: CALLBACK: (CALLBACK:) define-inline ; From efbc3033da31acaf054fd2aee3e889b618c19368 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 14 Apr 2010 12:25:22 -0700 Subject: [PATCH 126/157] math.libm: use FUNCTION-ALIAS: --- basis/math/libm/libm-docs.factor | 26 +++++------ basis/math/libm/libm.factor | 80 ++++++++++++++++---------------- 2 files changed, 54 insertions(+), 52 deletions(-) diff --git a/basis/math/libm/libm-docs.factor b/basis/math/libm/libm-docs.factor index 9de6e7d127..7dc6313b86 100644 --- a/basis/math/libm/libm-docs.factor +++ b/basis/math/libm/libm-docs.factor @@ -36,53 +36,53 @@ ARTICLE: "math.libm" "C standard library math functions" ABOUT: "math.libm" HELP: facos -{ $values { "x" real } { "y" real } } +{ $values { "x" real } { "double" real } } { $description "Calls the inverse trigonometric cosine function from the C standard library. User code should call " { $link acos } " instead." } ; HELP: fasin -{ $values { "x" real } { "y" real } } +{ $values { "x" real } { "double" real } } { $description "Calls the inverse trigonometric sine function from the C standard library. User code should call " { $link asin } " instead." } ; HELP: fatan -{ $values { "x" real } { "y" real } } +{ $values { "x" real } { "double" real } } { $description "Calls the inverse trigonometric tangent function from the C standard library. User code should call " { $link atan } " instead." } ; HELP: fatan2 -{ $values { "x" real } { "y" real } { "z" real } } +{ $values { "x" real } { "y" real } { "double" real } } { $description "Calls the two-parameter inverse trigonometric tangent function from the C standard library. User code should call " { $link arg } " instead." } ; HELP: fcos -{ $values { "x" real } { "y" real } } +{ $values { "x" real } { "double" real } } { $description "Calls the trigonometric cosine function from the C standard library. User code should call " { $link cos } " instead." } ; HELP: fsin -{ $values { "x" real } { "y" real } } +{ $values { "x" real } { "double" real } } { $description "Calls the trigonometric sine function from the C standard library. User code should call " { $link sin } " instead." } ; HELP: fcosh -{ $values { "x" real } { "y" real } } +{ $values { "x" real } { "double" real } } { $description "Calls the hyperbolic cosine function from the C standard library. User code should call " { $link cosh } " instead." } ; HELP: fsinh -{ $values { "x" real } { "y" real } } +{ $values { "x" real } { "double" real } } { $description "Calls the hyperbolic sine function from the C standard library. User code should call " { $link sinh } " instead." } ; HELP: fexp -{ $values { "x" real } { "y" real } } +{ $values { "x" real } { "double" real } } { $description "Calls the exponential function (" { $snippet "y=e^x" } " from the C standard library. User code should call " { $link exp } " instead." } ; HELP: flog -{ $values { "x" real } { "y" real } } +{ $values { "x" real } { "double" real } } { $description "Calls the natural logarithm function from the C standard library. User code should call " { $link log } " instead." } ; HELP: flog10 -{ $values { "x" real } { "y" real } } +{ $values { "x" real } { "double" real } } { $description "Calls the base 10 logarithm function from the C standard library. User code should call " { $link log10 } " instead." } ; HELP: fpow -{ $values { "x" real } { "y" real } { "z" real } } +{ $values { "x" real } { "y" real } { "double" real } } { $description "Calls the power function (" { $snippet "z=x^y" } ") from the C standard library. User code should call " { $link ^ } " instead." } ; HELP: fsqrt -{ $values { "x" real } { "y" real } } +{ $values { "x" real } { "double" real } } { $description "Calls the square root function from the C standard library. User code should call " { $link sqrt } " instead." } ; diff --git a/basis/math/libm/libm.factor b/basis/math/libm/libm.factor index 0288894081..c87a2819ca 100644 --- a/basis/math/libm/libm.factor +++ b/basis/math/libm/libm.factor @@ -1,62 +1,64 @@ ! Copyright (C) 2006 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: alien alien.c-types ; +USING: alien alien.c-types alien.syntax ; IN: math.libm -: facos ( x -- y ) - double "libm" "acos" { double } alien-invoke ; +LIBRARY: libm -: fasin ( x -- y ) - double "libm" "asin" { double } alien-invoke ; +FUNCTION-ALIAS: facos + double acos ( double x ) ; -: fatan ( x -- y ) - double "libm" "atan" { double } alien-invoke ; +FUNCTION-ALIAS: fasin + double asin ( double x ) ; -: fatan2 ( x y -- z ) - double "libm" "atan2" { double double } alien-invoke ; +FUNCTION-ALIAS: fatan + double atan ( double x ) ; -: fcos ( x -- y ) - double "libm" "cos" { double } alien-invoke ; +FUNCTION-ALIAS: fatan2 + double atan2 ( double x, double y ) ; -: fsin ( x -- y ) - double "libm" "sin" { double } alien-invoke ; +FUNCTION-ALIAS: fcos + double cos ( double x ) ; -: ftan ( x -- y ) - double "libm" "tan" { double } alien-invoke ; +FUNCTION-ALIAS: fsin + double sin ( double x ) ; -: fcosh ( x -- y ) - double "libm" "cosh" { double } alien-invoke ; +FUNCTION-ALIAS: ftan + double tan ( double x ) ; -: fsinh ( x -- y ) - double "libm" "sinh" { double } alien-invoke ; +FUNCTION-ALIAS: fcosh + double cosh ( double x ) ; -: ftanh ( x -- y ) - double "libm" "tanh" { double } alien-invoke ; +FUNCTION-ALIAS: fsinh + double sinh ( double x ) ; -: fexp ( x -- y ) - double "libm" "exp" { double } alien-invoke ; +FUNCTION-ALIAS: ftanh + double tanh ( double x ) ; -: flog ( x -- y ) - double "libm" "log" { double } alien-invoke ; +FUNCTION-ALIAS: fexp + double exp ( double x ) ; -: flog10 ( x -- y ) - double "libm" "log10" { double } alien-invoke ; +FUNCTION-ALIAS: flog + double log ( double x ) ; -: fpow ( x y -- z ) - double "libm" "pow" { double double } alien-invoke ; +FUNCTION-ALIAS: flog10 + double log10 ( double x ) ; -: fsqrt ( x -- y ) - double "libm" "sqrt" { double } alien-invoke ; +FUNCTION-ALIAS: fpow + double pow ( double x, double y ) ; + +FUNCTION-ALIAS: fsqrt + double sqrt ( double x ) ; ! Windows doesn't have these... -: flog1+ ( x -- y ) - double "libm" "log1p" { double } alien-invoke ; +FUNCTION-ALIAS: flog1+ + double log1p ( double x ) ; -: facosh ( x -- y ) - double "libm" "acosh" { double } alien-invoke ; +FUNCTION-ALIAS: facosh + double acosh ( double x ) ; -: fasinh ( x -- y ) - double "libm" "asinh" { double } alien-invoke ; +FUNCTION-ALIAS: fasinh + double asinh ( double x ) ; -: fatanh ( x -- y ) - double "libm" "atanh" { double } alien-invoke ; +FUNCTION-ALIAS: fatanh + double atanh ( double x ) ; From d20bff5615c110c82a39306dd7e72d85a81e9f77 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 14 Apr 2010 12:40:10 -0700 Subject: [PATCH 127/157] prettyprint FUNCTION-ALIAS: definitions --- basis/alien/parser/parser.factor | 5 +++- basis/alien/prettyprint/prettyprint.factor | 32 ++++++++++++++++------ 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/basis/alien/parser/parser.factor b/basis/alien/parser/parser.factor index 27c3024056..1db4ca5cd8 100755 --- a/basis/alien/parser/parser.factor +++ b/basis/alien/parser/parser.factor @@ -142,12 +142,15 @@ PRIVATE> current-library get scan-function-name ";" scan-c-args make-callback-type ; -PREDICATE: alien-function-word < word +PREDICATE: alien-function-alias-word < word def>> { [ length 5 = ] [ last \ alien-invoke eq? ] } 1&& ; +PREDICATE: alien-function-word < alien-function-alias-word + [ def>> third ] [ name>> ] bi = ; + PREDICATE: alien-callback-type-word < typedef-word "callback-effect" word-prop ; diff --git a/basis/alien/prettyprint/prettyprint.factor b/basis/alien/prettyprint/prettyprint.factor index 52e9978a5f..c47dafbfce 100644 --- a/basis/alien/prettyprint/prettyprint.factor +++ b/basis/alien/prettyprint/prettyprint.factor @@ -61,22 +61,36 @@ M: typedef-word synopsis* : pprint-library ( library -- ) [ \ LIBRARY: [ text ] pprint-prefix ] when* ; +: pprint-function ( word quot -- ) + [ def>> first pprint-c-type ] + swap + [ + > fourth ] [ stack-effect in>> ] bi + pprint-function-args + ")" text block> + ] tri ; inline + +M: alien-function-alias-word definer + drop \ FUNCTION-ALIAS: \ ; ; +M: alien-function-alias-word definition drop f ; +M: alien-function-alias-word synopsis* + { + [ seeing-word ] + [ def>> second pprint-library ] + [ definer. ] + [ pprint-word ] + [ [ def>> third text ] pprint-function ] + } cleave ; + M: alien-function-word definer drop \ FUNCTION: \ ; ; -M: alien-function-word definition drop f ; M: alien-function-word synopsis* { [ seeing-word ] [ def>> second pprint-library ] [ definer. ] - [ def>> first pprint-c-type ] - [ pprint-word ] - [ - > fourth ] [ stack-effect in>> ] bi - pprint-function-args - ")" text block> - ] + [ [ pprint-word ] pprint-function ] } cleave ; M: alien-callback-type-word definer From f10ea3cbeaf95d6ab880745473c7b5d8480115e7 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 14 Apr 2010 13:08:45 -0700 Subject: [PATCH 128/157] libc: add DESTRUCTOR: for (free) --- basis/libc/libc.factor | 1 + 1 file changed, 1 insertion(+) diff --git a/basis/libc/libc.factor b/basis/libc/libc.factor index 4a887e695f..27d7555d67 100644 --- a/basis/libc/libc.factor +++ b/basis/libc/libc.factor @@ -99,3 +99,4 @@ PRIVATE> size_t "libc" "strlen" { c-string } alien-invoke ; DESTRUCTOR: free +DESTRUCTOR: (free) From dcf68af105827fd44d456fb4ff3c95381f751bcd Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 14 Apr 2010 13:16:04 -0700 Subject: [PATCH 129/157] new vocab alien.cxx.demangle.libstdcxx: name demangling for gnu abi --- .../cxx/demangle/libstdcxx/libstdcxx.factor | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 extra/alien/cxx/demangle/libstdcxx/libstdcxx.factor diff --git a/extra/alien/cxx/demangle/libstdcxx/libstdcxx.factor b/extra/alien/cxx/demangle/libstdcxx/libstdcxx.factor new file mode 100644 index 0000000000..55a25be09d --- /dev/null +++ b/extra/alien/cxx/demangle/libstdcxx/libstdcxx.factor @@ -0,0 +1,39 @@ +! (c)2010 Joe Groff bsd license +USING: alien alien.c-types alien.libraries alien.strings +alien.syntax combinators destructors io.encodings.ascii kernel +libc locals sequences system ; +IN: alien.cxx.demangle.libstdcxx + +<< +"libstdc++" { + { [ os macosx? ] [ "/usr/lib/libstdc++.6.0.9.dylib" ] } + { [ os unix? ] [ "/usr/lib/libstdc++.so" ] } +} cond cdecl add-library +>> + +LIBRARY: libstdc++ + +FUNCTION: char* __cxa_demangle ( char* mangled_name, char* output_buffer, size_t* length, int* status ) ; + +ERROR: demangle-memory-allocation-failure ; +ERROR: invalid-mangled-name name ; +ERROR: invalid-demangle-args name ; + +: demangle-error ( name status -- ) + { + { 0 [ drop ] } + { -1 [ drop demangle-memory-allocation-failure ] } + { -2 [ invalid-mangled-name ] } + { -3 [ invalid-demangle-args ] } + } case ; + +: mangled-name? ( name -- ? ) + "_Z" head? ; + +:: demangle ( mangled-name -- c++-name ) + 0 :> length + 0 :> status [ + mangled-name ascii string>alien f length status __cxa_demangle &(free) :> demangled-buf + mangled-name status *int demangle-error + demangled-buf ascii alien>string + ] with-destructors ; From 94c0382b9991823a97cdedd71dad757b4aa9f035 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 14 Apr 2010 13:38:41 -0700 Subject: [PATCH 130/157] macho: use with-mapped-file-reader in with-mapped-macho --- extra/macho/macho.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/macho/macho.factor b/extra/macho/macho.factor index b18ea57ce5..66e76825aa 100644 --- a/extra/macho/macho.factor +++ b/extra/macho/macho.factor @@ -915,7 +915,7 @@ TYPED: load-commands ( macho: mach_header_32/64 -- load-commands ) : with-mapped-macho ( path quot -- ) '[ address>> macho-header @ - ] with-mapped-file ; inline + ] with-mapped-file-reader ; inline : macho-nm ( path -- ) [| macho | From 3544568fe87f13c17bf233f03c0fdf05832cc119 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 14 Apr 2010 14:37:21 -0700 Subject: [PATCH 131/157] macho: add utility for getting exported symbols from a dylib --- extra/macho/macho.factor | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/extra/macho/macho.factor b/extra/macho/macho.factor index 66e76825aa..79cb59c148 100644 --- a/extra/macho/macho.factor +++ b/extra/macho/macho.factor @@ -1,9 +1,10 @@ ! Copyright (C) 2010 Erik Charlebois. ! See http:// factorcode.org/license.txt for BSD license. USING: accessors alien alien.c-types alien.strings alien.syntax -classes classes.struct combinators io.encodings.ascii -io.encodings.string kernel literals make math sequences -specialized-arrays typed fry io.mmap formatting locals ; +classes classes.struct combinators combinators.short-circuit +io.encodings.ascii io.encodings.string kernel literals make +math sequences specialized-arrays typed fry io.mmap formatting +locals splitting ; FROM: alien.c-types => short ; IN: macho @@ -912,6 +913,9 @@ TYPED: load-commands ( macho: mach_header_32/64 -- load-commands ) : symbol-name ( symbol string-table -- name ) [ n_strx>> ] dip ascii alien>string ; +: c-symbol-name ( symbol string-table -- name ) + symbol-name "_" ?head drop ; + : with-mapped-macho ( path quot -- ) '[ address>> macho-header @ @@ -930,3 +934,18 @@ TYPED: load-commands ( macho: mach_header_32/64 -- load-commands ) ] curry each ] each ] with-mapped-macho ; + +: dylib-export? ( symtab-entry -- ? ) + n_type>> { + [ N_EXT bitand zero? not ] + [ N_TYPE bitand N_UNDF = not ] + } 1&& ; + +: dylib-exports ( path -- symbol-names ) + [| macho | + macho load-commands symtab-commands [| symtab | + macho symtab symbols + [ [ dylib-export? ] filter ] + [ [ c-symbol-name ] curry { } map-as ] bi* + ] { } map-as concat + ] with-mapped-macho ; From b4867f4a1cd6cafd03fe1ae74bbcb807fcf27f42 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 14 Apr 2010 15:08:32 -0700 Subject: [PATCH 132/157] assocs: add effect declarations to assoc combinators --- core/assocs/assocs-docs.factor | 28 ++++++++++++++-------------- core/assocs/assocs.factor | 30 +++++++++++++++--------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/core/assocs/assocs-docs.factor b/core/assocs/assocs-docs.factor index 8f93c5a9d1..2439f03aac 100644 --- a/core/assocs/assocs-docs.factor +++ b/core/assocs/assocs-docs.factor @@ -202,7 +202,7 @@ HELP: new-assoc { $contract "Creates a new assoc of the same size as " { $snippet "exemplar" } " which can hold " { $snippet "capacity" } " entries before growing." } ; HELP: assoc-find -{ $values { "assoc" assoc } { "quot" { $quotation "( key value -- ? )" } } { "key" "the successful key, or f" } { "value" "the successful value, or f" } { "?" "a boolean" } } +{ $values { "assoc" assoc } { "quot" { $quotation "( ... key value -- ... ? )" } } { "key" "the successful key, or f" } { "value" "the successful value, or f" } { "?" "a boolean" } } { $description "Applies a predicate quotation to each entry in the assoc. Returns the key and value that the quotation succeeds on, or " { $link f } " for both if the quotation fails. It also returns a boolean describing whether there was anything found; this can be used to distinguish between a key and a value equal to " { $link f } ", or nothing being found." } ; HELP: clear-assoc @@ -242,7 +242,7 @@ HELP: ?at { $description "Looks up the value associated with a key. If the key was not present, an error can be thrown without extra stack shuffling. This word handles assocs that store " { $link f } "." } ; HELP: assoc-each -{ $values { "assoc" assoc } { "quot" { $quotation "( key value -- )" } } } +{ $values { "assoc" assoc } { "quot" { $quotation "( ... key value -- ... )" } } } { $description "Applies a quotation to each entry in the assoc." } { $examples { $example @@ -254,7 +254,7 @@ HELP: assoc-each } ; HELP: assoc-map -{ $values { "assoc" assoc } { "quot" { $quotation "( key value -- newkey newvalue )" } } { "newassoc" "a new assoc" } } +{ $values { "assoc" assoc } { "quot" { $quotation "( ... key value -- ... newkey newvalue )" } } { "newassoc" "a new assoc" } } { $description "Applies the quotation to each entry in the input assoc and collects the results in a new assoc of the same type as the input." } { $examples { $unchecked-example @@ -269,15 +269,15 @@ HELP: assoc-map { assoc-map assoc-map-as } related-words HELP: assoc-filter -{ $values { "assoc" assoc } { "quot" { $quotation "( key value -- ? )" } } { "subassoc" "a new assoc" } } +{ $values { "assoc" assoc } { "quot" { $quotation "( ... key value -- ... ? )" } } { "subassoc" "a new assoc" } } { $description "Outputs an assoc of the same type as " { $snippet "assoc" } " consisting of all entries for which the predicate quotation yields true." } ; HELP: assoc-filter-as -{ $values { "assoc" assoc } { "quot" { $quotation "( key value -- ? )" } } { "exemplar" assoc } { "subassoc" "a new assoc" } } +{ $values { "assoc" assoc } { "quot" { $quotation "( ... key value -- ... ? )" } } { "exemplar" assoc } { "subassoc" "a new assoc" } } { $description "Outputs an assoc of the same type as " { $snippet "exemplar" } " consisting of all entries for which the predicate quotation yields true." } ; HELP: assoc-filter! -{ $values { "assoc" assoc } { "quot" { $quotation "( key value -- ? )" } } } +{ $values { "assoc" assoc } { "quot" { $quotation "( ... key value -- ... ? )" } } } { $description "Removes all entries for which the predicate quotation yields true." } { $side-effects "assoc" } ; @@ -291,11 +291,11 @@ HELP: assoc-partition { $description "Calls a predicate quotation on each key of the input assoc. If the test yields true, the key/value pair is added to " { $snippet "true-assoc" } "; if false, it's added to " { $snippet "false-assoc" } "." } ; HELP: assoc-any? -{ $values { "assoc" assoc } { "quot" { $quotation "( key value -- ? )" } } { "?" "a boolean" } } +{ $values { "assoc" assoc } { "quot" { $quotation "( ... key value -- ... ? )" } } { "?" "a boolean" } } { $description "Tests if the assoc contains an entry satisfying a predicate by applying the quotation to each entry in turn. Iteration stops if an entry is found for which the quotation outputs a true value." } ; HELP: assoc-all? -{ $values { "assoc" assoc } { "quot" { $quotation "( key value -- ? )" } } { "?" "a boolean" } } +{ $values { "assoc" assoc } { "quot" { $quotation "( ... key value -- ... ? )" } } { "?" "a boolean" } } { $description "Tests if all entries in the assoc satisfy a predicate by applying the quotation to each entry in turn. a predicate quotation to entry in the assoc. Iteration stops if an entry is found for which the quotation outputs " { $link f } ". If the assoc is empty, always outputs " { $link t } "." } ; HELP: assoc-subset? @@ -378,25 +378,25 @@ HELP: substitute { $description "Creates a new sequence where elements of " { $snippet "seq" } " which appear as keys in " { $snippet "assoc" } " are replaced by the corresponding values, and all other elements are unchanged." } ; HELP: cache -{ $values { "key" "a key" } { "assoc" assoc } { "quot" { $quotation "( key -- value )" } } { "value" "a previously-retained or freshly-computed value" } } +{ $values { "key" "a key" } { "assoc" assoc } { "quot" { $quotation "( ... key -- ... value )" } } { "value" "a previously-retained or freshly-computed value" } } { $description "If the key is present in the assoc, outputs the associated value, otherwise calls the quotation to produce a value and stores the key/value pair into the assoc. Returns a value either looked up or newly stored in the assoc." } { $side-effects "assoc" } ; HELP: 2cache -{ $values { "key1" "a key" } { "key2" "a key" } { "assoc" assoc } { "quot" { $quotation "( key1 key2 -- value )" } } { "value" "a previously-retained or freshly-computed value" } } +{ $values { "key1" "a key" } { "key2" "a key" } { "assoc" assoc } { "quot" { $quotation "( ... key1 key2 -- ... value )" } } { "value" "a previously-retained or freshly-computed value" } } { $description "If a single key composed of the input keys is present in the assoc, outputs the associated value, otherwise calls the quotation to produce a value and stores the keys/value pair into the assoc. Returns the value stored in the assoc. Returns a value either looked up or newly stored in the assoc." } { $side-effects "assoc" } ; HELP: map>assoc -{ $values { "seq" "a sequence" } { "quot" { $quotation "( elt -- key value )" } } { "exemplar" assoc } { "assoc" "a new assoc" } } +{ $values { "seq" "a sequence" } { "quot" { $quotation "( ... elt -- ... key value )" } } { "exemplar" assoc } { "assoc" "a new assoc" } } { $description "Applies the quotation to each element of the sequence, and collects the keys and values into a new assoc having the same type as " { $snippet "exemplar" } "." } ; HELP: assoc>map -{ $values { "assoc" assoc } { "quot" { $quotation "( key value -- elt )" } } { "exemplar" "a sequence" } { "seq" "a new sequence" } } +{ $values { "assoc" assoc } { "quot" { $quotation "( ... key value -- ... elt )" } } { "exemplar" "a sequence" } { "seq" "a new sequence" } } { $description "Applies the quotation to each entry of the assoc and collects the results into a new sequence of the same type as the exemplar." } ; HELP: change-at -{ $values { "key" object } { "assoc" assoc } { "quot" { $quotation "( value -- newvalue )" } } } +{ $values { "key" object } { "assoc" assoc } { "quot" { $quotation "( ..a value -- ..b newvalue )" } } } { $description "Applies the quotation to the value associated with " { $snippet "key" } ", storing the new value back in the assoc." } { $side-effects "assoc" } ; @@ -432,7 +432,7 @@ HELP: assoc-combine HELP: assoc-map-as { $values - { "assoc" assoc } { "quot" { $quotation "( key value -- newkey newvalue )" } } { "exemplar" assoc } + { "assoc" assoc } { "quot" { $quotation "( ... key value -- ... newkey newvalue )" } } { "exemplar" assoc } { "newassoc" assoc } } { $description "Applies the quotation to each entry in the input assoc and collects the results in a new assoc of the stame type as the exemplar." } { $examples { $example "USING: prettyprint assocs hashtables math ;" " H{ { 1 2 } { 3 4 } } [ sq ] { } assoc-map-as ." "{ { 1 4 } { 3 16 } }" } } ; diff --git a/core/assocs/assocs.factor b/core/assocs/assocs.factor index b0509b27cb..58a2a29eb1 100644 --- a/core/assocs/assocs.factor +++ b/core/assocs/assocs.factor @@ -49,43 +49,43 @@ M: assoc assoc-like drop ; inline PRIVATE> -: assoc-find ( assoc quot -- key value ? ) +: assoc-find ( ... assoc quot: ( ... key value -- ... ? ) -- ... key value ? ) (assoc-each) find swap [ first2 t ] [ drop f f f ] if ; inline : key? ( key assoc -- ? ) at* nip ; inline -: assoc-each ( assoc quot -- ) +: assoc-each ( ... assoc quot: ( ... key value -- ... ) -- ... ) (assoc-each) each ; inline -: assoc>map ( assoc quot exemplar -- seq ) +: assoc>map ( ... assoc quot: ( ... key value -- ... elt ) exemplar -- ... seq ) [ collector-for [ assoc-each ] dip ] [ like ] bi ; inline -: assoc-map-as ( assoc quot exemplar -- newassoc ) +: assoc-map-as ( ... assoc quot: ( ... key value -- ... newkey newvalue ) exemplar -- ... newassoc ) [ [ 2array ] compose V{ } assoc>map ] dip assoc-like ; inline -: assoc-map ( assoc quot -- newassoc ) +: assoc-map ( ... assoc quot: ( ... key value -- ... newkey newvalue ) -- ... newassoc ) over assoc-map-as ; inline -: assoc-filter-as ( assoc quot exemplar -- subassoc ) +: assoc-filter-as ( ... assoc quot: ( ... key value -- ... ? ) exemplar -- ... subassoc ) [ (assoc-each) filter ] dip assoc-like ; inline -: assoc-filter ( assoc quot -- subassoc ) +: assoc-filter ( ... assoc quot: ( ... key value -- ... ? ) -- ... subassoc ) over assoc-filter-as ; inline -: assoc-filter! ( assoc quot -- assoc ) +: assoc-filter! ( ... assoc quot: ( ... key value -- ... ? ) -- ... assoc ) [ over [ [ [ drop ] 2bi ] dip [ delete-at ] 2curry unless ] 2curry assoc-each ] [ drop ] 2bi ; inline -: assoc-partition ( assoc quot -- true-assoc false-assoc ) +: assoc-partition ( ... assoc quot: ( ... key value -- ... ? ) -- ... true-assoc false-assoc ) [ (assoc-each) partition ] [ drop ] 2bi [ assoc-like ] curry bi@ ; inline -: assoc-any? ( assoc quot -- ? ) +: assoc-any? ( ... assoc quot: ( ... key value -- ... ? ) -- ... ? ) assoc-find 2nip ; inline -: assoc-all? ( assoc quot -- ? ) +: assoc-all? ( ... assoc quot: ( ... key value -- ... ? ) -- ... ? ) [ not ] compose assoc-any? not ; inline : at ( key assoc -- value/f ) @@ -150,23 +150,23 @@ M: assoc assoc-clone-like ( assoc exemplar -- newassoc ) : substitute ( seq assoc -- newseq ) substituter map ; -: cache ( key assoc quot -- value ) +: cache ( ... key assoc quot: ( ... key -- ... value ) -- ... value ) [ [ at* ] 2keep ] dip [ [ nip call dup ] [ drop ] 3bi set-at ] 3curry [ drop ] prepose unless ; inline -: 2cache ( key1 key2 assoc quot -- value ) +: 2cache ( ... key1 key2 assoc quot: ( ... key1 key2 -- ... value ) -- ... value ) [ 2array ] 2dip [ first2 ] prepose cache ; inline -: change-at ( key assoc quot -- ) +: change-at ( ..a key assoc quot: ( ..a value -- ..b newvalue ) -- ..b ) [ [ at ] dip call ] [ drop ] 3bi set-at ; inline : at+ ( n key assoc -- ) [ 0 or + ] change-at ; inline : inc-at ( key assoc -- ) [ 1 ] 2dip at+ ; inline -: map>assoc ( seq quot exemplar -- assoc ) +: map>assoc ( ... seq quot: ( ... elt -- ... key value ) exemplar -- ... assoc ) [ [ 2array ] compose { } map-as ] dip assoc-like ; inline : extract-keys ( seq assoc -- subassoc ) From 4f91d1fede363922af1361b01ec57b3f14e2c5ca Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 14 Apr 2010 15:11:59 -0700 Subject: [PATCH 133/157] alien.cxx.demangle.libstdcxx: better to use libstdc++ linked into VM --- extra/alien/cxx/demangle/libstdcxx/libstdcxx.factor | 9 --------- 1 file changed, 9 deletions(-) diff --git a/extra/alien/cxx/demangle/libstdcxx/libstdcxx.factor b/extra/alien/cxx/demangle/libstdcxx/libstdcxx.factor index 55a25be09d..403015bad5 100644 --- a/extra/alien/cxx/demangle/libstdcxx/libstdcxx.factor +++ b/extra/alien/cxx/demangle/libstdcxx/libstdcxx.factor @@ -4,15 +4,6 @@ alien.syntax combinators destructors io.encodings.ascii kernel libc locals sequences system ; IN: alien.cxx.demangle.libstdcxx -<< -"libstdc++" { - { [ os macosx? ] [ "/usr/lib/libstdc++.6.0.9.dylib" ] } - { [ os unix? ] [ "/usr/lib/libstdc++.so" ] } -} cond cdecl add-library ->> - -LIBRARY: libstdc++ - FUNCTION: char* __cxa_demangle ( char* mangled_name, char* output_buffer, size_t* length, int* status ) ; ERROR: demangle-memory-allocation-failure ; From 4f2fd501e4b77fc638deeb04f3d53cfcc26322c9 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 14 Apr 2010 15:41:40 -0700 Subject: [PATCH 134/157] source file for testing c++ stuff --- extra/alien/cxx/tests/test.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 extra/alien/cxx/tests/test.cpp diff --git a/extra/alien/cxx/tests/test.cpp b/extra/alien/cxx/tests/test.cpp new file mode 100644 index 0000000000..d4a69958b9 --- /dev/null +++ b/extra/alien/cxx/tests/test.cpp @@ -0,0 +1,31 @@ +namespace Namespace { + int namespaced(int x, int y) { return x + y; } +} + +double toplevel(double x, double y) { return x + y; } +double toplevel(double x, double y, double z) { return x + y + z; } + +class Class +{ + unsigned x; + + Class(); + Class(unsigned _x); + + unsigned member(unsigned y); + unsigned member(unsigned y) const; + + unsigned static_member(unsigned x, unsigned y); +}; + +Class::Class() : x(42) { } +Class::Class(unsigned _x) : x(_x) { } +unsigned Class::member(unsigned y) { return x += y; } +unsigned Class::member(unsigned y) const { return x + y; } +unsigned Class::static_member(unsigned x, unsigned y) { return Class(x).member(y); } + +template +T templated(T x, T y) { return x + y; } + +template int templated(int x, int y); +template double templated(double x, double y); From b7307c2dd6bc6ac164459ed7a0629a3c88fed4f4 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 14 Apr 2010 15:51:32 -0700 Subject: [PATCH 135/157] foundation for abi-generic demangling --- extra/alien/cxx/cxx.factor | 12 ++++++++++++ extra/alien/cxx/demangle/demangle.factor | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 extra/alien/cxx/cxx.factor create mode 100644 extra/alien/cxx/demangle/demangle.factor diff --git a/extra/alien/cxx/cxx.factor b/extra/alien/cxx/cxx.factor new file mode 100644 index 0000000000..7194c5d960 --- /dev/null +++ b/extra/alien/cxx/cxx.factor @@ -0,0 +1,12 @@ +! (c)2010 Joe Groff bsd license +USING: alien kernel ; +IN: alien.cxx + +SINGLETONS: g++ visual-c++ ; +UNION: c++-abi + g++ visual-c++ ; + +GENERIC: c++>c-abi ( c++-abi -- c-abi ) + +M: g++ c++>c-abi drop cdecl ; +M: visual-c++ c++>c-abi drop thiscall ; diff --git a/extra/alien/cxx/demangle/demangle.factor b/extra/alien/cxx/demangle/demangle.factor new file mode 100644 index 0000000000..08cf8343af --- /dev/null +++ b/extra/alien/cxx/demangle/demangle.factor @@ -0,0 +1,12 @@ +! (c)2010 Joe Groff bsd license +USING: alien.cxx kernel ; +QUALIFIED-WITH: alien.cxx.demangle.libstdcxx libstdcxx +IN: alien.cxx.demangle + +GENERIC: c++-symbol? ( mangled-name abi -- ? ) +GENERIC: demangle ( mangled-name abi -- c++-name ) + +M: g++ c++-symbol? + drop libstdcxx:mangled-name? ; +M: g++ demangle + drop libstdcxx:demangle ; From 0f028feb22078c15d684ae4bc5c5e199201cf050 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 14 Apr 2010 15:52:46 -0700 Subject: [PATCH 136/157] get symbols out of a dylib and map the C++ ones to their demangled names --- extra/alien/cxx/scaffold/scaffold.factor | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 extra/alien/cxx/scaffold/scaffold.factor diff --git a/extra/alien/cxx/scaffold/scaffold.factor b/extra/alien/cxx/scaffold/scaffold.factor new file mode 100644 index 0000000000..603d5d065f --- /dev/null +++ b/extra/alien/cxx/scaffold/scaffold.factor @@ -0,0 +1,15 @@ +! (c)2010 Joe Groff bsd license +USING: alien.cxx.demangle assocs combinators fry io.pathnames +kernel macho sequences ; +IN: alien.cxx.scaffold + +: library-symbols ( file -- symbols ) + dup file-extension { + { "dylib" [ dylib-exports ] } + { f [ dylib-exports ] } + } case ; + +: c++-library-symbols ( file abi -- symbols ) + [ library-symbols ] dip + [ '[ _ c++-symbol? ] filter ] + [ '[ dup _ demangle ] H{ } map>assoc ] bi ; From 5b470d8da90401db7c4ebec5d07f44faf1506fc3 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 14 Apr 2010 16:00:11 -0700 Subject: [PATCH 137/157] system-info.linux: use FUNCTION-ALIAS: --- basis/system-info/linux/linux.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basis/system-info/linux/linux.factor b/basis/system-info/linux/linux.factor index 1a565705fb..9c6f9fbff3 100644 --- a/basis/system-info/linux/linux.factor +++ b/basis/system-info/linux/linux.factor @@ -6,8 +6,8 @@ specialized-arrays ; SPECIALIZED-ARRAY: char IN: system-info.linux -: (uname) ( buf -- int ) - int f "uname" { c-string } alien-invoke ; +FUNCTION-ALIAS: (uname) + int uname ( c-string buf ) ; : uname ( -- seq ) 65536 [ (uname) io-error ] keep From 54015782f3972ea3478959d9169b27e66a223e7c Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 14 Apr 2010 16:14:33 -0700 Subject: [PATCH 138/157] document FUNCTION-ALIAS: --- basis/alien/syntax/syntax-docs.factor | 20 ++++++++++++++++---- core/alien/alien-docs.factor | 1 + 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/basis/alien/syntax/syntax-docs.factor b/basis/alien/syntax/syntax-docs.factor index df20926480..b71d0bd533 100644 --- a/basis/alien/syntax/syntax-docs.factor +++ b/basis/alien/syntax/syntax-docs.factor @@ -26,9 +26,9 @@ HELP: LIBRARY: { $notes "Logical library names are defined with the " { $link add-library } " word." } ; HELP: FUNCTION: -{ $syntax "FUNCTION: return name ( parameters )" } +{ $syntax "FUNCTION: return name ( parameters ) ;" } { $values { "return" "a C return type" } { "name" "a C function name" } { "parameters" "a comma-separated sequence of type/name pairs; " { $snippet "type1 arg1, type2 arg2, ..." } } } -{ $description "Defines a new word " { $snippet "name" } " which calls a C library function with the same name, in the logical library given by the most recent " { $link POSTPONE: LIBRARY: } " declaration." +{ $description "Defines a new word " { $snippet "name" } " which calls the C library function with the same " { $snippet "name" } " in the logical library given by the most recent " { $link POSTPONE: LIBRARY: } " declaration." $nl "The new word must be compiled before being executed." } { $examples @@ -45,11 +45,23 @@ $nl "The answer to the question is 42." } } "Using the " { $link c-string } " type instead of " { $snippet "char*" } " causes the FFI to automatically convert Factor strings to C strings. See " { $link "c-strings" } " for more information on using strings with the FFI." -{ $notes "Note that the parentheses and commas are only syntax sugar and can be omitted; they serve no purpose other than to make the declaration slightly easier to read:" +{ $notes "Note that the parentheses and commas are only syntax sugar and can be omitted; they serve no purpose other than to make the declaration easier to read. The following definitions are equivalent:" { $code "FUNCTION: void glHint ( GLenum target, GLenum mode ) ;" "FUNCTION: void glHint GLenum target GLenum mode ;" -} } ; +} +"To make a Factor word with a name different from the C function, use " { $link POSTPONE: FUNCTION-ALIAS: } "." } ; + +HELP: FUNCTION-ALIAS: +{ $syntax "FUNCTION-ALIAS: factor-name + return c_name ( parameters ) ;" } +{ $values { "factor-name" "a Factor word name" } { "return" "a C return type" } { "name" "a C function name" } { "parameters" "a comma-separated sequence of type/name pairs; " { $snippet "type1 arg1, type2 arg2, ..." } } } +{ $description "Defines a new word " { $snippet "factor-name" } " which calls the C library function named " { $snippet "c_name" } " in the logical library given by the most recent " { $link POSTPONE: LIBRARY: } " declaration." +$nl +"The new word must be compiled before being executed." } +{ $notes "Note that the parentheses and commas are only syntax sugar and can be omitted. They serve no purpose other than to make the declaration easier to read." } ; + +{ POSTPONE: FUNCTION: POSTPONE: FUNCTION-ALIAS: } related-words HELP: TYPEDEF: { $syntax "TYPEDEF: old new" } diff --git a/core/alien/alien-docs.factor b/core/alien/alien-docs.factor index 96eb9002be..178e8a6f71 100644 --- a/core/alien/alien-docs.factor +++ b/core/alien/alien-docs.factor @@ -213,6 +213,7 @@ ARTICLE: "alien-invoke" "Calling C from Factor" { $subsections POSTPONE: LIBRARY: POSTPONE: FUNCTION: + POSTPONE: FUNCTION-ALIAS: } "The above parsing words create word definitions which call a lower-level word; you can use it directly, too:" { $subsections alien-invoke } From bd4e920995e972e7496a59115c6bf25a822a8510 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 14 Apr 2010 17:19:26 -0700 Subject: [PATCH 139/157] compiler.tree.propagation: fix scalability issue with constraints --- .../compiler/tree/propagation/branches/branches.factor | 10 ++++++---- .../tree/propagation/constraints/constraints.factor | 7 +++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/basis/compiler/tree/propagation/branches/branches.factor b/basis/compiler/tree/propagation/branches/branches.factor index 28f34cb425..ef9e4e8f0b 100644 --- a/basis/compiler/tree/propagation/branches/branches.factor +++ b/basis/compiler/tree/propagation/branches/branches.factor @@ -1,8 +1,8 @@ -! Copyright (C) 2008, 2009 Slava Pestov. +! Copyright (C) 2008, 2010 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: fry kernel sequences assocs accessors namespaces +USING: fry kernel sequences assocs accessors math.intervals arrays classes.algebra combinators columns -stack-checker.branches locals math +stack-checker.branches locals math namespaces compiler.utilities compiler.tree compiler.tree.combinators @@ -10,6 +10,8 @@ compiler.tree.propagation.info compiler.tree.propagation.nodes compiler.tree.propagation.simple compiler.tree.propagation.constraints ; +FROM: sets => union ; +FROM: assocs => change-at ; IN: compiler.tree.propagation.branches ! For conditionals, an assoc of child node # --> constraint @@ -90,7 +92,7 @@ M: #phi propagate-before ( #phi -- ) bi ; :: update-constraints ( new old -- ) - new [| key value | key old [ value append ] change-at ] assoc-each ; + new [| key value | key old [ value union ] change-at ] assoc-each ; : include-child-constraints ( i -- ) infer-children-data get nth constraints swap at last diff --git a/basis/compiler/tree/propagation/constraints/constraints.factor b/basis/compiler/tree/propagation/constraints/constraints.factor index 617352d699..f9988ba220 100644 --- a/basis/compiler/tree/propagation/constraints/constraints.factor +++ b/basis/compiler/tree/propagation/constraints/constraints.factor @@ -1,4 +1,4 @@ -! Copyright (C) 2008 Slava Pestov. +! Copyright (C) 2008, 2010 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: arrays assocs math math.intervals kernel accessors sequences namespaces classes classes.algebra @@ -87,8 +87,11 @@ TUPLE: implication p q ; C: --> implication +: maybe-add ( elt seq -- seq' ) + 2dup member? [ nip ] [ swap suffix ] if ; + : assume-implication ( q p -- ) - [ constraints get [ assoc-stack swap suffix ] 2keep last set-at ] + [ constraints get [ assoc-stack maybe-add ] 2keep last set-at ] [ satisfied? [ assume ] [ drop ] if ] 2bi ; M: implication assume* From c392ff27188d89e72025840396836111296e6ee9 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Wed, 14 Apr 2010 21:09:16 -0500 Subject: [PATCH 140/157] Working on a CUDA api. Add a hello world program. --- extra/cuda/cuda.factor | 303 +++++++++++++++++++++++++++++++++++----- extra/cuda/ffi/tags.txt | 1 + extra/cuda/hello.cu | 65 +++++++++ extra/cuda/hello.ptx | 71 ++++++++++ 4 files changed, 404 insertions(+), 36 deletions(-) create mode 100644 extra/cuda/hello.cu create mode 100644 extra/cuda/hello.ptx diff --git a/extra/cuda/cuda.factor b/extra/cuda/cuda.factor index 887740d542..6b343fb1cc 100644 --- a/extra/cuda/cuda.factor +++ b/extra/cuda/cuda.factor @@ -1,17 +1,24 @@ ! Copyright (C) 2010 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.c-types alien.data assocs classes.struct -combinators continuations cuda.ffi fry io.backend kernel -sequences ; +USING: accessors alien alien.c-types alien.data alien.parser +alien.strings arrays assocs byte-arrays classes.struct +combinators continuations cuda.ffi destructors fry io +io.backend io.encodings.string io.encodings.utf8 kernel lexer +locals math math.parser namespaces opengl.gl.extensions +prettyprint quotations sequences ; IN: cuda +SYMBOL: cuda-device +SYMBOL: cuda-context +SYMBOL: cuda-module +SYMBOL: cuda-function +SYMBOL: cuda-launcher +SYMBOL: cuda-memory-hashtable + ERROR: throw-cuda-error n ; : cuda-error ( n -- ) - { - { CUDA_SUCCESS [ ] } - [ throw-cuda-error ] - } case ; + dup CUDA_SUCCESS = [ drop ] [ throw-cuda-error ] if ; : cuda-version ( -- n ) int [ cuDriverGetVersion cuda-error ] keep *int ; @@ -19,32 +26,10 @@ ERROR: throw-cuda-error n ; : init-cuda ( -- ) 0 cuInit cuda-error ; -: with-cuda ( quot -- ) - init-cuda [ ] [ ] cleanup ; inline - - [ cuDeviceGetCount cuda-error ] keep *int ; - -: n>cuda-device ( n -- device ) - [ CUdevice ] dip [ cuDeviceGet cuda-error ] 2keep drop *int ; - -: enumerate-cuda-devices ( -- devices ) - #cuda-devices iota [ n>cuda-device ] map ; - -: cuda-device>properties ( device -- properties ) - [ CUdevprop ] dip - [ cuDeviceGetProperties cuda-error ] 2keep drop - CUdevprop memory>struct ; - -: cuda-device-properties ( -- properties ) - enumerate-cuda-devices [ cuda-device>properties ] map ; - -PRIVATE> - -: cuda-devices ( -- assoc ) - enumerate-cuda-devices [ dup cuda-device>properties ] { } map>assoc ; +TUPLE: launcher +{ device integer initial: 0 } +{ device-flags initial: 0 } +path block-shape shared-size grid ; : with-cuda-context ( flags device quot -- ) [ @@ -65,13 +50,259 @@ PRIVATE> [ drop '[ _ cuModuleUnload cuda-error ] ] 2bi [ ] cleanup ; inline -: get-cuda-function ( module string -- function ) +: with-cuda-program ( flags device path quot -- ) + [ dup cuda-device set ] 2dip + '[ + cuda-context set + _ [ + cuda-module set + _ call + ] with-cuda-module + ] with-cuda-context ; inline + +: with-cuda ( launcher quot -- ) + [ + init-cuda + H{ } clone cuda-memory-hashtable + ] 2dip '[ + _ + [ cuda-launcher set ] + [ [ device>> ] [ device-flags>> ] [ path>> ] tri ] bi + _ with-cuda-program + ] with-variable ; inline + + [ cuDeviceGetCount cuda-error ] keep *int ; + +: n>cuda-device ( n -- device ) + [ CUdevice ] dip [ cuDeviceGet cuda-error ] 2keep drop *int ; + +: enumerate-cuda-devices ( -- devices ) + #cuda-devices iota [ n>cuda-device ] map ; + +: cuda-device-properties ( device -- properties ) + [ CUdevprop ] dip + [ cuDeviceGetProperties cuda-error ] 2keep drop + CUdevprop memory>struct ; + +PRIVATE> + +: cuda-devices ( -- assoc ) + enumerate-cuda-devices [ dup cuda-device-properties ] { } map>assoc ; + +: cuda-device-name ( n -- string ) + [ 256 [ ] keep ] dip + [ cuDeviceGetName cuda-error ] + [ 2drop utf8 alien>string ] 3bi ; + +: cuda-device-capability ( n -- pair ) + [ int int ] dip + [ cuDeviceComputeCapability cuda-error ] + [ drop [ *int ] bi@ ] 3bi 2array ; + +: cuda-device-memory ( n -- bytes ) + [ uint ] dip + [ cuDeviceTotalMem cuda-error ] + [ drop *uint ] 2bi ; + +: get-cuda-function* ( module string -- function ) [ CUfunction ] 2dip [ cuModuleGetFunction cuda-error ] 3keep 2drop *void* ; +: get-cuda-function ( string -- function ) + [ cuda-module get ] dip get-cuda-function* ; + +: with-cuda-function ( string quot -- ) + [ + get-cuda-function cuda-function set + ] dip call ; inline + +: launch-function* ( function -- ) cuLaunch cuda-error ; + +: launch-function ( -- ) cuda-function get cuLaunch cuda-error ; + +: launch-function-grid* ( function width height -- ) + cuLaunchGrid cuda-error ; + +: launch-function-grid ( width height -- ) + [ cuda-function get ] 2dip + cuLaunchGrid cuda-error ; + +TUPLE: cuda-memory < disposable ptr length ; + +: ( ptr length -- obj ) + cuda-memory new-disposable + swap >>length + swap >>ptr ; + +: add-cuda-memory ( obj -- obj ) + dup dup ptr>> cuda-memory-hashtable get set-at ; + +: delete-cuda-memory ( obj -- ) + cuda-memory-hashtable delete-at ; + +ERROR: invalid-cuda-memory ptr ; + +: cuda-memory-length ( cuda-memory -- n ) + ptr>> cuda-memory-hashtable get ?at [ + length>> + ] [ + invalid-cuda-memory + ] if ; + +M: cuda-memory byte-length length>> ; + : cuda-malloc ( n -- ptr ) [ CUdeviceptr ] dip - [ cuMemAlloc cuda-error ] 2keep drop *int ; + [ cuMemAlloc cuda-error ] 2keep + [ *int ] dip add-cuda-memory ; -: cuda-free ( ptr -- ) +: cuda-free* ( ptr -- ) cuMemFree cuda-error ; + +M: cuda-memory dispose ( ptr -- ) + ptr>> cuda-free* ; + +: host>device ( dest-ptr src-ptr -- ) + [ ptr>> ] dip dup length cuMemcpyHtoD cuda-error ; + +:: device>host ( ptr -- seq ) + ptr byte-length + [ ptr [ ptr>> ] [ byte-length ] bi cuMemcpyDtoH cuda-error ] keep ; + +: memcpy-device>device ( dest-ptr src-ptr count -- ) + cuMemcpyDtoD cuda-error ; + +: memcpy-device>array ( dest-array dest-index src-ptr count -- ) + cuMemcpyDtoA cuda-error ; + +: memcpy-array>device ( dest-ptr src-array src-index count -- ) + cuMemcpyAtoD cuda-error ; + +: memcpy-array>host ( dest-ptr src-array src-index count -- ) + cuMemcpyAtoH cuda-error ; + +: memcpy-host>array ( dest-array dest-index src-ptr count -- ) + cuMemcpyHtoA cuda-error ; + +: memcpy-array>array ( dest-array dest-index src-array src-ptr count -- ) + cuMemcpyAtoA cuda-error ; + +: cuda-int* ( function offset value -- ) + cuParamSeti cuda-error ; + +: cuda-int ( offset value -- ) + [ cuda-function get ] 2dip cuda-int* ; + +: cuda-float* ( function offset value -- ) + cuParamSetf cuda-error ; + +: cuda-float ( offset value -- ) + [ cuda-function get ] 2dip cuda-float* ; + +: cuda-vector* ( function offset ptr n -- ) + cuParamSetv cuda-error ; + +: cuda-vector ( offset ptr n -- ) + [ cuda-function get ] 3dip cuda-vector* ; + +: param-size* ( function n -- ) + cuParamSetSize cuda-error ; + +: param-size ( n -- ) + [ cuda-function get ] dip param-size* ; + +: malloc-device-string ( string -- n ) + utf8 encode + [ length cuda-malloc ] keep + [ host>device ] [ drop ] 2bi ; + +ERROR: bad-cuda-parameter parameter ; + +:: set-parameters ( seq -- ) + cuda-function get :> function + 0 :> offset! + seq [ + [ offset ] dip + { + { [ dup cuda-memory? ] [ ptr>> cuda-int ] } + { [ dup float? ] [ cuda-float ] } + { [ dup integer? ] [ cuda-int ] } + [ bad-cuda-parameter ] + } cond + offset 4 + offset! + ] each + offset param-size ; + +: cuda-device-attribute ( attribute dev -- n ) + [ int ] 2dip + [ cuDeviceGetAttribute cuda-error ] + [ 2drop *int ] 3bi ; + +: function-block-shape* ( function x y z -- ) + cuFuncSetBlockShape cuda-error ; + +: function-block-shape ( x y z -- ) + [ cuda-function get ] 3dip + cuFuncSetBlockShape cuda-error ; + +: function-shared-size* ( function n -- ) + cuFuncSetSharedSize cuda-error ; + +: function-shared-size ( n -- ) + [ cuda-function get ] dip + cuFuncSetSharedSize cuda-error ; + +: launch ( -- ) + cuda-launcher get { + [ block-shape>> first3 function-block-shape ] + [ shared-size>> function-shared-size ] + [ + grid>> [ + launch-function + ] [ + first2 launch-function-grid + ] if-empty + ] + } cleave ; + +: cuda-device. ( n -- ) + { + [ "Device: " write number>string print ] + [ "Name: " write cuda-device-name print ] + [ "Memory: " write cuda-device-memory number>string print ] + [ + "Capability: " write + cuda-device-capability [ number>string ] map " " join print + ] + [ "Properties: " write cuda-device-properties . ] + [ + "CU_DEVICE_ATTRIBUTE_GPU_OVERLAP: " write + CU_DEVICE_ATTRIBUTE_GPU_OVERLAP swap + cuda-device-attribute number>string print + ] + } cleave ; + +: cuda. ( -- ) + "CUDA Version: " write cuda-version number>string print nl + #cuda-devices iota [ nl ] [ cuda-device. ] interleave ; + + +: test-cuda0 ( -- ) + T{ launcher + { path "vocab:cuda/hello.ptx" } + { block-shape { 6 6 6 } } + { shared-size 2 } + { grid { 2 6 } } + } [ + "helloWorld" [ + "Hello World!" [ - ] map-index + malloc-device-string &dispose + + [ 1array set-parameters ] + [ drop launch ] + [ device>host utf8 alien>string . ] tri + ] with-cuda-function + ] with-cuda ; diff --git a/extra/cuda/ffi/tags.txt b/extra/cuda/ffi/tags.txt index 700f0dc9a5..f74dbeec64 100644 --- a/extra/cuda/ffi/tags.txt +++ b/extra/cuda/ffi/tags.txt @@ -1 +1,2 @@ not tested +bindings diff --git a/extra/cuda/hello.cu b/extra/cuda/hello.cu new file mode 100644 index 0000000000..1f3cd677f9 --- /dev/null +++ b/extra/cuda/hello.cu @@ -0,0 +1,65 @@ +/* + World using CUDA +** +** The string "Hello World!" is mangled then restored using a common CUDA idiom +** +** Byron Galbraith +** 2009-02-18 +*/ +#include +#include + +// Prototypes +extern "C" __global__ void helloWorld(char*); + +// Host function +int +main(int argc, char** argv) +{ + int i; + + // desired output + char str[] = "Hello World!"; + + // mangle contents of output + // the null character is left intact for simplicity + for(i = 0; i < 12; i++) + str[i] -= i; + + // allocate memory on the device + char *d_str; + size_t size = sizeof(str); + cudaMalloc((void**)&d_str, size); + + // copy the string to the device + cudaMemcpy(d_str, str, size, cudaMemcpyHostToDevice); + + // set the grid and block sizes + dim3 dimGrid(2); // one block per word + dim3 dimBlock(6); // one thread per character + + // invoke the kernel + helloWorld<<< dimGrid, dimBlock >>>(d_str); + + // retrieve the results from the device + cudaMemcpy(str, d_str, size, cudaMemcpyDeviceToHost); + + // free up the allocated memory on the device + cudaFree(d_str); + + // everyone's favorite part + printf("%s\n", str); + + return 0; +} + +// Device kernel +__global__ void +helloWorld(char* str) +{ + // determine where in the thread grid we are + int idx = blockIdx.x * blockDim.x + threadIdx.x; + + // unmangle output + str[idx] += idx; +} diff --git a/extra/cuda/hello.ptx b/extra/cuda/hello.ptx new file mode 100644 index 0000000000..049bb5e9a5 --- /dev/null +++ b/extra/cuda/hello.ptx @@ -0,0 +1,71 @@ + .version 1.4 + .target sm_10, map_f64_to_f32 + // compiled with /usr/local/cuda/bin/../open64/lib//be + // nvopencc 3.0 built on 2010-03-11 + + //----------------------------------------------------------- + // Compiling /tmp/tmpxft_00000eab_00000000-7_hello.cpp3.i (/var/folders/KD/KDnx4D80Eh0fsORqNrFWBE+++TI/-Tmp-/ccBI#.AYqbdQ) + //----------------------------------------------------------- + + //----------------------------------------------------------- + // Options: + //----------------------------------------------------------- + // Target:ptx, ISA:sm_10, Endian:little, Pointer Size:32 + // -O3 (Optimization level) + // -g0 (Debug level) + // -m2 (Report advisories) + //----------------------------------------------------------- + + .file 1 "" + .file 2 "/tmp/tmpxft_00000eab_00000000-6_hello.cudafe2.gpu" + .file 3 "/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/stddef.h" + .file 4 "/usr/local/cuda/bin/../include/crt/device_runtime.h" + .file 5 "/usr/local/cuda/bin/../include/host_defines.h" + .file 6 "/usr/local/cuda/bin/../include/builtin_types.h" + .file 7 "/usr/local/cuda/bin/../include/device_types.h" + .file 8 "/usr/local/cuda/bin/../include/driver_types.h" + .file 9 "/usr/local/cuda/bin/../include/texture_types.h" + .file 10 "/usr/local/cuda/bin/../include/vector_types.h" + .file 11 "/usr/local/cuda/bin/../include/device_launch_parameters.h" + .file 12 "/usr/local/cuda/bin/../include/crt/storage_class.h" + .file 13 "/usr/include/i386/_types.h" + .file 14 "/usr/include/time.h" + .file 15 "/usr/local/cuda/bin/../include/texture_fetch_functions.h" + .file 16 "/usr/local/cuda/bin/../include/common_functions.h" + .file 17 "/usr/local/cuda/bin/../include/crt/func_macro.h" + .file 18 "/usr/local/cuda/bin/../include/math_functions.h" + .file 19 "/usr/local/cuda/bin/../include/device_functions.h" + .file 20 "/usr/local/cuda/bin/../include/math_constants.h" + .file 21 "/usr/local/cuda/bin/../include/sm_11_atomic_functions.h" + .file 22 "/usr/local/cuda/bin/../include/sm_12_atomic_functions.h" + .file 23 "/usr/local/cuda/bin/../include/sm_13_double_functions.h" + .file 24 "/usr/local/cuda/bin/../include/common_types.h" + .file 25 "/usr/local/cuda/bin/../include/sm_20_atomic_functions.h" + .file 26 "/usr/local/cuda/bin/../include/sm_20_intrinsics.h" + .file 27 "/usr/local/cuda/bin/../include/math_functions_dbl_ptx1.h" + .file 28 "hello.cu" + + + .entry helloWorld ( + .param .u32 __cudaparm_helloWorld_str) + { + .reg .u16 %rh<4>; + .reg .u32 %r<9>; + .loc 28 58 0 +$LBB1_helloWorld: + .loc 28 64 0 + mov.u16 %rh1, %ctaid.x; + mov.u16 %rh2, %ntid.x; + mul.wide.u16 %r1, %rh1, %rh2; + cvt.u32.u16 %r2, %tid.x; + add.u32 %r3, %r2, %r1; + ld.param.u32 %r4, [__cudaparm_helloWorld_str]; + add.u32 %r5, %r4, %r3; + ld.global.s8 %r6, [%r5+0]; + add.s32 %r7, %r6, %r3; + st.global.s8 [%r5+0], %r7; + .loc 28 65 0 + exit; +$LDWend_helloWorld: + } // helloWorld + From c595c4a151f3859543dbf0ad7e3a88aebcf1230b Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 14 Apr 2010 21:34:32 -0700 Subject: [PATCH 141/157] x11.syntax: update X-FUNCTION: for FUNCTION: refactoring --- basis/x11/syntax/syntax.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basis/x11/syntax/syntax.factor b/basis/x11/syntax/syntax.factor index db2adab5dc..5e368f79cb 100644 --- a/basis/x11/syntax/syntax.factor +++ b/basis/x11/syntax/syntax.factor @@ -4,6 +4,6 @@ USING: alien.syntax alien.parser words x11.io sequences kernel ; IN: x11.syntax SYNTAX: X-FUNCTION: - (FUNCTION:) + (FUNCTION:) make-function [ \ awaken-event-loop suffix ] dip - define-declared ; \ No newline at end of file + define-declared ; From 37784cd35630119fb818f8e5fc0023ea28fc962f Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 14 Apr 2010 21:40:29 -0700 Subject: [PATCH 142/157] rearrange stuff in alien.arrays and alien.data to eliminate libc dependency from alien.arrays, and by extension, alien.syntax --- basis/alien/arrays/arrays.factor | 11 +++-------- basis/alien/data/data.factor | 8 +++++++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/basis/alien/arrays/arrays.factor b/basis/alien/arrays/arrays.factor index ce6eb85245..e112a38d25 100644 --- a/basis/alien/arrays/arrays.factor +++ b/basis/alien/arrays/arrays.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2008, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: alien alien.strings alien.c-types alien.data alien.accessors +USING: alien alien.strings alien.c-types alien.accessors arrays words sequences math kernel namespaces fry cpu.architecture -io.encodings.binary io.encodings.utf8 accessors ; +io.encodings.binary io.encodings.utf8 accessors compiler.units ; IN: alien.arrays INSTANCE: array value-type @@ -34,11 +34,6 @@ M: array box-return drop void* box-return ; M: array stack-size drop void* stack-size ; -M: array c-type-boxer-quot - unclip [ array-length ] dip [ ] 2curry ; - -M: array c-type-unboxer-quot drop [ >c-ptr ] ; - PREDICATE: string-type < pair first2 [ c-string = ] [ word? ] bi* and ; @@ -100,5 +95,5 @@ M: string-type c-type-getter M: string-type c-type-setter drop [ set-alien-cell ] ; -{ c-string utf8 } c-string typedef +[ { c-string utf8 } c-string typedef ] with-compilation-unit diff --git a/basis/alien/data/data.factor b/basis/alien/data/data.factor index 2d572e9f13..a0450d5122 100644 --- a/basis/alien/data/data.factor +++ b/basis/alien/data/data.factor @@ -1,5 +1,5 @@ ! (c)2009, 2010 Slava Pestov, Joe Groff bsd license -USING: accessors alien alien.c-types alien.strings arrays +USING: accessors alien alien.c-types alien.arrays alien.strings arrays byte-arrays cpu.architecture fry io io.encodings.binary io.files io.streams.memory kernel libc math sequences words byte-vectors ; @@ -78,3 +78,9 @@ M: value-type c-type-getter M: value-type c-type-setter ( type -- quot ) [ c-type-getter ] [ c-type-unboxer-quot ] [ heap-size ] tri '[ @ swap @ _ memcpy ] ; + +M: array c-type-boxer-quot + unclip [ array-length ] dip [ ] 2curry ; + +M: array c-type-unboxer-quot drop [ >c-ptr ] ; + From 1c99d0cae017fbda0d424f71309e3d53329599fb Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 14 Apr 2010 21:50:30 -0700 Subject: [PATCH 143/157] update libc to use FUNCTION: and FUNCTION-ALIAS: --- basis/libc/libc.factor | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/basis/libc/libc.factor b/basis/libc/libc.factor index 27d7555d67..5495ec2705 100644 --- a/basis/libc/libc.factor +++ b/basis/libc/libc.factor @@ -2,15 +2,18 @@ ! Copyright (C) 2007, 2010 Slava Pestov ! Copyright (C) 2007, 2008 Doug Coleman ! See http://factorcode.org/license.txt for BSD license. -USING: alien alien.c-types assocs continuations alien.destructors kernel -namespaces accessors sets summary destructors destructors.private ; +USING: alien alien.c-types alien.syntax assocs continuations +alien.destructors kernel namespaces accessors sets summary +destructors destructors.private ; IN: libc -: errno ( -- int ) - int "factor" "err_no" { } alien-invoke ; +LIBRARY: factor -: set-errno ( int -- ) - void "factor" "set_err_no" { int } alien-invoke ; +FUNCTION-ALIAS: errno + int err_no ( ) ; + +FUNCTION-ALIAS: set-errno + void set_err_no ( int err-no ) ; : clear-errno ( -- ) 0 set-errno ; @@ -18,17 +21,19 @@ IN: libc : preserve-errno ( quot -- ) errno [ call ] dip set-errno ; inline -: (malloc) ( size -- alien ) - void* "libc" "malloc" { ulong } alien-invoke ; +LIBRARY: libc -: (calloc) ( count size -- alien ) - void* "libc" "calloc" { ulong ulong } alien-invoke ; +FUNCTION-ALIAS: (malloc) + void* malloc ( ulong size ) ; -: (free) ( alien -- ) - void "libc" "free" { void* } alien-invoke ; +FUNCTION-ALIAS: (calloc) + void* calloc ( ulong count, ulong size ) ; -: (realloc) ( alien size -- newalien ) - void* "libc" "realloc" { void* ulong } alien-invoke ; +FUNCTION-ALIAS: (free) + void free ( void* alien ) ; + +FUNCTION-ALIAS: (realloc) + void* realloc ( void* alien, ulong size ) ; : free ( alien -- ) >c-ptr [ delete-malloc ] [ (free) ] bi ; -: memcpy ( dst src size -- ) - void "libc" "memcpy" { void* void* ulong } alien-invoke ; +FUNCTION: void memcpy ( void* dst, void* src, ulong size ) ; -: memcmp ( a b size -- cmp ) - int "libc" "memcmp" { void* void* ulong } alien-invoke ; +FUNCTION: int memcmp ( void* a, void* b, ulong size ) ; : memory= ( a b size -- ? ) memcmp 0 = ; -: strlen ( alien -- len ) - size_t "libc" "strlen" { c-string } alien-invoke ; +FUNCTION: size_t strlen ( c-string alien ) ; DESTRUCTOR: free DESTRUCTOR: (free) From f40b313be5724d687431d164646d2d8585ab5a5a Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 14 Apr 2010 19:00:37 -0700 Subject: [PATCH 144/157] sequences: 'accumulate' now outputs a sequence of the same type as its input --- core/sequences/sequences-docs.factor | 2 +- core/sequences/sequences-tests.factor | 3 +++ core/sequences/sequences.factor | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/core/sequences/sequences-docs.factor b/core/sequences/sequences-docs.factor index 8d6ddf1be9..f7f774ad86 100644 --- a/core/sequences/sequences-docs.factor +++ b/core/sequences/sequences-docs.factor @@ -286,7 +286,7 @@ $nl HELP: accumulate { $values { "seq" sequence } { "identity" object } { "quot" { $quotation "( ... prev elt -- ... next )" } } { "final" "the final result" } { "newseq" "a new array" } } -{ $description "Combines successive elements of the sequence using a binary operation, and outputs an array of intermediate results, together with the final result." +{ $description "Combines successive elements of the sequence using a binary operation, and outputs a sequence of intermediate results, together with the final result." $nl "The first element of the new sequence is " { $snippet "identity" } ". Then, on the first iteration, the two inputs to the quotation are " { $snippet "identity" } ", and the first element of the old sequence. On successive iterations, the first input is the result of the previous iteration, and the second input is the corresponding element of the old sequence." $nl diff --git a/core/sequences/sequences-tests.factor b/core/sequences/sequences-tests.factor index 665e7a7ada..175ab252e1 100644 --- a/core/sequences/sequences-tests.factor +++ b/core/sequences/sequences-tests.factor @@ -24,6 +24,9 @@ IN: sequences.tests [ 5040 { 1 1 2 6 24 120 720 } ] [ { 1 2 3 4 5 6 7 } 1 [ * ] accumulate ] unit-test +[ 64 B{ 1 2 4 16 } ] +[ B{ 2 2 4 4 } 1 [ * ] accumulate ] unit-test + [ 5040 { 1 1 2 6 24 120 720 } ] [ { 1 2 3 4 5 6 7 } 1 [ * ] accumulate! ] unit-test diff --git a/core/sequences/sequences.factor b/core/sequences/sequences.factor index 02c5d0ac72..d9c234e717 100644 --- a/core/sequences/sequences.factor +++ b/core/sequences/sequences.factor @@ -436,7 +436,7 @@ PRIVATE> [ (accumulate) ] dip map-as ; inline : accumulate ( ... seq identity quot: ( ... prev elt -- ... next ) -- ... final newseq ) - { } accumulate-as ; inline + pick accumulate-as ; inline : accumulate! ( ... seq identity quot: ( ... prev elt -- ... next ) -- ... final seq ) (accumulate) map! ; inline From b87171ff0000bb2183ba62a89ebf9ee37ec646a0 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 14 Apr 2010 21:49:41 -0700 Subject: [PATCH 145/157] benchmark.fasta: make it about 2x faster --- extra/benchmark/fasta/fasta.factor | 39 ++++++++++++++---------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/extra/benchmark/fasta/fasta.factor b/extra/benchmark/fasta/fasta.factor index bd7ccafb9f..226287974f 100644 --- a/extra/benchmark/fasta/fasta.factor +++ b/extra/benchmark/fasta/fasta.factor @@ -1,8 +1,9 @@ ! Based on http://shootout.alioth.debian.org/gp4/benchmark.php?test=fasta&lang=java&id=2 -USING: alien.c-types math kernel io io.files locals multiline -assocs sequences sequences.private benchmark.reverse-complement -hints io.encodings.ascii byte-arrays specialized-arrays ; -SPECIALIZED-ARRAY: double +USING: assocs benchmark.reverse-complement byte-arrays fry io +io.encodings.ascii io.files locals kernel math sequences +sequences.private specialized-arrays strings typed ; +QUALIFIED-WITH: alien.c-types c +SPECIALIZED-ARRAY: c:double IN: benchmark.fasta CONSTANT: IM 139968 @@ -11,10 +12,8 @@ CONSTANT: IC 29573 CONSTANT: initial-seed 42 CONSTANT: line-length 60 -: random ( seed -- n seed ) - >float IA * IC + IM mod [ IM /f ] keep ; inline - -HINTS: random fixnum ; +: random ( seed -- seed n ) + >float IA * IC + IM mod dup IM /f ; inline CONSTANT: ALU "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA" @@ -46,34 +45,32 @@ CONSTANT: homo-sapiens { CHAR: t 0.3015094502008 } } -: make-cumulative ( freq -- chars floats ) +TYPED: make-cumulative ( freq -- chars: byte-array floats: double-array ) [ keys >byte-array ] - [ values >double-array ] bi unclip [ + ] accumulate swap suffix ; + [ values >double-array unclip [ + ] accumulate swap suffix ] bi ; :: select-random ( seed chars floats -- seed elt ) - floats seed random -rot - [ >= ] curry find drop - chars nth-unsafe ; inline + seed random floats [ <= ] with find drop chars nth-unsafe ; inline -: make-random-fasta ( seed len chars floats -- seed ) - [ iota ] 2dip [ [ drop ] 2dip select-random ] 2curry "" map-as print ; inline +TYPED: make-random-fasta ( seed: fixnum len: fixnum chars: byte-array floats: double-array -- seed: fixnum ) + '[ _ _ select-random ] "" replicate-as print ; : write-description ( desc id -- ) - ">" write write bl print ; inline + ">" write write bl print ; :: split-lines ( n quot -- ) n line-length /mod [ [ line-length quot call ] times ] dip quot unless-zero ; inline -: write-random-fasta ( seed n chars floats desc id -- seed ) +TYPED: write-random-fasta ( seed: fixnum n: fixnum chars: byte-array floats: double-array desc id -- seed: fixnum ) write-description - [ make-random-fasta ] 2curry split-lines ; inline + '[ _ _ make-random-fasta ] split-lines ; -:: make-repeat-fasta ( k len alu -- k' ) +TYPED:: make-repeat-fasta ( k: fixnum len: fixnum alu: string -- k': fixnum ) alu length :> kn len iota [ k + kn mod alu nth-unsafe ] "" map-as print - k len + ; inline + k len + ; : write-repeat-fasta ( n alu desc id -- ) write-description @@ -81,7 +78,7 @@ CONSTANT: homo-sapiens :> alu 0 :> k! [| len | k len alu make-repeat-fasta k! ] split-lines - ] ; inline + ] ; : fasta ( n out -- ) homo-sapiens make-cumulative From 008ec8f40f71973dd7297262100070e5a1b4ca2b Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 14 Apr 2010 21:50:00 -0700 Subject: [PATCH 146/157] benchmark.knucleotide: small performance improvement from using virtual sequences --- extra/benchmark/knucleotide/knucleotide.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extra/benchmark/knucleotide/knucleotide.factor b/extra/benchmark/knucleotide/knucleotide.factor index f03e26675e..4e4ec72271 100644 --- a/extra/benchmark/knucleotide/knucleotide.factor +++ b/extra/benchmark/knucleotide/knucleotide.factor @@ -14,7 +14,7 @@ IN: benchmark.knucleotide CHAR: \n swap remove >upper ; : handle-table ( inputs n -- ) - clump + [ histogram >alist sort-values reverse ] [ length ] bi '[ [ first write bl ] @@ -22,7 +22,7 @@ IN: benchmark.knucleotide ] each ; : handle-n ( input x -- ) - [ nip ] [ length clump histogram ] 2bi at 0 or "%d\t" printf ; + [ nip ] [ length histogram ] 2bi at 0 or "%d\t" printf ; : process-input ( input -- ) [ 1 handle-table nl ] From 829b7c89041c4f79fb42846e6941eb7c21726399 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 14 Apr 2010 21:50:17 -0700 Subject: [PATCH 147/157] benchmark.spectral-norm: use unsafe sequence ops again, use TYPED: instead of HINTS: --- extra/benchmark/spectral-norm/spectral-norm.factor | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/extra/benchmark/spectral-norm/spectral-norm.factor b/extra/benchmark/spectral-norm/spectral-norm.factor index 386ffb0ae1..93fb8cb562 100644 --- a/extra/benchmark/spectral-norm/spectral-norm.factor +++ b/extra/benchmark/spectral-norm/spectral-norm.factor @@ -1,8 +1,8 @@ ! Factor port of ! http://shootout.alioth.debian.org/gp4/benchmark.php?test=spectralnorm&lang=all USING: alien.c-types specialized-arrays kernel math -math.functions math.vectors sequences prettyprint words hints -locals ; +math.functions math.vectors sequences sequences.private +prettyprint words typed locals ; SPECIALIZED-ARRAY: double IN: benchmark.spectral-norm @@ -19,13 +19,13 @@ IN: benchmark.spectral-norm + 1 + recip ; inline : (eval-A-times-u) ( u i j -- x ) - [ swap nth ] [ eval-A ] bi-curry bi* * ; inline + [ swap nth-unsafe ] [ eval-A ] bi-curry bi* * ; inline : eval-A-times-u ( n u -- seq ) [ (eval-A-times-u) ] inner-loop ; inline : (eval-At-times-u) ( u i j -- x ) - [ swap nth ] [ swap eval-A ] bi-curry bi* * ; inline + [ swap nth-unsafe ] [ swap eval-A ] bi-curry bi* * ; inline : eval-At-times-u ( u n -- seq ) [ (eval-At-times-u) ] inner-loop ; inline @@ -43,11 +43,9 @@ IN: benchmark.spectral-norm [ n eval-AtA-times-u ] keep ] times ; inline -: spectral-norm ( n -- norm ) +TYPED: spectral-norm ( n: fixnum -- norm ) u/v [ v. ] [ norm-sq ] bi /f sqrt ; -HINTS: spectral-norm fixnum ; - : spectral-norm-main ( -- ) 2000 spectral-norm . ; From 06d91b239f0e450c59f2ea870838285cf536e6a5 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 14 Apr 2010 21:50:23 -0700 Subject: [PATCH 148/157] elf.nm: fix load error --- extra/elf/nm/nm-docs.factor | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extra/elf/nm/nm-docs.factor b/extra/elf/nm/nm-docs.factor index a7b7ad426e..31ca3debf4 100644 --- a/extra/elf/nm/nm-docs.factor +++ b/extra/elf/nm/nm-docs.factor @@ -3,7 +3,7 @@ USING: elf help.markup help.syntax ; IN: elf.nm -HELP: nm +HELP: elf-nm { $values { "path" "a pathname string" } } @@ -17,6 +17,7 @@ HELP: print-symbol ARTICLE: "elf.nm" "ELF nm" "The " { $vocab-link "elf.nm" } " vocab prints the values, sections and names of the symbols in a given ELF file. In an ELF executable or shared library, the symbol values are typically their virtual addresses. In a relocatable ELF object, they are section-relative offsets." +{ $subsections elf-nm } ; ABOUT: "elf.nm" From 343856307e98cece7a8a4289d0185fb0345be8b8 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 14 Apr 2010 21:58:52 -0700 Subject: [PATCH 149/157] db.sqlite.ffi: use FUNCTION-ALIAS: --- basis/db/sqlite/ffi/ffi.factor | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/basis/db/sqlite/ffi/ffi.factor b/basis/db/sqlite/ffi/ffi.factor index d9da317c89..c06581e1a2 100644 --- a/basis/db/sqlite/ffi/ffi.factor +++ b/basis/db/sqlite/ffi/ffi.factor @@ -119,9 +119,8 @@ FUNCTION: int sqlite3_bind_double ( sqlite3_stmt* pStmt, int index, double x ) ; FUNCTION: int sqlite3_bind_int ( sqlite3_stmt* pStmt, int index, int n ) ; FUNCTION: int sqlite3_bind_int64 ( sqlite3_stmt* pStmt, int index, sqlite3_int64 n ) ; ! Bind the same function as above, but for unsigned 64bit integers -: sqlite3-bind-uint64 ( pStmt index in64 -- int ) - int "sqlite" "sqlite3_bind_int64" - { pointer: sqlite3_stmt int sqlite3_uint64 } alien-invoke ; +FUNCTION-ALIAS: sqlite3-bind-uint64 ( pStmt index in64 -- int ) + int sqlite3_bind_int64 ( sqlite3_stmt* pStmt, int index, sqlite3_uint64 in64 ) ; FUNCTION: int sqlite3_bind_null ( sqlite3_stmt* pStmt, int n ) ; FUNCTION: int sqlite3_bind_text ( sqlite3_stmt* pStmt, int index, c-string text, int len, int destructor ) ; FUNCTION: int sqlite3_bind_parameter_index ( sqlite3_stmt* pStmt, c-string name ) ; @@ -133,9 +132,8 @@ FUNCTION: c-string sqlite3_column_decltype ( sqlite3_stmt* pStmt, int col ) ; FUNCTION: int sqlite3_column_int ( sqlite3_stmt* pStmt, int col ) ; FUNCTION: sqlite3_int64 sqlite3_column_int64 ( sqlite3_stmt* pStmt, int col ) ; ! Bind the same function as above, but for unsigned 64bit integers -: sqlite3-column-uint64 ( pStmt col -- uint64 ) - sqlite3_uint64 "sqlite" "sqlite3_column_int64" - { pointer: sqlite3_stmt int } alien-invoke ; +FUNCTION-ALIAS: sqlite3-column-uint64 ( pStmt col -- uint64 ) + sqlite3_uint64 sqlite3_column_int64 ( sqlite3_stmt* pStmt, int col ) ; FUNCTION: double sqlite3_column_double ( sqlite3_stmt* pStmt, int col ) ; FUNCTION: c-string sqlite3_column_name ( sqlite3_stmt* pStmt, int col ) ; FUNCTION: c-string sqlite3_column_text ( sqlite3_stmt* pStmt, int col ) ; From ba2fa96eebd7b65590ad53c2f28863c55aa569a7 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 14 Apr 2010 22:04:04 -0700 Subject: [PATCH 150/157] unix: don't hack _exit to have a terminating effect; just use FUNCTION: --- basis/io/launcher/unix/unix.factor | 13 +++++++------ basis/unix/unix.factor | 4 +--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/basis/io/launcher/unix/unix.factor b/basis/io/launcher/unix/unix.factor index aaaccd4719..87af808df2 100644 --- a/basis/io/launcher/unix/unix.factor +++ b/basis/io/launcher/unix/unix.factor @@ -68,12 +68,13 @@ IN: io.launcher.unix ] when ; : spawn-process ( process -- * ) - [ setup-priority ] [ 250 _exit ] recover - [ setup-redirection ] [ 251 _exit ] recover - [ current-directory get absolute-path cd ] [ 252 _exit ] recover - [ setup-environment ] [ 253 _exit ] recover - [ get-arguments exec-args-with-path ] [ 254 _exit ] recover - 255 _exit ; + [ setup-priority ] [ 2drop 250 _exit ] recover + [ setup-redirection ] [ 2drop 251 _exit ] recover + [ current-directory get absolute-path cd ] [ 2drop 252 _exit ] recover + [ setup-environment ] [ 2drop 253 _exit ] recover + [ get-arguments exec-args-with-path ] [ 2drop 254 _exit ] recover + 255 _exit + f throw ; M: unix current-process-handle ( -- handle ) getpid ; diff --git a/basis/unix/unix.factor b/basis/unix/unix.factor index e747e48433..dbbfbcce6e 100644 --- a/basis/unix/unix.factor +++ b/basis/unix/unix.factor @@ -50,9 +50,7 @@ HOOK: open-file os ( path flags mode -- fd ) : close-file ( fd -- ) [ close ] unix-system-call drop ; -: _exit ( status -- * ) - #! We throw to give this a terminating stack effect. - int f "_exit" { int } alien-invoke "Exit failed" throw ; +FUNCTION: int _exit ( int status ) ; M: unix open-file [ open ] unix-system-call ; From 6556311115326993c853dc40cadef8845c542dfb Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 14 Apr 2010 22:08:47 -0700 Subject: [PATCH 151/157] mason: fix --- extra/mason/mason.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/mason/mason.factor b/extra/mason/mason.factor index 9732c03dfa..3afa56290b 100755 --- a/extra/mason/mason.factor +++ b/extra/mason/mason.factor @@ -15,9 +15,9 @@ IN: mason error. flush ; : build-loop ( -- ) - notify-heartbeat ?prepare-build-machine [ + notify-heartbeat [ builds/factor set-current-directory new-code-available? [ build ] when From aaacd2a34942ec870ee0b2d220722d8722a31f2d Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 14 Apr 2010 22:45:30 -0700 Subject: [PATCH 152/157] unix.process: use if-zero instead of re-inventing it --- basis/unix/process/process.factor | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/basis/unix/process/process.factor b/basis/unix/process/process.factor index 4b33c37d07..1e9129af58 100644 --- a/basis/unix/process/process.factor +++ b/basis/unix/process/process.factor @@ -36,8 +36,7 @@ FUNCTION: int execve ( c-string path, c-string* argv, c-string* envp ) ; [ [ first ] [ ] bi ] dip exec-with-env ; : with-fork ( child parent -- ) - [ [ fork-process dup zero? ] dip '[ drop @ ] ] dip - if ; inline + [ fork-process ] 2dip if-zero ; inline CONSTANT: SIGKILL 9 CONSTANT: SIGTERM 15 From 5f71d2bb18feccc76022b3a623a0f816108bc3e8 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Thu, 15 Apr 2010 11:27:33 -0700 Subject: [PATCH 153/157] db.sqlite.ffi: remove leftover stack effects from converted FUNCTION-ALIAS:es --- basis/db/sqlite/ffi/ffi.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basis/db/sqlite/ffi/ffi.factor b/basis/db/sqlite/ffi/ffi.factor index c06581e1a2..b5f9020ce9 100644 --- a/basis/db/sqlite/ffi/ffi.factor +++ b/basis/db/sqlite/ffi/ffi.factor @@ -119,7 +119,7 @@ FUNCTION: int sqlite3_bind_double ( sqlite3_stmt* pStmt, int index, double x ) ; FUNCTION: int sqlite3_bind_int ( sqlite3_stmt* pStmt, int index, int n ) ; FUNCTION: int sqlite3_bind_int64 ( sqlite3_stmt* pStmt, int index, sqlite3_int64 n ) ; ! Bind the same function as above, but for unsigned 64bit integers -FUNCTION-ALIAS: sqlite3-bind-uint64 ( pStmt index in64 -- int ) +FUNCTION-ALIAS: sqlite3-bind-uint64 int sqlite3_bind_int64 ( sqlite3_stmt* pStmt, int index, sqlite3_uint64 in64 ) ; FUNCTION: int sqlite3_bind_null ( sqlite3_stmt* pStmt, int n ) ; FUNCTION: int sqlite3_bind_text ( sqlite3_stmt* pStmt, int index, c-string text, int len, int destructor ) ; @@ -132,7 +132,7 @@ FUNCTION: c-string sqlite3_column_decltype ( sqlite3_stmt* pStmt, int col ) ; FUNCTION: int sqlite3_column_int ( sqlite3_stmt* pStmt, int col ) ; FUNCTION: sqlite3_int64 sqlite3_column_int64 ( sqlite3_stmt* pStmt, int col ) ; ! Bind the same function as above, but for unsigned 64bit integers -FUNCTION-ALIAS: sqlite3-column-uint64 ( pStmt col -- uint64 ) +FUNCTION-ALIAS: sqlite3-column-uint64 sqlite3_uint64 sqlite3_column_int64 ( sqlite3_stmt* pStmt, int col ) ; FUNCTION: double sqlite3_column_double ( sqlite3_stmt* pStmt, int col ) ; FUNCTION: c-string sqlite3_column_name ( sqlite3_stmt* pStmt, int col ) ; From f26bf45b4a45e7342bd5225287b0afff5d7ad133 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 15 Apr 2010 13:48:13 -0500 Subject: [PATCH 154/157] formatting: fix unit tests on Windows; libc's float formatting produces different output there --- basis/formatting/formatting-tests.factor | 148 +++++++++++------------ 1 file changed, 74 insertions(+), 74 deletions(-) mode change 100644 => 100755 basis/formatting/formatting-tests.factor diff --git a/basis/formatting/formatting-tests.factor b/basis/formatting/formatting-tests.factor old mode 100644 new mode 100755 index 35b1dfff4a..740babf866 --- a/basis/formatting/formatting-tests.factor +++ b/basis/formatting/formatting-tests.factor @@ -1,83 +1,85 @@ ! Copyright (C) 2008 John Benediktsson ! See http://factorcode.org/license.txt for BSD license -USING: calendar kernel formatting tools.test ; +USING: calendar kernel formatting tools.test system ; IN: formatting.tests [ "%s" printf ] must-infer [ "%s" sprintf ] must-infer -[ t ] [ "" "" sprintf = ] unit-test -[ t ] [ "asdf" "asdf" sprintf = ] unit-test -[ t ] [ "10" 10 "%d" sprintf = ] unit-test -[ t ] [ "+10" 10 "%+d" sprintf = ] unit-test -[ t ] [ "-10" -10 "%d" sprintf = ] unit-test -[ t ] [ " -10" -10 "%5d" sprintf = ] unit-test -[ t ] [ "-0010" -10 "%05d" sprintf = ] unit-test -[ t ] [ "+0010" 10 "%+05d" sprintf = ] unit-test -[ t ] [ "123.456000" 123.456 "%f" sprintf = ] unit-test -[ t ] [ "2.44" 2.436 "%.2f" sprintf = ] unit-test -[ t ] [ "8.950" 8.950179003580072 "%.3f" sprintf = ] unit-test -[ t ] [ "123.10" 123.1 "%01.2f" sprintf = ] unit-test -[ t ] [ "1.2346" 1.23456789 "%.4f" sprintf = ] unit-test -[ t ] [ " 1.23" 1.23456789 "%6.2f" sprintf = ] unit-test -[ t ] [ "1.234000e+08" 123400000 "%e" sprintf = ] unit-test -[ t ] [ "-1.234000e+08" -123400000 "%e" sprintf = ] unit-test -[ t ] [ "1.234567e+08" 123456700 "%e" sprintf = ] unit-test -[ t ] [ "3.625e+08" 362525200 "%.3e" sprintf = ] unit-test -[ t ] [ "2.500000e-03" 0.0025 "%e" sprintf = ] unit-test -[ t ] [ "2.500000E-03" 0.0025 "%E" sprintf = ] unit-test -[ t ] [ " 1.0E+01" 10 "%10.1E" sprintf = ] unit-test -[ t ] [ " -1.0E+01" -10 "%10.1E" sprintf = ] unit-test -[ t ] [ " -1.0E+01" -10 "%+10.1E" sprintf = ] unit-test -[ t ] [ " +1.0E+01" 10 "%+10.1E" sprintf = ] unit-test -[ t ] [ "-001.0E+01" -10 "%+010.1E" sprintf = ] unit-test -[ t ] [ "+001.0E+01" 10 "%+010.1E" sprintf = ] unit-test -[ t ] [ "ff" HEX: ff "%x" sprintf = ] unit-test -[ t ] [ "FF" HEX: ff "%X" sprintf = ] unit-test -[ t ] [ "0f" HEX: f "%02x" sprintf = ] unit-test -[ t ] [ "0F" HEX: f "%02X" sprintf = ] unit-test -[ t ] [ "2008-09-10" - 2008 9 10 "%04d-%02d-%02d" sprintf = ] unit-test -[ t ] [ "Hello, World!" - "Hello, World!" "%s" sprintf = ] unit-test -[ t ] [ "printf test" - "printf test" sprintf = ] unit-test -[ t ] [ "char a = 'a'" - CHAR: a "char %c = 'a'" sprintf = ] unit-test -[ t ] [ "00" HEX: 0 "%02x" sprintf = ] unit-test -[ t ] [ "ff" HEX: ff "%02x" sprintf = ] unit-test -[ t ] [ "0 message(s)" - 0 "message" "%d %s(s)" sprintf = ] unit-test -[ t ] [ "0 message(s) with %" - 0 "message" "%d %s(s) with %%" sprintf = ] unit-test -[ t ] [ "justif: \"left \"" - "left" "justif: \"%-10s\"" sprintf = ] unit-test -[ t ] [ "justif: \" right\"" - "right" "justif: \"%10s\"" sprintf = ] unit-test -[ t ] [ " 3: 0003 zero padded" - 3 " 3: %04d zero padded" sprintf = ] unit-test -[ t ] [ " 3: 3 left justif" - 3 " 3: %-4d left justif" sprintf = ] unit-test -[ t ] [ " 3: 3 right justif" - 3 " 3: %4d right justif" sprintf = ] unit-test -[ t ] [ " -3: -003 zero padded" - -3 " -3: %04d zero padded" sprintf = ] unit-test -[ t ] [ " -3: -3 left justif" - -3 " -3: %-4d left justif" sprintf = ] unit-test -[ t ] [ " -3: -3 right justif" - -3 " -3: %4d right justif" sprintf = ] unit-test -[ t ] [ "There are 10 monkeys in the kitchen" - 10 "kitchen" "There are %d monkeys in the %s" sprintf = ] unit-test -[ f ] [ "%d" 10 "%d" sprintf = ] unit-test -[ t ] [ "[monkey]" "monkey" "[%s]" sprintf = ] unit-test -[ t ] [ "[ monkey]" "monkey" "[%10s]" sprintf = ] unit-test -[ t ] [ "[monkey ]" "monkey" "[%-10s]" sprintf = ] unit-test -[ t ] [ "[0000monkey]" "monkey" "[%010s]" sprintf = ] unit-test -[ t ] [ "[####monkey]" "monkey" "[%'#10s]" sprintf = ] unit-test -[ t ] [ "[many monke]" "many monkeys" "[%10.10s]" sprintf = ] unit-test +[ "" ] [ "" sprintf ] unit-test +[ "asdf" ] [ "asdf" sprintf ] unit-test +[ "10" ] [ 10 "%d" sprintf ] unit-test +[ "+10" ] [ 10 "%+d" sprintf ] unit-test +[ "-10" ] [ -10 "%d" sprintf ] unit-test +[ " -10" ] [ -10 "%5d" sprintf ] unit-test +[ "-0010" ] [ -10 "%05d" sprintf ] unit-test +[ "+0010" ] [ 10 "%+05d" sprintf ] unit-test +[ "123.456000" ] [ 123.456 "%f" sprintf ] unit-test +[ "2.44" ] [ 2.436 "%.2f" sprintf ] unit-test +[ "8.950" ] [ 8.950179003580072 "%.3f" sprintf ] unit-test +[ "123.10" ] [ 123.1 "%01.2f" sprintf ] unit-test +[ "1.2346" ] [ 1.23456789 "%.4f" sprintf ] unit-test +[ " 1.23" ] [ 1.23456789 "%6.2f" sprintf ] unit-test -[ t ] [ "{ 1, 2, 3 }" { 1 2 3 } "%[%s, %]" sprintf = ] unit-test -[ t ] [ "{ 1:2, 3:4 }" H{ { 1 2 } { 3 4 } } "%[%s: %s %]" sprintf = ] unit-test +os windows? [ + [ "1.234000e+008" ] [ 123400000 "%e" sprintf ] unit-test + [ "-1.234000e+008" ] [ -123400000 "%e" sprintf ] unit-test + [ "1.234567e+008" ] [ 123456700 "%e" sprintf ] unit-test + [ "3.625e+008" ] [ 362525200 "%.3e" sprintf ] unit-test + [ "2.500000e-003" ] [ 0.0025 "%e" sprintf ] unit-test + [ "2.500000E-003" ] [ 0.0025 "%E" sprintf ] unit-test + [ " 1.0E+001" ] [ 10 "%11.1E" sprintf ] unit-test + [ " -1.0E+001" ] [ -10 "%11.1E" sprintf ] unit-test + [ " -1.0E+001" ] [ -10 "%+11.1E" sprintf ] unit-test + [ " +1.0E+001" ] [ 10 "%+11.1E" sprintf ] unit-test + [ "-001.0E+001" ] [ -10 "%+011.1E" sprintf ] unit-test + [ "+001.0E+001" ] [ 10 "%+011.1E" sprintf ] unit-test +] [ + [ "1.234000e+08" ] [ 123400000 "%e" sprintf ] unit-test + [ "-1.234000e+08" ] [ -123400000 "%e" sprintf ] unit-test + [ "1.234567e+08" ] [ 123456700 "%e" sprintf ] unit-test + [ "3.625e+08" ] [ 362525200 "%.3e" sprintf ] unit-test + [ "2.500000e-03" ] [ 0.0025 "%e" sprintf ] unit-test + [ "2.500000E-03" ] [ 0.0025 "%E" sprintf ] unit-test + [ " 1.0E+01" ] [ 10 "%10.1E" sprintf ] unit-test + [ " -1.0E+01" ] [ -10 "%10.1E" sprintf ] unit-test + [ " -1.0E+01" ] [ -10 "%+10.1E" sprintf ] unit-test + [ " +1.0E+01" ] [ 10 "%+10.1E" sprintf ] unit-test + [ "-001.0E+01" ] [ -10 "%+010.1E" sprintf ] unit-test + [ "+001.0E+01" ] [ 10 "%+010.1E" sprintf ] unit-test +] if + +[ "ff" ] [ HEX: ff "%x" sprintf ] unit-test +[ "FF" ] [ HEX: ff "%X" sprintf ] unit-test +[ "0f" ] [ HEX: f "%02x" sprintf ] unit-test +[ "0F" ] [ HEX: f "%02X" sprintf ] unit-test +[ "2008-09-10" ] [ 2008 9 10 "%04d-%02d-%02d" sprintf ] unit-test +[ "Hello, World!" ] [ "Hello, World!" "%s" sprintf ] unit-test +[ "printf test" ] [ "printf test" sprintf ] unit-test +[ "char a = 'a'" ] [ CHAR: a "char %c = 'a'" sprintf ] unit-test +[ "00" ] [ HEX: 0 "%02x" sprintf ] unit-test +[ "ff" ] [ HEX: ff "%02x" sprintf ] unit-test +[ "0 message(s)" ] [ 0 "message" "%d %s(s)" sprintf ] unit-test +[ "0 message(s) with %" ] [ 0 "message" "%d %s(s) with %%" sprintf ] unit-test +[ "justif: \"left \"" ] [ "left" "justif: \"%-10s\"" sprintf ] unit-test +[ "justif: \" right\"" ] [ "right" "justif: \"%10s\"" sprintf ] unit-test +[ " 3: 0003 zero padded" ] [ 3 " 3: %04d zero padded" sprintf ] unit-test +[ " 3: 3 left justif" ] [ 3 " 3: %-4d left justif" sprintf ] unit-test +[ " 3: 3 right justif" ] [ 3 " 3: %4d right justif" sprintf ] unit-test +[ " -3: -003 zero padded" ] [ -3 " -3: %04d zero padded" sprintf ] unit-test +[ " -3: -3 left justif" ] [ -3 " -3: %-4d left justif" sprintf ] unit-test +[ " -3: -3 right justif" ] [ -3 " -3: %4d right justif" sprintf ] unit-test +[ "There are 10 monkeys in the kitchen" ] [ 10 "kitchen" "There are %d monkeys in the %s" sprintf ] unit-test +[ "10" ] [ 10 "%d" sprintf ] unit-test +[ "[monkey]" ] [ "monkey" "[%s]" sprintf ] unit-test +[ "[ monkey]" ] [ "monkey" "[%10s]" sprintf ] unit-test +[ "[monkey ]" ] [ "monkey" "[%-10s]" sprintf ] unit-test +[ "[0000monkey]" ] [ "monkey" "[%010s]" sprintf ] unit-test +[ "[####monkey]" ] [ "monkey" "[%'#10s]" sprintf ] unit-test +[ "[many monke]" ] [ "many monkeys" "[%10.10s]" sprintf ] unit-test + +[ "{ 1, 2, 3 }" ] [ { 1 2 3 } "%[%s, %]" sprintf ] unit-test +[ "{ 1:2, 3:4 }" ] [ H{ { 1 2 } { 3 4 } } "%[%s: %s %]" sprintf ] unit-test [ "%H:%M:%S" strftime ] must-infer @@ -96,5 +98,3 @@ IN: formatting.tests [ t ] [ "October" testtime "%B" strftime = ] unit-test [ t ] [ "Thu Oct 09 12:03:15 2008" testtime "%c" strftime = ] unit-test [ t ] [ "PM" testtime "%p" strftime = ] unit-test - - From feb62f3e883ffc32cbe6ea1bd842a8bd191c3010 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Thu, 15 Apr 2010 13:48:14 -0700 Subject: [PATCH 155/157] missing USING: for system-info.linux --- basis/system-info/linux/linux.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/system-info/linux/linux.factor b/basis/system-info/linux/linux.factor index 9c6f9fbff3..2eb395b8d1 100644 --- a/basis/system-info/linux/linux.factor +++ b/basis/system-info/linux/linux.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: unix alien alien.c-types kernel math sequences strings io.backend.unix splitting io.encodings.utf8 io.encodings.string -specialized-arrays ; +specialized-arrays alien.syntax ; SPECIALIZED-ARRAY: char IN: system-info.linux From 2ace3c59560bca2f546bbfbdf1fb9123b8e96729 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 15 Apr 2010 16:06:44 -0500 Subject: [PATCH 156/157] formatting: remove platform-specific example --- basis/formatting/formatting-docs.factor | 4 ---- 1 file changed, 4 deletions(-) mode change 100644 => 100755 basis/formatting/formatting-docs.factor diff --git a/basis/formatting/formatting-docs.factor b/basis/formatting/formatting-docs.factor old mode 100644 new mode 100755 index 9625c40577..100c88c4eb --- a/basis/formatting/formatting-docs.factor +++ b/basis/formatting/formatting-docs.factor @@ -62,10 +62,6 @@ HELP: printf "USING: formatting ;" "1.23456789 \"%.3f\" printf" "1.235" } - { $example - "USING: formatting ;" - "1234567890 \"%.5e\" printf" - "1.23457e+09" } { $example "USING: formatting ;" "12 \"%'#4d\" printf" From 8f56108702e7294e695a8babf5902eccf4f37bb7 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Thu, 15 Apr 2010 14:46:13 -0700 Subject: [PATCH 157/157] cuda.ffi: add CUDA versions of double, longlong, ulonglong that always 8-byte align, and a >cuda-param-type function we can use to make structs that match kernel param space layout --- extra/cuda/ffi/ffi.factor | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/extra/cuda/ffi/ffi.factor b/extra/cuda/ffi/ffi.factor index 3d41f1e4c5..b7efeff9fb 100644 --- a/extra/cuda/ffi/ffi.factor +++ b/extra/cuda/ffi/ffi.factor @@ -1,6 +1,6 @@ ! (c)2010 Joe Groff bsd license -USING: alien alien.c-types alien.libraries alien.syntax -classes.struct combinators system ; +USING: accessors alien alien.c-types alien.libraries alien.syntax +classes.struct combinators kernel system ; IN: cuda.ffi << @@ -24,6 +24,28 @@ TYPEDEF: void* CUevent TYPEDEF: void* CUstream TYPEDEF: void* CUgraphicsResource +! versions of double and longlong that always 8-byte align + +SYMBOLS: CUdouble CUlonglong CUulonglong ; + +: >cuda-param-type ( c-type -- c-type' ) + { + { CUdeviceptr [ void* ] } + { double [ CUdouble ] } + { longlong [ CUlonglong ] } + { ulonglong [ CUulonglong ] } + [ ] + } case ; + +<< +: always-8-byte-align ( c-type -- c-type ) + 8 >>align 8 >>align-first ; + +longlong c-type clone always-8-byte-align \ CUlonglong typedef +ulonglong c-type clone always-8-byte-align \ CUulonglong typedef +double c-type clone always-8-byte-align \ CUdouble typedef +>> + STRUCT: CUuuid { bytes char[16] } ;