summaryrefslogtreecommitdiff
path: root/parse-options.h
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2025-07-09 11:45:14 +0200
committerJunio C Hamano <gitster@pobox.com>2025-07-09 08:39:10 -0700
commit0d3e045b34f38d23e6160ce8aae363f358bd5cdc (patch)
tree1e051719494ba37f8cd8ba844e30efb80371c954 /parse-options.h
parent369e6d94b21d238a203ffb702605f97aca5704c9 (diff)
parse-options: add precision handling for PARSE_OPT_CMDMODE
Build on 09705696f7 (parse-options: introduce precision handling for `OPTION_INTEGER`, 2025-04-17) to support value variables of different sizes for PARSE_OPT_CMDMODE options. Do that by requiring their "precision" to be set and casting their "value" pointer accordingly. Call the function that does the raw casting do_get_int_value() to reserve the name get_int_value() for a more friendly wrapper we're going to introduce in one of the next patches. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'parse-options.h')
-rw-r--r--parse-options.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/parse-options.h b/parse-options.h
index 91c3e3c29b..c75a473c9e 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -269,6 +269,7 @@ struct option {
.short_name = (s), \
.long_name = (l), \
.value = (v), \
+ .precision = sizeof(*v), \
.help = (h), \
.flags = PARSE_OPT_CMDMODE|PARSE_OPT_NOARG|PARSE_OPT_NONEG | (f), \
.defval = (i), \