[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: RFC: date parser strawman

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2003-12-30 23:07:29 CET

On Tue, 2003-12-30 at 15:08, kfogel@collab.net wrote:
> I'm a bit mystified by the casting of &ms to get base, and by the
> pointer arithmetic here.

This is how you deal with structure offsets in C. I had initially
suggested that mbk should write a function which maps a template
character to an apr_int32_t * using a case statement or a ? :
expression, in which case you could use more conventional C constructs,
but the table approach has its elegance too. But, since you can't write
&exp->tm_usec in a table initializer (in C89, at least), you have to use
the byte offset instead.

A comment might be appropriate, since this is a little-used feature of
C.

Just noticed a naming bug, incidentally; the constant MILLI should
probably be named MICRO instead.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Dec 30 23:12:15 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.