commit eaf25f8cb2dccec6be5c16e15e04bfa931059c99 parent 0ed5d6492171c6d53401729b830405be84b42a33 Author: Michael Savage <mikejsavage@gmail.com> Date: Sun Mar 6 21:48:22 +0000 DEF_TYPE -> DEF_READ_WRITE Diffstat:
stream.h | | | 26 | +++++++++++++------------- |
diff --git a/stream.h b/stream.h @@ -8,7 +8,7 @@ struct Stream { }; #ifdef IS_LITTLE_ENDIAN -#define DEF_TYPE( type ) \ +#define DEF_READ_WRITE( type ) \ inline Stream read_##type( Stream stream, type * v ) { \ *v = *( type * ) stream.ptr; \ stream.ptr += sizeof( type ); \ @@ -20,7 +20,7 @@ struct Stream { return stream; \ } #else -#define DEF_TYPE( type ) \ +#define DEF_READ_WRITE( type ) \ inline Stream read_##type( Stream stream, type * v ) { \ char swapped[ sizeof( type ) ]; \ for( int i = 0; i < sizeof( type ); i++ ) { \ @@ -40,17 +40,17 @@ struct Stream { } #endif -DEF_TYPE( u8 ) -DEF_TYPE( u16 ) -DEF_TYPE( u32 ) -DEF_TYPE( u64 ) -DEF_TYPE( s8 ) -DEF_TYPE( s16 ) -DEF_TYPE( s32 ) -DEF_TYPE( s64 ) -DEF_TYPE( f32 ) -DEF_TYPE( f64 ) +DEF_READ_WRITE( u8 ) +DEF_READ_WRITE( u16 ) +DEF_READ_WRITE( u32 ) +DEF_READ_WRITE( u64 ) +DEF_READ_WRITE( s8 ) +DEF_READ_WRITE( s16 ) +DEF_READ_WRITE( s32 ) +DEF_READ_WRITE( s64 ) +DEF_READ_WRITE( f32 ) +DEF_READ_WRITE( f64 ) -#undef DEF_TYPE +#undef DEF_READ_WRITE #endif // _STREAM_H_