$OpenBSD: patch-codec_cc,v 1.2 2002/01/08 12:33:23 naddy Exp $
--- orb/codec.cc.orig	Fri Sep 21 17:05:51 2001
+++ orb/codec.cc	Mon Jan  7 13:27:26 2002
@@ -1014,13 +1014,13 @@ CORBA::DataDecoder::byteorder (CORBA::By
 
 /**************************** CDREncoder ******************************/
 
-static inline void swap2 (void *d, const void *s)
+static inline void swapp2 (void *d, const void *s)
 {
     ((CORBA::Octet *)d)[0] = ((CORBA::Octet *)s)[1];
     ((CORBA::Octet *)d)[1] = ((CORBA::Octet *)s)[0];
 }
 
-static inline void swap4 (void *d, const void *s)
+static inline void swapp4 (void *d, const void *s)
 {
     ((CORBA::Octet *)d)[0] = ((CORBA::Octet *)s)[3];
     ((CORBA::Octet *)d)[1] = ((CORBA::Octet *)s)[2];
@@ -1028,7 +1028,7 @@ static inline void swap4 (void *d, const
     ((CORBA::Octet *)d)[3] = ((CORBA::Octet *)s)[0];
 }
 
-static inline void swap8 (void *d, const void *s)
+static inline void swapp8 (void *d, const void *s)
 {
     ((CORBA::Octet *)d)[0] = ((CORBA::Octet *)s)[7];
     ((CORBA::Octet *)d)[1] = ((CORBA::Octet *)s)[6];
@@ -1040,7 +1040,7 @@ static inline void swap8 (void *d, const
     ((CORBA::Octet *)d)[7] = ((CORBA::Octet *)s)[0];
 }
 
-static inline void swap16 (void *d, const void *s)
+static inline void swapp16 (void *d, const void *s)
 {
     ((CORBA::Octet *)d)[0]  = ((CORBA::Octet *)s)[15];
     ((CORBA::Octet *)d)[1]  = ((CORBA::Octet *)s)[14];
@@ -1096,7 +1096,7 @@ MICO::CDREncoder::put_short (CORBA::Shor
 	buf->put2 (&s);
     } else {
 	CORBA::Short s2;
-	swap2 (&s2, &s);
+	swapp2 (&s2, &s);
 	buf->put2 (&s2);
     }
 }
@@ -1108,7 +1108,7 @@ MICO::CDREncoder::put_ushort (CORBA::USh
 	buf->put2 (&us);
     } else {
 	CORBA::UShort us2;
-	swap2 (&us2, &us);
+	swapp2 (&us2, &us);
 	buf->put2 (&us2);
     }
 }
@@ -1120,7 +1120,7 @@ MICO::CDREncoder::put_long (CORBA::Long 
 	buf->put4 (&l);
     } else {
 	CORBA::Long l2;
-	swap4 (&l2, &l);
+	swapp4 (&l2, &l);
 	buf->put4 (&l2);
     }
 }
@@ -1132,7 +1132,7 @@ MICO::CDREncoder::put_longlong (CORBA::L
 	buf->put8 (&l);
     } else {
 	CORBA::LongLong l2;
-	swap8 (&l2, &l);
+	swapp8 (&l2, &l);
 	buf->put8 (&l2);
     }
 }
@@ -1144,7 +1144,7 @@ MICO::CDREncoder::put_ulong (CORBA::ULon
 	buf->put4 (&ul);
     } else {
 	CORBA::ULong ul2;
-	swap4 (&ul2, &ul);
+	swapp4 (&ul2, &ul);
 	buf->put4 (&ul2);
     }
 }
@@ -1156,7 +1156,7 @@ MICO::CDREncoder::put_ulonglong (CORBA::
 	buf->put8 (&ul);
     } else {
 	CORBA::ULongLong ul2;
-	swap8 (&ul2, &ul);
+	swapp8 (&ul2, &ul);
 	buf->put8 (&ul2);
     }
 }
@@ -1169,7 +1169,7 @@ MICO::CDREncoder::put_float (CORBA::Floa
 	buf->put4 (&f);
     } else {
 	CORBA::Float f2;
-	swap4 (&f2, &f);
+	swapp4 (&f2, &f);
 	buf->put4 (&f2);
     }
 #else
@@ -1179,7 +1179,7 @@ MICO::CDREncoder::put_float (CORBA::Floa
 	buf->put4 (b);
     } else {
 	CORBA::Octet b2[4];
-	swap4 (b2, b);
+	swapp4 (b2, b);
 	buf->put4 (b2);
     }
 #endif
@@ -1193,7 +1193,7 @@ MICO::CDREncoder::put_double (CORBA::Dou
 	buf->put8 (&d);
     } else {
 	CORBA::Double d2;
-	swap8 (&d2, &d);
+	swapp8 (&d2, &d);
 	buf->put8 (&d2);
     }
 #else
@@ -1203,7 +1203,7 @@ MICO::CDREncoder::put_double (CORBA::Dou
 	buf->put8 (b);
     } else {
 	CORBA::Octet b2[8];
-	swap8 (b2, b);
+	swapp8 (b2, b);
 	buf->put8 (b2);
     }
 #endif
@@ -1217,7 +1217,7 @@ MICO::CDREncoder::put_longdouble (CORBA:
 	buf->put16 (&d);
     } else {
 	CORBA::LongDouble d2;
-	swap16 (&d2, &d);
+	swapp16 (&d2, &d);
 	buf->put16 (&d2);
     }
 #else
@@ -1227,7 +1227,7 @@ MICO::CDREncoder::put_longdouble (CORBA:
 	buf->put16 (b);
     } else {
 	CORBA::Octet b2[16];
-	swap16 (b2, b);
+	swapp16 (b2, b);
 	buf->put16 (b2);
     }
 #endif
@@ -1281,7 +1281,7 @@ MICO::CDREncoder::put_shorts (const CORB
 	buf->resize (2*l);
 	CORBA::Short *d = (CORBA::Short *)buf->wdata();
 	for (CORBA::Long i = l; --i >= 0; ++d, ++p)
-	    swap2 (d, p);
+	    swapp2 (d, p);
 	buf->wseek_rel (2*l);
     }
 }
@@ -1296,7 +1296,7 @@ MICO::CDREncoder::put_ushorts (const COR
 	buf->resize (2*l);
 	CORBA::UShort *d = (CORBA::UShort *)buf->wdata();
 	for (CORBA::Long i = l; --i >= 0; ++d, ++p)
-	    swap2 (d, p);
+	    swapp2 (d, p);
 	buf->wseek_rel (2*l);
     }
 }
@@ -1311,7 +1311,7 @@ MICO::CDREncoder::put_longs (const CORBA
 	buf->resize (4*l);
 	CORBA::Long *d = (CORBA::Long *)buf->wdata();
 	for (CORBA::Long i = l; --i >= 0; ++d, ++p)
-	    swap4 (d, p);
+	    swapp4 (d, p);
 	buf->wseek_rel (4*l);
     }
 }
@@ -1326,7 +1326,7 @@ MICO::CDREncoder::put_longlongs (const C
 	buf->resize (8*l);
 	CORBA::LongLong *d = (CORBA::LongLong *)buf->wdata();
 	for (CORBA::Long i = l; --i >= 0; ++d, ++p)
-	    swap8 (d, p);
+	    swapp8 (d, p);
 	buf->wseek_rel (8*l);
     }
 }
@@ -1341,7 +1341,7 @@ MICO::CDREncoder::put_ulongs (const CORB
 	buf->resize (4*l);
 	CORBA::ULong *d = (CORBA::ULong *)buf->wdata();
 	for (CORBA::Long i = l; --i >= 0; ++d, ++p)
-	    swap4 (d, p);
+	    swapp4 (d, p);
 	buf->wseek_rel (4*l);
     }
 }
@@ -1356,7 +1356,7 @@ MICO::CDREncoder::put_ulonglongs (const 
 	buf->resize (8*l);
 	CORBA::ULongLong *d = (CORBA::ULongLong *)buf->wdata();
 	for (CORBA::Long i = l; --i >= 0; ++d, ++p)
-	    swap8 (d, p);
+	    swapp8 (d, p);
 	buf->wseek_rel (8*l);
     }
 }
@@ -1571,7 +1571,7 @@ MICO::CDRDecoder::get_short (CORBA::Shor
     CORBA::Short s2;
     if (!buf->get2 (&s2))
 	return FALSE;
-    swap2 (&s, &s2);
+    swapp2 (&s, &s2);
     return TRUE;
 }
 
@@ -1584,7 +1584,7 @@ MICO::CDRDecoder::get_ushort (CORBA::USh
     CORBA::UShort us2;
     if (!buf->get2 (&us2))
 	return FALSE;
-    swap2 (&us, &us2);
+    swapp2 (&us, &us2);
     return TRUE;
 }
 
@@ -1597,7 +1597,7 @@ MICO::CDRDecoder::get_long (CORBA::Long 
     CORBA::Long l2;
     if (!buf->get4 (&l2))
 	return FALSE;
-    swap4 (&l, &l2);
+    swapp4 (&l, &l2);
     return TRUE;
 }
 
@@ -1610,7 +1610,7 @@ MICO::CDRDecoder::get_longlong (CORBA::L
     CORBA::LongLong l2;
     if (!buf->get8 (&l2))
 	return FALSE;
-    swap8 (&l, &l2);
+    swapp8 (&l, &l2);
     return TRUE;
 }
 
@@ -1623,7 +1623,7 @@ MICO::CDRDecoder::get_ulong (CORBA::ULon
     CORBA::ULong ul2;
     if (!buf->get4 (&ul2))
 	return FALSE;
-    swap4 (&ul, &ul2);
+    swapp4 (&ul, &ul2);
     return TRUE;
 }
 
@@ -1636,7 +1636,7 @@ MICO::CDRDecoder::get_ulonglong (CORBA::
     CORBA::ULongLong ul2;
     if (!buf->get8 (&ul2))
 	return FALSE;
-    swap8 (&ul, &ul2);
+    swapp8 (&ul, &ul2);
     return TRUE;
 }
 
@@ -1650,7 +1650,7 @@ MICO::CDRDecoder::get_float (CORBA::Floa
     CORBA::Float f2;
     if (!buf->get4 (&f2))
 	return FALSE;
-    swap4 (&f, &f2);
+    swapp4 (&f, &f2);
 #else
     CORBA::Octet b[4];
     if (data_bo == mach_bo) {
@@ -1663,7 +1663,7 @@ MICO::CDRDecoder::get_float (CORBA::Floa
     CORBA::Octet b2[4];
     if (!buf->get4 (b2))
 	return FALSE;
-    swap4 (&b, &b2);
+    swapp4 (&b, &b2);
     mico_ieee2float (b, f);
 #endif
     return TRUE;
@@ -1679,7 +1679,7 @@ MICO::CDRDecoder::get_double (CORBA::Dou
     CORBA::Double d2;
     if (!buf->get8 (&d2))
 	return FALSE;
-    swap8 (&d, &d2);
+    swapp8 (&d, &d2);
 #else
     CORBA::Octet b[8];
     if (data_bo == mach_bo) {
@@ -1692,7 +1692,7 @@ MICO::CDRDecoder::get_double (CORBA::Dou
     CORBA::Octet b2[8];
     if (!buf->get8 (b2))
 	return FALSE;
-    swap8 (&b, &b2);
+    swapp8 (&b, &b2);
     mico_ieee2double (b, d);
 #endif
     return TRUE;
@@ -1708,7 +1708,7 @@ MICO::CDRDecoder::get_longdouble (CORBA:
     CORBA::LongDouble d2;
     if (!buf->get16 (&d2))
 	return FALSE;
-    swap16 (&d, &d2);
+    swapp16 (&d, &d2);
 #else
     CORBA::Octet b[16];
     if (data_bo == mach_bo) {
@@ -1721,7 +1721,7 @@ MICO::CDRDecoder::get_longdouble (CORBA:
     CORBA::Octet b2[16];
     if (!buf->get16 (b2))
 	return FALSE;
-    swap16 (&b, &b2);
+    swapp16 (&b, &b2);
     mico_ieee2ldouble (b, d);
 #endif
     return TRUE;
@@ -1779,7 +1779,7 @@ MICO::CDRDecoder::get_shorts (CORBA::Sho
 
     CORBA::Short *s = (CORBA::Short *)buf->data();
     for (CORBA::Long i = l; --i >= 0; ++p, ++s)
-	swap2 (p, s);
+	swapp2 (p, s);
     buf->rseek_rel (2*l);
 
     return TRUE;
@@ -1799,7 +1799,7 @@ MICO::CDRDecoder::get_ushorts (CORBA::US
 
     CORBA::UShort *s = (CORBA::UShort *)buf->data();
     for (CORBA::Long i = l; --i >= 0; ++p, ++s)
-	swap2 (p, s);
+	swapp2 (p, s);
     buf->rseek_rel (2*l);
 
     return TRUE;
@@ -1819,7 +1819,7 @@ MICO::CDRDecoder::get_longs (CORBA::Long
 
     CORBA::Long *s = (CORBA::Long *)buf->data();
     for (CORBA::Long i = l; --i >= 0; ++p, ++s)
-	swap4 (p, s);
+	swapp4 (p, s);
     buf->rseek_rel (4*l);
 
     return TRUE;
@@ -1839,7 +1839,7 @@ MICO::CDRDecoder::get_longlongs (CORBA::
 
     CORBA::LongLong *s = (CORBA::LongLong *)buf->data();
     for (CORBA::Long i = l; --i >= 0; ++p, ++s)
-	swap8 (p, s);
+	swapp8 (p, s);
     buf->rseek_rel (8*l);
 
     return TRUE;
@@ -1859,7 +1859,7 @@ MICO::CDRDecoder::get_ulongs (CORBA::ULo
 
     CORBA::ULong *s = (CORBA::ULong *)buf->data();
     for (CORBA::Long i = l; --i >= 0; ++p, ++s)
-	swap4 (p, s);
+	swapp4 (p, s);
     buf->rseek_rel (4*l);
 
     return TRUE;
@@ -1879,7 +1879,7 @@ MICO::CDRDecoder::get_ulonglongs (CORBA:
 
     CORBA::ULongLong *s = (CORBA::ULongLong *)buf->data();
     for (CORBA::Long i = l; --i >= 0; ++p, ++s)
-	swap8 (p, s);
+	swapp8 (p, s);
     buf->rseek_rel (8*l);
 
     return TRUE;
