Changeset 5a2feea in rtems


Ignore:
Timestamp:
May 8, 2007, 9:10:19 PM (13 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
890d2c6
Parents:
70e624e
Message:

2007-05-08 Ralf Corsépius <ralf.corsepius@…>

  • libnetworking/machine/endian.h: Convert htons, htonl, ntohs, ntohl to inline functions, using uint[16,32]_t.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r70e624e r5a2feea  
    112007-05-08      Ralf Corsépius <ralf.corsepius@rtems.org>
    22
     3        * libnetworking/machine/endian.h: Convert htons, htonl, ntohs, ntohl
     4        to inline functions, using uint[16,32]_t.
    35        * libnetworking/netdb.h: Change netent->n_net to uint32_t to comply
    46        with SUSv3.
  • cpukit/libnetworking/machine/endian.h

    r70e624e r5a2feea  
    3232 */
    3333
    34 #define       ntohl(_x)        (_x)
    35 #define       ntohs(_x)        (_x)
    36 #define       htonl(_x)        (_x)
    37 #define       htons(_x)        (_x)
     34static inline uint32_t ntohl( uint32_t _x )
     35{
     36  return _x;
     37}
     38
     39static inline uint16_t ntohs( uint16_t _x )
     40{
     41  return _x;
     42}
     43
     44static inline uint32_t htonl( uint32_t _x )
     45{
     46  return _x;
     47}
     48
     49static inline uint16_t htons( uint16_t _x )
     50{
     51  return _x;
     52}
    3853
    3954#define NTOHS(x)
     
    4863 */
    4964
    50 #define       ntohl(_x)        ((long)  CPU_swap_u32((uint32_t  )_x))
    51 #define       ntohs(_x)        ((short) CPU_swap_u16((uint16_t  )_x))
    52 #define       htonl(_x)        ((long)  CPU_swap_u32((uint32_t  )_x))
    53 #define       htons(_x)        ((short) CPU_swap_u16((uint16_t  )_x))
     65static inline uint32_t ntohl( uint32_t _x )
     66{
     67  return CPU_swap_u32(_x);
     68}
     69
     70static inline uint16_t ntohs( uint16_t _x )
     71{
     72  return CPU_swap_u16(_x);
     73}
     74
     75static inline uint32_t htonl( uint32_t _x )
     76{
     77  return CPU_swap_u32(_x);
     78}
     79
     80static inline uint16_t htons( uint16_t _x )
     81{
     82  return CPU_swap_u16(_x);
     83}
    5484
    5585#define NTOHS(x) (x) = ntohs(x)
Note: See TracChangeset for help on using the changeset viewer.