* Respect endiannes for item lengths inside swapped BMessages

* Also swap the flattened size when creating the read buffer
* Define specialized byte_swap()s for unsigned types too so that type_code and the like get swapped correctly

This should fix bug #1371.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21901 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2007-08-12 10:32:21 +00:00
parent 8c1a98d8d4
commit 0127fb779d
2 changed files with 75 additions and 13 deletions
+24
View File
@@ -136,6 +136,14 @@ byte_swap(int64 &data)
}
template<>
inline void
byte_swap(uint64 &data)
{
data = __swap_int64(data);
}
template<>
inline void
byte_swap(int32 &data)
@@ -144,6 +152,14 @@ byte_swap(int32 &data)
}
template<>
inline void
byte_swap(uint32 &data)
{
data = __swap_int32(data);
}
template<>
inline void
byte_swap(int16 &data)
@@ -152,6 +168,14 @@ byte_swap(int16 &data)
}
template<>
inline void
byte_swap(uint16 &data)
{
data = __swap_int16(data);
}
template<>
inline void
byte_swap(entry_ref &data)