summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-02-19 01:19:57 -0800
committerOri Bernstein <ori@eigenstate.org>2017-02-19 01:19:57 -0800
commitaf128ae8ef5c2d4627ab90e02efe15eca7b8cdb5 (patch)
tree7678d2d4fef24d8924de362d4136f0ca83237dc6
parent124f45afc8c465541deec8b7775dff2d91f702c6 (diff)
downloadmc-af128ae8ef5c2d4627ab90e02efe15eca7b8cdb5.tar.gz
Clean up magic numbers in directories.
Counting up byte offsets sucks. This still sucks, but less.
-rw-r--r--lib/json/test/parse.myr2
-rw-r--r--lib/std/syswrap+plan9.myr30
2 files changed, 21 insertions, 11 deletions
diff --git a/lib/json/test/parse.myr b/lib/json/test/parse.myr
index 0045fb7..4ed65dc 100644
--- a/lib/json/test/parse.myr
+++ b/lib/json/test/parse.myr
@@ -125,7 +125,7 @@ const filetest = {
std.put("ignoring implementation defined test {}\n", f)
| wat:
if !std.sleq(f, "LICENSE")
- std.fatal("unknown test {}: needs to start with y or n\n", f)
+ std.fatal("unknown test '{}': needs to start with y or n\n", f)
;;
;;
std.slfree(data)
diff --git a/lib/std/syswrap+plan9.myr b/lib/std/syswrap+plan9.myr
index bd3552f..ab1c025 100644
--- a/lib/std/syswrap+plan9.myr
+++ b/lib/std/syswrap+plan9.myr
@@ -77,16 +77,26 @@ pkg std =
/* statbuf offsets */
pkglocal const Sizeoff : int64 = 0
- pkglocal const Typeoff : int64 = 2
- pkglocal const Devoff : int64 = 4
- pkglocal const Qidtypeoff : int64 =8
- pkglocal const Qidversoff : int64 = 9
- pkglocal const Qidpathoff : int64 = 13
- pkglocal const Modeoff : int64 = 21
- pkglocal const Atimeoff : int64 = 25
- pkglocal const Mtimeoff : int64 = 29
- pkglocal const Lengthoff : int64 = 31
- pkglocal const Stringsoff : int64 = 39
+ pkglocal const Sizesz : int64 = 2
+ pkglocal const Typeoff : int64 = Sizeoff + Sizesz
+ pkglocal const Typesz : int64 = 2
+ pkglocal const Devoff : int64 = Typeoff + Typesz
+ pkglocal const Devsz : int64 = 4
+ pkglocal const Qidtypeoff : int64 = Devoff + Devsz
+ pkglocal const Qidtypesz : int64 = 1
+ pkglocal const Qidversoff : int64 = Qidtypeoff + Qidtypesz
+ pkglocal const Qidverssz : int64 = 4
+ pkglocal const Qidpathoff : int64 = Qidversoff + Qidverssz
+ pkglocal const Qidpathsz : int64 = 8
+ pkglocal const Modeoff : int64 = Qidpathoff + Qidpathsz
+ pkglocal const Modesz : int64 = 4
+ pkglocal const Atimeoff : int64 = Modeoff + Modesz
+ pkglocal const Atimesz : int64 = 4
+ pkglocal const Mtimeoff : int64 = Atimeoff + Atimesz
+ pkglocal const Mtimesz : int64 = 4
+ pkglocal const Lengthoff : int64 = Mtimeoff + Mtimesz
+ pkglocal const Lengthsz : int64 = 8
+ pkglocal const Stringsoff : int64 = Lengthoff + Lengthsz
;;
/* UGLY: circular dependency breaking... */