avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] I fixed dtostre()


From: Joerg Wunsch
Subject: Re: [avr-libc-dev] I fixed dtostre()
Date: Mon, 9 Sep 2002 14:12:20 +0200
User-agent: Mutt/1.2.5i

As Joerg Wunsch wrote:

> Courtesy Ted Roth's simulavr and avr-gdb, i finally debugged it
> and believe that i've fixed all bugs in it, including cosmetic
> things like it sometimes spitting out a leading `0'.  The fixed
> version is in CVS now, please give it a try.

There was still another issue where a leading `0' could survive
(e. g. for displaying 6.8e-5).  I fixed this, too.

While documenting <stdlib.h>, i also decided that the flagbit
constants should be moved out into this file to become user-visible.
(The assembler source itself doesn't use them at all, but i included a
test that verifies the implied assumptions against the defined
constants).  In order to be more in line with the C notation for
#defined macros, i changed them to use all capitals, and to start with
DTOSTR_ to make it clear where they belong to.  Sorry for any
inconvenience i might have caused to existing users of this function.
At the pro side, the function is documented now. ;-)

Note that i intend to add a similar flags parameter to dtostrf() to
make it compatible (and to make it more useful for a future printf()
implementation).  Would anybody mind me changing the parameter
sequence of dtostrf() by the same time so it's going to be similar to
dtostre()?

Current dtostre():

extern char *dtostre(double __val, char *__s, unsigned char __prec,
                     unsigned char __flags);

Old:

extern char *dtostrf(double __val, char __width, char __prec, char *__s);

New:

extern char *dtostrf(double __val, char *_s, unsigned char __width,
                     unsigned char __prec, unsigned char __flags);

Note that dtostre() has no width field.  Should we add one, too?  For
a full printf() implementation, this could become handy.

-- 
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]