hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 73cd71026c8a65de21092e9d4168885dda413d1a
parent 8330f2c75131f41bc1f0eb1a1371ddf03addb180
Author: Sebastian <sebastian@sebsite.pw>
Date:   Sat,  3 Jun 2023 21:43:57 -0400

net: remove slices dependency

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mnet/msg.ha | 5++---
Mscripts/gen-stdlib | 4++--
Mstdlib.mk | 8++++----
3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/net/msg.ha b/net/msg.ha @@ -5,7 +5,6 @@ // - Set name field // - Figure out the portability mess that is this interface use rt; -use slices; use fmt; export type msghdr = struct { @@ -37,8 +36,8 @@ export fn finish(msg: *msghdr) void = { // vectors or control messages without a re-allocation, which improves // performance if the new configuration fits into the same amount of memory. export fn reset(msg: *msghdr) void = { - slices::trunc(&msg.control: *[]void); - slices::trunc(&msg.vectors: *[]void); + msg.control = msg.control[..0]; + msg.vectors = msg.vectors[..0]; }; // Adds an I/O vector to the message. diff --git a/scripts/gen-stdlib b/scripts/gen-stdlib @@ -999,14 +999,14 @@ net() { errors.ha \ msg.ha \ types.ha - gen_ssa -plinux net io errors rt fmt slices + gen_ssa -plinux net io errors rt fmt gen_srcs -pfreebsd net \ +freebsd.ha \ errors.ha \ msg.ha \ types.ha - gen_ssa -pfreebsd net io errors rt fmt slices + gen_ssa -pfreebsd net io errors rt fmt } net_dial() { diff --git a/stdlib.mk b/stdlib.mk @@ -1712,7 +1712,7 @@ stdlib_net_linux_srcs = \ $(STDLIB)/net/msg.ha \ $(STDLIB)/net/types.ha -$(HARECACHE)/net/net-linux.ssa: $(stdlib_net_linux_srcs) $(stdlib_rt) $(stdlib_io_$(PLATFORM)) $(stdlib_errors_$(PLATFORM)) $(stdlib_rt_$(PLATFORM)) $(stdlib_fmt_$(PLATFORM)) $(stdlib_slices_$(PLATFORM)) +$(HARECACHE)/net/net-linux.ssa: $(stdlib_net_linux_srcs) $(stdlib_rt) $(stdlib_io_$(PLATFORM)) $(stdlib_errors_$(PLATFORM)) $(stdlib_rt_$(PLATFORM)) $(stdlib_fmt_$(PLATFORM)) @printf 'HAREC \t$@\n' @mkdir -p $(HARECACHE)/net @$(stdlib_env) $(HAREC) $(HAREFLAGS) -o $@ -Nnet \ @@ -1725,7 +1725,7 @@ stdlib_net_freebsd_srcs = \ $(STDLIB)/net/msg.ha \ $(STDLIB)/net/types.ha -$(HARECACHE)/net/net-freebsd.ssa: $(stdlib_net_freebsd_srcs) $(stdlib_rt) $(stdlib_io_$(PLATFORM)) $(stdlib_errors_$(PLATFORM)) $(stdlib_rt_$(PLATFORM)) $(stdlib_fmt_$(PLATFORM)) $(stdlib_slices_$(PLATFORM)) +$(HARECACHE)/net/net-freebsd.ssa: $(stdlib_net_freebsd_srcs) $(stdlib_rt) $(stdlib_io_$(PLATFORM)) $(stdlib_errors_$(PLATFORM)) $(stdlib_rt_$(PLATFORM)) $(stdlib_fmt_$(PLATFORM)) @printf 'HAREC \t$@\n' @mkdir -p $(HARECACHE)/net @$(stdlib_env) $(HAREC) $(HAREFLAGS) -o $@ -Nnet \ @@ -4156,7 +4156,7 @@ testlib_net_linux_srcs = \ $(STDLIB)/net/msg.ha \ $(STDLIB)/net/types.ha -$(TESTCACHE)/net/net-linux.ssa: $(testlib_net_linux_srcs) $(testlib_rt) $(testlib_io_$(PLATFORM)) $(testlib_errors_$(PLATFORM)) $(testlib_rt_$(PLATFORM)) $(testlib_fmt_$(PLATFORM)) $(testlib_slices_$(PLATFORM)) +$(TESTCACHE)/net/net-linux.ssa: $(testlib_net_linux_srcs) $(testlib_rt) $(testlib_io_$(PLATFORM)) $(testlib_errors_$(PLATFORM)) $(testlib_rt_$(PLATFORM)) $(testlib_fmt_$(PLATFORM)) @printf 'HAREC \t$@\n' @mkdir -p $(TESTCACHE)/net @$(testlib_env) $(HAREC) $(TESTHAREFLAGS) -o $@ -Nnet \ @@ -4169,7 +4169,7 @@ testlib_net_freebsd_srcs = \ $(STDLIB)/net/msg.ha \ $(STDLIB)/net/types.ha -$(TESTCACHE)/net/net-freebsd.ssa: $(testlib_net_freebsd_srcs) $(testlib_rt) $(testlib_io_$(PLATFORM)) $(testlib_errors_$(PLATFORM)) $(testlib_rt_$(PLATFORM)) $(testlib_fmt_$(PLATFORM)) $(testlib_slices_$(PLATFORM)) +$(TESTCACHE)/net/net-freebsd.ssa: $(testlib_net_freebsd_srcs) $(testlib_rt) $(testlib_io_$(PLATFORM)) $(testlib_errors_$(PLATFORM)) $(testlib_rt_$(PLATFORM)) $(testlib_fmt_$(PLATFORM)) @printf 'HAREC \t$@\n' @mkdir -p $(TESTCACHE)/net @$(testlib_env) $(HAREC) $(TESTHAREFLAGS) -o $@ -Nnet \