~ubuntu-branches/ubuntu/trusty/avr-libc/trusty-proposed

« back to all changes in this revision

Viewing changes to libc/stdlib/dtostre.c

  • Committer: Package Import Robot
  • Author(s): Hakan Ardo
  • Date: 2012-05-23 10:30:07 UTC
  • mfrom: (10.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20120523103007-q41qxawuhqv6bn5j
Tags: 1:1.8.0-2
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
27
  POSSIBILITY OF SUCH DAMAGE. */
28
28
 
29
 
/* $Id: dtostre.c 1944 2009-04-01 23:12:20Z arcanum $ */
 
29
/* $Id: dtostre.c 2241 2011-05-11 12:59:48Z joerg_wunsch $ */
30
30
 
31
31
#include <stdlib.h>
32
32
#include <avr/pgmspace.h>
37
37
char *
38
38
dtostre (double val, char *sbeg, unsigned char prec, unsigned char flags)
39
39
{
40
 
    __attribute__((progmem)) static char str_nan[2][4] =
 
40
    __attribute__((progmem)) static const char str_nan[2][4] =
41
41
        {"nan", "NAN"};
42
 
    __attribute__((progmem)) static char str_inf[2][sizeof(str_nan[0])] =
 
42
    __attribute__((progmem)) static const char str_inf[2][sizeof(str_nan[0])] =
43
43
        {"inf", "INF"};
44
44
    char *d;            /* dst  */
45
 
    char *s;            /* src  */
 
45
    const char *s;              /* src  */
46
46
    signed char exp;
47
47
    unsigned char vtype;
48
48