option-parser: Make bools boolean
When option-parser is confronted with a boolean option, have it write a bool rather than treating the value as a pointer to an int32. (lib)weston already heavily uses bool types internally, so this has the nice side effect of eliminating quite a few local variables which only existed as integer shadows of internal boolean variables. Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
committed by
Daniel Stone
parent
b8c3926445
commit
dd8219b3fb
@@ -76,7 +76,7 @@ long_option(const struct weston_option *options, int count, char *arg)
|
||||
|
||||
if (options[k].type == WESTON_OPTION_BOOLEAN) {
|
||||
if (!arg[len + 2]) {
|
||||
* (int32_t *) options[k].data = 1;
|
||||
* (bool *) options[k].data = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -127,7 +127,7 @@ short_option(const struct weston_option *options, int count, char *arg)
|
||||
|
||||
if (options[k].type == WESTON_OPTION_BOOLEAN) {
|
||||
if (!arg[2]) {
|
||||
* (int32_t *) options[k].data = 1;
|
||||
* (bool *) options[k].data = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user