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:
Alan Coopersmith
2024-07-14 11:24:00 -07:00
parent 6a1d730006
commit 522f469fe9
37 changed files with 65 additions and 65 deletions

View File

@@ -350,7 +350,7 @@ ProcXListInputDevices(ClientPtr client)
};
/* allocate space for saving skip value */
skip = calloc(sizeof(Bool), inputInfo.numDevices);
skip = calloc(inputInfo.numDevices, sizeof(Bool));
if (!skip)
return BadAlloc;