From ec05778d5718a7912e506764d443a78d6a6179e3 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 5 Nov 2012 22:41:51 +0000 Subject: Converted tabs to spaces with tabconv. --- src/stable/archive.cpp | 76 +++++++++++++++++++++++++------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) (limited to 'src/stable/archive.cpp') diff --git a/src/stable/archive.cpp b/src/stable/archive.cpp index 13480e1..3769e0e 100644 --- a/src/stable/archive.cpp +++ b/src/stable/archive.cpp @@ -12,9 +12,9 @@ #include "bu/sio.h" Bu::Archive::Archive( Stream &rStream, bool bLoading ) : - bLoading( bLoading ), - rStream( rStream ), - nNextID( 1 ) + bLoading( bLoading ), + rStream( rStream ), + nNextID( 1 ) { } @@ -24,66 +24,66 @@ Bu::Archive::~Archive() void Bu::Archive::write( const void *pData, size_t nSize ) { - if( nSize == 0 || pData == NULL ) - return; + if( nSize == 0 || pData == NULL ) + return; - rStream.write( (const char *)pData, nSize ); + rStream.write( (const char *)pData, nSize ); } void Bu::Archive::read( void *pData, size_t nSize ) { - if( nSize == 0 || pData == NULL ) - return; + if( nSize == 0 || pData == NULL ) + return; - if( (size_t)rStream.read( (char *)pData, nSize ) < nSize ) - throw Bu::ExceptionBase("Insufficient data to unarchive object."); + if( (size_t)rStream.read( (char *)pData, nSize ) < nSize ) + throw Bu::ExceptionBase("Insufficient data to unarchive object."); } void Bu::Archive::close() { - rStream.close(); + rStream.close(); } bool Bu::Archive::isLoading() { - return bLoading; + return bLoading; } uint32_t Bu::Archive::getID( const void *ptr ) { - if( hPtrID.has( (ptrdiff_t)ptr ) ) - return hPtrID.get( (ptrdiff_t)ptr ); - hPtrID.insert( (ptrdiff_t)ptr, nNextID ); - return nNextID++; + if( hPtrID.has( (ptrdiff_t)ptr ) ) + return hPtrID.get( (ptrdiff_t)ptr ); + hPtrID.insert( (ptrdiff_t)ptr, nNextID ); + return nNextID++; } void Bu::Archive::assocPtrID( void **ptr, uint32_t id ) { - if( hPtrID.has( id ) ) - { - *ptr = (void *)hPtrID.get( id ); - return; - } - - if( !hPtrDest.has( id ) ) - hPtrDest.insert( id, List() ); - - hPtrDest[id].getValue().append( ptr ); + if( hPtrID.has( id ) ) + { + *ptr = (void *)hPtrID.get( id ); + return; + } + + if( !hPtrDest.has( id ) ) + hPtrDest.insert( id, List() ); + + hPtrDest[id].getValue().append( ptr ); } void Bu::Archive::readID( const void *ptr, uint32_t id ) { - hPtrID.insert( id, (ptrdiff_t)ptr ); - - if( hPtrDest.has( id ) ) - { - Bu::List &l = hPtrDest.get( id ); - for( Bu::List::iterator i = l.begin(); i != l.end(); i++ ) - { - *(*i) = (void *)ptr; - } - - hPtrDest.erase( id ); - } + hPtrID.insert( id, (ptrdiff_t)ptr ); + + if( hPtrDest.has( id ) ) + { + Bu::List &l = hPtrDest.get( id ); + for( Bu::List::iterator i = l.begin(); i != l.end(); i++ ) + { + *(*i) = (void *)ptr; + } + + hPtrDest.erase( id ); + } } -- cgit v1.2.3