Merge branch 'master' of git://factorcode.org/git/factor

db4
Joe Groff 2009-10-05 22:34:41 -05:00
commit fb8eeb6065
7 changed files with 18 additions and 14 deletions

View File

@ -1465,7 +1465,7 @@ V{
[ ] [ { 1 2 3 } test-linear-scan-on-cfg ] unit-test [ ] [ { 1 2 3 } test-linear-scan-on-cfg ] unit-test
[ { 1 } ] [ 1 get instructions>> first tagged-values>> ] unit-test [ { { 0 1 } } ] [ 1 get instructions>> first tagged-values>> ] unit-test
V{ V{
T{ ##peek f 0 D 0 } T{ ##peek f 0 D 0 }
@ -1487,4 +1487,4 @@ V{
[ ] [ { 1 2 3 } test-linear-scan-on-cfg ] unit-test [ ] [ { 1 2 3 } test-linear-scan-on-cfg ] unit-test
[ { 1 } ] [ 1 get instructions>> first tagged-values>> ] unit-test [ { { 0 1 } } ] [ 1 get instructions>> first tagged-values>> ] unit-test

View File

@ -88,7 +88,7 @@ HELP: stream-throws
{ stream-eofs stream-throws } related-words { stream-eofs stream-throws } related-words
ARTICLE: "io.streams.limited" "Limited input streams" ARTICLE: "io.streams.limited" "Limited input streams"
"The " { $vocab-link "io.streams.limited" } " vocabulary wraps a stream to behave as if it had only a limited number of bytes, either throwing an error or returning " { $link f } " upon reaching the end." $nl "The " { $vocab-link "io.streams.limited" } " vocabulary wraps a stream to behave as if it had only a limited number of bytes, either throwing an error or returning " { $link f } " upon reaching the end. Limiting a non-seekable stream keeps a byte count and triggers the end-of-stream behavior when this byte count has been reached. However, limiting a seekable stream creates a window of bytes that supports seeking and re-reading of bytes in that window." $nl
"Wrap a stream in a limited stream:" "Wrap a stream in a limited stream:"
{ $subsections limit } { $subsections limit }
"Wrap the current " { $link input-stream } " in a limited stream:" "Wrap the current " { $link input-stream } " in a limited stream:"

View File

@ -69,8 +69,8 @@ C: <button-pen> button-pen
: button-pen ( button pen -- button pen ) : button-pen ( button pen -- button pen )
over find-button { over find-button {
{ [ dup { [ pressed?>> ] [ selected?>> ] } 1&& ] { [ dup { [ pressed?>> ] [ selected?>> ] } 1&& ] [
[ drop pressed-selected>> drop pressed-selected>>
] } ] }
{ [ dup pressed?>> ] [ drop pressed>> ] } { [ dup pressed?>> ] [ drop pressed>> ] }
{ [ dup selected?>> ] [ drop selected>> ] } { [ dup selected?>> ] [ drop selected>> ] }

View File

@ -112,7 +112,7 @@ M: editor ungraft*
} cond ; } cond ;
: clicked-loc ( editor -- loc ) : clicked-loc ( editor -- loc )
[ hand-rel ] [ point>loc ] bi ; [ hand-rel ] keep point>loc ;
: click-loc ( editor model -- ) : click-loc ( editor model -- )
[ clicked-loc ] dip set-model ; [ clicked-loc ] dip set-model ;
@ -130,7 +130,7 @@ M: editor ungraft*
[ loc>x ] [ [ first ] dip line>y ceiling ] 2bi 2array ; [ loc>x ] [ [ first ] dip line>y ceiling ] 2bi 2array ;
: caret-loc ( editor -- loc ) : caret-loc ( editor -- loc )
[ editor-caret ] [ loc>point ] bi ; [ editor-caret ] keep loc>point ;
: caret-dim ( editor -- dim ) : caret-dim ( editor -- dim )
[ 0 ] dip line-height 2array ; [ 0 ] dip line-height 2array ;
@ -139,7 +139,7 @@ M: editor ungraft*
dup graft-state>> second [ dup graft-state>> second [
[ [
[ caret-loc ] [ caret-dim { 2 1 } v+ ] bi <rect> [ caret-loc ] [ caret-dim { 2 1 } v+ ] bi <rect>
] [ scroll>rect ] bi ] keep scroll>rect
] [ drop ] if ; ] [ drop ] if ;
: draw-caret? ( editor -- ? ) : draw-caret? ( editor -- ? )
@ -212,7 +212,7 @@ M: editor cap-height font>> font-metrics cap-height>> ;
[ nip relayout ] 2tri ; [ nip relayout ] 2tri ;
: caret/mark-changed ( editor -- ) : caret/mark-changed ( editor -- )
[ restart-blinking ] [ scroll>caret ] bi ; [ restart-blinking ] keep scroll>caret ;
M: editor model-changed M: editor model-changed
{ {

View File

@ -115,7 +115,7 @@ M: gadget gadget-text-separator
gadget-text-separator '[ _ % ] [ gadget-text* ] interleave ; gadget-text-separator '[ _ % ] [ gadget-text* ] interleave ;
M: gadget gadget-text* M: gadget gadget-text*
[ children>> ] [ gadget-seq-text ] bi ; [ children>> ] keep gadget-seq-text ;
M: array gadget-text* M: array gadget-text*
[ gadget-text* ] each ; [ gadget-text* ] each ;
@ -183,7 +183,7 @@ GENERIC: pref-dim* ( gadget -- dim )
: pref-dim ( gadget -- dim ) : pref-dim ( gadget -- dim )
dup pref-dim>> [ ] [ dup pref-dim>> [ ] [
[ pref-dim* ] [ dup layout-state>> ] bi [ pref-dim* ] [ ] [ layout-state>> ] tri
[ drop ] [ dupd (>>pref-dim) ] if [ drop ] [ dupd (>>pref-dim) ] if
] ?if ; ] ?if ;
@ -388,7 +388,7 @@ M: gadget request-focus-on parent>> request-focus-on ;
M: f request-focus-on 2drop ; M: f request-focus-on 2drop ;
: request-focus ( gadget -- ) : request-focus ( gadget -- )
[ focusable-child ] [ request-focus-on ] bi ; [ focusable-child ] keep request-focus-on ;
: focus-path ( gadget -- seq ) : focus-path ( gadget -- seq )
[ focus>> ] follow ; [ focus>> ] follow ;

View File

@ -30,6 +30,7 @@ const char *default_image_path()
char *new_path = new char[PATH_MAX + SUFFIX_LEN + 1]; char *new_path = new char[PATH_MAX + SUFFIX_LEN + 1];
memcpy(new_path,path,len + 1); memcpy(new_path,path,len + 1);
memcpy(new_path + len,SUFFIX,SUFFIX_LEN + 1); memcpy(new_path + len,SUFFIX,SUFFIX_LEN + 1);
free(const_cast<char *>(path));
return new_path; return new_path;
} }

View File

@ -3,7 +3,7 @@
namespace factor namespace factor
{ {
/* Snarfed from SBCL linux-so.c. You must delete[] the result yourself. */ /* Snarfed from SBCL linux-so.c. You must free() the result yourself. */
const char *vm_executable_path() const char *vm_executable_path()
{ {
char *path = new char[PATH_MAX + 1]; char *path = new char[PATH_MAX + 1];
@ -17,7 +17,10 @@ const char *vm_executable_path()
else else
{ {
path[size] = '\0'; path[size] = '\0';
return safe_strdup(path);
const char *ret = safe_strdup(path);
delete[] path;
return ret;
} }
} }