Re: cvs: php4 /main spprintf.c

From: Date: Tue, 11 Feb 2003 23:39:30 +0000
Subject: Re: cvs: php4 /main spprintf.c
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-94179@lists.php.net to get a copy of this message
At 23:44 11.02.2003, Sascha Schumann wrote:
    Markus,
    here is a patch against the current CVS which
    - trims +100 lines of code from spprintf.c
    - introduces an overflow detection in STR_TO_DEC
Why then this comment? Did you forgot to remove it. +/* XXX: Does not handle overflow. */
+#define STR_TO_DEC(str, num) do {                      \
    - eliminates dead code (e.g. assert(foo); if (foo) {..})
    - removes unused macros from the original code
    - simplifies code (e.g. cc was completely dropped)
    - improves run-time performance
      The max_len feature is never used in our code base.
      Nevertheless, cpu cycles were spent on each string
      operation to check the current length against max_len which
      is quite inefficient.  Thus, I've moved the check to
      vspprintf where it is applied only once per call.
    - Sascha
Hey cool i just thought about doing that, too. You're really fast.... Unfortunatley i haven't yet the time to try it out but it looks good. Does it have any known problems? marcus p.s.: I asked about adding the cli manpage some days ago, can you help?

« previous php.dev (#94179) next »