- Timestamp:
- 2012-02-28T13:59:00+13:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/common-src/indexers/mg/lib/netorder.h
r22257 r25147 17 17 #define HTOND(d) \ 18 18 do { \ 19 unsignedlong tmph, tmpl; \19 mg_u_long tmph, tmpl; \ 20 20 bcopy ((char *) &d, (char *) &tmph, sizeof(double) >> 1); \ 21 21 bcopy ((char *) &d + (sizeof(double) >> 1), (char *) &tmpl, sizeof (double) >> 1); \ … … 27 27 #define NTOHD(d) \ 28 28 do { \ 29 unsignedlong tmph, tmpl; \29 mg_u_long tmph, tmpl; \ 30 30 bcopy ((char *) &d, (char *) &tmph, sizeof(double) >> 1); \ 31 31 bcopy ((char *) &d + (sizeof(double) >> 1), (char *) &tmpl, sizeof (double) >> 1); \ … … 37 37 #define HTOND2(hd, nd) \ 38 38 do { \ 39 unsignedlong tmph, tmpl; \39 mg_u_long tmph, tmpl; \ 40 40 bcopy ((char *) &hd, (char *) &tmph, sizeof(double) >> 1); \ 41 41 bcopy ((char *) &hd + (sizeof(double) >> 1), (char *) &tmpl, sizeof (double) >> 1); \ … … 47 47 #define NTOHD2(nd, hd) \ 48 48 do { \ 49 unsignedlong tmph, tmpl; \49 mg_u_long tmph, tmpl; \ 50 50 bcopy ((char *) &nd, (char *) &tmph, sizeof(double) >> 1); \ 51 51 bcopy ((char *) &nd + (sizeof(double) >> 1), (char *) &tmpl, sizeof (double) >> 1); \ … … 59 59 #define HTONF(f) \ 60 60 do { \ 61 unsignedlong tmp; \61 mg_u_long tmp; \ 62 62 bcopy ((char *) &(f), (char *) &tmp, sizeof (float)); \ 63 63 HTONUL (tmp); \ … … 66 66 #define NTOHF(f) \ 67 67 do { \ 68 unsignedlong tmp; \68 mg_u_long tmp; \ 69 69 bcopy ((char *) &(f), (char *) &tmp, sizeof (float)); \ 70 70 NTOHUL (tmp); \ … … 73 73 #define HTONF2(hf, nf) \ 74 74 do { \ 75 unsignedlong tmp; \75 mg_u_long tmp; \ 76 76 bcopy ((char *) &(hf), (char *) &tmp, sizeof (float)); \ 77 77 HTONUL (tmp); \ … … 80 80 #define NTOHF2(nf, hf) \ 81 81 do { \ 82 unsignedlong tmp; \82 mg_u_long tmp; \ 83 83 bcopy ((char *) &(nf), (char *) &tmp, sizeof (float)); \ 84 84 NTOHUL (tmp); \ … … 115 115 116 116 /* pointers */ 117 #define HTONP(p) ((p) = (void *) htonl (( unsignedlong) p))118 #define NTOHP(p) ((p) = (void *) ntohl (( unsignedlong) p))119 #define HTONP2(hp, np) ((np) = (void *) htonl (( unsignedlong) hp))120 #define NTOHP2(np, hp) ((hp) = (void *) ntohl (( unsignedlong) 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)) 121 121 122 122 /* unsigned long */ … … 127 127 128 128 /* signed long */ 129 #define HTONSL(l) ((l) = ( long) htonl ((unsignedlong) (l)))130 #define NTOHSL(l) ((l) = ( long) ntohl ((unsignedlong) (l)))131 #define HTONSL2(hl, nl) ((nl) = ( long) htonl ((unsignedlong) (hl)))132 #define NTOHSL2(nl, hl) ((hl) = ( long) ntohl ((unsignedlong) (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))) 133 133 134 134 /* unsigned int */ 135 #define HTONUI(i) ((i) = (unsigned int) htonl (( unsignedlong) (i)))136 #define NTOHUI(i) ((i) = (unsigned int) ntohl (( unsignedlong) (i)))137 #define HTONUI2(hi, ni) ((ni) = (unsigned int) htonl (( unsignedlong) (hi)))138 #define NTOHUI2(ni, hi) ((hi) = (unsigned int) ntohl (( unsignedlong) (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))) 139 139 140 140 /* signed int */ 141 #define HTONSI(i) ((i) = (int) htonl (( unsignedlong) (i)))142 #define NTOHSI(i) ((i) = (int) ntohl (( unsignedlong) (i)))143 #define HTONSI2(hi, ni) ((ni) = (int) htonl (( unsignedlong) (hi)))144 #define NTOHSI2(ni, hi) ((hi) = (int) ntohl (( unsignedlong) (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))) 145 145 146 146 /* unsigned short */
Note:
See TracChangeset
for help on using the changeset viewer.