mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 03:44:06 +00:00
Move sizeof to second argument in calloc calls
Clears -Wcalloc-transposed-args warnings from gcc 14.1, such as:
../dix/main.c:165:42: warning: ‘calloc’ sizes specified with ‘sizeof’ in the
earlier argument and not in the later argument [-Wcalloc-transposed-args]
165 | serverClient = calloc(sizeof(ClientRec), 1);
| ^~~~~~~~~
../dix/main.c:165:42: note: earlier argument should specify number of
elements, later size of each element
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1606>
This commit is contained in:
@@ -162,7 +162,7 @@ dix_main(int argc, char *argv[], char *envp[])
|
||||
CreateWellKnownSockets();
|
||||
for (i = 1; i < LimitClients; i++)
|
||||
clients[i] = NullClient;
|
||||
serverClient = calloc(sizeof(ClientRec), 1);
|
||||
serverClient = calloc(1, sizeof(ClientRec));
|
||||
if (!serverClient)
|
||||
FatalError("couldn't create server client");
|
||||
InitClient(serverClient, 0, (void *) NULL);
|
||||
|
||||
Reference in New Issue
Block a user