celix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [celix] Oipo commented on a change in pull request #230: Update the wire protocol to use fixed size types
Date Wed, 27 May 2020 03:59:46 GMT

Oipo commented on a change in pull request #230:
URL: https://github.com/apache/celix/pull/230#discussion_r430265487



##########
File path: bundles/pubsub/pubsub_spi/include/pubsub_protocol.h
##########
@@ -32,27 +33,29 @@ typedef struct pubsub_protocol_header pubsub_protocol_header_t;
  * The protocol header structure, contains the information about the message payload and
metadata
  */
 struct pubsub_protocol_header {
-  /** message payload identification attributes */
-    unsigned int msgId;
-    unsigned short msgMajorVersion;
-    unsigned short msgMinorVersion;
+    /** message payload identification attributes */
+    uint32_t msgId;
+    uint16_t msgMajorVersion;
+    uint16_t msgMinorVersion;
 
     /** Payload and metadata sizes attributes */
-    unsigned int payloadSize;
-    unsigned int metadataSize;
+    uint32_t payloadSize;
+    uint32_t metadataSize;
 
     /** Optional message segmentation attributes, these attributes are only used/written
by the protocol admin.
      *  When message segmentation is supported by the protocol admin */
-    unsigned int seqNr;
-    unsigned int payloadPartSize;
-    unsigned int payloadOffset;
+    uint32_t seqNr;
+    uint32_t payloadPartSize;
+    uint32_t payloadOffset;
+
+    uint32_t padding; //to arrange alignment on 64 bit

Review comment:
       Probably better to use the aligned attribute: https://stackoverflow.com/a/11130216




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message