Ignore:
Timestamp:
2012-02-28T13:59:00+13:00 (12 years ago)
Author:
kjdon
Message:

merged 64_bit_Greenstone branch into trunk, rev 25139

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/common-src/indexers/mg/lib/netorder.h

    r22257 r25147  
    1717#define HTOND(d)                                                                                  \
    1818        do {                                                                                      \
    19              unsigned long tmph, tmpl;                                                            \
     19             mg_u_long tmph, tmpl;                                                            \
    2020         bcopy ((char *) &d, (char *) &tmph, sizeof(double) >> 1);                            \
    2121         bcopy ((char *) &d + (sizeof(double) >> 1), (char *) &tmpl, sizeof (double) >> 1);   \
     
    2727#define NTOHD(d)                                                                                  \
    2828        do {                                                                                      \
    29              unsigned long tmph, tmpl;                                                            \
     29             mg_u_long tmph, tmpl;                                                            \
    3030         bcopy ((char *) &d, (char *) &tmph, sizeof(double) >> 1);                            \
    3131         bcopy ((char *) &d + (sizeof(double) >> 1), (char *) &tmpl, sizeof (double) >> 1);   \
     
    3737#define HTOND2(hd, nd)                                                                            \
    3838        do {                                                                                      \
    39              unsigned long tmph, tmpl;                                                            \
     39             mg_u_long tmph, tmpl;                                                            \
    4040         bcopy ((char *) &hd, (char *) &tmph, sizeof(double) >> 1);                           \
    4141         bcopy ((char *) &hd + (sizeof(double) >> 1), (char *) &tmpl, sizeof (double) >> 1);  \
     
    4747#define NTOHD2(nd, hd)                                                                            \
    4848        do {                                                                                      \
    49              unsigned long tmph, tmpl;                                                            \
     49             mg_u_long tmph, tmpl;                                                            \
    5050         bcopy ((char *) &nd, (char *) &tmph, sizeof(double) >> 1);                           \
    5151         bcopy ((char *) &nd + (sizeof(double) >> 1), (char *) &tmpl, sizeof (double) >> 1);  \
     
    5959#define HTONF(f)                                                                   \
    6060        do {                                                                       \
    61              unsigned long tmp;                                                    \
     61             mg_u_long tmp;                                                    \
    6262             bcopy ((char *) &(f), (char *) &tmp, sizeof (float));                 \
    6363             HTONUL (tmp);                                                         \
     
    6666#define NTOHF(f)                                                                   \
    6767        do {                                                                       \
    68              unsigned long tmp;                                                    \
     68             mg_u_long tmp;                                                    \
    6969             bcopy ((char *) &(f), (char *) &tmp, sizeof (float));                 \
    7070         NTOHUL (tmp);                                                         \
     
    7373#define HTONF2(hf, nf)                                                             \
    7474        do {                                                                       \
    75              unsigned long tmp;                                                    \
     75             mg_u_long tmp;                                                    \
    7676             bcopy ((char *) &(hf), (char *) &tmp, sizeof (float));                \
    7777             HTONUL (tmp);                                                         \
     
    8080#define NTOHF2(nf, hf)                                                             \
    8181        do {                                                                       \
    82              unsigned long tmp;                                                    \
     82             mg_u_long tmp;                                                    \
    8383             bcopy ((char *) &(nf), (char *) &tmp, sizeof (float));                \
    8484         NTOHUL (tmp);                                                         \
     
    115115
    116116/* pointers */
    117 #define HTONP(p)          ((p) = (void *) htonl ((unsigned long) p))
    118 #define NTOHP(p)          ((p) = (void *) ntohl ((unsigned long) p))
    119 #define HTONP2(hp, np)    ((np) = (void *) htonl ((unsigned long) hp))
    120 #define NTOHP2(np, hp)    ((hp) = (void *) ntohl ((unsigned long) np))
     117#define HTONP(p)          ((p) = (void *) htonl ((mg_u_long) p))
     118#define NTOHP(p)          ((p) = (void *) ntohl ((mg_u_long) p))
     119#define HTONP2(hp, np)    ((np) = (void *) htonl ((mg_u_long) hp))
     120#define NTOHP2(np, hp)    ((hp) = (void *) ntohl ((mg_u_long) np))
    121121
    122122/* unsigned long */
     
    127127
    128128/* signed long */
    129 #define HTONSL(l)         ((l) = (long) htonl ((unsigned long) (l)))
    130 #define NTOHSL(l)         ((l) = (long) ntohl ((unsigned long) (l)))
    131 #define HTONSL2(hl, nl)   ((nl) = (long) htonl ((unsigned long) (hl)))
    132 #define NTOHSL2(nl, hl)   ((hl) = (long) ntohl ((unsigned long) (nl)))
     129#define HTONSL(l)         ((l) = (mg_s_long) htonl ((mg_u_long) (l)))
     130#define NTOHSL(l)         ((l) = (mg_s_long) ntohl ((mg_u_long) (l)))
     131#define HTONSL2(hl, nl)   ((nl) = (mg_s_long) htonl ((mg_u_long) (hl)))
     132#define NTOHSL2(nl, hl)   ((hl) = (mg_s_long) ntohl ((mg_u_long) (nl)))
    133133
    134134/* unsigned int */
    135 #define HTONUI(i)         ((i) = (unsigned int) htonl ((unsigned long) (i)))
    136 #define NTOHUI(i)         ((i) = (unsigned int) ntohl ((unsigned long) (i)))
    137 #define HTONUI2(hi, ni)   ((ni) = (unsigned int) htonl ((unsigned long) (hi)))
    138 #define NTOHUI2(ni, hi)   ((hi) = (unsigned int) ntohl ((unsigned long) (ni)))
     135#define HTONUI(i)         ((i) = (unsigned int) htonl ((mg_u_long) (i)))
     136#define NTOHUI(i)         ((i) = (unsigned int) ntohl ((mg_u_long) (i)))
     137#define HTONUI2(hi, ni)   ((ni) = (unsigned int) htonl ((mg_u_long) (hi)))
     138#define NTOHUI2(ni, hi)   ((hi) = (unsigned int) ntohl ((mg_u_long) (ni)))
    139139
    140140/* signed int */
    141 #define HTONSI(i)         ((i) = (int) htonl ((unsigned long) (i)))
    142 #define NTOHSI(i)         ((i) = (int) ntohl ((unsigned long) (i)))
    143 #define HTONSI2(hi, ni)   ((ni) = (int) htonl ((unsigned long) (hi)))
    144 #define NTOHSI2(ni, hi)   ((hi) = (int) ntohl ((unsigned long) (ni)))
     141#define HTONSI(i)         ((i) = (int) htonl ((mg_u_long) (i)))
     142#define NTOHSI(i)         ((i) = (int) ntohl ((mg_u_long) (i)))
     143#define HTONSI2(hi, ni)   ((ni) = (int) htonl ((mg_u_long) (hi)))
     144#define NTOHSI2(ni, hi)   ((hi) = (int) ntohl ((mg_u_long) (ni)))
    145145
    146146/* unsigned short */
Note: See TracChangeset for help on using the changeset viewer.