xkb: maprules: use static struct init instead of memset()
Allow the compiler to figure out the most efficient way to do the struct initialization, and a little improvement on code readability. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840>
This commit is contained in:
parent
ffd7ca8af2
commit
a88b17565b
|
@ -376,7 +376,6 @@ CheckLine(InputLine * line,
|
||||||
{
|
{
|
||||||
char *str, *tok;
|
char *str, *tok;
|
||||||
register int nread;
|
register int nread;
|
||||||
FileSpec tmp;
|
|
||||||
_Xstrtokparams strtok_buf;
|
_Xstrtokparams strtok_buf;
|
||||||
Bool append = FALSE;
|
Bool append = FALSE;
|
||||||
|
|
||||||
|
@ -419,7 +418,9 @@ CheckLine(InputLine * line,
|
||||||
DebugF("Illegal line of data ignored\n");
|
DebugF("Illegal line of data ignored\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
memset((char *) &tmp, 0, sizeof(FileSpec));
|
|
||||||
|
FileSpec tmp = { 0 };
|
||||||
|
|
||||||
str = line->line;
|
str = line->line;
|
||||||
for (nread = 0; (tok = _XStrtok(str, " ", strtok_buf)) != NULL; nread++) {
|
for (nread = 0; (tok = _XStrtok(str, " ", strtok_buf)) != NULL; nread++) {
|
||||||
str = NULL;
|
str = NULL;
|
||||||
|
|
Loading…
Reference in New Issue