diff --git a/basis/compiler/cfg/linear-scan/linear-scan-tests.factor b/basis/compiler/cfg/linear-scan/linear-scan-tests.factor index 2f49bf7fae..3a9a7ac0a1 100644 --- a/basis/compiler/cfg/linear-scan/linear-scan-tests.factor +++ b/basis/compiler/cfg/linear-scan/linear-scan-tests.factor @@ -1465,7 +1465,7 @@ V{ [ ] [ { 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{ T{ ##peek f 0 D 0 } @@ -1487,4 +1487,4 @@ V{ [ ] [ { 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 diff --git a/basis/io/streams/limited/limited-docs.factor b/basis/io/streams/limited/limited-docs.factor index 833e53820e..6c1806ff38 100755 --- a/basis/io/streams/limited/limited-docs.factor +++ b/basis/io/streams/limited/limited-docs.factor @@ -88,7 +88,7 @@ HELP: stream-throws { stream-eofs stream-throws } related-words 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:" { $subsections limit } "Wrap the current " { $link input-stream } " in a limited stream:" diff --git a/basis/ui/gadgets/buttons/buttons.factor b/basis/ui/gadgets/buttons/buttons.factor index d5e8dff3b1..061fd8d364 100644 --- a/basis/ui/gadgets/buttons/buttons.factor +++ b/basis/ui/gadgets/buttons/buttons.factor @@ -69,8 +69,8 @@ C: button-pen : button-pen ( button pen -- button pen ) over find-button { - { [ dup { [ pressed?>> ] [ selected?>> ] } 1&& ] - [ drop pressed-selected>> + { [ dup { [ pressed?>> ] [ selected?>> ] } 1&& ] [ + drop pressed-selected>> ] } { [ dup pressed?>> ] [ drop pressed>> ] } { [ dup selected?>> ] [ drop selected>> ] } diff --git a/basis/ui/gadgets/editors/editors.factor b/basis/ui/gadgets/editors/editors.factor index 80e15d8a98..f83c5d710a 100755 --- a/basis/ui/gadgets/editors/editors.factor +++ b/basis/ui/gadgets/editors/editors.factor @@ -112,7 +112,7 @@ M: editor ungraft* } cond ; : clicked-loc ( editor -- loc ) - [ hand-rel ] [ point>loc ] bi ; + [ hand-rel ] keep point>loc ; : click-loc ( editor model -- ) [ clicked-loc ] dip set-model ; @@ -130,7 +130,7 @@ M: editor ungraft* [ loc>x ] [ [ first ] dip line>y ceiling ] 2bi 2array ; : caret-loc ( editor -- loc ) - [ editor-caret ] [ loc>point ] bi ; + [ editor-caret ] keep loc>point ; : caret-dim ( editor -- dim ) [ 0 ] dip line-height 2array ; @@ -139,7 +139,7 @@ M: editor ungraft* dup graft-state>> second [ [ [ caret-loc ] [ caret-dim { 2 1 } v+ ] bi - ] [ scroll>rect ] bi + ] keep scroll>rect ] [ drop ] if ; : draw-caret? ( editor -- ? ) @@ -212,7 +212,7 @@ M: editor cap-height font>> font-metrics cap-height>> ; [ nip relayout ] 2tri ; : caret/mark-changed ( editor -- ) - [ restart-blinking ] [ scroll>caret ] bi ; + [ restart-blinking ] keep scroll>caret ; M: editor model-changed { diff --git a/basis/ui/gadgets/gadgets.factor b/basis/ui/gadgets/gadgets.factor index a6d9028a46..e4a0e672d2 100644 --- a/basis/ui/gadgets/gadgets.factor +++ b/basis/ui/gadgets/gadgets.factor @@ -115,7 +115,7 @@ M: gadget gadget-text-separator gadget-text-separator '[ _ % ] [ gadget-text* ] interleave ; M: gadget gadget-text* - [ children>> ] [ gadget-seq-text ] bi ; + [ children>> ] keep gadget-seq-text ; M: array gadget-text* [ gadget-text* ] each ; @@ -183,7 +183,7 @@ GENERIC: pref-dim* ( gadget -- dim ) : pref-dim ( gadget -- dim ) dup pref-dim>> [ ] [ - [ pref-dim* ] [ dup layout-state>> ] bi + [ pref-dim* ] [ ] [ layout-state>> ] tri [ drop ] [ dupd (>>pref-dim) ] if ] ?if ; @@ -388,7 +388,7 @@ M: gadget request-focus-on parent>> request-focus-on ; M: f request-focus-on 2drop ; : request-focus ( gadget -- ) - [ focusable-child ] [ request-focus-on ] bi ; + [ focusable-child ] keep request-focus-on ; : focus-path ( gadget -- seq ) [ focus>> ] follow ; diff --git a/vm/os-genunix.cpp b/vm/os-genunix.cpp index 7bbe388ff2..065f0dfd40 100644 --- a/vm/os-genunix.cpp +++ b/vm/os-genunix.cpp @@ -30,6 +30,7 @@ const char *default_image_path() char *new_path = new char[PATH_MAX + SUFFIX_LEN + 1]; memcpy(new_path,path,len + 1); memcpy(new_path + len,SUFFIX,SUFFIX_LEN + 1); + free(const_cast(path)); return new_path; } diff --git a/vm/os-linux.cpp b/vm/os-linux.cpp index 2d26fba390..352467d379 100644 --- a/vm/os-linux.cpp +++ b/vm/os-linux.cpp @@ -3,7 +3,7 @@ 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() { char *path = new char[PATH_MAX + 1]; @@ -17,7 +17,10 @@ const char *vm_executable_path() else { path[size] = '\0'; - return safe_strdup(path); + + const char *ret = safe_strdup(path); + delete[] path; + return ret; } }