summaryrefslogtreecommitdiff
path: root/netbytes.h
diff options
context:
space:
mode:
Diffstat (limited to 'netbytes.h')
-rw-r--r--netbytes.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/netbytes.h b/netbytes.h
index a77ef24..6e008bc 100644
--- a/netbytes.h
+++ b/netbytes.h
@@ -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;