diff options
author | FreeArtMan <dos21h@gmail.com> | 2017-08-21 23:40:07 +0100 |
---|---|---|
committer | FreeArtMan <dos21h@gmail.com> | 2017-08-21 23:40:07 +0100 |
commit | de6abbfddf1b0e15f444f4fe2a642d3a9775eec7 (patch) | |
tree | 7f243d875461034ce56d0d62d6ac302d66d0e702 /netbytes.h | |
parent | 40e4b1da84808b4e592126e037601f5b6ccc0e25 (diff) | |
download | netbytes-de6abbfddf1b0e15f444f4fe2a642d3a9775eec7.tar.gz netbytes-de6abbfddf1b0e15f444f4fe2a642d3a9775eec7.zip |
Small bug fixed
Diffstat (limited to 'netbytes.h')
-rw-r--r-- | netbytes.h | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -47,25 +47,25 @@ #define __NBT_MAX_TYPES (256) //creating netbyte structure -typedef struct __nb_type { +typedef struct __attribute__((packed)) __nb_type { __NBT_TYPED type; uint8_t *nb_val; -} __nb_type; +} __nb_type ; -typedef struct netbyte_store +typedef struct __attribute__((packed)) netbyte_store { __NBT_SIZE size; int count; __nb_type types[__NBT_MAX_TYPES]; } netbyte_store; -typedef struct nb_u8 +typedef struct __attribute__((packed)) nb_u8 { __NBT_TYPED type; uint8_t val; } nb_u8; -typedef struct nb_u8arr +typedef struct __attribute__((packed)) nb_u8arr { __NBT_TYPED type; __NBT_U8ARR_LEN len; @@ -74,13 +74,13 @@ typedef struct nb_u8arr /*-----------------*/ -typedef struct nb_u16 +typedef struct __attribute__((packed)) nb_u16 { __NBT_TYPED type; uint16_t val; } nb_u16; -typedef struct nb_u16arr +typedef struct __attribute__((packed)) nb_u16arr { __NBT_TYPED type; __NBT_U16ARR_LEN len; @@ -89,13 +89,13 @@ typedef struct nb_u16arr /*-----------------*/ -typedef struct nb_u32 +typedef struct __attribute__((packed)) nb_u32 { __NBT_TYPED type; uint32_t val; } nb_u32; -typedef struct nb_u32arr +typedef struct __attribute__((packed)) nb_u32arr { __NBT_TYPED type; __NBT_U32ARR_LEN len; @@ -104,13 +104,13 @@ typedef struct nb_u32arr /*------------------*/ -typedef struct nb_u64 +typedef struct __attribute__((packed)) nb_u64 { __NBT_TYPED type; uint64_t val; } nb_u64; -typedef struct nb_u64arr +typedef struct __attribute__((packed)) nb_u64arr { __NBT_TYPED type; __NBT_U64ARR_LEN len; @@ -118,7 +118,7 @@ typedef struct nb_u64arr } nb_u64arr; //loading/parsing netbyte structure -typedef struct netbyte_load +typedef struct __attribute__((packed)) netbyte_load { __NBT_SIZE size; uint8_t *buf; |