treewide: replace xnfalloc() calls to XNFalloc()
This has been nothing but an alias for two decades now (somewhere in R6.6),
so there doesn't seem to be any practical need for this indirection.
The macro still needs to remain, as long as (external) drivers still using it.
Fixes: ded6147bfb
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1529>
This commit is contained in:
parent
96c99b8318
commit
c55ddd072b
|
@ -255,7 +255,7 @@ dri3_get_supported_modifiers(ScreenPtr screen, DrawablePtr drawable,
|
|||
}
|
||||
|
||||
/* copy the screen mods so we can return an owned allocation */
|
||||
screen_mods = xnfalloc(screen_format->num_modifiers * sizeof(CARD64));
|
||||
screen_mods = XNFalloc(screen_format->num_modifiers * sizeof(CARD64));
|
||||
memcpy(screen_mods, screen_format->modifiers,
|
||||
screen_format->num_modifiers * sizeof(CARD64));
|
||||
|
||||
|
|
|
@ -1095,7 +1095,7 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
|
|||
if (xf86GlamorEGLPrivateIndex == -1)
|
||||
xf86GlamorEGLPrivateIndex = xf86AllocateScrnInfoPrivateIndex();
|
||||
|
||||
options = xnfalloc(sizeof(GlamorEGLOptions));
|
||||
options = XNFalloc(sizeof(GlamorEGLOptions));
|
||||
memcpy(options, GlamorEGLOptions, sizeof(GlamorEGLOptions));
|
||||
xf86ProcessOptions(scrn->scrnIndex, scrn->options, options);
|
||||
glvnd_vendor = xf86GetOptValString(options, GLAMOREGLOPT_VENDOR_LIBRARY);
|
||||
|
|
|
@ -42,7 +42,7 @@ glamor_upload_boxes(DrawablePtr drawable, BoxPtr in_boxes, int in_nbox,
|
|||
char *tmp_bits = NULL;
|
||||
|
||||
if (glamor_drawable_effective_depth(drawable) == 24 && pixmap->drawable.depth == 32)
|
||||
tmp_bits = xnfalloc(byte_stride * pixmap->drawable.height);
|
||||
tmp_bits = XNFalloc(byte_stride * pixmap->drawable.height);
|
||||
|
||||
glamor_make_current(glamor_priv);
|
||||
|
||||
|
|
|
@ -128,7 +128,7 @@ glamor_get_vbo_space(ScreenPtr screen, unsigned size, char **vbo_offset)
|
|||
if (glamor_priv->vbo_size < size) {
|
||||
glamor_priv->vbo_size = MAX(GLAMOR_VBO_SIZE, size);
|
||||
free(glamor_priv->vb);
|
||||
glamor_priv->vb = xnfalloc(glamor_priv->vbo_size);
|
||||
glamor_priv->vb = XNFalloc(glamor_priv->vbo_size);
|
||||
}
|
||||
*vbo_offset = NULL;
|
||||
/* We point to the start of glamor_priv->vb every time, and
|
||||
|
|
|
@ -977,7 +977,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
|
|||
screen->base.fbconfigs = glxConvertConfigs(screen->core,
|
||||
screen->driConfigs);
|
||||
|
||||
options = xnfalloc(sizeof(GLXOptions));
|
||||
options = XNFalloc(sizeof(GLXOptions));
|
||||
memcpy(options, GLXOptions, sizeof(GLXOptions));
|
||||
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
|
||||
glvnd = xf86GetOptValString(options, GLXOPT_VENDOR_LIBRARY);
|
||||
|
|
|
@ -427,7 +427,7 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen)
|
|||
|
||||
i = __glXGetExtensionString(pGlxScreen->glx_enable_bits, NULL);
|
||||
if (i > 0) {
|
||||
pGlxScreen->GLXextensions = xnfalloc(i);
|
||||
pGlxScreen->GLXextensions = XNFalloc(i);
|
||||
(void) __glXGetExtensionString(pGlxScreen->glx_enable_bits,
|
||||
pGlxScreen->GLXextensions);
|
||||
}
|
||||
|
|
|
@ -1580,7 +1580,7 @@ __glXQueryServerString(CARD32 name)
|
|||
/* The spec doesn't mention this, but the Xorg server replies with
|
||||
* a string already terminated with '\0'. */
|
||||
len = xcb_glx_query_server_string_string_length(reply);
|
||||
buf = xnfalloc(len);
|
||||
buf = XNFalloc(len);
|
||||
memcpy(buf, str, len);
|
||||
free(reply);
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ AppendToList(const char *s, const char ***list, int *lines)
|
|||
for (p = strtok(str, "\n"); p; p = strtok(NULL, "\n")) {
|
||||
(*lines)++;
|
||||
*list = xnfreallocarray(*list, *lines + 1, sizeof(**list));
|
||||
newstr = xnfalloc(strlen(p) + 2);
|
||||
newstr = XNFalloc(strlen(p) + 2);
|
||||
strcpy(newstr, p);
|
||||
strcat(newstr, "\n");
|
||||
(*list)[*lines - 1] = newstr;
|
||||
|
|
|
@ -568,7 +568,7 @@ configFiles(XF86ConfFilesPtr fileconf)
|
|||
temp_path++;
|
||||
}
|
||||
|
||||
log_buf = xnfalloc(strlen(defaultFontPath) + (2 * countDirs) + 1);
|
||||
log_buf = XNFalloc(strlen(defaultFontPath) + (2 * countDirs) + 1);
|
||||
temp_path = log_buf;
|
||||
start = (char *) defaultFontPath;
|
||||
while ((end = index(start, ',')) != NULL) {
|
||||
|
@ -1643,7 +1643,7 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen,
|
|||
}
|
||||
else {
|
||||
/* Set up an empty input device list, then look for some core devices. */
|
||||
indp = xnfalloc(sizeof(InputInfoPtr));
|
||||
indp = XNFalloc(sizeof(InputInfoPtr));
|
||||
*indp = NULL;
|
||||
servlayoutp->inputs = indp;
|
||||
}
|
||||
|
|
|
@ -124,7 +124,7 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData,
|
|||
DevToConfig[i].iDriver = CurrentDriver;
|
||||
|
||||
/* Fill in what we know, converting the driver name to lower case */
|
||||
lower_driver = xnfalloc(strlen(driver) + 1);
|
||||
lower_driver = XNFalloc(strlen(driver) + 1);
|
||||
for (j = 0; (lower_driver[j] = tolower(driver[j])); j++);
|
||||
DevToConfig[i].GDev.driver = lower_driver;
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ xf86AddDriver(DriverPtr driver, void *module, int flags)
|
|||
xf86NumDrivers++;
|
||||
xf86DriverList = xnfreallocarray(xf86DriverList,
|
||||
xf86NumDrivers, sizeof(DriverPtr));
|
||||
xf86DriverList[xf86NumDrivers - 1] = xnfalloc(sizeof(DriverRec));
|
||||
xf86DriverList[xf86NumDrivers - 1] = XNFalloc(sizeof(DriverRec));
|
||||
*xf86DriverList[xf86NumDrivers - 1] = *driver;
|
||||
xf86DriverList[xf86NumDrivers - 1]->module = module;
|
||||
xf86DriverList[xf86NumDrivers - 1]->refCount = 0;
|
||||
|
@ -118,7 +118,7 @@ xf86AddInputDriver(InputDriverPtr driver, void *module, int flags)
|
|||
xf86NumInputDrivers,
|
||||
sizeof(InputDriverPtr));
|
||||
xf86InputDriverList[xf86NumInputDrivers - 1] =
|
||||
xnfalloc(sizeof(InputDriverRec));
|
||||
XNFalloc(sizeof(InputDriverRec));
|
||||
*xf86InputDriverList[xf86NumInputDrivers - 1] = *driver;
|
||||
xf86InputDriverList[xf86NumInputDrivers - 1]->module = module;
|
||||
}
|
||||
|
@ -575,7 +575,7 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp,
|
|||
scrp->confScreen->displays[i]->whiteColour.green = -1;
|
||||
scrp->confScreen->displays[i]->whiteColour.blue = -1;
|
||||
scrp->confScreen->displays[i]->defaultVisual = -1;
|
||||
scrp->confScreen->displays[i]->modes = xnfalloc(sizeof(char *));
|
||||
scrp->confScreen->displays[i]->modes = XNFalloc(sizeof(char *));
|
||||
scrp->confScreen->displays[i]->modes[0] = NULL;
|
||||
scrp->confScreen->displays[i]->depth = depth;
|
||||
scrp->confScreen->displays[i]->fbbpp = fbbpp;
|
||||
|
@ -1550,7 +1550,7 @@ xf86SetBackingStore(ScreenPtr pScreen)
|
|||
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
||||
OptionInfoPtr options;
|
||||
|
||||
options = xnfalloc(sizeof(BSOptions));
|
||||
options = XNFalloc(sizeof(BSOptions));
|
||||
(void) memcpy(options, BSOptions, sizeof(BSOptions));
|
||||
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
|
||||
|
||||
|
@ -1596,7 +1596,7 @@ xf86SetSilkenMouse(ScreenPtr pScreen)
|
|||
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
||||
OptionInfoPtr options;
|
||||
|
||||
options = xnfalloc(sizeof(SMOptions));
|
||||
options = XNFalloc(sizeof(SMOptions));
|
||||
(void) memcpy(options, SMOptions, sizeof(SMOptions));
|
||||
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
|
||||
|
||||
|
|
|
@ -1457,7 +1457,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
|
|||
* Store the clockRanges for later use by the VidMode extension.
|
||||
*/
|
||||
nt_list_for_each_entry(cp, clockRanges, next) {
|
||||
ClockRangePtr newCR = xnfalloc(sizeof(ClockRange));
|
||||
ClockRangePtr newCR = XNFalloc(sizeof(ClockRange));
|
||||
memcpy(newCR, cp, sizeof(ClockRange));
|
||||
newCR->next = NULL;
|
||||
if (scrp->clockRanges == NULL)
|
||||
|
@ -1574,7 +1574,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
|
|||
}
|
||||
|
||||
if (status == MODE_OK) {
|
||||
new = xnfalloc(sizeof(DisplayModeRec));
|
||||
new = XNFalloc(sizeof(DisplayModeRec));
|
||||
*new = *p;
|
||||
new->next = NULL;
|
||||
if (!q) {
|
||||
|
|
|
@ -950,7 +950,7 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
|
|||
if (fd != -1) {
|
||||
if (paused) {
|
||||
/* Put on new_input_devices list for delayed probe */
|
||||
PausedInputDevicePtr new_device = xnfalloc(sizeof *new_device);
|
||||
PausedInputDevicePtr new_device = XNFalloc(sizeof *new_device);
|
||||
new_device->pInfo = pInfo;
|
||||
|
||||
xorg_list_append(&new_device->node, &new_input_devices_list);
|
||||
|
|
|
@ -271,7 +271,7 @@ xf86DoEDID_DDC1(ScrnInfoPtr pScrn, DDC1SetSpeedProc DDC1SetSpeed,
|
|||
Bool noddc = FALSE, noddc1 = FALSE;
|
||||
OptionInfoPtr options;
|
||||
|
||||
options = xnfalloc(sizeof(DDCOptions));
|
||||
options = XNFalloc(sizeof(DDCOptions));
|
||||
(void) memcpy(options, DDCOptions, sizeof(DDCOptions));
|
||||
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
|
||||
|
||||
|
|
|
@ -2924,7 +2924,7 @@ drmmode_output_get_modes(xf86OutputPtr output)
|
|||
|
||||
/* modes should already be available */
|
||||
for (i = 0; i < koutput->count_modes; i++) {
|
||||
Mode = xnfalloc(sizeof(DisplayModeRec));
|
||||
Mode = XNFalloc(sizeof(DisplayModeRec));
|
||||
|
||||
drmmode_ConvertFromKMode(output->scrn, &koutput->modes[i], Mode);
|
||||
Modes = xf86ModesAdd(Modes, Mode);
|
||||
|
|
|
@ -121,7 +121,7 @@ exaDDXDriverInit(ScreenPtr pScreen)
|
|||
if (pScreenPriv == NULL)
|
||||
return;
|
||||
|
||||
pScreenPriv->options = xnfalloc(sizeof(EXAOptions));
|
||||
pScreenPriv->options = XNFalloc(sizeof(EXAOptions));
|
||||
memcpy(pScreenPriv->options, EXAOptions, sizeof(EXAOptions));
|
||||
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pScreenPriv->options);
|
||||
|
||||
|
|
|
@ -287,7 +287,7 @@ fbdev_open_pci(struct pci_device *pPci, char **namep)
|
|||
if (fd != -1) {
|
||||
if (ioctl(fd, FBIOGET_FSCREENINFO, (void *) &fix) != -1) {
|
||||
if (namep) {
|
||||
*namep = xnfalloc(16);
|
||||
*namep = XNFalloc(16);
|
||||
strncpy(*namep, fix.id, 16);
|
||||
}
|
||||
|
||||
|
@ -396,7 +396,7 @@ fbdev_open(int scrnIndex, const char *dev, char **namep)
|
|||
return -1;
|
||||
}
|
||||
else {
|
||||
*namep = xnfalloc(16);
|
||||
*namep = XNFalloc(16);
|
||||
strncpy(*namep, fix.id, 16);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -141,7 +141,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
|
|||
pInt->private = (void *) xnfcalloc(1, sizeof(genericInt10Priv));
|
||||
INTPriv(pInt)->alloc = (void *) xnfcalloc(1, ALLOC_ENTRIES(getpagesize()));
|
||||
pInt->pScrn = pScrn;
|
||||
base = INTPriv(pInt)->base = xnfalloc(SYS_BIOS);
|
||||
base = INTPriv(pInt)->base = XNFalloc(SYS_BIOS);
|
||||
|
||||
/* FIXME: Shouldn't this be a failure case? Leaving dev as NULL seems like
|
||||
* FIXME: an error
|
||||
|
@ -217,7 +217,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
|
|||
}
|
||||
#else
|
||||
if (!sysMem) {
|
||||
sysMem = xnfalloc(BIOS_SIZE);
|
||||
sysMem = XNFalloc(BIOS_SIZE);
|
||||
setup_system_bios(sysMem);
|
||||
}
|
||||
INTPriv(pInt)->sysMem = sysMem;
|
||||
|
|
|
@ -744,7 +744,7 @@ xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, Bool save)
|
|||
|
||||
base += BIOS_SCRATCH_OFF;
|
||||
if (save) {
|
||||
if ((pInt->BIOSScratch = xnfalloc(BIOS_SCRATCH_LEN)))
|
||||
if ((pInt->BIOSScratch = XNFalloc(BIOS_SCRATCH_LEN)))
|
||||
for (i = 0; i < BIOS_SCRATCH_LEN; i++)
|
||||
*(((char *) pInt->BIOSScratch + i)) = *(base + i);
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@ VBEExtendedInit(xf86Int10InfoPtr pInt, int entityIndex, int Flags)
|
|||
L_ADD(vbe->
|
||||
OemProductRevPtr)));
|
||||
}
|
||||
vip = (vbeInfoPtr) xnfalloc(sizeof(vbeInfoRec));
|
||||
vip = (vbeInfoPtr) XNFalloc(sizeof(vbeInfoRec));
|
||||
vip->version = B_O16(vbe->VbeVersion);
|
||||
vip->pInt10 = pInt;
|
||||
vip->ddc = DDC_UNCHECKED;
|
||||
|
@ -270,7 +270,7 @@ vbeReadEDID(vbeInfoPtr pVbe)
|
|||
if (!page)
|
||||
return NULL;
|
||||
|
||||
options = xnfalloc(sizeof(VBEOptions));
|
||||
options = XNFalloc(sizeof(VBEOptions));
|
||||
(void) memcpy(options, VBEOptions, sizeof(VBEOptions));
|
||||
xf86ProcessOptions(screen, pScrn->options, options);
|
||||
xf86GetOptValBool(options, VBEOPT_NOVBE, &novbe);
|
||||
|
@ -302,7 +302,7 @@ vbeReadEDID(vbeInfoPtr pVbe)
|
|||
switch (pVbe->pInt10->ax & 0xff00) {
|
||||
case 0x0:
|
||||
xf86DrvMsgVerb(screen, X_INFO, 3, "VESA VBE DDC read successfully\n");
|
||||
tmp = (unsigned char *) xnfalloc(128);
|
||||
tmp = (unsigned char *) XNFalloc(128);
|
||||
memcpy(tmp, page, 128);
|
||||
break;
|
||||
case 0x100:
|
||||
|
@ -1078,7 +1078,7 @@ VBEReadPanelID(vbeInfoPtr pVbe)
|
|||
case 0x0:
|
||||
xf86DrvMsgVerb(screen, X_INFO, 3,
|
||||
"VESA VBE PanelID read successfully\n");
|
||||
tmp = xnfalloc(32);
|
||||
tmp = XNFalloc(32);
|
||||
memcpy(tmp, page, 32);
|
||||
break;
|
||||
case 0x100:
|
||||
|
|
|
@ -521,7 +521,7 @@ xf86OutputSetMonitor(xf86OutputPtr output)
|
|||
|
||||
free(output->options);
|
||||
|
||||
output->options = xnfalloc(sizeof(xf86OutputOptions));
|
||||
output->options = XNFalloc(sizeof(xf86OutputOptions));
|
||||
memcpy(output->options, xf86OutputOptions, sizeof(xf86OutputOptions));
|
||||
|
||||
XNFasprintf(&option_name, "monitor-%s", output->name);
|
||||
|
@ -2551,7 +2551,7 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow)
|
|||
Bool success = FALSE;
|
||||
|
||||
/* Set up the device options */
|
||||
config->options = xnfalloc(sizeof(xf86DeviceOptions));
|
||||
config->options = XNFalloc(sizeof(xf86DeviceOptions));
|
||||
memcpy(config->options, xf86DeviceOptions, sizeof(xf86DeviceOptions));
|
||||
xf86ProcessOptions(scrn->scrnIndex, scrn->options, config->options);
|
||||
config->debug_modes = xf86ReturnOptValBool(config->options,
|
||||
|
|
|
@ -212,7 +212,7 @@ xf86DuplicateMode(const DisplayModeRec * pMode)
|
|||
{
|
||||
DisplayModePtr pNew;
|
||||
|
||||
pNew = xnfalloc(sizeof(DisplayModeRec));
|
||||
pNew = XNFalloc(sizeof(DisplayModeRec));
|
||||
*pNew = *pMode;
|
||||
pNew->next = NULL;
|
||||
pNew->prev = NULL;
|
||||
|
|
|
@ -1346,7 +1346,7 @@ keyboard_check_repeat (DeviceIntPtr dev, XkbSrvInfoPtr xkbi, unsigned key)
|
|||
}
|
||||
}
|
||||
|
||||
p = xnfalloc(sizeof(struct sync_pending));
|
||||
p = XNFalloc(sizeof(struct sync_pending));
|
||||
p->pending_dev = dev;
|
||||
callback = wl_display_sync (xwl_screen->display);
|
||||
xorg_list_add(&p->l, &xwl_seat->sync_pending);
|
||||
|
|
|
@ -1187,7 +1187,7 @@ xwl_output_set_transform(struct xwl_output *xwl_output)
|
|||
}
|
||||
|
||||
if (xwl_output->transform == NULL) {
|
||||
xwl_output->transform = xnfalloc(sizeof(RRTransformRec));
|
||||
xwl_output->transform = XNFalloc(sizeof(RRTransformRec));
|
||||
RRTransformInit(xwl_output->transform);
|
||||
}
|
||||
|
||||
|
|
|
@ -1860,7 +1860,7 @@ MarkUnderlayWindow(WindowPtr pWin)
|
|||
if (pTree->valdata)
|
||||
return;
|
||||
pTree->valdata =
|
||||
(miOverlayValDataPtr) xnfalloc(sizeof(miOverlayValDataRec));
|
||||
(miOverlayValDataPtr) XNFalloc(sizeof(miOverlayValDataRec));
|
||||
pTree->valdata->oldAbsCorner.x = pWin->drawable.x;
|
||||
pTree->valdata->oldAbsCorner.y = pWin->drawable.y;
|
||||
pTree->valdata->borderVisible = NullRegion;
|
||||
|
|
|
@ -124,7 +124,7 @@ miMarkWindow(WindowPtr pWin)
|
|||
|
||||
if (pWin->valdata)
|
||||
return;
|
||||
val = (ValidatePtr) xnfalloc(sizeof(ValidateRec));
|
||||
val = (ValidatePtr) XNFalloc(sizeof(ValidateRec));
|
||||
val->before.oldAbsCorner.x = pWin->drawable.x;
|
||||
val->before.oldAbsCorner.y = pWin->drawable.y;
|
||||
val->before.borderVisible = NullRegion;
|
||||
|
|
|
@ -64,7 +64,7 @@ tbGetBuffer(unsigned size)
|
|||
|
||||
if (size > tb->size) {
|
||||
free(tb->buffer);
|
||||
tb->buffer = xnfalloc(size);
|
||||
tb->buffer = XNFalloc(size);
|
||||
tb->size = size;
|
||||
}
|
||||
return tb->buffer;
|
||||
|
|
Loading…
Reference in New Issue