Skip to content

Commit

Permalink
Now uses List reverse(), and ditched Cell for the sdk's one
Browse files Browse the repository at this point in the history
  • Loading branch information
nddrylliog committed Jan 21, 2010
1 parent e869fd1 commit be5df86
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Makefile
@@ -1,7 +1,7 @@
.PHONY: all clean

all:
ooc tests/test_partial -o=tests/test_partial -gcc -D_BSD_SOURCE -driver=sequence -g -shout -v -noclean
ooc tests/test_partial -o=tests/test_partial -gcc -D_BSD_SOURCE -driver=sequence -g -shout -v -noclean -nolines

clean:
rm -rf ooc_tmp
Expand Down
21 changes: 0 additions & 21 deletions yajit/Partial.ooc
Expand Up @@ -4,27 +4,6 @@ import os/mmap
import structs/[ArrayList,HashMap]
include errno


Cell: class <T>{
val :T
init: func(=val) {}
}


reverse: func <T> (list: ArrayList<T>) {
"i'm reversed" println()
i := 0
j := list size() -1
tmp: T
while (i <= j / 2) {
tmp = list[i]
list[i] = list[j]
list[j] = tmp
i += 1
j -= 1
}
}

Partial: abstract class {
genCode: abstract func<T>(funcArg: Pointer, arg: T, sizes: String) -> Pointer
genCode: abstract func ~multipleArgs(funcArg: Pointer, arg: ArrayList<Cell<Pointer>>, sizes: String) -> Pointer
Expand Down
2 changes: 1 addition & 1 deletion yajit/x86-32/OpCodes.ooc
Expand Up @@ -68,7 +68,7 @@ OpCodes: class extends Partial {
printf("\n%daaa\n\n", closure size())
bseq := initSequence(1024)
closureArgs := closure clone() // cloning fixes problem with reverse (don't ask why^^)
reverse(closureArgs)
closureArgs reverse()
pushNonClosureArgs(getBase(argSizes, bseq),argSizes)
for (item: Cell<Pointer> in closureArgs) {
T := item T
Expand Down

0 comments on commit be5df86

Please sign in to comment.