From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josh Triplett Subject: Re: [PATCH] __DATE__ & __TIME expansion Date: Sun, 20 May 2007 15:52:10 -0700 Message-ID: <4650D11A.8020706@freedesktop.org> References: <11796983862564-git-send-email-damien.lespiau@gmail.com> <11796983861111-git-send-email-damien.lespiau@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigA768D0C2DF7A3B075E7C8FBB" Return-path: Received: from mail4.sea5.speakeasy.net ([69.17.117.6]:36519 "EHLO mail4.sea5.speakeasy.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757248AbXETWwX (ORCPT ); Sun, 20 May 2007 18:52:23 -0400 In-Reply-To: <11796983861111-git-send-email-damien.lespiau@gmail.com> Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: Damien Lespiau Cc: linux-sparse@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigA768D0C2DF7A3B075E7C8FBB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Damien Lespiau wrote: > Makes __DATE__expand to a character string literal of > the form "Mmm dd yyyy" where the names of the months > are the same as those generated by the asctime function, > and the first character of dd is a space character if the > value is less than 10. > Makes __TIME__ expand to a a character string literal of > the form "hh:mm:ss" as in the time generated by the > asctime function. Thanks for this patch. I think I'd prefer to avoid calling time more tha= n once per run of the program. __DATE__ and __TIME__ seem sufficiently rar= e (ideally at most once each per project anyway) that avoiding repeated cal= ls to strftime probably doesn't matter; however, avoiding repeated calls to tim= e seems useful, even if it only avoids the one extra call when you use __DA= TE__ and __TIME__ once each. Could you make the time_t static and only call time once? Thanks, Josh Triplett --------------enigA768D0C2DF7A3B075E7C8FBB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGUNEaGJuZRtD+evsRAigxAJ9kfBO9+/Rkjg7v8iQFgvIEm+9QEACgsCIx HDH31QjYdanvMF0VomJuZ4M= =PLuh -----END PGP SIGNATURE----- --------------enigA768D0C2DF7A3B075E7C8FBB--