mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-08 10:18:04 +02:00
xquartz: Move side effects out of assert statements in hx/xquartz/darwin.c.
Thanks to Walter Harms for pointing out that the previous code would have failed if it had been compiled with NDEBUG.
This commit is contained in:
parent
ff6b771eee
commit
c033b0be2b
1 changed files with 13 additions and 7 deletions
|
|
@ -517,13 +517,15 @@ InitInput(int argc, char **argv)
|
|||
.rules = "base", .model = "empty", .layout = "empty",
|
||||
.variant = NULL, .options = NULL
|
||||
};
|
||||
int result;
|
||||
|
||||
/* We need to really have rules... or something... */
|
||||
XkbSetRulesDflts(&rmlvo);
|
||||
|
||||
assert(Success == AllocDevicePair(serverClient, "xquartz virtual",
|
||||
&darwinPointer, &darwinKeyboard,
|
||||
DarwinMouseProc, DarwinKeybdProc, FALSE));
|
||||
result = AllocDevicePair(serverClient, "xquartz virtual",
|
||||
&darwinPointer, &darwinKeyboard,
|
||||
DarwinMouseProc, DarwinKeybdProc, FALSE);
|
||||
assert(result == Success);
|
||||
|
||||
/* here's the snippet from the current gdk sources:
|
||||
if (!strcmp (tmp_name, "pointer"))
|
||||
|
|
@ -677,8 +679,12 @@ OsVendorInit(void)
|
|||
if (serverGeneration == 1) {
|
||||
char *lf;
|
||||
char *home = getenv("HOME");
|
||||
int nbytes;
|
||||
|
||||
assert(home);
|
||||
assert(0 < asprintf(&lf, "%s/Library/Logs/X11", home));
|
||||
|
||||
nbytes = asprintf(&lf, "%s/Library/Logs/X11", home);
|
||||
assert(nbytes > 0);
|
||||
|
||||
/* Ignore errors. If EEXIST, we don't care. If anything else,
|
||||
* LogInit will handle it for us.
|
||||
|
|
@ -686,9 +692,9 @@ OsVendorInit(void)
|
|||
(void)mkdir(lf, S_IRWXU | S_IRWXG | S_IRWXO);
|
||||
free(lf);
|
||||
|
||||
assert(0 <
|
||||
asprintf(&lf, "%s/Library/Logs/X11/%s.log", home,
|
||||
bundle_id_prefix));
|
||||
nbytes = asprintf(&lf, "%s/Library/Logs/X11/%s.log", home,
|
||||
bundle_id_prefix);
|
||||
assert(nbytes > 0);
|
||||
LogInit(lf, ".old");
|
||||
free(lf);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue