Index: source/ariba/utility/serialization/CMakeLists.txt
===================================================================
--- source/ariba/utility/serialization/CMakeLists.txt	(revision 12775)
+++ 	(revision )
@@ -1,50 +1,0 @@
-# [License]
-# The Ariba-Underlay Copyright
-#
-# Copyright (c) 2008-2012, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
-#
-# Institute of Telematics
-# UniversitÃ€t Karlsruhe (TH)
-# Zirkel 2, 76128 Karlsruhe
-# Germany
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OF TELEMATICS OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation
-# are those of the authors and should not be interpreted as representing
-# official policies, either expressed or implied, of the Institute of
-# Telematics.
-# [License]
-
-add_headers(
-    Data.hpp
-    DataStream.hpp
-    DataUtilities.hpp
-    Serialization.hpp
-    TestSerialization.h
-    )
-
-add_sources(
-    Serialization.cpp
-    TestSerialization.cpp
-    )
Index: source/ariba/utility/serialization/Data.hpp
===================================================================
--- source/ariba/utility/serialization/Data.hpp	(revision 12775)
+++ source/ariba/utility/serialization/Data.hpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef DATA_HPP_
@@ -41,9 +41,7 @@
 
 //== library includes ==
-#include <string.h>
 #include <stdlib.h>
 #include <iostream>
 #include <boost/cstdint.hpp>
-#include <boost/type_traits/make_unsigned.hpp>
 
 // forward declaration
@@ -51,5 +49,5 @@
 template<typename T = uint8_t, typename DataModel = DefaultDataModel<uint8_t> > class DataTpl;
 typedef DataTpl<> Data;
-template<typename T, typename DataModel> std::ostream& operator<<(std::ostream& stream, const DataTpl<T, DataModel>& data);
+template<typename T, typename DataModel> std::ostream& operator<<(std::ostream& stream, DataTpl<T, DataModel>& data);
 
 //== internal includes ==
@@ -121,6 +119,5 @@
 		template<typename X>
 		finline void get(X& value, size_t length = sizeof(X) * 8, if_int(X)) const {
-			typedef typename boost::make_unsigned<X>::type unsigned_type;
-			_unsigned(value) = bitget<unsigned_type> (bits.buffer(), index, length);
+			_unsigned(value) = bitget<X> (bits.buffer(), index, length);
 		}
 
@@ -326,4 +323,18 @@
 	}
 };
+
+/* default human readable text output */
+template<typename T, typename DataModel>
+std::ostream& operator<<(std::ostream& stream, DataTpl<T, DataModel>& data) {
+	stream << "[" << bitstr(data.getBuffer(), data.getLength(), 4)
+			<< "|'";
+	char* buffer = (char*) data.getBuffer();
+	for (size_t i = 0; i < data.getLength() / 8; i++) {
+		char c = buffer[i] < 32 ? '.' : buffer[i];
+		stream << c;
+	}
+	stream << "']";
+	return stream;
+}
 
 /* unspecified type */
@@ -386,5 +397,5 @@
 
 	finline int32_t length() const {
-		return (bufferLen == -1) ? 0 : bufferLen;
+		return bufferLen;
 	}
 
@@ -397,25 +408,17 @@
 		size_t res_length = calcLength(new_length);
 		if (old_length != res_length) {
-
-			if(res_length <= 0){
-				if (bufferPtr != NULL) delete [] bufferPtr;
-				bufferPtr = NULL;
-				bufferLen = 0;
-			}else{
-				T* new_buffer = new T[res_length];
-				if (new_buffer != NULL) memset(new_buffer, 0, res_length*sizeof(T));
-				if (bufferPtr != NULL) {
-					size_t clength = res_length < old_length ? res_length : old_length;
-					memcpy( new_buffer, bufferPtr, clength*sizeof(T) );
-					delete [] bufferPtr;
-				}
-				bufferPtr = new_buffer;
-				bufferLen = new_length;
+			T* new_buffer = new T[res_length];
+			if (bufferPtr != NULL) {
+				size_t clength = res_length < old_length ? res_length : old_length;
+				memcpy( new_buffer, bufferPtr, clength*sizeof(T) );
+				delete [] bufferPtr;
 			}
+			bufferPtr = new_buffer;
+			bufferLen = new_length;
 		}
 	}
 
 	finline void release() {
-		if (bufferPtr!=NULL && bufferLen>=0) delete [] bufferPtr;
+		delete [] bufferPtr;
 		bufferPtr = NULL;
 		bufferLen = -1;
@@ -439,16 +442,3 @@
 }sznEnd();
 
-/* default human readable text output */
-template<typename T, typename DataModel>
-std::ostream& operator<<(std::ostream& stream, const DataTpl<T, DataModel>& data) {
-	stream << "[" << bitstr(data.getBuffer(), data.getLength(), 4)
-			<< "|'";
-	const char* buffer = (const char*) data.getBuffer();
-	for (size_t i = 0; i < data.getLength() / 8; i++) {
-		char c = buffer[i] < 32 ? '.' : buffer[i];
-		stream << c;
-	}
-	stream << "']";
-	return stream;
-}
 #endif /* DATA_HPP_ */
Index: source/ariba/utility/serialization/DataStream.hpp
===================================================================
--- source/ariba/utility/serialization/DataStream.hpp	(revision 12775)
+++ source/ariba/utility/serialization/DataStream.hpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef DATASTREAM_HPP_
@@ -42,7 +42,4 @@
 //== Library includes ==
 #include <boost/cstdint.hpp>
-#include <boost/type_traits/make_unsigned.hpp>
-
-#include <cassert>
 #include <iostream>
 #include <vector>
@@ -150,6 +147,5 @@
 	finline void add(X& obj, if_uint(X)) {
 		if (!isMeasure())
-//			bitcpy( obj, 0, bits.getBuffer(), index);
-			bitcpy( obj, 0, bits.getBuffer(), index, sizeof(X)*8 );
+		bitcpy( obj, 0, bits.getBuffer(), index);
 		index += sizeof(X) * 8;
 	}
@@ -157,24 +153,4 @@
 	template<typename X>
 	finline void remove(X& obj, if_uint(X)) {
-		//if (!isMeasure()) bits[index].get(obj);
-		if (!isMeasure())
-			bitcpy( bits.getBuffer(), index, obj, 0, sizeof(X)*8 );
-		index += sizeof(X) * 8;
-	}
-
-	/* support signed ints */
-	template<typename X>
-	finline void add(X& sobj, if_int(X)) {
-		typedef typename boost::make_unsigned<X>::type UX;
-		UX& obj = *((UX*)&sobj);
-		if (!isMeasure())
-		bitcpy( sobj, 0, bits.getBuffer(), index);
-		index += sizeof(X) * 8;
-	}
-
-	template<typename X>
-	finline void remove(X& sobj, if_int(X)) {
-		typedef typename boost::make_unsigned<X>::type UX;
-		UX& obj = *((UX*)&sobj);
 		if (!isMeasure()) bits[index].get(obj);
 		index += sizeof(X) * 8;
@@ -332,17 +308,4 @@
 		bits.setLength(index);
 		return bits;
-	}
-
-	finline uint8_t* bytes( size_t length ) {
-		assert((index%bits.word_width)==0);
-		if (!isMeasure()) {
-			bits.ensureLength( index + length * 8);
-			uint8_t* buffer = (uint8_t*)bits.getBuffer()+(index/bits.word_width);
-			index += length*8;
-			return buffer;
-		} else {
-			index += length*8;
-			return NULL;
-		}
 	}
 
@@ -509,6 +472,5 @@
 				i++;
 			}
-			if (isCharP) *text = strdup(s.c_str());
-			else string->assign(s);
+			if (isCharP) *text = strdup(s.c_str()); else *string = s;
 		}
 		sznMethodEnd()
@@ -524,24 +486,9 @@
 	public:
 		finline ArrayTpl( T*& array, size_t length ) :
-		v(array), l(length) {}
+		v(0), l(length) {}
 
 		sznMethodBegin(X)
 		if (X.isDeserializer()) v = new T[l];
 		for (size_t i=0; i<l; i++) X && v[i];
-		sznMethodEnd()
-	};
-
-	template<typename T>
-	class StaticArrayTpl : public ExplicitSerializer {
-	private:
-		T* v;
-		size_t l;
-
-	public:
-		finline StaticArrayTpl( T* array, size_t length ) :
-		v(array), l(length) {}
-
-		sznMethodBegin(X)
-			for (size_t i=0; i<l; i++) X && v[i];
 		sznMethodEnd()
 	};
@@ -571,9 +518,4 @@
 	finline ArrayTpl<T> A( T*& array, size_t length ) {
 		return ArrayTpl<T>(array,length);
-	}
-
-	template<typename T>
-	finline StaticArrayTpl<T> static_A( T* array, size_t length ) {
-		return StaticArrayTpl<T>(array,length);
 	}
 
Index: source/ariba/utility/serialization/DataUtilities.hpp
===================================================================
--- source/ariba/utility/serialization/DataUtilities.hpp	(revision 12775)
+++ source/ariba/utility/serialization/DataUtilities.hpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 /* This file implements some common bit operations for unsigned integer types
@@ -71,14 +71,4 @@
 #include <string>
 
-template<typename X> finline
-static X shr( const X& value, unsigned int bits ) {
-	return (sizeof(X)*8 == bits) ? 0 : (value >> bits);
-}
-
-template<typename X> finline
-static X shl( const X& value, unsigned int bits ) {
-	return (sizeof(X)*8 == bits) ? 0 : (value << bits);
-}
-
 /**
  * TODO: Doc
@@ -87,5 +77,5 @@
 static X bitblk(size_t index, size_t length, bool value, if_uint(X)) {
 	if (index == 0 && length >= sizeof(X) * 8) return value ? ~0 : 0;
-	X x = shl(( shl( ((X) 1), length) - 1), index);
+	X x = ((((X) 1) << length) - 1) << index;
 	return value ? x : ~x;
 }
@@ -117,5 +107,5 @@
 	if (srcInvert) srcIdx = sizeof(X) * 8 - srcIdx - len;
 	if (dstInvert) dstIdx = sizeof(Y) * 8 - dstIdx - len;
-	Y value = ((Y)shr(src, srcIdx)) << dstIdx;
+	Y value = ((Y) (src >> srcIdx)) << dstIdx;
 	Y mask = bitblk<Y, 0> (dstIdx, len);
 	return (dst & mask) | (value & ~mask);
@@ -146,5 +136,5 @@
 	// check if first word only is affected
 	if ((dwp + len) <= w) {
-		X fw = shl(src[0],swp) | shr(src[1],iswp);
+		X fw = (src[0] << swp) | (src[1] >> iswp);
 		*dst = bitcpy(fw, 0, *dst, dwp, len, true, true);
 		return;
@@ -153,6 +143,6 @@
 	// set first word
 	if (idwp != 0) {
-		X fw = shl(src[0],swp) | shr(src[1],iswp);
-		*dst = (*dst & ~(((X) 1 << idwp) - 1)) | shr(fw,dwp);
+		X fw = (src[0] << swp) | (src[1] >> iswp);
+		*dst = (*dst & ~(((X) 1 << idwp) - 1)) | (fw >> dwp);
 
 		// recalculate indexes & lengths
@@ -179,5 +169,5 @@
 		a = src[0], b = src[1];
 		while (len >= w) {
-			*dst = shl(a,swp) | shr(b,iswp);
+			*dst = (a << swp) | (b >> iswp);
 			dst++;
 			src++;
@@ -189,9 +179,7 @@
 
 	// set last word
-	X lw = shl(a,swp) | shr(b,iswp), lm = (shl((X) 1,(w - len)) - 1);
+	X lw = (a << swp) | (b >> iswp), lm = (((X) 1 << (w - len)) - 1);
 	*dst = (*dst & lm) | (lw & ~lm);
 }
-
-
 
 /**
@@ -217,5 +205,5 @@
 		src++;
 		while (len >= w) {
-			X x = shl(a,swp) | shr(b,iswp);
+			X x = (a << swp) | (b >> iswp);
 			value <<= w;
 			value |= x;
@@ -228,5 +216,5 @@
 		if ( len> 0 ) {
 			value <<= len;
-			value |= ((shl(a,swp) | shr(b,iswp)) >> (w - len)) & (shl(1,len)-1);
+			value |= (((a << swp) | (b >> iswp)) >> (w - len)) & ((1 << len)-1);
 		}
 
@@ -266,8 +254,8 @@
 		size_t idwp = w - dwp;
 		src >>= srcIdx;
-		X mask1 = ~(shl(1,idwp) - 1);
-		dst[0] = (dst[0] & mask1) | (shr(src,(len - idwp)) & ~mask1);
-		X mask2 = shl(1,(w - len + idwp)) - 1;
-		dst[1] = (dst[1] & mask2) | (shl(src, (w - len + idwp)) & ~mask2);
+		X mask1 = ~((1 << idwp) - 1);
+		dst[0] = (dst[0] & mask1) | ((src >> (len - idwp)) & ~mask1);
+		X mask2 = (1 << (w - len + idwp)) - 1;
+		dst[1] = (dst[1] & mask2) | ((src << (w - len + idwp)) & ~mask2);
 	}
 }
@@ -289,9 +277,9 @@
 		// check inversion
 		if (srcInvert) srcIdx = sizeof(Y) * 8 - srcIdx - len;
-		src = shr(src, srcIdx);
+		src >>= srcIdx;
 
 		const size_t dw = sizeof(X)*8;
 		while (len >= dw) {
-			X word = (X)shr(src,(len-dw));
+			X word = (X)(src >> (len-dw));
 			bitcpy(word,0,dst,dstIdx,dw);
 			dstIdx += dw;
Index: source/ariba/utility/serialization/Serialization.cpp
===================================================================
--- source/ariba/utility/serialization/Serialization.cpp	(revision 12775)
+++ source/ariba/utility/serialization/Serialization.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "Serialization.hpp"
Index: source/ariba/utility/serialization/Serialization.hpp
===================================================================
--- source/ariba/utility/serialization/Serialization.hpp	(revision 12775)
+++ source/ariba/utility/serialization/Serialization.hpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef SERIALIZATION_HPP_
@@ -200,5 +200,4 @@
 #include <typeinfo>
 #include <iostream>
-#include <cstdio>
 
 //---------------------------------------------------------------------------
Index: source/ariba/utility/serialization/TestSerialization.cpp
===================================================================
--- source/ariba/utility/serialization/TestSerialization.cpp	(revision 12775)
+++ source/ariba/utility/serialization/TestSerialization.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,7 +35,6 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
-#include "TestSerialization.h"
 #include "Data.hpp"
 #include "DataStream.hpp"
@@ -55,10 +54,7 @@
 	Aclass* vclass;
 	bool vcls;
-	uint8_t* static_array;
 
 	Aclass(bool vcls = false) {
 		text = new char[80];
-		static_array = new uint8_t[20];
-		for (size_t i=0; i<20; i++) static_array[i] = i;
 		strcpy(text, "Hallo!");
 		str = "std::string:)";
@@ -98,8 +94,5 @@
 
 sznBeginDefault( Aclass, X ){
-	double xpos;
 	X && x && b && I(y,6) && T(text) && T(str) && A(v,4) && I(z) && vcls;
-	X && static_A(static_array,20);
-	X && static_A( (uint8_t*)&xpos, 8 );
 	if (vcls) X && VO(vclass);
 }sznEnd()
@@ -107,5 +100,5 @@
 vsznDefault( Aclass );
 
-int test_serialization() {
+int main() {
 	using namespace std;
 
Index: source/ariba/utility/serialization/TestSerialization.h
===================================================================
--- source/ariba/utility/serialization/TestSerialization.h	(revision 12775)
+++ 	(revision )
@@ -1,8 +1,0 @@
-// TestSerialization.h, created on 13.11.2009 by Sebastian Mies
-
-#ifndef TESTSERIALIZATION_H_
-#define TESTSERIALIZATION_H_
-
-int test_serialization();
-
-#endif /* TESTSERIALIZATION_H_ */
