Buf.bytes and Sys.entryKind take const (report 2026-10.33) The seed no longer compiles Buf and Sys, so the two that only read their record take it as const, as the rest of the library does. No caller changes.
| @@ -268,7 +268,7 @@ | ||
| 268 | 268 | |
| 269 | 269 | proc openDir*(var d: Dir; path: []U8): INT; |
| 270 | 270 | proc nextEntry*(var d: Dir): ([]U8, BOOL); (* a name, good until the next call; false at the end *) |
| 271 | -proc entryKind*(var d: Dir): Kind; (* what the name nextEntry gave last is *) | |
| 271 | +proc entryKind*(const d: Dir): Kind; (* what the name nextEntry gave last is *) | |
| 272 | 272 | proc closeDir*(var d: Dir); |
| 273 | 273 | |
| 274 | 274 | proc rawMode*(fd: INT): BOOL; (* the terminal on fd: no echo, no lines, no signals *) |
| @@ -625,7 +625,7 @@ | ||
| 625 | 625 | proc add*(var b: Buf; c: U8); |
| 626 | 626 | proc str*(var b: Buf; s: []U8); |
| 627 | 627 | proc spare*(var b: Buf; n: INT): []U8; (* room for n more bytes, and those bytes, to fill *) |
| 628 | -proc bytes*(b: Buf): []U8; (* what it holds, until it next grows *) | |
| 628 | +proc bytes*(const b: Buf): []U8; (* what it holds, until it next grows *) | |
| 629 | 629 | proc cut*(var b: Buf; n: INT); (* only the first n bytes kept, its memory kept *) |
| 630 | 630 | proc reset*(var b: Buf); (* emptied, its memory kept *) |
| 631 | 631 | proc done*(var b: Buf); (* its memory given back *) |
| @@ -79,7 +79,7 @@ | ||
| 79 | 79 | end; |
| 80 | 80 | |
| 81 | 81 | (* What the buffer holds, until it next grows. *) |
| 82 | -proc bytes*(b: Buf): []U8; | |
| 82 | +proc bytes*(const b: Buf): []U8; | |
| 83 | 83 | begin |
| 84 | 84 | if b.len = 0 then return ""; end; |
| 85 | 85 | return b.data[0..b.len]; |
| @@ -566,7 +566,7 @@ | ||
| 566 | 566 | (* What the name nextEntry gave last is, as the directory says, so that |
| 567 | 567 | a walk needn't ask each file with linkInfo; unknown where the file |
| 568 | 568 | system doesn't say. A link is isLink, whatever it names. *) |
| 569 | -proc entryKind*(var d: Dir): Kind; | |
| 569 | +proc entryKind*(const d: Dir): Kind; | |
| 570 | 570 | begin |
| 571 | 571 | return d.kind; |
| 572 | 572 | end; |
| @@ -629,7 +629,7 @@ | ||
| 629 | 629 | (* What the name nextEntry gave last is, as the directory says, so that |
| 630 | 630 | a walk needn't ask each file with linkInfo; unknown where the file |
| 631 | 631 | system doesn't say. A link is isLink, whatever it names. *) |
| 632 | -proc entryKind*(var d: Dir): Kind; | |
| 632 | +proc entryKind*(const d: Dir): Kind; | |
| 633 | 633 | begin |
| 634 | 634 | return d.kind; |
| 635 | 635 | end; |