Last commit as of getopt porting. 'social' still gives warnings.
authorMarcello Stanisci <marcello.stanisci@inria.fr>
Thu, 16 Mar 2017 15:53:28 +0000 (16:53 +0100)
committerMarcello Stanisci <marcello.stanisci@inria.fr>
Thu, 16 Mar 2017 15:53:28 +0000 (16:53 +0100)
src/auction/gnunet-auction-create.c
src/dht/gnunet-dht-put.c
src/identity-provider/gnunet-identity-token.c
src/secretsharing/gnunet-service-secretsharing.c

index a4c0295725baba30d5e2ae6e3a69c0eec4a0a313..e6fcab097f48c74606a6617d47482a2c75cb871b 100644 (file)
@@ -155,30 +155,49 @@ fail:
 int
 main (int argc, char *const *argv)
 {
-       static const struct GNUNET_GETOPT_CommandLineOption options[] = {
-               {'d', "description", "FILE",
-                       gettext_noop ("description of the item to be sold"),
-                       1, &GNUNET_GETOPT_set_filename, &fndesc},
-               {'p', "pricemap", "FILE",
-                       gettext_noop ("mapping of possible prices"),
-                       1, &GNUNET_GETOPT_set_filename, &fnprices},
-               {'r', "roundtime", "DURATION",
-                       gettext_noop ("max duration per round"),
-                       1, &GNUNET_GETOPT_set_relative_time, &dround},
-               {'s', "regtime", "DURATION",
-                       gettext_noop ("duration until auction starts"),
-                       1, &GNUNET_GETOPT_set_relative_time, &dstart},
-               {'m', "m", "NUMBER",
-                       gettext_noop ("number of items to sell\n"
-                                     "0 for first price auction\n"
-                                     ">0 for vickrey/M+1st price auction"),
-                       1, &GNUNET_GETOPT_set_uint, &m},
-               {'u', "public", NULL,
-                       gettext_noop ("public auction outcome"),
-                       0, &GNUNET_GETOPT_set_one, &outcome},
-               {'i', "interactive", NULL,
-                       gettext_noop ("keep running in foreground until auction completes"),
-                       0, &GNUNET_GETOPT_set_one, &interactive},
+       struct GNUNET_GETOPT_CommandLineOption options[] = {
+
+                GNUNET_GETOPT_OPTION_FILENAME ('d',
+                                               "description",
+                                               "FILE",
+                                               gettext_noop ("description of the item to be sold"),
+                                               &fndesc),
+
+                GNUNET_GETOPT_OPTION_FILENAME ('p',
+                                               "pricemap",
+                                               "FILE",
+                                               gettext_noop ("mapping of possible prices"),
+                                               &fnprices),
+
+                GNUNET_GETOPT_OPTION_SET_RELATIVE_TIME ('r',
+                                                        "roundtime",
+                                                        "DURATION",
+                                                        gettext_noop ("max duration per round"),
+                                                        &dround),
+
+                GNUNET_GETOPT_OPTION_SET_RELATIVE_TIME ('s',
+                                                        "regtime",
+                                                        "DURATION",
+                                                        gettext_noop ("duration until auction starts"),
+                                                        &dstart),
+                GNUNET_GETOPT_OPTION_SET_UINT ('m',
+                                               "m",
+                                               "NUMBER",
+                                               gettext_noop ("number of items to sell\n"
+                                                             "0 for first price auction\n"
+                                                            ">0 for vickrey/M+1st price auction"),
+                                               &m), 
+
+                GNUNET_GETOPT_OPTION_SET_ONE ('u',
+                                              "public",
+                                              gettext_noop ("public auction outcome"),
+                                              &outcome),
+
+                GNUNET_GETOPT_OPTION_SET_ONE ('i',
+                                              "interactive",
+                                              gettext_noop ("keep running in foreground until auction completes"),
+                                              &interactive),
+
                GNUNET_GETOPT_OPTION_END
        };
        if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
index 55644a94cc7835aee3920cb85dd0529e75c6f476..bf88e5ded97225b593375c9f4d80febeb67f8889 100644 (file)
@@ -244,10 +244,7 @@ main (int argc, char *const *argv)
                                    gettext_noop ("the type to insert data as"),
                                    &query_type),
   
-    GNUNET_GETOPT_OPTION_SET_ONE ('V',
-                                  "verbose",
-                                  gettext_noop ("be verbose (print progress information)"),
-                                  &verbose),
+    GNUNET_GETOPT_OPTION_VERBOSE (&verbose),
   
     GNUNET_GETOPT_OPTION_END
   };
index 4bb3292bee1caa1eba7215651b8d1a1ed816e47c..906899ea761353d4946796e3422eefb954bd15bf 100644 (file)
@@ -158,13 +158,18 @@ run (void *cls,
 int
 main(int argc, char *const argv[])
 {
-  static const struct GNUNET_GETOPT_CommandLineOption options[] = {
-    {'t', "token", NULL,
-      gettext_noop ("GNUid token"), 1,
-      &GNUNET_GETOPT_set_string, &token},
-    {'p', "print", NULL,
-      gettext_noop ("Print token contents"), 0,
-      &GNUNET_GETOPT_set_one, &print_token},
+  struct GNUNET_GETOPT_CommandLineOption options[] = {
+
+    GNUNET_GETOPT_OPTION_STRING ('t',
+                                 "token",
+                                 NULL,
+                                 gettext_noop ("GNUid token"),
+                                 &token),
+
+    GNUNET_GETOPT_OPTION_SET_ONE ('p',
+                                  "print",
+                                  gettext_noop ("Print token contents"),
+                                  &print_token),
 
     GNUNET_GETOPT_OPTION_END
   };
index fa35dc21b16fa910daf99917e09cea81b08293e1..6c281df86b243b13b920ff042a22c387f50e694d 100644 (file)
@@ -720,7 +720,7 @@ keygen_round1_new_element (void *cls,
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                 "keygen commit data with wrong size (%u) in consensus, "
-                " %lu expected\n",
+                " %u expected\n",
                 element->size, sizeof (struct GNUNET_SECRETSHARING_KeygenCommitData));
     return;
   }