Changeset c368bd6 in rtems


Ignore:
Timestamp:
Feb 1, 2011, 5:38:01 AM (9 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.11, master
Children:
5df16fab
Parents:
37ecff5c
Message:

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

  • libmisc/stringto/stringtounsignedlonglong.c: Reformat range check. c99 portability improvements.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r37ecff5c rc368bd6  
    112011-02-01      Ralf Corsepius <ralf.corsepius@rtems.org>
    22
     3        * libmisc/stringto/stringtounsignedlonglong.c: Reformat range check.
     4        c99 portability improvements.
    35        * libmisc/stringto/stringtounsignedlong.c: Reformat range check.
    46        * libmisc/stringto/stringtolong.c:  Reformat range check.
  • cpukit/libmisc/stringto/stringtounsignedlonglong.c

    r37ecff5c rc368bd6  
    2121
    2222#include <rtems/stringto.h>
     23
     24/* c99 has ULLONG_MAX instead of ULONG_LONG_MAX */
     25#ifndef ULONG_LONG_MAX
     26#define ULONG_LONG_MAX  ULLONG_MAX
     27#endif
    2328
    2429/*
     
    5055    return RTEMS_NOT_DEFINED;
    5156
    52   if ( (result == ULONG_LONG_MAX) && (errno == ERANGE) )
    53     return RTEMS_INVALID_NUMBER;
    54 
    55   if ( (result == 0) && (errno == ERANGE) )
    56     return RTEMS_INVALID_NUMBER;
     57  if ( ( errno == ERANGE ) &&
     58    (( result == 0 ) || ( result == ULONG_LONG_MAX )))
     59      return RTEMS_INVALID_NUMBER;
    5760
    5861  *n = result;
Note: See TracChangeset for help on using the changeset viewer.