aboutsummaryrefslogtreecommitdiff
path: root/utils/genmovecode.sh
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2023-11-05 16:29:14 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2023-11-05 16:37:39 +0100
commit1964938ca6abef6e5c81d9dccdf42c55abacb5e9 (patch)
tree9908417751ddf22e45ea68da0f209083249ac08e /utils/genmovecode.sh
parent9c1659d91a331735f88c127aa236a59153e23dfc (diff)
downloadnissy-core-1964938ca6abef6e5c81d9dccdf42c55abacb5e9.tar.gz
nissy-core-1964938ca6abef6e5c81d9dccdf42c55abacb5e9.zip
Refactoring
Diffstat (limited to 'utils/genmovecode.sh')
-rwxr-xr-xutils/genmovecode.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/utils/genmovecode.sh b/utils/genmovecode.sh
index c389ea8..688ee39 100755
--- a/utils/genmovecode.sh
+++ b/utils/genmovecode.sh
@@ -2,16 +2,16 @@
2 2
3type="${1:-src}" 3type="${1:-src}"
4 4
5gcc -DDEBUG h48_to_"$type".c ../src/cube.c -o h48_to_"$type" 5gcc -DDEBUG h48_to_"$type".c ../cube.c -o h48_to_"$type"
6 6
7genfuncs() { 7genfuncs() {
8 for f in move_??_*.txt; do 8 for f in move_??_*.txt; do
9 move="$(echo $f | sed 's/.*_// ; s/\.txt//')" 9 move="$(echo $f | sed 's/.*_// ; s/\.txt//')"
10 printf 'static inline cube_t\ninline_move_%s' "$move" 10 printf 'static inline cube_t\n_move_%s' "$move"
11 printf '(cube_t c)\n{\n' 11 printf '(cube_t c)\n{\n'
12 printf '\tcube_t m = ' 12 printf '\tcube_t m = '
13 ./h48_to_"$type" <"$f" | sed '2,4s/^/\t/' 13 ./h48_to_"$type" <"$f" | sed '2,4s/^/\t/'
14 printf ';\n\n\treturn compose(c, m);\n}\n\n' 14 printf ';\n\n\treturn _compose(c, m);\n}\n\n'
15 done 15 done
16} 16}
17 17

Generated with cgit - Back to sebastiano.tronto.net