mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 07:02:34 +02:00
dmi.c: Retype variable anchored
with bool
Use the bool type instead of an integer for the variable `anchored`, since this represents its purpose much better. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I5bedaf47cdd2fd5d152f69b6b02aab69fd1285c6 Reviewed-on: https://review.coreboot.org/c/flashrom/+/66903 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
parent
de2052849d
commit
6f5c8fdfc3
7
dmi.c
7
dmi.c
@ -27,6 +27,7 @@
|
|||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <stdbool.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
@ -432,7 +433,7 @@ void dmi_init(void)
|
|||||||
*/
|
*/
|
||||||
static int dmi_compare(const char *value, const char *pattern)
|
static int dmi_compare(const char *value, const char *pattern)
|
||||||
{
|
{
|
||||||
int anchored = 0;
|
bool anchored = false;
|
||||||
int patternlen;
|
int patternlen;
|
||||||
|
|
||||||
msg_pspew("matching %s against %s\n", value, pattern);
|
msg_pspew("matching %s against %s\n", value, pattern);
|
||||||
@ -441,7 +442,7 @@ static int dmi_compare(const char *value, const char *pattern)
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (pattern[0] == '^') {
|
if (pattern[0] == '^') {
|
||||||
anchored = 1;
|
anchored = true;
|
||||||
pattern++;
|
pattern++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -458,7 +459,7 @@ static int dmi_compare(const char *value, const char *pattern)
|
|||||||
|
|
||||||
/* start character to make ends match */
|
/* start character to make ends match */
|
||||||
value += valuelen - patternlen;
|
value += valuelen - patternlen;
|
||||||
anchored = 1;
|
anchored = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (anchored)
|
if (anchored)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user