Merge pull request #862 from xexyl/2001-herrmann1-fixes
This commit is contained in:
2 files changed
+40
-28
No files matched your search
+10
-12
@@ -3,27 +3,25 @@
|
|||||||
name=herrmann1
|
name=herrmann1
|
||||||
|
|
||||||
# Make sure things are clean to start with...
|
# Make sure things are clean to start with...
|
||||||
rm -f ${name} ${name}-1.c ${name}-2.c ${name}-3.c
|
rm -f "${name}" "${name}-1.c" "${name}-2.c" "${name}-3.c"
|
||||||
|
|
||||||
defs=""
|
defs=""
|
||||||
for p in ${1+"$@"}; do
|
for p in ${1+"$@"}; do
|
||||||
defs="$defs \"-D$p\""
|
defs="$defs \"-D$p\""
|
||||||
done
|
done
|
||||||
|
|
||||||
cp ${name}.c ${name}-1.c
|
cp "${name}.c" "${name}-1.c"
|
||||||
touch ${name}-3.c
|
touch "${name}-3.c"
|
||||||
|
|
||||||
until cmp -s ${name}-1.c ${name}-3.c > /dev/null; do
|
until cmp -s "${name}-1.c" "${name}-3.c" > /dev/null; do
|
||||||
eval ${CC:-cc} -E ${name}-1.c -o ${name}-2.c -P $defs 2> error || exit
|
eval "${CC:-cc}" -E "${name}-1.c" -o "${name}-2.c" -P "$defs" 2> error || exit
|
||||||
mv -f ${name}-1.c ${name}-3.c
|
mv -f "${name}-1.c" "${name}-3.c"
|
||||||
sed -e 's/ */ /g' -e 's/^ //' -e '/^$/ d' -e 's:^/ \*:/*:' \
|
sed -e 's/ */ /g' -e 's/^ //' -e '/^$/ d' -e 's:^/ \*:/*:' \
|
||||||
< ${name}-2.c > ${name}-1.c
|
< "${name}-2.c" > "${name}-1.c"
|
||||||
head ${name}-1.c
|
head "${name}-1.c"
|
||||||
done
|
done
|
||||||
|
|
||||||
eval ${CC:-cc} ${name}-1.c -o ${name} 2> error && rm error
|
eval "${CC:-cc}" "${name}-1.c" -o "${name}" 2> error && rm error
|
||||||
|
|
||||||
eval ./${name}
|
|
||||||
|
|
||||||
# Clean up intermediates...
|
# Clean up intermediates...
|
||||||
rm -f ${name}-1.c ${name}-2.c ${name}-3.c
|
rm -f "${name}-1.c" "${name}-2.c" "${name}-3.c"
|
||||||
+30
-16
@@ -910,17 +910,33 @@ He also points out that there is a way to get the computer to automatically lose
|
|||||||
very quickly and he also points out that there is a flaw in the alternate
|
very quickly and he also points out that there is a flaw in the alternate
|
||||||
version that the author did not note. Do you know what these are?
|
version that the author did not note. Do you know what these are?
|
||||||
|
|
||||||
|
## [2001/herrmann1](2001/herrmann1/herrmann1.c) ([README.md](2001/herrmann1/README.md]))
|
||||||
|
|
||||||
|
Cody fixed this so that the when compiling the code the program is not executed
|
||||||
|
itself by itself which just showed the usage string and exited. The [script
|
||||||
|
herrmann1.sh](2001/herrmann1/herrmann1.sh) is used to compile the program but
|
||||||
|
it's also how you invoke the program.
|
||||||
|
|
||||||
|
He also fixed the [script herrmann1.sh](2001/herrmann1/herrmann1.sh) for
|
||||||
|
shellcheck. In particular there were quite a few:
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
SC2086 (info): Double quote to prevent globbing and word splitting.
|
||||||
|
SC2248 (style): Prefer double quoting even when variables don't contain special characters.
|
||||||
|
```
|
||||||
|
|
||||||
|
errors/warnings.
|
||||||
|
|
||||||
## [2001/herrmann2](2001/herrmann2/herrmann2.c) ([README.md](2001/herrmann2/README.md]))
|
## [2001/herrmann2](2001/herrmann2/herrmann2.c) ([README.md](2001/herrmann2/README.md]))
|
||||||
|
|
||||||
Cody fixed this to work with
|
Cody fixed this to work with both 64-bit and 32-bit compiles by changing most of
|
||||||
both 64-bit and 32-bit compiles by changing most of the `int`s (all but that in
|
the `int`s (all but that in `main`) to `long`s. He also fixed it to compile with
|
||||||
`main`) to `long`s. He also fixed it to compile with clang by changing the args
|
clang by changing the args of main to be `int` and `char **` respectively and
|
||||||
of main to be `int` and `char **` respectively and changing specific references
|
changing specific references to the `argv` arg, casting to `long` (was `int` but
|
||||||
to the `argv` arg, casting to `long` (was `int` but the 64-bit fix requires
|
the 64-bit fix requires `long`) which was its old type. The original file, used
|
||||||
`long`) which was its old type. The original file, used for demonstration
|
for demonstration purposes, as well as if you want to see if your system works
|
||||||
purposes, as well as if you want to see if your system works with the original
|
with the original code, is the alternate version. See the README.md for details.
|
||||||
code, is the alternate version. See the README.md for details.
|
|
||||||
|
|
||||||
|
|
||||||
## [2001/kev](2001/kev/kev.c) ([README.md](2001/kev/README.md]))
|
## [2001/kev](2001/kev/kev.c) ([README.md](2001/kev/README.md]))
|
||||||
@@ -958,14 +974,12 @@ int and the rest must be a `char **`.
|
|||||||
|
|
||||||
## [2004/gavin](2004/gavin/gavin.c) ([README.md](2004/gavin/README.md]))
|
## [2004/gavin](2004/gavin/gavin.c) ([README.md](2004/gavin/README.md]))
|
||||||
|
|
||||||
Yusuke provided the `kernel` and `fs.tar`
|
Yusuke provided the `kernel` and `fs.tar` files which can be used if you cannot
|
||||||
files which can be used if you cannot normally use this entry. Instead of
|
normally use this entry. Instead of generating the files just use the files
|
||||||
generating the files just use the files provided, found under the
|
provided, found under the [img/](2004/gavin/img/) directory. Note that the
|
||||||
[img/](2004/gavin/img/)
|
`img/fs.tar` extracts into `fs/` so you will have to fix the tarball; this is
|
||||||
directory. Note that the `img/fs.tar` extracts into `fs/` so you will have to
|
done this way to prevent extraction from the entry directory overwriting the
|
||||||
fix the tarball; this is done this way to prevent extraction from the entry
|
files and causing `make clobber` to wipe some of them out.
|
||||||
directory overwriting the files and causing `make clobber` to wipe some of them
|
|
||||||
out.
|
|
||||||
|
|
||||||
|
|
||||||
## [2004/kopczynski](2004/kopczynski/kopczynski.c) ([README.md](2004/kopczynski/README.md]))
|
## [2004/kopczynski](2004/kopczynski/kopczynski.c) ([README.md](2004/kopczynski/README.md]))
|
||||||
|
|||||||
Reference in new issue
Block a user