raz / commit 9b7ca9ea

commit
9b7ca9eabf546a1bb75956867dfe713bfc5af0f4
author
Luis <42945842+ldiaz94@users.noreply.github.com>
date
parent
a2ea2c5e
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.

patch · log

4 files changed, +5 -5

doc/raz-lib.md (history) modified +2 -2

@@ -268,7 +268,7 @@
268268
269269 proc openDir*(var d: Dir; path: []U8): INT;
270270 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 *)
272272 proc closeDir*(var d: Dir);
273273
274274 proc rawMode*(fd: INT): BOOL; (* the terminal on fd: no echo, no lines, no signals *)
@@ -625,7 +625,7 @@
625625 proc add*(var b: Buf; c: U8);
626626 proc str*(var b: Buf; s: []U8);
627627 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 *)
629629 proc cut*(var b: Buf; n: INT); (* only the first n bytes kept, its memory kept *)
630630 proc reset*(var b: Buf); (* emptied, its memory kept *)
631631 proc done*(var b: Buf); (* its memory given back *)

lib/Buf.raz (history) modified +1 -1

@@ -79,7 +79,7 @@
7979 end;
8080
8181 (* What the buffer holds, until it next grows. *)
82-proc bytes*(b: Buf): []U8;
82+proc bytes*(const b: Buf): []U8;
8383 begin
8484 if b.len = 0 then return ""; end;
8585 return b.data[0..b.len];

lib/Sys.linux-x86_64.raz (history) modified +1 -1

@@ -566,7 +566,7 @@
566566 (* What the name nextEntry gave last is, as the directory says, so that
567567 a walk needn't ask each file with linkInfo; unknown where the file
568568 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;
570570 begin
571571 return d.kind;
572572 end;

lib/Sys.raz (history) modified +1 -1

@@ -629,7 +629,7 @@
629629 (* What the name nextEntry gave last is, as the directory says, so that
630630 a walk needn't ask each file with linkInfo; unknown where the file
631631 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;
633633 begin
634634 return d.kind;
635635 end;