openbsd-ports/devel/mico/patches/patch-codec_cc
shell e38f8ebe1a Initial import of mico-2.3.5
Port Maintainer : Andre S. Barbosa <andre@ravel.ufrj.br>
---
Mico is a freely available and complete CORBA-compliant implementation.
It allows applications to interoperate in a distributed and
heterogeneous environment, regardless of the locations of the
applications, operating systems and programming language.

WWW: http://www.mico.org
2001-06-28 19:59:03 +00:00

362 lines
9.1 KiB
Plaintext

$OpenBSD: patch-codec_cc,v 1.1.1.1 2001/06/28 19:59:08 shell Exp $
--- orb/codec.cc.orig Mon Dec 4 13:53:52 2000
+++ orb/codec.cc Thu Mar 15 19:47:00 2001
@@ -983,13 +983,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];
@@ -997,7 +997,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];
@@ -1009,7 +1009,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];
@@ -1065,7 +1065,7 @@ MICO::CDREncoder::put_short (CORBA::Shor
buf->put2 (&s);
} else {
CORBA::Short s2;
- swap2 (&s2, &s);
+ swapp2 (&s2, &s);
buf->put2 (&s2);
}
}
@@ -1077,7 +1077,7 @@ MICO::CDREncoder::put_ushort (CORBA::USh
buf->put2 (&us);
} else {
CORBA::UShort us2;
- swap2 (&us2, &us);
+ swapp2 (&us2, &us);
buf->put2 (&us2);
}
}
@@ -1089,7 +1089,7 @@ MICO::CDREncoder::put_long (CORBA::Long
buf->put4 (&l);
} else {
CORBA::Long l2;
- swap4 (&l2, &l);
+ swapp4 (&l2, &l);
buf->put4 (&l2);
}
}
@@ -1101,7 +1101,7 @@ MICO::CDREncoder::put_longlong (CORBA::L
buf->put8 (&l);
} else {
CORBA::LongLong l2;
- swap8 (&l2, &l);
+ swapp8 (&l2, &l);
buf->put8 (&l2);
}
}
@@ -1113,7 +1113,7 @@ MICO::CDREncoder::put_ulong (CORBA::ULon
buf->put4 (&ul);
} else {
CORBA::ULong ul2;
- swap4 (&ul2, &ul);
+ swapp4 (&ul2, &ul);
buf->put4 (&ul2);
}
}
@@ -1125,7 +1125,7 @@ MICO::CDREncoder::put_ulonglong (CORBA::
buf->put8 (&ul);
} else {
CORBA::ULongLong ul2;
- swap8 (&ul2, &ul);
+ swapp8 (&ul2, &ul);
buf->put8 (&ul2);
}
}
@@ -1138,7 +1138,7 @@ MICO::CDREncoder::put_float (CORBA::Floa
buf->put4 (&f);
} else {
CORBA::Float f2;
- swap4 (&f2, &f);
+ swapp4 (&f2, &f);
buf->put4 (&f2);
}
#else
@@ -1148,7 +1148,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
@@ -1162,7 +1162,7 @@ MICO::CDREncoder::put_double (CORBA::Dou
buf->put8 (&d);
} else {
CORBA::Double d2;
- swap8 (&d2, &d);
+ swapp8 (&d2, &d);
buf->put8 (&d2);
}
#else
@@ -1172,7 +1172,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
@@ -1186,7 +1186,7 @@ MICO::CDREncoder::put_longdouble (CORBA:
buf->put16 (&d);
} else {
CORBA::LongDouble d2;
- swap16 (&d2, &d);
+ swapp16 (&d2, &d);
buf->put16 (&d2);
}
#else
@@ -1196,7 +1196,7 @@ MICO::CDREncoder::put_longdouble (CORBA:
buf->put16 (b);
} else {
CORBA::Octet b2[16];
- swap16 (b2, b);
+ swapp16 (b2, b);
buf->put16 (b2);
}
#endif
@@ -1250,7 +1250,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);
}
}
@@ -1265,7 +1265,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);
}
}
@@ -1280,7 +1280,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);
}
}
@@ -1295,7 +1295,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);
}
}
@@ -1310,7 +1310,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);
}
}
@@ -1325,7 +1325,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);
}
}
@@ -1541,7 +1541,7 @@ MICO::CDRDecoder::get_short (CORBA::Shor
CORBA::Short s2;
if (!buf->get2 (&s2))
return FALSE;
- swap2 (&s, &s2);
+ swapp2 (&s, &s2);
return TRUE;
}
@@ -1554,7 +1554,7 @@ MICO::CDRDecoder::get_ushort (CORBA::USh
CORBA::UShort us2;
if (!buf->get2 (&us2))
return FALSE;
- swap2 (&us, &us2);
+ swapp2 (&us, &us2);
return TRUE;
}
@@ -1567,7 +1567,7 @@ MICO::CDRDecoder::get_long (CORBA::Long
CORBA::Long l2;
if (!buf->get4 (&l2))
return FALSE;
- swap4 (&l, &l2);
+ swapp4 (&l, &l2);
return TRUE;
}
@@ -1580,7 +1580,7 @@ MICO::CDRDecoder::get_longlong (CORBA::L
CORBA::LongLong l2;
if (!buf->get8 (&l2))
return FALSE;
- swap8 (&l, &l2);
+ swapp8 (&l, &l2);
return TRUE;
}
@@ -1593,7 +1593,7 @@ MICO::CDRDecoder::get_ulong (CORBA::ULon
CORBA::ULong ul2;
if (!buf->get4 (&ul2))
return FALSE;
- swap4 (&ul, &ul2);
+ swapp4 (&ul, &ul2);
return TRUE;
}
@@ -1606,7 +1606,7 @@ MICO::CDRDecoder::get_ulonglong (CORBA::
CORBA::ULongLong ul2;
if (!buf->get8 (&ul2))
return FALSE;
- swap8 (&ul, &ul2);
+ swapp8 (&ul, &ul2);
return TRUE;
}
@@ -1620,7 +1620,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) {
@@ -1633,7 +1633,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;
@@ -1649,7 +1649,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) {
@@ -1662,7 +1662,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;
@@ -1678,7 +1678,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) {
@@ -1691,7 +1691,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;
@@ -1749,7 +1749,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;
@@ -1769,7 +1769,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;
@@ -1789,7 +1789,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;
@@ -1809,7 +1809,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;
@@ -1829,7 +1829,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;
@@ -1849,7 +1849,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;