hw: Rename boolean config value field from bool to boolean

"bool" conflicts with C++ (meh) and stdbool.h (ngh alright fine). This
is a driver-visible change and will likely break the build for mach64,
but it can be fixed by simply using xf86ReturnOptValBool like every
other driver.

Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Adam Jackson 2019-07-22 13:51:06 -04:00
parent 074c98cf53
commit 454b3a826e
4 changed files with 18 additions and 18 deletions

View File

@ -41,7 +41,7 @@ typedef union {
unsigned long num; unsigned long num;
const char *str; const char *str;
double realnum; double realnum;
Bool bool; Bool boolean;
OptFrequency freq; OptFrequency freq;
} ValueUnion; } ValueUnion;

View File

@ -213,7 +213,7 @@ LookupBoolOption(XF86OptionPtr optlist, const char *name, int deflt,
o.name = name; o.name = name;
o.type = OPTV_BOOLEAN; o.type = OPTV_BOOLEAN;
if (ParseOptionValue(-1, optlist, &o, markUsed)) if (ParseOptionValue(-1, optlist, &o, markUsed))
deflt = o.value.bool; deflt = o.value.boolean;
return deflt; return deflt;
} }
@ -474,7 +474,7 @@ xf86ShowUnusedOptions(int scrnIndex, XF86OptionPtr opt)
static Bool static Bool
GetBoolValue(OptionInfoPtr p, const char *s) GetBoolValue(OptionInfoPtr p, const char *s)
{ {
return xf86getBoolValue(&p->value.bool, s); return xf86getBoolValue(&p->value.boolean, s);
} }
static Bool static Bool
@ -678,7 +678,7 @@ ParseOptionValue(int scrnIndex, XF86OptionPtr options, OptionInfoPtr p,
if (markUsed) if (markUsed)
xf86MarkOptionUsedByName(options, newn); xf86MarkOptionUsedByName(options, newn);
if (GetBoolValue(&opt, s)) { if (GetBoolValue(&opt, s)) {
p->value.bool = !opt.value.bool; p->value.boolean = !opt.value.boolean;
p->found = TRUE; p->found = TRUE;
} }
else { else {
@ -869,7 +869,7 @@ xf86GetOptValBool(const OptionInfoRec * table, int token, Bool *value)
p = xf86TokenToOptinfo(table, token); p = xf86TokenToOptinfo(table, token);
if (p && p->found) { if (p && p->found) {
*value = p->value.bool; *value = p->value.boolean;
return TRUE; return TRUE;
} }
else else
@ -883,7 +883,7 @@ xf86ReturnOptValBool(const OptionInfoRec * table, int token, Bool def)
p = xf86TokenToOptinfo(table, token); p = xf86TokenToOptinfo(table, token);
if (p && p->found) { if (p && p->found) {
return p->value.bool; return p->value.boolean;
} }
else else
return def; return def;

View File

@ -623,7 +623,7 @@ winSetBoolOption(void *optlist, const char *name, int deflt)
o.name = name; o.name = name;
o.type = OPTV_BOOLEAN; o.type = OPTV_BOOLEAN;
if (ParseOptionValue(-1, optlist, &o)) if (ParseOptionValue(-1, optlist, &o))
deflt = o.value.bool; deflt = o.value.boolean;
return deflt; return deflt;
} }
@ -918,7 +918,7 @@ ParseOptionValue(int scrnIndex, void *options, OptionInfoPtr p)
} }
if ((s = winFindOptionValue(options, newn)) != NULL) { if ((s = winFindOptionValue(options, newn)) != NULL) {
if (GetBoolValue(&opt, s)) { if (GetBoolValue(&opt, s)) {
p->value.bool = !opt.value.bool; p->value.boolean = !opt.value.boolean;
p->found = TRUE; p->found = TRUE;
} }
else { else {
@ -968,25 +968,25 @@ static Bool
GetBoolValue(OptionInfoPtr p, const char *s) GetBoolValue(OptionInfoPtr p, const char *s)
{ {
if (*s == 0) { if (*s == 0) {
p->value.bool = TRUE; p->value.boolean = TRUE;
} }
else { else {
if (winNameCompare(s, "1") == 0) if (winNameCompare(s, "1") == 0)
p->value.bool = TRUE; p->value.boolean = TRUE;
else if (winNameCompare(s, "on") == 0) else if (winNameCompare(s, "on") == 0)
p->value.bool = TRUE; p->value.boolean = TRUE;
else if (winNameCompare(s, "true") == 0) else if (winNameCompare(s, "true") == 0)
p->value.bool = TRUE; p->value.boolean = TRUE;
else if (winNameCompare(s, "yes") == 0) else if (winNameCompare(s, "yes") == 0)
p->value.bool = TRUE; p->value.boolean = TRUE;
else if (winNameCompare(s, "0") == 0) else if (winNameCompare(s, "0") == 0)
p->value.bool = FALSE; p->value.boolean = FALSE;
else if (winNameCompare(s, "off") == 0) else if (winNameCompare(s, "off") == 0)
p->value.bool = FALSE; p->value.boolean = FALSE;
else if (winNameCompare(s, "false") == 0) else if (winNameCompare(s, "false") == 0)
p->value.bool = FALSE; p->value.boolean = FALSE;
else if (winNameCompare(s, "no") == 0) else if (winNameCompare(s, "no") == 0)
p->value.bool = FALSE; p->value.boolean = FALSE;
} }
return TRUE; return TRUE;
} }

View File

@ -199,7 +199,7 @@ typedef union {
unsigned long num; unsigned long num;
char *str; char *str;
double realnum; double realnum;
Bool bool; Bool boolean;
OptFrequency freq; OptFrequency freq;
} ValueUnion; } ValueUnion;