Change in libosmo-sccp[master]: cosmetic: apply changes to match struct_endianess.py output

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Wed May 20 10:38:42 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/16761 )

Change subject: cosmetic: apply changes to match struct_endianess.py output
......................................................................

cosmetic: apply changes to match struct_endianess.py output

Rationale: the script is a good way to avoid bugs from manually composing the
big endian parts (for example, it detected the missing endian.h include, fixed
in I5906d94e0e0a74674c3a14cf2ec81c681e696474). However, it becomes cumbersome
if it creates numerous edits in the source tree, which cause more time spent
for whoever wanted to rather save time with it. So let's keep the code tree
matching that script's output.

Change-Id: I04ad3795fbaf495cae168aed69124b1dc132a9bd
---
M include/osmocom/mtp/mtp_level3.h
M include/osmocom/sccp/sccp_types.h
2 files changed, 14 insertions(+), 18 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/include/osmocom/mtp/mtp_level3.h b/include/osmocom/mtp/mtp_level3.h
index d0d24a1..414b144 100644
--- a/include/osmocom/mtp/mtp_level3.h
+++ b/include/osmocom/mtp/mtp_level3.h
@@ -131,9 +131,8 @@
 		 spare : 2,
 		 ni : 2;
 #elif OSMO_IS_BIG_ENDIAN
-	uint8_t ni : 2,
-		 spare : 2,
-		 ser_ind : 4;
+/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
+	uint8_t ni:2, spare:2, ser_ind:4;
 #endif
 	uint32_t addr;
 	uint8_t data[0];
@@ -144,8 +143,8 @@
 	uint8_t h0 : 4,
 		 h1 : 4;
 #elif OSMO_IS_BIG_ENDIAN
-	uint8_t h1 : 4,
-		 h0 : 4;
+/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
+	uint8_t h1:4, h0:4;
 #endif
 } __attribute__((packed));
 
@@ -155,8 +154,8 @@
 	uint8_t spare : 4,
 		 length : 4;
 #elif OSMO_IS_BIG_ENDIAN
-	uint8_t length : 4,
-		 spare : 4;
+/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
+	uint8_t length:4, spare:4;
 #endif
 	uint8_t data[0];
 } __attribute__((packed));
@@ -175,8 +174,8 @@
 	uint8_t mul_ind : 2,
 		 spare : 6;
 #elif OSMO_IS_BIG_ENDIAN
-	uint8_t spare : 6,
-		 mul_ind : 2;
+/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
+	uint8_t spare:6, mul_ind:2;
 #endif
 } __attribute__((packed));
 
diff --git a/include/osmocom/sccp/sccp_types.h b/include/osmocom/sccp/sccp_types.h
index 09bf271..616a7ee 100644
--- a/include/osmocom/sccp/sccp_types.h
+++ b/include/osmocom/sccp/sccp_types.h
@@ -106,11 +106,8 @@
 			routing_indicator    : 1,
 			reserved	     : 1;
 #elif OSMO_IS_BIG_ENDIAN
-	uint8_t	reserved	     : 1,
-			routing_indicator    : 1,
-			global_title_indicator : 4,
-			ssn_indicator	     : 1,
-			point_code_indicator : 1;
+/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
+	uint8_t	reserved:1, routing_indicator:1, global_title_indicator:4, ssn_indicator:1, point_code_indicator:1;
 #endif
 	uint8_t	data[0];
 } __attribute__((packed));
@@ -124,8 +121,8 @@
 	uint8_t	msb : 6,
 			reserved : 2;
 #elif OSMO_IS_BIG_ENDIAN
-	uint8_t	reserved : 2,
-			msb : 6;
+/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
+	uint8_t	reserved:2, msb:6;
 #endif
 } __attribute__((packed));
 
@@ -166,8 +163,8 @@
 	uint8_t	nature_of_addr_ind : 7,
 			odd_even : 1;
 #elif OSMO_IS_BIG_ENDIAN
-	uint8_t	odd_even : 1,
-			nature_of_addr_ind : 7;
+/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
+	uint8_t	odd_even:1, nature_of_addr_ind:7;
 #endif
 	uint8_t	data[0];
 } __attribute__((packed));

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/16761
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I04ad3795fbaf495cae168aed69124b1dc132a9bd
Gerrit-Change-Number: 16761
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200520/09e33f45/attachment.htm>


More information about the gerrit-log mailing list