Changeset 5df16fab in rtems


Ignore:
Timestamp:
Feb 1, 2011, 5:39:20 AM (8 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.11, master
Children:
61bbacea
Parents:
c368bd6
Message:

2011-02-01 Ralf Corsepius <ralf.corsepius@…>

  • libmisc/stringto/stringtolonglong.c: Reformat range check. c99 portability improvements. Add check for result==0.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rc368bd6 r5df16fab  
    112011-02-01      Ralf Corsepius <ralf.corsepius@rtems.org>
    22
     3        * libmisc/stringto/stringtolonglong.c: Reformat range check.
     4        c99 portability improvements. Add check for result==0.
    35        * libmisc/stringto/stringtounsignedlonglong.c: Reformat range check.
    46        c99 portability improvements.
  • cpukit/libmisc/stringto/stringtolonglong.c

    rc368bd6 r5df16fab  
    2121
    2222#include <rtems/stringto.h>
     23
     24/* c99 has LLONG_MAX instead of LONG_LONG_MAX */
     25#ifndef LONG_LONG_MAX
     26#define LONG_LONG_MAX   LLONG_MAX
     27#endif
     28/* c99 has LLONG_MIN instead of LONG_LONG_MIN */
     29#ifndef LONG_LONG_MIN
     30#define LONG_LONG_MIN   LLONG_MIN
     31#endif
    2332
    2433/*
     
    5059    return RTEMS_NOT_DEFINED;
    5160
    52   if ( (result == LONG_LONG_MAX) && (errno == ERANGE) )
    53     return RTEMS_INVALID_NUMBER;
    54 
    55   if ( (result == LONG_LONG_MIN) && (errno == ERANGE) )
    56     return RTEMS_INVALID_NUMBER;
     61  if ( ( errno == ERANGE ) &&
     62    (( result == 0 ) || ( result == LONG_LONG_MAX ) || ( result == LONG_LONG_MIN )))
     63      return RTEMS_INVALID_NUMBER;
    5764
    5865  *n = result;
Note: See TracChangeset for help on using the changeset viewer.