Whamcloud - gitweb
LU-6210 utils: Use C99 initializers in lfs_setquota_times() 19/27519/2
authorSteve Guminski <stephenx.guminski@intel.com>
Fri, 14 Apr 2017 19:27:22 +0000 (15:27 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 13 Jun 2017 16:56:08 +0000 (16:56 +0000)
This patch makes no functional changes.  Struct initializers that
use C89 or GCC-only syntax are updated to C99 syntax.

C89 positional initializers require values to be placed in the
correct order. This will cause errors if the fields of the struct
definition are reordered or fields are added or removed. C99 named
initializers avoid this problem, and also automatically clear any
values that are not explicitly set.

This patch updates lfs_setquota_times() to use the C99 syntax.

Test-Parameters: trivial
Signed-off-by: Steve Guminski <stephenx.guminski@intel.com>
Change-Id: I50c6260246e0ac345d8b981dd624791bab9220a5
Reviewed-on: https://review.whamcloud.com/27519
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
lustre/utils/lfs.c

index 668f261..339d745 100644 (file)
@@ -3606,14 +3606,13 @@ int lfs_setquota_times(int argc, char **argv)
         struct obd_dqblk *dqb = &qctl.qc_dqblk;
         struct obd_dqinfo *dqi = &qctl.qc_dqinfo;
         struct option long_opts[] = {
-                {"block-grace",     required_argument, 0, 'b'},
-                {"group",           no_argument,       0, 'g'},
-                {"inode-grace",     required_argument, 0, 'i'},
-               {"projid",          no_argument,       0, 'p'},
-                {"times",           no_argument,       0, 't'},
-                {"user",            no_argument,       0, 'u'},
-                {0, 0, 0, 0}
-        };
+       { .val = 'b',   .name = "block-grace",  .has_arg = required_argument },
+       { .val = 'g',   .name = "group",        .has_arg = no_argument },
+       { .val = 'i',   .name = "inode-grace",  .has_arg = required_argument },
+       { .val = 'p',   .name = "projid",       .has_arg = no_argument },
+       { .val = 't',   .name = "times",        .has_arg = no_argument },
+       { .val = 'u',   .name = "user",         .has_arg = no_argument },
+       { .name = NULL } };
        int qtype;
 
        memset(&qctl, 0, sizeof(qctl));