Origin of hjdicks and hj prefix

From the 9fans thread '[9fans] am I nuts? does 8c support packed structs?'.

C H Forsyth 17 years ago
hj were only dicks on the mips it seems, but it's easy to add it to 8c.

diff /n/dump/2004/1022/sys/src/cmd/8c/swt.c /sys/src/cmd/8c/swt.c
589a590,591
if(hjdickflg)
w = hjdickflg;
597a600,601
if(hjdickflg)
w = hjdickflg;

t.c:

	#include <u.h>
	#pragma hjdicks dick
	struct a {
	ulong x;
	long y;
	short z;
	};
	#pragma hjdicks off
	static int xxx = sizeof(struct a);
	static struct a xx[2];
	static int xxsize = sizeof(xx);

8c -S t.c

	DATA xxx<>+0(SB)/4,$10
	DATA xxsize<>+0(SB)/4,$20
	GLOBL xxsize<>+0(SB),$4
	GLOBL xx<>+0(SB),$20
	GLOBL xxx<>+0(SB),$4

perhaps i should add "xen" as a synonym for "dick"

"on" will work too, if you'd like to be less rude.

also,

	#pragma hjdicks xN

for some integer N sets the padding/rounding to N

C H Forsyth 17 years ago

	Post by Ronald G. Minnich
	but it's not there now, right?

if you apply the diffs i gave in the email to the version of /sys/src/cmd/8c/swt.c on sources, against
which i had diffed, and recompile your copy, you will (should) then have it.

	Post by Ronald G. Minnich
	and I have to know, what's the whole hj thing?

it's somewhere in the 9fans archive, but H&J (Harris & Jeffries i think) did protocol implementations
that relied on that effect extensively. oh here it is:

...
From: "Bruce Ellis" <***@chunder.com>
Date: Wed, 7 May 2003 22:47:40 +1000

pragmatism and a silly discussion over dinner.
hj were dicks for assuming that they could
lay out structs in an architecture independant way.
we had to live with it.