~humm

~humm/public-inbox

Last active 1 year, 9 months ago
View more

Recent activity

Re: [PATCH lists.sr.ht] Use format=flowed for automatic answer e-mails an hour ago

From Lennart Jablonka to ~sircmpwn/public-inbox

Quoth Matěj Cepl:
>This seems like too little. You know that meme with Aragorn
>saying “One does not simply enter Mordor” [1]? One does not simply
>make message into format=flowed by adding one header. [2]
>
># When creating flowed text, the generating agent wraps, that is,
># inserts 'soft' line breaks as needed.  Soft line breaks are added at
># natural wrapping points, such as between words.  A soft line break is
># a SP CRLF sequence.
>
>All lines should be gone through and all flowed lines should be
>finished with <space>CRLF.
>
>Best,

Re: question how to create and interact with C's array of pointers 21 days ago

From Lennart Jablonka to ~sircmpwn/hare-users

Quoth Abdul Wahab:
>The function was `LoadWEBPAnimation_RW` from sdl2_image. I need to
>iterate through the `frames` field in the `IMG_Animation` struct,
>which is `**SDL_Surface` and convert it to texture for later on to be
>rendered.
>I think the problem is solved. C's `**opaque` (array of pointers)
>translates to `*[*]*opaque` instead of `[*]opaque`. Although I haven't
>try my actual code.
>B

Note that in C, a pointer to void is incompatible with a pointer 
to SDL_Surface.  For example, a pointer to void may be larger than 
a pointer to SDL_Surface.  For you, that means that it’d be better 
to represent a C SDL_Surface** not as *[*]*opaque in Hare, but as

Re: question how to create and interact with C's array of pointers 22 days ago

From Lennart Jablonka to ~sircmpwn/hare-users

Quoth Abdul Wahab:
>how to iterate over c array? and is it possible to initialize C's
>array of pointer in Hare?

In C, when you have an array of pointers, it looks like this: 
[text diagrams]

	int i, *a[5] = {&i, &i, &i, &i, &i};

	   +----+----+----+----+----+
	a: | &i | &i | &i | &i | &i |
	   +----+----+----+----+----+

Perhaps because not every part of the code base knows the size of

[PATCH hare] rt/+openbsd: fix writev syscall 23 days ago

From Lennart Jablonka to ~sircmpwn/hare-dev

Signed-off-by: Lennart Jablonka <humm@ljabl.com>
---
 rt/+openbsd/syscalls.ha | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rt/+openbsd/syscalls.ha b/rt/+openbsd/syscalls.ha
index 10cc0e06..a5a52b45 100644
--- a/rt/+openbsd/syscalls.ha
+++ b/rt/+openbsd/syscalls.ha
@@ -938,7 +938,7 @@ export fn readv(fd: int, iov: const *[*]iovec, iovcnt: int) (size | errno) = {

// writev

@symbol("readv") fn libc_writev(d: int, iov: const *[*]iovec, iovcnt: int) size;
[message trimmed]

Re: Need example of pointers arithmetic a month ago

From Lennart Jablonka to ~sircmpwn/hare-users

Quoth Dmitry B:
>Hi! Could anybody give an example of pointers arithmetic in Hare?

While Lorenz’s answers aren’t bad, I want to add this: Pointers in 
C and pointers in Hare have different semantics.

Yes, both in C and in Hare, a pointer is a “memory address.”  But 
in C, a pointer is used as an /iterator over an array/ (or over 
a single object, as if it were a one-element array).  Pointer 
arithmetic is iterator arithmetic.  A pointer pointing at a single 
object and not into an array is a special case of the rules.  And 
on such a pointer, you wouldn’t—aren’t allowed to, by the 
standard!—do arithmetic.

Re: [PATCH hare-docs] Improve recommended lib.Makefile a month ago

From Lennart Jablonka to ~sircmpwn/hare-dev

Quoth Willow Barraco:
>I continue to dislike this way of writing install makefiles. When the
>"example" folders contains subfolders (most of the time), install will
>ommit them. We generally chains install commands, which means we have to
>update the Makefile when folders are re-organised.

That’s true.  I don’t think it’s a huge problem, but repeating 
oneself like is done right now (in the install and uninstall 
recipes) isn’t very nice.

>I found a better way (or at least I prefer it), using a bit more from Makefile.

Nice!

[PATCH himitsu-firefox] Makefile: don't depend on extension a month ago

From Lennart Jablonka to ~sircmpwn/himitsu-devel

The $< macro in non-suffix rules is an extension and doesn't work with,
for example, OpenBSD make.
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index d34d0a5..ac94c1b 100644
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,7 @@ native/himitsu-firefox-native: $(NATIVE_SOURCE)
	cd native && $(HARE) build $(HAREFLAGS) -o himitsu-firefox-native

native/manifest.json: native/manifest.json.in
[message trimmed]

Re: [PATCH hare v2] unix: add setsid, getsid 2 months ago

From Lennart Jablonka to ~sircmpwn/hare-dev

>+export fn setsid() (void | errno) = {
>+	return wrap_return(syscall0(SYS_setsid))?: void;
>+};

> // setsid
>+
>+@symbol("setsid") fn libc_setsid() pid_t;
>+
>+export fn setsid() (void | errno) = {
>+	let res = libc_setsid();
>+	if (res == -1) {
>+		return *__errno(): errno;
>+	};
>+};

[PATCH hare] configs/openbsd.mk: default to /usr/local/man 2 months ago

From Lennart Jablonka to ~sircmpwn/hare-dev

That's where man pages go on OpenBSD.  Might apply to FreeBSD too; idk.

Signed-off-by: Lennart Jablonka <humm@ljabl.com>
---
 configs/openbsd.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configs/openbsd.mk b/configs/openbsd.mk
index b7c19726..3dff0d75 100644
--- a/configs/openbsd.mk
+++ b/configs/openbsd.mk
@@ -1,7 +1,7 @@
# install locations
PREFIX = /usr/local/
[message trimmed]

[PATCH himitsu] himitsu-store: write newline at end of config.ini 2 months ago

From Lennart Jablonka to ~sircmpwn/himitsu-devel

---
 cmd/himitsu-store/main.ha | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cmd/himitsu-store/main.ha b/cmd/himitsu-store/main.ha
index a4a23ae..5554373 100644
--- a/cmd/himitsu-store/main.ha
+++ b/cmd/himitsu-store/main.ha
@@ -19,7 +19,8 @@ use net;

// XXX: Distros may want to modify the default config
const conf: str = `[himitsud]
prompter=hiprompt-gtk`;
prompter=hiprompt-gtk
[message trimmed]