From 110b3a63bc5f05a65d1f4679fe7578b00f5cdb27 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 30 Aug 2011 11:09:37 +0000 Subject: [PATCH] nicer alignment, unsigned sizes --- src/mesh/mesh_api_new.c | 57 ++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/src/mesh/mesh_api_new.c b/src/mesh/mesh_api_new.c index b103b96e7..5ec7a4875 100644 --- a/src/mesh/mesh_api_new.c +++ b/src/mesh/mesh_api_new.c @@ -69,14 +69,15 @@ struct GNUNET_MESH_queue struct GNUNET_MESH_queue *prev; /** - * Size of the data to follow + * Data itself */ - uint16_t size; + void *data; /** - * Data itself + * Size of the data to follow */ - void *data; + uint16_t size; + }; @@ -94,7 +95,6 @@ struct GNUNET_MESH_Handle * Set of handlers used for processing incoming messages in the tunnels */ const struct GNUNET_MESH_MessageHandler *message_handlers; - int n_handlers; /** * Set of applications that should be claimed to be offered at this node. @@ -102,8 +102,7 @@ struct GNUNET_MESH_Handle * registered independently and the mapping is up to the developer of the * client application. */ - const GNUNET_MESH_ApplicationType *applications; - int n_applications; + const GNUNET_MESH_ApplicationType *applications; /** * Double linked list of the tunnels this client is connected to. @@ -111,11 +110,6 @@ struct GNUNET_MESH_Handle struct GNUNET_MESH_Tunnel *tunnels_head; struct GNUNET_MESH_Tunnel *tunnels_tail; - /** - * tid of the next tunnel to create (to avoid reusing IDs often) - */ - MESH_TunnelNumber next_tid; - /** * Callback for tunnel disconnection */ @@ -137,6 +131,15 @@ struct GNUNET_MESH_Handle struct GNUNET_MESH_queue *queue_head; struct GNUNET_MESH_queue *queue_tail; + /** + * tid of the next tunnel to create (to avoid reusing IDs often) + */ + MESH_TunnelNumber next_tid; + + unsigned int n_handlers; + + unsigned int n_applications; + /** * Have we started the task to receive messages from the service * yet? We do this after we send the 'MESH_LOCAL_CONNECT' message. @@ -156,16 +159,6 @@ struct GNUNET_MESH_Tunnel struct GNUNET_MESH_Tunnel *next; struct GNUNET_MESH_Tunnel *prev; - /** - * Local ID of the tunnel - */ - MESH_TunnelNumber tid; - - /** - * Owner of the tunnel - */ - GNUNET_PEER_Id owner; - /** * Callback to execute when peers connect to the tunnel */ @@ -181,11 +174,6 @@ struct GNUNET_MESH_Tunnel */ GNUNET_PEER_Id *peers; - /** - * Number of peer added to the tunnel - */ - uint32_t npeers; - /** * Closure for the connect/disconnect handlers */ @@ -195,6 +183,21 @@ struct GNUNET_MESH_Tunnel * Handle to the mesh this tunnel belongs to */ struct GNUNET_MESH_Handle *mesh; + + /** + * Local ID of the tunnel + */ + MESH_TunnelNumber tid; + + /** + * Owner of the tunnel + */ + GNUNET_PEER_Id owner; + + /** + * Number of peer added to the tunnel + */ + uint32_t npeers; }; struct GNUNET_MESH_TransmitHandle -- 2.25.1