aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2017-03-16 16:53:28 +0100
committerMarcello Stanisci <marcello.stanisci@inria.fr>2017-03-16 16:53:28 +0100
commit23dd95c65463bffdc46dc8e74a0b15eab568b9fd (patch)
tree9e9f654660de21d103b53f5efe00ac6aed93493a
parentb92543a726e5f0df8c29788badae049923f3b35a (diff)
Last commit as of getopt porting. 'social' still gives warnings.
-rw-r--r--src/auction/gnunet-auction-create.c67
-rw-r--r--src/dht/gnunet-dht-put.c5
-rw-r--r--src/identity-provider/gnunet-identity-token.c19
-rw-r--r--src/secretsharing/gnunet-service-secretsharing.c2
4 files changed, 57 insertions, 36 deletions
diff --git a/src/auction/gnunet-auction-create.c b/src/auction/gnunet-auction-create.c
index a4c0295725..e6fcab097f 100644
--- a/src/auction/gnunet-auction-create.c
+++ b/src/auction/gnunet-auction-create.c
@@ -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))
diff --git a/src/dht/gnunet-dht-put.c b/src/dht/gnunet-dht-put.c
index 55644a94cc..bf88e5ded9 100644
--- a/src/dht/gnunet-dht-put.c
+++ b/src/dht/gnunet-dht-put.c
@@ -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
};
diff --git a/src/identity-provider/gnunet-identity-token.c b/src/identity-provider/gnunet-identity-token.c
index 4bb3292bee..906899ea76 100644
--- a/src/identity-provider/gnunet-identity-token.c
+++ b/src/identity-provider/gnunet-identity-token.c
@@ -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
};
diff --git a/src/secretsharing/gnunet-service-secretsharing.c b/src/secretsharing/gnunet-service-secretsharing.c
index fa35dc21b1..6c281df86b 100644
--- a/src/secretsharing/gnunet-service-secretsharing.c
+++ b/src/secretsharing/gnunet-service-secretsharing.c
@@ -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;
}