bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH hurd] Use designated initializers when building mach_msg_type_t


From: Flavio Cruz
Subject: [PATCH hurd] Use designated initializers when building mach_msg_type_t
Date: Wed, 3 May 2023 18:11:46 -0400

---
 boot/boot.c                       | 16 +++----
 console/display.c                 | 58 ++++++++++++-------------
 libfshelp/start-translator-long.c | 56 ++++++++++++-------------
 libpager/demuxer.c                | 16 +++----
 libports/manage-multithread.c     | 16 +++----
 libports/manage-one-thread.c      | 16 +++----
 mach-defpager/default_pager.c     | 16 +++----
 proc/stubs.c                      | 70 +++++++++++++++----------------
 startup/startup.c                 | 14 +++----
 utils/rpctrace.c                  | 14 +++----
 10 files changed, 146 insertions(+), 146 deletions(-)

diff --git a/boot/boot.c b/boot/boot.c
index e0c6bfb2..3fa9ddab 100644
--- a/boot/boot.c
+++ b/boot/boot.c
@@ -168,14 +168,14 @@ mig_reply_setup (
        mach_msg_header_t       *out)
 {
       static const mach_msg_type_t RetCodeType = {
-               /* msgt_name = */               MACH_MSG_TYPE_INTEGER_32,
-               /* msgt_size = */               32,
-               /* msgt_number = */             1,
-               /* msgt_inline = */             TRUE,
-               /* msgt_longform = */           FALSE,
-               /* msgt_deallocate = */         FALSE,
-               /* msgt_unused = */             0
-       };
+        .msgt_name = MACH_MSG_TYPE_INTEGER_32,
+        .msgt_size = 32,
+        .msgt_number = 1,
+        .msgt_inline = TRUE,
+        .msgt_longform = FALSE,
+        .msgt_deallocate = FALSE,
+        .msgt_unused = 0
+      };
 
 #define        InP     (in)
 #define        OutP    ((mig_reply_header_t *) out)
diff --git a/console/display.c b/console/display.c
index 5c821938..071cd993 100644
--- a/console/display.c
+++ b/console/display.c
@@ -229,43 +229,43 @@ nowait_file_changed (mach_port_t notify_port, natural_t 
tickno,
   Request *InP = &Mess.In;
 
   static const mach_msg_type_t ticknoType = {
-    /* msgt_name = */           2,
-    /* msgt_size = */           32,
-    /* msgt_number = */         1,
-    /* msgt_inline = */         TRUE,
-    /* msgt_longform = */       FALSE,
-    /* msgt_deallocate = */     FALSE,
-    /* msgt_unused = */         0
-  };  
+    .msgt_name = MACH_MSG_TYPE_INTEGER_32,
+    .msgt_size = 32,
+    .msgt_number = 1,
+    .msgt_inline = TRUE,
+    .msgt_longform = FALSE,
+    .msgt_deallocate = FALSE,
+    .msgt_unused = 0
+  };
 
   static const mach_msg_type_t changeType = {
-    /* msgt_name = */          2,
-    /* msgt_size = */          32,
-    /* msgt_number = */                1,
-    /* msgt_inline = */                TRUE,
-    /* msgt_longform = */      FALSE,
-    /* msgt_deallocate = */    FALSE,
-    /* msgt_unused = */                0
+    .msgt_name = MACH_MSG_TYPE_INTEGER_32,
+    .msgt_size = 32,
+    .msgt_number = 1,
+    .msgt_inline = TRUE,
+    .msgt_longform = FALSE,
+    .msgt_deallocate = FALSE,
+    .msgt_unused = 0
   };
 
   static const mach_msg_type_t startType = {
-    /* msgt_name = */          11,
-    /* msgt_size = */          64,
-    /* msgt_number = */                1,
-    /* msgt_inline = */                TRUE,
-    /* msgt_longform = */      FALSE,
-    /* msgt_deallocate = */    FALSE,
-    /* msgt_unused = */                0
+    .msgt_name = MACH_MSG_TYPE_INTEGER_64,
+    .msgt_size = 64,
+    .msgt_number = 1,
+    .msgt_inline = TRUE,
+    .msgt_longform = FALSE,
+    .msgt_deallocate = FALSE,
+    .msgt_unused = 0
   };
 
   static const mach_msg_type_t endType = {
-    /* msgt_name = */          11,
-    /* msgt_size = */          64,
-    /* msgt_number = */                1,
-    /* msgt_inline = */                TRUE,
-    /* msgt_longform = */      FALSE,
-    /* msgt_deallocate = */    FALSE,
-    /* msgt_unused = */                0
+    .msgt_name = MACH_MSG_TYPE_INTEGER_64,
+    .msgt_size = 64,
+    .msgt_number = 1,
+    .msgt_inline = TRUE,
+    .msgt_longform = FALSE,
+    .msgt_deallocate = FALSE,
+    .msgt_unused = 0
   };
 
   InP->ticknoType = ticknoType;
diff --git a/libfshelp/start-translator-long.c 
b/libfshelp/start-translator-long.c
index 4bce337f..3541c681 100644
--- a/libfshelp/start-translator-long.c
+++ b/libfshelp/start-translator-long.c
@@ -65,43 +65,43 @@ service_fsys_startup (fshelp_open_fn_t underlying_open_fn, 
void *cookie,
   /* These should be optimized away to pure integer constants.  */
   const mach_msg_type_t flagsCheck =
     {
-      MACH_MSG_TYPE_INTEGER_32,        /* msgt_name = */
-      32,                      /* msgt_size = */
-      1,                       /* msgt_number = */
-      TRUE,                    /* msgt_inline = */
-      FALSE,                   /* msgt_longform = */
-      FALSE,                   /* msgt_deallocate = */
-      0                                /* msgt_unused = */
+      .msgt_name = MACH_MSG_TYPE_INTEGER_32,
+      .msgt_size = 32,
+      .msgt_number = 1,
+      .msgt_inline = TRUE,
+      .msgt_longform = FALSE,
+      .msgt_deallocate = FALSE,
+      .msgt_unused = 0
     };
   const mach_msg_type_t control_portCheck =
     {
-      MACH_MSG_TYPE_PORT_SEND, /* msgt_name = */
-      32,                      /* msgt_size = */
-      1,                       /* msgt_number = */
-      TRUE,                    /* msgt_inline = */
-      FALSE,                   /* msgt_longform = */
-      FALSE,                   /* msgt_deallocate = */
-      0                                /* msgt_unused = */
+      .msgt_name = MACH_MSG_TYPE_PORT_SEND,
+      .msgt_size = 32,
+      .msgt_number = 1,
+      .msgt_inline = TRUE,
+      .msgt_longform = FALSE,
+      .msgt_deallocate = FALSE,
+      .msgt_unused = 0
     };
   const mach_msg_type_t RetCodeType =
     {
-      MACH_MSG_TYPE_INTEGER_32,        /* msgt_name = */
-      32,                      /* msgt_size = */
-      1,                       /* msgt_number = */
-      TRUE,                    /* msgt_inline = */
-      FALSE,                   /* msgt_longform = */
-      FALSE,                   /* msgt_deallocate = */
-      0                                /* msgt_unused = */
+      .msgt_name = MACH_MSG_TYPE_INTEGER_32,
+      .msgt_size = 32,
+      .msgt_number = 1,
+      .msgt_inline = TRUE,
+      .msgt_longform = FALSE,
+      .msgt_deallocate = FALSE,
+      .msgt_unused = 0
     };
   const mach_msg_type_t realnodeType =
     {
-      -1,                      /* msgt_name = */
-      32,                      /* msgt_size = */
-      1,                       /* msgt_number = */
-      TRUE,                    /* msgt_inline = */
-      FALSE,                   /* msgt_longform = */
-      FALSE,                   /* msgt_deallocate = */
-      0                                /* msgt_unused = */
+      .msgt_name = (unsigned char) MACH_MSG_TYPE_POLYMORPHIC,
+      .msgt_size = 32,
+      .msgt_number = 1,
+      .msgt_inline = TRUE,
+      .msgt_longform = FALSE,
+      .msgt_deallocate = FALSE,
+      .msgt_unused = 0
     };
 
   /* Return true iff TYPE fails to match CHECK.  */
diff --git a/libpager/demuxer.c b/libpager/demuxer.c
index dbc7e334..dfdda104 100644
--- a/libpager/demuxer.c
+++ b/libpager/demuxer.c
@@ -138,14 +138,14 @@ mig_reply_setup (
        mach_msg_header_t       *out)
 {
       static const mach_msg_type_t RetCodeType = {
-               /* msgt_name = */               MACH_MSG_TYPE_INTEGER_32,
-               /* msgt_size = */               32,
-               /* msgt_number = */             1,
-               /* msgt_inline = */             TRUE,
-               /* msgt_longform = */           FALSE,
-               /* msgt_deallocate = */         FALSE,
-               /* msgt_unused = */             0
-       };
+        .msgt_name = MACH_MSG_TYPE_INTEGER_32,
+        .msgt_size = 32,
+        .msgt_number = 1,
+        .msgt_inline = TRUE,
+        .msgt_longform = FALSE,
+        .msgt_deallocate = FALSE,
+        .msgt_unused = 0
+      };
 
 #define        InP     (in)
 #define        OutP    ((mig_reply_header_t *) out)
diff --git a/libports/manage-multithread.c b/libports/manage-multithread.c
index d138092b..9f397b26 100644
--- a/libports/manage-multithread.c
+++ b/libports/manage-multithread.c
@@ -128,14 +128,14 @@ ports_manage_port_operations_multithread (struct 
port_bucket *bucket,
       struct rpc_info link;
       mig_reply_header_t *outp = (mig_reply_header_t *) outheadp;
       static const mach_msg_type_t RetCodeType = {
-               /* msgt_name = */               MACH_MSG_TYPE_INTEGER_32,
-               /* msgt_size = */               32,
-               /* msgt_number = */             1,
-               /* msgt_inline = */             TRUE,
-               /* msgt_longform = */           FALSE,
-               /* msgt_deallocate = */         FALSE,
-               /* msgt_unused = */             0
-       };
+        .msgt_name = MACH_MSG_TYPE_INTEGER_32,
+        .msgt_size = 32,
+        .msgt_number = 1,
+        .msgt_inline = TRUE,
+        .msgt_longform = FALSE,
+        .msgt_deallocate = FALSE,
+        .msgt_unused = 0
+      };
 
       if (__atomic_sub_fetch (&nreqthreads, 1, __ATOMIC_RELAXED) == 0)
        /* No thread would be listening for requests, spawn one. */
diff --git a/libports/manage-one-thread.c b/libports/manage-one-thread.c
index 4b92148b..3f039c5d 100644
--- a/libports/manage-one-thread.c
+++ b/libports/manage-one-thread.c
@@ -38,14 +38,14 @@ ports_manage_port_operations_one_thread (struct port_bucket 
*bucket,
       error_t err;
       mig_reply_header_t *outp = (mig_reply_header_t *) outheadp;
       static const mach_msg_type_t RetCodeType = {
-               /* msgt_name = */               MACH_MSG_TYPE_INTEGER_32,
-               /* msgt_size = */               32,
-               /* msgt_number = */             1,
-               /* msgt_inline = */             TRUE,
-               /* msgt_longform = */           FALSE,
-               /* msgt_deallocate = */         FALSE,
-               /* msgt_unused = */             0
-       };
+        .msgt_name = MACH_MSG_TYPE_INTEGER_32,
+        .msgt_size = 32,
+        .msgt_number = 1,
+        .msgt_inline = TRUE,
+        .msgt_longform = FALSE,
+        .msgt_deallocate = FALSE,
+        .msgt_unused = 0
+      };
 
       /* Fill in default response. */
       outp->Head.msgh_bits 
diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c
index a547ade8..82e8f526 100644
--- a/mach-defpager/default_pager.c
+++ b/mach-defpager/default_pager.c
@@ -2778,14 +2778,14 @@ mig_reply_setup (
        mach_msg_header_t       *out)
 {
       static const mach_msg_type_t RetCodeType = {
-               /* msgt_name = */               MACH_MSG_TYPE_INTEGER_32,
-               /* msgt_size = */               32,
-               /* msgt_number = */             1,
-               /* msgt_inline = */             TRUE,
-               /* msgt_longform = */           FALSE,
-               /* msgt_deallocate = */         FALSE,
-               /* msgt_unused = */             0
-       };
+        .msgt_name = MACH_MSG_TYPE_INTEGER_32,
+        .msgt_size = 32,
+        .msgt_number = 1,
+        .msgt_inline = TRUE,
+        .msgt_longform = FALSE,
+        .msgt_deallocate = FALSE,
+        .msgt_unused = 0
+      };
 
 #define        InP     (in)
 #define        OutP    ((mig_reply_header_t *) out)
diff --git a/proc/stubs.c b/proc/stubs.c
index 50882418..ea0ae7a6 100644
--- a/proc/stubs.c
+++ b/proc/stubs.c
@@ -85,52 +85,52 @@ send_signal (mach_port_t msgport,
      so we cannot safely use a shared static buffer.  */
   struct msg_sig_post_request message =
   {
-    {
+    .head = {
       /* Message header: */
-      (MACH_MSGH_BITS_COMPLEX
+      .msgh_bits = (MACH_MSGH_BITS_COMPLEX
        | MACH_MSGH_BITS (MACH_MSG_TYPE_COPY_SEND,
-                        MACH_MSG_TYPE_MAKE_SEND_ONCE)), /* msgh_bits */
-      sizeof message,          /* msgh_size */
-      msgport,                 /* msgh_remote_port */
-      { MACH_PORT_NULL },      /* msgh_local_port */
-      0,                       /* msgh_seqno */
-      RPCID_SIG_POST,          /* msgh_id */
+                        MACH_MSG_TYPE_MAKE_SEND_ONCE)),
+      .msgh_size = sizeof message,
+      .msgh_remote_port = msgport,
+      .msgh_local_port = MACH_PORT_NULL,
+      .msgh_seqno = 0,
+      .msgh_id = RPCID_SIG_POST,
     },
-    {
+    .signaltype = {
       /* Type descriptor for signo */
-      MACH_MSG_TYPE_INTEGER_32, /* msgt_name */
-      32,                      /* msgt_size */
-      1,                       /* msgt_number */
-      1,                       /* msgt_inline */
-      0,                       /* msgt_longform */
-      0,                       /* msgt_deallocate */
-      0,                       /* msgt_unused */
+      .msgt_name = MACH_MSG_TYPE_INTEGER_32,
+      .msgt_size = 32,
+      .msgt_number = 1,
+      .msgt_inline = TRUE,
+      .msgt_longform = FALSE,
+      .msgt_deallocate = FALSE,
+      .msgt_unused = 0
     },
     /* Signal number */
-    signal,
+    .signal = signal,
     /* Type descriptor for sigcode */
-    {
-      MACH_MSG_TYPE_INTEGER_32, /* msgt_name */
-      32,                      /* msgt_size */
-      1,                       /* msgt_number */
-      1,                       /* msgt_inline */
-      0,                       /* msgt_longform */
-      0,                       /* msgt_deallocate */
-      0,                       /* msgt_unused */
+    .sigcode_type = {
+      .msgt_name = MACH_MSG_TYPE_INTEGER_32,
+      .msgt_size = 32,
+      .msgt_number = 1,
+      .msgt_inline = TRUE,
+      .msgt_longform = FALSE,
+      .msgt_deallocate = FALSE,
+      .msgt_unused = 0
     },
     /* Sigcode */
-    sigcode,
-    {
+    .sigcode = sigcode,
+    .refporttype = {
       /* Type descriptor for refport */
-      MACH_MSG_TYPE_COPY_SEND, /* msgt_name */
-      32,                      /* msgt_size */
-      1,                       /* msgt_number */
-      1,                       /* msgt_inline */
-      0,                       /* msgt_longform */
-      0,                       /* msgt_deallocate */
-      0,                       /* msgt_unused */
+      .msgt_name = MACH_MSG_TYPE_COPY_SEND,
+      .msgt_size = 32,
+      .msgt_number = 1,
+      .msgt_inline = TRUE,
+      .msgt_longform = FALSE,
+      .msgt_deallocate = FALSE,
+      .msgt_unused = 0
     },
-    refport
+    .refport = refport
   };
 
   err = mach_msg ((mach_msg_header_t *)&message,
diff --git a/startup/startup.c b/startup/startup.c
index e151cd2f..fd7503f4 100644
--- a/startup/startup.c
+++ b/startup/startup.c
@@ -633,13 +633,13 @@ mig_reply_setup (
        mach_msg_header_t       *out)
 {
       static const mach_msg_type_t RetCodeType = {
-               /* msgt_name = */               MACH_MSG_TYPE_INTEGER_32,
-               /* msgt_size = */               32,
-               /* msgt_number = */             1,
-               /* msgt_inline = */             TRUE,
-               /* msgt_longform = */           FALSE,
-               /* msgt_deallocate = */         FALSE,
-               /* msgt_unused = */             0
+        .msgt_name = MACH_MSG_TYPE_INTEGER_32,
+        .msgt_size = 32,
+        .msgt_number = 1,
+        .msgt_inline = TRUE,
+        .msgt_longform = FALSE,
+        .msgt_deallocate = FALSE,
+        .msgt_unused = 0
        };
 
 #define        InP     (in)
diff --git a/utils/rpctrace.c b/utils/rpctrace.c
index 09edc1e8..f4d103e8 100644
--- a/utils/rpctrace.c
+++ b/utils/rpctrace.c
@@ -1105,13 +1105,13 @@ trace_and_forward (mach_msg_header_t *inp, 
mach_msg_header_t *outp)
 
   const mach_msg_type_t RetCodeType =
   {
-    MACH_MSG_TYPE_INTEGER_32,  /* msgt_name = */
-    32,                                /* msgt_size = */
-    1,                         /* msgt_number = */
-    TRUE,                      /* msgt_inline = */
-    FALSE,                     /* msgt_longform = */
-    FALSE,                     /* msgt_deallocate = */
-    0                          /* msgt_unused = */
+    .msgt_name = MACH_MSG_TYPE_INTEGER_32,
+    .msgt_size = 32,
+    .msgt_number = 1,
+    .msgt_inline = TRUE,
+    .msgt_longform = FALSE,
+    .msgt_deallocate = FALSE,
+    .msgt_unused = 0
   };
 
   error_t err;
-- 
2.39.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]