Subject: Re: Implementation of RFC 1201 arcnet
To: Ignatios Souvatzis <email@example.com>
From: Chris G Demetriou <Chris_G_Demetriou@LAGAVULIN.PDL.CS.CMU.EDU>
Date: 03/16/1995 19:03:49
> (line 44:)
> * 14.07.1994 TR -- Now shouldn't cause those NFS 'odd length' messages.
> (line 547:)
> /* This should solve the NFS odd length packet problem... */
> head->m_data += (((sizeof(struct ether_header) + 3) & ~3) -
> sizeof(struct ether_header));
hmm. sounds odd. "whatever."
> you don't even need to build a table, you can have a simple function,
> e.g. int arc_padding(u_char packet_type); which returned the number of
> bytes of padding necessary. it could consist of a short switch table,
> defaulting to 0 bytes of padding.
> You're saying, a subroutine call is cheaper than a 256 byte array
> indexing? Or is it simply a matter of programming style?
it's a matter of programming style; _I_ would do it as a function call
(or macro invocation; they look the same, mostly). you could just
#define arc_padding(packet_type) [ ... ]
to be an array lookup...