xserver: Branch 'master' - 7 commits
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Jul 26 23:46:20 UTC 2024
Xi/exevents.c | 2
config/config.c | 2
dix/devices.c | 2
dix/dixutils.c | 2
dri3/dri3_screen.c | 2
glamor/glamor.c | 2
glamor/glamor_egl.c | 2
glamor/glamor_transfer.c | 2
glamor/glamor_vbo.c | 2
glx/glxdri2.c | 4 -
glx/glxscreens.c | 2
hw/kdrive/ephyr/ephyr_glamor_xv.c | 6 +-
hw/kdrive/ephyr/hostx.c | 2
hw/xfree86/common/xf86AutoConfig.c | 12 ++--
hw/xfree86/common/xf86Bus.c | 18 +++---
hw/xfree86/common/xf86Config.c | 62 +++++++++++------------
hw/xfree86/common/xf86Configure.c | 50 +++++++++---------
hw/xfree86/common/xf86Helper.c | 38 +++++++-------
hw/xfree86/common/xf86Mode.c | 14 ++---
hw/xfree86/common/xf86Xinput.c | 8 +-
hw/xfree86/common/xf86pciBus.c | 8 +-
hw/xfree86/common/xf86platformBus.c | 2
hw/xfree86/common/xf86sbusBus.c | 14 ++---
hw/xfree86/ddc/ddc.c | 2
hw/xfree86/ddc/interpret_edid.c | 2
hw/xfree86/doc/ddxDesign.xml | 4 -
hw/xfree86/dri/dri.c | 2
hw/xfree86/drivers/modesetting/driver.c | 4 -
hw/xfree86/drivers/modesetting/drmmode_display.c | 4 -
hw/xfree86/exa/examodule.c | 2
hw/xfree86/fbdevhw/fbdevhw.c | 6 +-
hw/xfree86/i2c/xf86i2c.c | 2
hw/xfree86/int10/generic.c | 10 +--
hw/xfree86/int10/helper_exec.c | 2
hw/xfree86/int10/vbe.c | 10 +--
hw/xfree86/int10/vbeModes.c | 4 -
hw/xfree86/loader/loadmod.c | 2
hw/xfree86/modes/xf86Crtc.c | 18 +++---
hw/xfree86/modes/xf86EdidModes.c | 2
hw/xfree86/modes/xf86Modes.c | 12 ++--
hw/xfree86/modes/xf86gtf.c | 2
hw/xfree86/os-support/bus/Sbus.c | 4 -
hw/xfree86/os-support/linux/int10/linux.c | 6 +-
hw/xfree86/vgahw/vgaHW.c | 4 -
hw/xwayland/xwayland-dmabuf.c | 8 +-
hw/xwayland/xwayland-glamor-xv.c | 16 ++---
hw/xwayland/xwayland-input.c | 2
hw/xwayland/xwayland-output.c | 2
hw/xwayland/xwayland-window.c | 4 -
hw/xwayland/xwayland-xtest.c | 2
include/os.h | 2
mi/mioverlay.c | 2
mi/miwindow.c | 2
os/connection.c | 4 -
test/input.c | 10 +--
test/touch.c | 10 +--
xkb/ddxLoad.c | 2
xkb/xkbInit.c | 10 +--
xkb/xkbUtils.c | 6 +-
xkb/xkbtext.c | 2
60 files changed, 222 insertions(+), 224 deletions(-)
New commits:
commit dec57e5796ac3cd6a9a542117d5bf0a13a9d4273
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date: Fri May 10 11:15:20 2024 +0200
treewide: replace xnfstrdup() calls by XNFstrdup()
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.
Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1529>
diff --git a/glamor/glamor.c b/glamor/glamor.c
index 70a34d81b..914c414a1 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -954,7 +954,7 @@ glamor_set_glvnd_vendor(ScreenPtr screen, const char *vendor_name)
if (glamor_priv->glvnd_vendor)
free(glamor_priv->glvnd_vendor);
- glamor_priv->glvnd_vendor = xnfstrdup(vendor_name);
+ glamor_priv->glvnd_vendor = XNFstrdup(vendor_name);
}
const char *
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 2321be922..bb557fb7d 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -982,7 +982,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
glvnd = xf86GetOptValString(options, GLXOPT_VENDOR_LIBRARY);
if (glvnd)
- screen->base.glvnd = xnfstrdup(glvnd);
+ screen->base.glvnd = XNFstrdup(glvnd);
free(options);
if (!screen->base.glvnd)
diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c
index a63b53676..d49f59085 100644
--- a/hw/xfree86/common/xf86AutoConfig.c
+++ b/hw/xfree86/common/xf86AutoConfig.c
@@ -104,7 +104,7 @@ AppendToList(const char *s, const char ***list, int *lines)
{
char *str, *newstr, *p;
- str = xnfstrdup(s);
+ str = XNFstrdup(s);
for (p = strtok(str, "\n"); p; p = strtok(NULL, "\n")) {
(*lines)++;
*list = XNFreallocarray(*list, *lines + 1, sizeof(**list));
@@ -156,7 +156,7 @@ xf86AddMatchedDriver(XF86MatchedDrivers *md, const char *driver)
}
if (nmatches < MATCH_DRIVERS_LIMIT) {
- md->matches[nmatches] = xnfstrdup(driver);
+ md->matches[nmatches] = XNFstrdup(driver);
md->nmatches++;
}
else {
@@ -272,7 +272,7 @@ listPossibleVideoDrivers(XF86MatchedDrivers *md)
/* find end of all uppercase vendor section */
}
if ((cp != visid.name) && (*cp != '\0')) {
- char *vendorName = xnfstrdup(visid.name);
+ char *vendorName = XNFstrdup(visid.name);
vendorName[cp - visid.name] = '\0';
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index c3e77350f..fce7c401d 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -556,7 +556,7 @@ configFiles(XF86ConfFilesPtr fileconf)
temp_path = defaultFontPath ? (char *) defaultFontPath : (char *) "";
/* xf86ValidateFontPath modifies its argument, but returns a copy of it. */
- temp_path = must_copy ? xnfstrdup(defaultFontPath) : (char *) defaultFontPath;
+ temp_path = must_copy ? XNFstrdup(defaultFontPath) : (char *) defaultFontPath;
defaultFontPath = xf86ValidateFontPath(temp_path);
free(temp_path);
@@ -1950,7 +1950,7 @@ configMonitor(MonPtr monitorp, XF86ConfMonitorPtr conf_monitor)
mode->Flags = cmodep->ml_flags;
mode->HSkew = cmodep->ml_hskew;
mode->VScan = cmodep->ml_vscan;
- mode->name = xnfstrdup(cmodep->ml_identifier);
+ mode->name = XNFstrdup(cmodep->ml_identifier);
if (last) {
mode->prev = last;
last->next = mode;
@@ -2347,7 +2347,7 @@ xf86HandleConfigFile(Bool autoconfig)
filename = xf86openConfigFile(filesearch, xf86ConfigFile, PROJECTROOT);
if (filename) {
xf86MsgVerb(filefrom, 0, "Using config file: \"%s\"\n", filename);
- xf86ConfigFile = xnfstrdup(filename);
+ xf86ConfigFile = XNFstrdup(filename);
}
else {
if (xf86ConfigFile)
@@ -2357,7 +2357,7 @@ xf86HandleConfigFile(Bool autoconfig)
if (dirname) {
xf86MsgVerb(dirfrom, 0, "Using config directory: \"%s\"\n",
dirname);
- xf86ConfigDir = xnfstrdup(dirname);
+ xf86ConfigDir = XNFstrdup(dirname);
}
else {
if (xf86ConfigDir)
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index 24602a879..052794efe 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -165,8 +165,8 @@ configureInputSection(void)
parsePrologue(XF86ConfInputPtr, XF86ConfInputRec);
- ptr->inp_identifier = xnfstrdup("Keyboard0");
- ptr->inp_driver = xnfstrdup("kbd");
+ ptr->inp_identifier = XNFstrdup("Keyboard0");
+ ptr->inp_driver = XNFstrdup("kbd");
ptr->list.next = NULL;
/* Crude mechanism to auto-detect mouse (os dependent) */
@@ -181,17 +181,17 @@ configureInputSection(void)
}
mouse = calloc(1, sizeof(XF86ConfInputRec));
- mouse->inp_identifier = xnfstrdup("Mouse0");
- mouse->inp_driver = xnfstrdup("mouse");
+ mouse->inp_identifier = XNFstrdup("Mouse0");
+ mouse->inp_driver = XNFstrdup("mouse");
mouse->inp_option_lst =
- xf86addNewOption(mouse->inp_option_lst, xnfstrdup("Protocol"),
- xnfstrdup(DFLT_MOUSE_PROTO));
+ xf86addNewOption(mouse->inp_option_lst, XNFstrdup("Protocol"),
+ XNFstrdup(DFLT_MOUSE_PROTO));
mouse->inp_option_lst =
- xf86addNewOption(mouse->inp_option_lst, xnfstrdup("Device"),
- xnfstrdup(DFLT_MOUSE_DEV));
+ xf86addNewOption(mouse->inp_option_lst, XNFstrdup("Device"),
+ XNFstrdup(DFLT_MOUSE_DEV));
mouse->inp_option_lst =
- xf86addNewOption(mouse->inp_option_lst, xnfstrdup("ZAxisMapping"),
- xnfstrdup("4 5 6 7"));
+ xf86addNewOption(mouse->inp_option_lst, XNFstrdup("ZAxisMapping"),
+ XNFstrdup("4 5 6 7"));
ptr = (XF86ConfInputPtr) xf86addListItem((glp) ptr, (glp) mouse);
return ptr;
}
@@ -294,7 +294,7 @@ configureDeviceSection(int screennum)
" ### <string>: \"String\", <freq>: \"<f> Hz/kHz/MHz\",\n"
" ### <percent>: \"<f>%\"\n"
" ### [arg]: arg optional\n";
- ptr->dev_comment = xnfstrdup(descrip);
+ ptr->dev_comment = XNFstrdup(descrip);
if (ptr->dev_comment) {
for (p = DevToConfig[screennum].GDev.options; p->name != NULL; p++) {
char *p_e;
@@ -341,9 +341,9 @@ configureLayoutSection(void)
iptr = malloc(sizeof(XF86ConfInputrefRec));
iptr->list.next = NULL;
iptr->iref_option_lst = NULL;
- iptr->iref_inputdev_str = xnfstrdup("Mouse0");
+ iptr->iref_inputdev_str = XNFstrdup("Mouse0");
iptr->iref_option_lst =
- xf86addNewOption(iptr->iref_option_lst, xnfstrdup("CorePointer"),
+ xf86addNewOption(iptr->iref_option_lst, XNFstrdup("CorePointer"),
NULL);
ptr->lay_input_lst = (XF86ConfInputrefPtr)
xf86addListItem((glp) ptr->lay_input_lst, (glp) iptr);
@@ -355,9 +355,9 @@ configureLayoutSection(void)
iptr = malloc(sizeof(XF86ConfInputrefRec));
iptr->list.next = NULL;
iptr->iref_option_lst = NULL;
- iptr->iref_inputdev_str = xnfstrdup("Keyboard0");
+ iptr->iref_inputdev_str = XNFstrdup("Keyboard0");
iptr->iref_option_lst =
- xf86addNewOption(iptr->iref_option_lst, xnfstrdup("CoreKeyboard"),
+ xf86addNewOption(iptr->iref_option_lst, XNFstrdup("CoreKeyboard"),
NULL);
ptr->lay_input_lst = (XF86ConfInputrefPtr)
xf86addListItem((glp) ptr->lay_input_lst, (glp) iptr);
@@ -429,9 +429,9 @@ configureFilesSection(void)
parsePrologue(XF86ConfFilesPtr, XF86ConfFilesRec);
if (xf86ModulePath)
- ptr->file_modulepath = xnfstrdup(xf86ModulePath);
+ ptr->file_modulepath = XNFstrdup(xf86ModulePath);
if (defaultFontPath)
- ptr->file_fontpath = xnfstrdup(defaultFontPath);
+ ptr->file_fontpath = XNFstrdup(defaultFontPath);
return ptr;
}
@@ -444,8 +444,8 @@ configureMonitorSection(int screennum)
XNFasprintf(&tmp, "Monitor%d", screennum);
ptr->mon_identifier = tmp;
- ptr->mon_vendor = xnfstrdup("Monitor Vendor");
- ptr->mon_modelname = xnfstrdup("Monitor Model");
+ ptr->mon_vendor = XNFstrdup("Monitor Vendor");
+ ptr->mon_modelname = XNFstrdup("Monitor Model");
return ptr;
}
@@ -489,7 +489,7 @@ configureDDCMonitorSection(int screennum)
XNFasprintf(&tmp, "Monitor%d", screennum);
ptr->mon_identifier = tmp;
- ptr->mon_vendor = xnfstrdup(ConfiguredMonitor->vendor.name);
+ ptr->mon_vendor = XNFstrdup(ConfiguredMonitor->vendor.name);
XNFasprintf(&ptr->mon_modelname, "%x", ConfiguredMonitor->vendor.prod_id);
/* features in centimetres, we want millimetres */
@@ -527,7 +527,7 @@ configureDDCMonitorSection(int screennum)
if (ConfiguredMonitor->features.dpms) {
ptr->mon_option_lst =
- xf86addNewOption(ptr->mon_option_lst, xnfstrdup("DPMS"), NULL);
+ xf86addNewOption(ptr->mon_option_lst, XNFstrdup("DPMS"), NULL);
}
return ptr;
diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
index 1f2de02fb..b9cbcf54c 100644
--- a/hw/xfree86/common/xf86Mode.c
+++ b/hw/xfree86/common/xf86Mode.c
@@ -1585,7 +1585,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
}
new->prev = NULL;
q = new;
- q->name = xnfstrdup(p->name);
+ q->name = XNFstrdup(p->name);
q->status = MODE_OK;
}
else {
@@ -1618,7 +1618,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
new = XNFcallocarray(1, sizeof(DisplayModeRec));
new->prev = last;
new->type = M_T_USERDEF;
- new->name = xnfstrdup(modeNames[i]);
+ new->name = XNFstrdup(modeNames[i]);
if (new->prev)
new->prev->next = new;
*endp = last = new;
@@ -1685,7 +1685,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
p = XNFcallocarray(1, sizeof(DisplayModeRec));
p->prev = last;
- p->name = xnfstrdup(r->name);
+ p->name = XNFstrdup(r->name);
if (!userModes)
p->type = M_T_USERDEF;
if (p->prev)
diff --git a/hw/xfree86/common/xf86sbusBus.c b/hw/xfree86/common/xf86sbusBus.c
index 2af66b807..b7638a352 100644
--- a/hw/xfree86/common/xf86sbusBus.c
+++ b/hw/xfree86/common/xf86sbusBus.c
@@ -73,7 +73,7 @@ CheckSbusDevice(const char *device, int fbNum)
xf86SbusInfo[xf86nSbusInfo - 1] = psdp = XNFcallocarray(1, sizeof(sbusDevice));
psdp->devId = sbusDeviceTable[i].devId;
psdp->fbNum = fbNum;
- psdp->device = xnfstrdup(device);
+ psdp->device = XNFstrdup(device);
psdp->width = fbattr.fbtype.fb_width;
psdp->height = fbattr.fbtype.fb_height;
psdp->fd = -1;
diff --git a/hw/xfree86/modes/xf86Modes.c b/hw/xfree86/modes/xf86Modes.c
index b0cead26f..091ce6333 100644
--- a/hw/xfree86/modes/xf86Modes.c
+++ b/hw/xfree86/modes/xf86Modes.c
@@ -220,7 +220,7 @@ xf86DuplicateMode(const DisplayModeRec * pMode)
if (pMode->name == NULL)
xf86SetModeDefaultName(pNew);
else
- pNew->name = xnfstrdup(pMode->name);
+ pNew->name = XNFstrdup(pMode->name);
return pNew;
}
diff --git a/test/input.c b/test/input.c
index b0de20331..267d4b14e 100644
--- a/test/input.c
+++ b/test/input.c
@@ -1214,27 +1214,27 @@ dix_input_attributes(void)
assert(memcmp(orig, new, sizeof(InputAttributes)) == 0);
FreeInputAttributes(new);
- orig->product = xnfstrdup("product name");
+ orig->product = XNFstrdup("product name");
new = DuplicateInputAttributes(orig);
cmp_attr_fields(orig, new);
FreeInputAttributes(new);
- orig->vendor = xnfstrdup("vendor name");
+ orig->vendor = XNFstrdup("vendor name");
new = DuplicateInputAttributes(orig);
cmp_attr_fields(orig, new);
FreeInputAttributes(new);
- orig->device = xnfstrdup("device path");
+ orig->device = XNFstrdup("device path");
new = DuplicateInputAttributes(orig);
cmp_attr_fields(orig, new);
FreeInputAttributes(new);
- orig->pnp_id = xnfstrdup("PnPID");
+ orig->pnp_id = XNFstrdup("PnPID");
new = DuplicateInputAttributes(orig);
cmp_attr_fields(orig, new);
FreeInputAttributes(new);
- orig->usb_id = xnfstrdup("USBID");
+ orig->usb_id = XNFstrdup("USBID");
new = DuplicateInputAttributes(orig);
cmp_attr_fields(orig, new);
FreeInputAttributes(new);
diff --git a/test/touch.c b/test/touch.c
index e4d14f63d..dcd693326 100644
--- a/test/touch.c
+++ b/test/touch.c
@@ -62,7 +62,7 @@ touch_grow_queue(void)
memset(&dev, 0, sizeof(dev));
dev.type = MASTER_POINTER; /* claim it's a master to stop ptracccel */
- dev.name = xnfstrdup("test device");
+ dev.name = XNFstrdup("test device");
dev.id = 2;
InitValuatorClassDeviceStruct(&dev, 2, labels, 10, Absolute);
@@ -128,7 +128,7 @@ touch_find_ddxid(void)
memset(&dev, 0, sizeof(dev));
dev.type = MASTER_POINTER; /* claim it's a master to stop ptracccel */
- dev.name = xnfstrdup("test device");
+ dev.name = XNFstrdup("test device");
dev.id = 2;
InitValuatorClassDeviceStruct(&dev, 2, labels, 10, Absolute);
@@ -202,7 +202,7 @@ touch_begin_ddxtouch(void)
memset(&dev, 0, sizeof(dev));
dev.type = MASTER_POINTER; /* claim it's a master to stop ptracccel */
- dev.name = xnfstrdup("test device");
+ dev.name = XNFstrdup("test device");
dev.id = 2;
inputInfo.devices = &dev;
@@ -252,7 +252,7 @@ touch_begin_touch(void)
memset(&dev, 0, sizeof(dev));
dev.type = MASTER_POINTER; /* claim it's a master to stop ptracccel */
- dev.name = xnfstrdup("test device");
+ dev.name = XNFstrdup("test device");
dev.id = 2;
ti = TouchBeginTouch(&dev, sourceid, touchid, TRUE);
@@ -289,7 +289,7 @@ touch_init(void)
memset(&dev, 0, sizeof(dev));
dev.type = MASTER_POINTER; /* claim it's a master to stop ptracccel */
- dev.name = xnfstrdup("test device");
+ dev.name = XNFstrdup("test device");
memset(&sprite, 0, sizeof(sprite));
dev.spriteInfo = &sprite;
diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c
index 3aafab90e..abf213970 100644
--- a/xkb/ddxLoad.c
+++ b/xkb/ddxLoad.c
@@ -193,7 +193,7 @@ RunXkbComp(xkbcomp_buffer_callback callback, void *userdata)
#ifdef WIN32
unlink(tmpname);
#endif
- return xnfstrdup(keymap);
+ return XNFstrdup(keymap);
}
else {
LogMessage(X_ERROR, "Error compiling keymap (%s) executing '%s'\n",
diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
index a9c5bbf71..a45fba6f6 100644
--- a/xkb/xkbInit.c
+++ b/xkb/xkbInit.c
@@ -208,11 +208,11 @@ XkbInitRules(XkbRMLVOSet *rmlvo,
const char *variant,
const char *options)
{
- rmlvo->rules = rules ? xnfstrdup(rules) : NULL;
- rmlvo->model = model ? xnfstrdup(model) : NULL;
- rmlvo->layout = layout ? xnfstrdup(layout) : NULL;
- rmlvo->variant = variant ? xnfstrdup(variant) : NULL;
- rmlvo->options = options ? xnfstrdup(options) : NULL;
+ rmlvo->rules = rules ? XNFstrdup(rules) : NULL;
+ rmlvo->model = model ? XNFstrdup(model) : NULL;
+ rmlvo->layout = layout ? XNFstrdup(layout) : NULL;
+ rmlvo->variant = variant ? XNFstrdup(variant) : NULL;
+ rmlvo->options = options ? XNFstrdup(options) : NULL;
}
static void
commit f446235b715e6fd456be5671239b8fcca2d5e7b6
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date: Fri May 10 10:47:12 2024 +0200
treewide: replace xnfcalloc() calls by XNFcallocarray()
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.
Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1529>
diff --git a/config/config.c b/config/config.c
index fb60295ae..ae67dde27 100644
--- a/config/config.c
+++ b/config/config.c
@@ -133,7 +133,7 @@ struct OdevAttributes *
config_odev_allocate_attributes(void)
{
struct OdevAttributes *attribs =
- xnfcalloc(1, sizeof (struct OdevAttributes));
+ XNFcallocarray(1, sizeof (struct OdevAttributes));
attribs->fd = -1;
return attribs;
}
diff --git a/hw/kdrive/ephyr/ephyr_glamor_xv.c b/hw/kdrive/ephyr/ephyr_glamor_xv.c
index b5eae48c8..62e7adaeb 100644
--- a/hw/kdrive/ephyr/ephyr_glamor_xv.c
+++ b/hw/kdrive/ephyr/ephyr_glamor_xv.c
@@ -123,7 +123,7 @@ ephyr_glamor_xv_init(ScreenPtr screen)
glamor_xv_core_init(screen);
- adaptor = xnfcalloc(1, sizeof(*adaptor));
+ adaptor = XNFcallocarray(1, sizeof(*adaptor));
adaptor->name = "glamor textured video";
adaptor->type = XvWindowMask | XvInputMask | XvImageMask;
@@ -135,9 +135,9 @@ ephyr_glamor_xv_init(ScreenPtr screen)
adaptor->nFormats = NUM_FORMATS;
adaptor->nPorts = 16; /* Some absurd number */
- port_privates = xnfcalloc(adaptor->nPorts,
+ port_privates = XNFcallocarray(adaptor->nPorts,
sizeof(glamor_port_private));
- adaptor->pPortPrivates = xnfcalloc(adaptor->nPorts,
+ adaptor->pPortPrivates = XNFcallocarray(adaptor->nPorts,
sizeof(glamor_port_private *));
for (i = 0; i < adaptor->nPorts; i++) {
adaptor->pPortPrivates[i].ptr = &port_privates[i];
diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c
index 7311d8ddc..a63b53676 100644
--- a/hw/xfree86/common/xf86AutoConfig.c
+++ b/hw/xfree86/common/xf86AutoConfig.c
@@ -403,7 +403,7 @@ autoConfigDevice(GDevPtr preconf_device)
* minus one for the already existing first one
* plus one for the terminating NULL */
for (; slp[num_screens].screen; num_screens++);
- xf86ConfigLayout.screens = xnfcalloc(num_screens + md.nmatches,
+ xf86ConfigLayout.screens = XNFcallocarray(num_screens + md.nmatches,
sizeof(screenLayoutRec));
xf86ConfigLayout.screens[0] = slp[0];
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 687769c31..5e5cdb1a6 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -299,9 +299,9 @@ xf86AllocateEntity(void)
xf86NumEntities++;
xf86Entities = XNFreallocarray(xf86Entities,
xf86NumEntities, sizeof(EntityPtr));
- xf86Entities[xf86NumEntities - 1] = xnfcalloc(1, sizeof(EntityRec));
+ xf86Entities[xf86NumEntities - 1] = XNFcallocarray(1, sizeof(EntityRec));
xf86Entities[xf86NumEntities - 1]->entityPrivates =
- xnfcalloc(xf86EntityPrivateCount, sizeof(DevUnion));
+ XNFcallocarray(xf86EntityPrivateCount, sizeof(DevUnion));
return xf86NumEntities - 1;
}
@@ -500,7 +500,7 @@ xf86GetEntityInfo(int entityIndex)
if (entityIndex >= xf86NumEntities)
return NULL;
- pEnt = xnfcalloc(1, sizeof(EntityInfoRec));
+ pEnt = XNFcallocarray(1, sizeof(EntityInfoRec));
pEnt->index = entityIndex;
pEnt->location = xf86Entities[entityIndex]->bus;
pEnt->active = xf86Entities[entityIndex]->active;
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 8c4c9842c..c3e77350f 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -184,7 +184,7 @@ xf86ValidateFontPath(char *path)
while (next != NULL) {
path_elem = xf86GetPathElem(&next);
if (*path_elem == '/') {
- dir_elem = xnfcalloc(1, strlen(path_elem) + 1);
+ dir_elem = XNFcallocarray(1, strlen(path_elem) + 1);
if ((p1 = strchr(path_elem, ':')) != 0)
dirlen = p1 - path_elem;
else
@@ -334,7 +334,7 @@ xf86ModulelistFromConfig(void ***optlist)
}
}
else {
- xf86configptr->conf_modules = xnfcalloc(1, sizeof(XF86ConfModuleRec));
+ xf86configptr->conf_modules = XNFcallocarray(1, sizeof(XF86ConfModuleRec));
for (i = 0; ModuleDefaults[i].name != NULL; i++) {
if (ModuleDefaults[i].toLoad == TRUE) {
XF86LoadPtr ptr = (XF86LoadPtr) xf86configptr->conf_modules;
@@ -1346,7 +1346,7 @@ configInputDevices(XF86ConfLayoutPtr layout, serverLayoutPtr servlayoutp)
}
DebugF("Found %d input devices in the layout section %s\n",
count, layout->lay_identifier);
- indp = xnfcalloc((count + 1), sizeof(InputInfoPtr));
+ indp = XNFcallocarray((count + 1), sizeof(InputInfoPtr));
indp[count] = NULL;
irp = layout->lay_input_lst;
count = 0;
@@ -1430,7 +1430,7 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
if (!count) /* alloc enough storage even if no screen is specified */
count = 1;
- slp = xnfcalloc((count + 1), sizeof(screenLayoutRec));
+ slp = XNFcallocarray((count + 1), sizeof(screenLayoutRec));
slp[count].screen = NULL;
/*
* now that we have storage, loop over the list again and fill in our
@@ -1440,7 +1440,7 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
adjp = conf_layout->lay_adjacency_lst;
count = 0;
while (adjp) {
- slp[count].screen = xnfcalloc(1, sizeof(confScreenRec));
+ slp[count].screen = XNFcallocarray(1, sizeof(confScreenRec));
if (adjp->adj_scrnum < 0)
scrnum = count;
else
@@ -1494,7 +1494,7 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
XF86ConfScreenPtr screen;
FIND_SUITABLE (XF86ConfScreenPtr, xf86configptr->conf_screen_lst, screen);
- slp[0].screen = xnfcalloc(1, sizeof(confScreenRec));
+ slp[0].screen = XNFcallocarray(1, sizeof(confScreenRec));
if (!configScreen(slp[0].screen, screen,
0, X_CONFIG, TRUE)) {
free(slp[0].screen);
@@ -1622,8 +1622,8 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen,
/* We have exactly one screen */
- slp = xnfcalloc(1, 2 * sizeof(screenLayoutRec));
- slp[0].screen = xnfcalloc(1, sizeof(confScreenRec));
+ slp = XNFcallocarray(1, 2 * sizeof(screenLayoutRec));
+ slp[0].screen = XNFcallocarray(1, sizeof(confScreenRec));
slp[1].screen = NULL;
if (!configScreen(slp[0].screen, conf_screen, 0, from, TRUE)) {
free(slp);
@@ -1631,7 +1631,7 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen,
}
servlayoutp->id = "(implicit)";
servlayoutp->screens = slp;
- servlayoutp->inactives = xnfcalloc(1, sizeof(GDevRec));
+ servlayoutp->inactives = XNFcallocarray(1, sizeof(GDevRec));
servlayoutp->options = NULL;
memset(&layout, 0, sizeof(layout));
@@ -1716,7 +1716,7 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
screenp->defaultdepth = conf_screen->scrn_defaultdepth;
screenp->defaultbpp = conf_screen->scrn_defaultbpp;
screenp->defaultfbbpp = conf_screen->scrn_defaultfbbpp;
- screenp->monitor = xnfcalloc(1, sizeof(MonRec));
+ screenp->monitor = XNFcallocarray(1, sizeof(MonRec));
/* If no monitor is specified, create a default one. */
if (!conf_screen->scrn_monitor) {
XF86ConfMonitorRec defMon;
@@ -1734,7 +1734,7 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
/* Configure the device. If there isn't one configured, attach to the
* first inactive one that we can configure. If there's none that work,
* set it to NULL so that the section can be autoconfigured later */
- screenp->device = xnfcalloc(1, sizeof(GDevRec));
+ screenp->device = XNFcallocarray(1, sizeof(GDevRec));
if ((!conf_screen->scrn_device) && (xf86configptr->conf_device_lst)) {
FIND_SUITABLE (XF86ConfDevicePtr, xf86configptr->conf_device_lst, conf_screen->scrn_device);
xf86Msg(X_DEFAULT, "No device specified for screen \"%s\".\n"
@@ -1777,7 +1777,7 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
continue;
}
- screenp->gpu_devices[i] = xnfcalloc(1, sizeof(GDevRec));
+ screenp->gpu_devices[i] = XNFcallocarray(1, sizeof(GDevRec));
if (configDevice(screenp->gpu_devices[i], conf_screen->scrn_gpu_devices[i], TRUE, TRUE)) {
screenp->gpu_devices[i]->myScreenSection = screenp;
}
@@ -1787,7 +1787,7 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
} else {
for (i = 0; i < conf_screen->num_gpu_devices; i++) {
- screenp->gpu_devices[i] = xnfcalloc(1, sizeof(GDevRec));
+ screenp->gpu_devices[i] = XNFcallocarray(1, sizeof(GDevRec));
if (configDevice(screenp->gpu_devices[i], conf_screen->scrn_gpu_devices[i], TRUE, TRUE)) {
screenp->gpu_devices[i]->myScreenSection = screenp;
}
@@ -1813,7 +1813,7 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
dispptr = (XF86ConfDisplayPtr) dispptr->list.next, count++) {
/* Allocate individual Display records */
- screenp->displays[count] = xnfcalloc(1, sizeof(DispRec));
+ screenp->displays[count] = XNFcallocarray(1, sizeof(DispRec));
/* Fill in the default Virtual size, if any */
if (conf_screen->scrn_virtualX && conf_screen->scrn_virtualY) {
@@ -1936,7 +1936,7 @@ configMonitor(MonPtr monitorp, XF86ConfMonitorPtr conf_monitor)
*/
cmodep = conf_monitor->mon_modeline_lst;
while (cmodep) {
- mode = xnfcalloc(1, sizeof(DisplayModeRec));
+ mode = XNFcallocarray(1, sizeof(DisplayModeRec));
mode->type = 0;
mode->Clock = cmodep->ml_clock;
mode->HDisplay = cmodep->ml_hdisplay;
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index c342829e3..24602a879 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -707,10 +707,10 @@ DoConfigure(void)
xf86DoConfigurePass1 = FALSE;
- dev2screen = xnfcalloc(nDevToConfig, sizeof(int));
+ dev2screen = XNFcallocarray(nDevToConfig, sizeof(int));
{
- Bool *driverProbed = xnfcalloc(xf86NumDrivers, sizeof(Bool));
+ Bool *driverProbed = XNFcallocarray(xf86NumDrivers, sizeof(Bool));
for (screennum = 0; screennum < nDevToConfig; screennum++) {
int k, l, n, oldNumScreens;
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index a6edccba7..ec785cb67 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -172,7 +172,7 @@ xf86AllocateScreen(DriverPtr drv, int flags)
i = xf86NumGPUScreens++;
xf86GPUScreens = XNFreallocarray(xf86GPUScreens, xf86NumGPUScreens,
sizeof(ScrnInfoPtr));
- xf86GPUScreens[i] = xnfcalloc(1, sizeof(ScrnInfoRec));
+ xf86GPUScreens[i] = XNFcallocarray(1, sizeof(ScrnInfoRec));
pScrn = xf86GPUScreens[i];
pScrn->scrnIndex = i + GPU_SCREEN_OFFSET; /* Changes when a screen is removed */
pScrn->is_gpu = TRUE;
@@ -183,14 +183,14 @@ xf86AllocateScreen(DriverPtr drv, int flags)
i = xf86NumScreens++;
xf86Screens = XNFreallocarray(xf86Screens, xf86NumScreens,
sizeof(ScrnInfoPtr));
- xf86Screens[i] = xnfcalloc(1, sizeof(ScrnInfoRec));
+ xf86Screens[i] = XNFcallocarray(1, sizeof(ScrnInfoRec));
pScrn = xf86Screens[i];
pScrn->scrnIndex = i; /* Changes when a screen is removed */
}
pScrn->origIndex = pScrn->scrnIndex; /* This never changes */
- pScrn->privates = xnfcalloc(xf86ScrnInfoPrivateCount, sizeof(DevUnion));
+ pScrn->privates = XNFcallocarray(xf86ScrnInfoPrivateCount, sizeof(DevUnion));
/*
* EnableDisableFBAccess now gets initialized in InitOutput()
* pScrn->EnableDisableFBAccess = xf86EnableDisableFBAccess;
@@ -566,7 +566,7 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp,
"Creating default Display subsection in Screen section\n"
"\t\"%s\" for depth/fbbpp %d/%d\n",
scrp->confScreen->id, scrp->depth, scrp->bitsPerPixel);
- scrp->confScreen->displays[i] = xnfcalloc(1, sizeof(DispRec));
+ scrp->confScreen->displays[i] = XNFcallocarray(1, sizeof(DispRec));
memset(scrp->confScreen->displays[i], 0, sizeof(DispRec));
scrp->confScreen->displays[i]->blackColour.red = -1;
scrp->confScreen->displays[i]->blackColour.green = -1;
diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
index c20334dde..1f2de02fb 100644
--- a/hw/xfree86/common/xf86Mode.c
+++ b/hw/xfree86/common/xf86Mode.c
@@ -1615,7 +1615,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
if (modeNames != NULL) {
for (i = 0; modeNames[i] != NULL; i++) {
userModes = TRUE;
- new = xnfcalloc(1, sizeof(DisplayModeRec));
+ new = XNFcallocarray(1, sizeof(DisplayModeRec));
new->prev = last;
new->type = M_T_USERDEF;
new->name = xnfstrdup(modeNames[i]);
@@ -1683,7 +1683,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
if (r == NULL)
break;
- p = xnfcalloc(1, sizeof(DisplayModeRec));
+ p = XNFcallocarray(1, sizeof(DisplayModeRec));
p->prev = last;
p->name = xnfstrdup(r->name);
if (!userModes)
diff --git a/hw/xfree86/common/xf86sbusBus.c b/hw/xfree86/common/xf86sbusBus.c
index 7048f1d16..2af66b807 100644
--- a/hw/xfree86/common/xf86sbusBus.c
+++ b/hw/xfree86/common/xf86sbusBus.c
@@ -70,7 +70,7 @@ CheckSbusDevice(const char *device, int fbNum)
xf86SbusInfo =
XNFreallocarray(xf86SbusInfo, ++xf86nSbusInfo + 1, sizeof(psdp));
xf86SbusInfo[xf86nSbusInfo] = NULL;
- xf86SbusInfo[xf86nSbusInfo - 1] = psdp = xnfcalloc(1, sizeof(sbusDevice));
+ xf86SbusInfo[xf86nSbusInfo - 1] = psdp = XNFcallocarray(1, sizeof(sbusDevice));
psdp->devId = sbusDeviceTable[i].devId;
psdp->fbNum = fbNum;
psdp->device = xnfstrdup(device);
@@ -589,7 +589,7 @@ xf86SbusUseBuiltinMode(ScrnInfoPtr pScrn, sbusDevicePtr psdp)
{
DisplayModePtr mode;
- mode = xnfcalloc(sizeof(DisplayModeRec), 1);
+ mode = XNFcallocarray(sizeof(DisplayModeRec), 1);
mode->name = "current";
mode->next = mode;
mode->prev = mode;
@@ -698,7 +698,7 @@ xf86SbusHandleColormaps(ScreenPtr pScreen, sbusDevicePtr psdp)
if (!dixRegisterPrivateKey(sbusPaletteKey, PRIVATE_SCREEN, 0))
FatalError("Cannot register sbus private key");
- cmap = xnfcalloc(1, sizeof(sbusCmapRec));
+ cmap = XNFcallocarray(1, sizeof(sbusCmapRec));
dixSetPrivate(&pScreen->devPrivates, sbusPaletteKey, cmap);
cmap->psdp = psdp;
fbcmap.index = 0;
diff --git a/hw/xfree86/ddc/interpret_edid.c b/hw/xfree86/ddc/interpret_edid.c
index 5be559b07..0ded3ff71 100644
--- a/hw/xfree86/ddc/interpret_edid.c
+++ b/hw/xfree86/ddc/interpret_edid.c
@@ -171,7 +171,7 @@ xf86InterpretEDID(int scrnIndex, Uchar * block)
if (!block)
return NULL;
- if (!(m = xnfcalloc(1, sizeof(xf86Monitor))))
+ if (!(m = XNFcallocarray(1, sizeof(xf86Monitor))))
return NULL;
m->scrnIndex = scrnIndex;
m->rawData = block;
diff --git a/hw/xfree86/doc/ddxDesign.xml b/hw/xfree86/doc/ddxDesign.xml
index bf1bdc271..c33dc360c 100644
--- a/hw/xfree86/doc/ddxDesign.xml
+++ b/hw/xfree86/doc/ddxDesign.xml
@@ -7818,7 +7818,7 @@ zzzSetup(pointer module, pointer opts, int *errmaj, int *errmin)
The <structname>ScrnInfoRec</structname>'s <structfield>driverPrivate</structfield> is
initialised to <constant>NULL</constant>, so it is easy to check if the
initialisation has already been done. After allocating it, initialise
- the fields. By using <function>xnfcalloc()</function> to do the allocation
+ the fields. By using <function>XNFcallocarray()</function> to do the allocation
it is zeroed, and if the allocation fails the server exits.
</para>
@@ -7837,7 +7837,7 @@ ZZZGetRec(ScrnInfoPtr pScrn)
{
if (pScrn->driverPrivate != NULL)
return TRUE;
- pScrn->driverPrivate = xnfcalloc(1, sizeof(ZZZRec));
+ pScrn->driverPrivate = XNFcallocarray(1, sizeof(ZZZRec));
/* Initialise as required */
...
return TRUE;
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index 2cba7442e..dfc33f33d 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -259,7 +259,7 @@ DRIOpenDRMMaster(ScrnInfoPtr pScrn,
tmp.resOwner = NULL;
if (!pDRIEntPriv)
- pDRIEntPriv = xnfcalloc(1, sizeof(*pDRIEntPriv));
+ pDRIEntPriv = XNFcallocarray(1, sizeof(*pDRIEntPriv));
if (!pDRIEntPriv) {
DRIDrvMsg(-1, X_INFO, "[drm] Failed to allocate memory for "
diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index 8741ffe5e..a3d0b5197 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -396,7 +396,7 @@ ms_setup_entity(ScrnInfoPtr scrn, int entity_num)
xf86SetEntityInstanceForScreen(scrn, entity_num, xf86GetNumEntityInstances(entity_num) - 1);
if (!pPriv->ptr)
- pPriv->ptr = xnfcalloc(1, sizeof(modesettingEntRec));
+ pPriv->ptr = XNFcallocarray(1, sizeof(modesettingEntRec));
}
#ifdef XSERVER_LIBPCIACCESS
@@ -515,7 +515,7 @@ GetRec(ScrnInfoPtr pScrn)
if (pScrn->driverPrivate)
return TRUE;
- pScrn->driverPrivate = xnfcalloc(1, sizeof(modesettingRec));
+ pScrn->driverPrivate = XNFcallocarray(1, sizeof(modesettingRec));
return TRUE;
}
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 488522ca9..a21198b35 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -2573,7 +2573,7 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_res
crtc = xf86CrtcCreate(pScrn, &drmmode_crtc_funcs);
if (crtc == NULL)
return 0;
- drmmode_crtc = xnfcalloc(1, sizeof(drmmode_crtc_private_rec));
+ drmmode_crtc = XNFcallocarray(1, sizeof(drmmode_crtc_private_rec));
crtc->driver_private = drmmode_crtc;
drmmode_crtc->mode_crtc =
drmModeGetCrtc(drmmode->fd, mode_res->crtcs[num]);
diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c
index 602e39932..1e39c8146 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.c
+++ b/hw/xfree86/fbdevhw/fbdevhw.c
@@ -94,7 +94,7 @@ fbdevHWGetRec(ScrnInfoPtr pScrn)
if (FBDEVHWPTR(pScrn) != NULL)
return TRUE;
- FBDEVHWPTRLVAL(pScrn) = xnfcalloc(1, sizeof(fbdevHWRec));
+ FBDEVHWPTRLVAL(pScrn) = XNFcallocarray(1, sizeof(fbdevHWRec));
return TRUE;
}
diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c
index ec4e4c175..4d8dfb4de 100644
--- a/hw/xfree86/int10/generic.c
+++ b/hw/xfree86/int10/generic.c
@@ -133,13 +133,13 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
return NULL;
}
- pInt = (xf86Int10InfoPtr) xnfcalloc(1, sizeof(xf86Int10InfoRec));
+ pInt = (xf86Int10InfoPtr) XNFcallocarray(1, sizeof(xf86Int10InfoRec));
pInt->entityIndex = entityIndex;
if (!xf86Int10ExecSetup(pInt))
goto error0;
pInt->mem = &genericMem;
- pInt->private = (void *) xnfcalloc(1, sizeof(genericInt10Priv));
- INTPriv(pInt)->alloc = (void *) xnfcalloc(1, ALLOC_ENTRIES(getpagesize()));
+ pInt->private = (void *) XNFcallocarray(1, sizeof(genericInt10Priv));
+ INTPriv(pInt)->alloc = (void *) XNFcallocarray(1, ALLOC_ENTRIES(getpagesize()));
pInt->pScrn = pScrn;
base = INTPriv(pInt)->base = XNFalloc(SYS_BIOS);
diff --git a/hw/xfree86/int10/vbe.c b/hw/xfree86/int10/vbe.c
index 48878cd40..a4f3af58c 100644
--- a/hw/xfree86/int10/vbe.c
+++ b/hw/xfree86/int10/vbe.c
@@ -886,7 +886,7 @@ VBEBuildVbeModeList(vbeInfoPtr pVbe, VbeInfoBlock * vbe)
bpp = mode->BitsPerPixel;
- m = xnfcalloc(1, sizeof(vbeModeInfoRec));
+ m = XNFcallocarray(1, sizeof(vbeModeInfoRec));
m->width = mode->XResolution;
m->height = mode->YResolution;
m->bpp = bpp;
diff --git a/hw/xfree86/int10/vbeModes.c b/hw/xfree86/int10/vbeModes.c
index 244e84858..7c5d882fc 100644
--- a/hw/xfree86/int10/vbeModes.c
+++ b/hw/xfree86/int10/vbeModes.c
@@ -240,7 +240,7 @@ CheckMode(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock * vbe, int id,
VBEFreeModeInfo(mode);
return NULL;
}
- pMode = xnfcalloc(1, sizeof(DisplayModeRec));
+ pMode = XNFcallocarray(1, sizeof(DisplayModeRec));
pMode->status = MODE_OK;
pMode->type = M_T_BUILTIN;
@@ -249,7 +249,7 @@ CheckMode(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock * vbe, int id,
pMode->HDisplay = mode->XResolution;
pMode->VDisplay = mode->YResolution;
- data = xnfcalloc(1, sizeof(VbeModeInfoData));
+ data = XNFcallocarray(1, sizeof(VbeModeInfoData));
data->mode = id;
data->data = mode;
pMode->PrivSize = sizeof(VbeModeInfoData);
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 647e2a5f5..902a39104 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -59,7 +59,7 @@ xf86CrtcConfigInit(ScrnInfoPtr scrn, const xf86CrtcConfigFuncsRec * funcs)
if (xf86CrtcConfigPrivateIndex == -1)
xf86CrtcConfigPrivateIndex = xf86AllocateScrnInfoPrivateIndex();
- config = xnfcalloc(1, sizeof(xf86CrtcConfigRec));
+ config = XNFcallocarray(1, sizeof(xf86CrtcConfigRec));
config->funcs = funcs;
config->compat_output = -1;
@@ -2284,8 +2284,8 @@ xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
DisplayModePtr *preferred, *preferred_match;
Bool ret = FALSE;
- preferred = xnfcalloc(config->num_output, sizeof(DisplayModePtr));
- preferred_match = xnfcalloc(config->num_output, sizeof(DisplayModePtr));
+ preferred = XNFcallocarray(config->num_output, sizeof(DisplayModePtr));
+ preferred_match = XNFcallocarray(config->num_output, sizeof(DisplayModePtr));
/* Check if the preferred mode is available on all outputs */
for (p = -1; nextEnabledOutput(config, enabled, &p);) {
@@ -2394,7 +2394,7 @@ xf86TargetAspect(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
Bool ret = FALSE;
DisplayModePtr guess = NULL, aspect_guess = NULL, base_guess = NULL;
- aspects = xnfcalloc(config->num_output, sizeof(float));
+ aspects = XNFcallocarray(config->num_output, sizeof(float));
/* collect the aspect ratios */
for (o = -1; nextEnabledOutput(config, enabled, &o);) {
@@ -2571,9 +2571,9 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow)
xf86ProbeOutputModes(scrn, width, height);
- crtcs = xnfcalloc(config->num_output, sizeof(xf86CrtcPtr));
- modes = xnfcalloc(config->num_output, sizeof(DisplayModePtr));
- enabled = xnfcalloc(config->num_output, sizeof(Bool));
+ crtcs = XNFcallocarray(config->num_output, sizeof(xf86CrtcPtr));
+ modes = XNFcallocarray(config->num_output, sizeof(DisplayModePtr));
+ enabled = XNFcallocarray(config->num_output, sizeof(Bool));
ret = xf86CollectEnabledOutputs(scrn, config, enabled);
if (ret == FALSE && canGrow) {
diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index 1ac573867..b0f93e2b7 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -596,7 +596,7 @@ DDCModeFromDetailedTiming(int scrnIndex, struct detailed_timings *timing,
" sync.\n", __func__, timing->h_active, timing->v_active);
}
- Mode = xnfcalloc(1, sizeof(DisplayModeRec));
+ Mode = XNFcallocarray(1, sizeof(DisplayModeRec));
Mode->type = M_T_DRIVER;
if (preferred)
diff --git a/hw/xfree86/modes/xf86Modes.c b/hw/xfree86/modes/xf86Modes.c
index e8283db0c..b0cead26f 100644
--- a/hw/xfree86/modes/xf86Modes.c
+++ b/hw/xfree86/modes/xf86Modes.c
@@ -322,7 +322,7 @@ void
xf86PrintModeline(int scrnIndex, DisplayModePtr mode)
{
char tmp[256];
- char *flags = xnfcalloc(1, 1);
+ char *flags = XNFcallocarray(1, 1);
#define TBITS 6
const char tchar[TBITS + 1] = "UezdPb";
@@ -802,7 +802,7 @@ xf86CVTMode(int HDisplay, int VDisplay, float VRefresh, Bool Reduced,
Bool Interlaced)
{
struct libxcvt_mode_info *libxcvt_mode_info;
- DisplayModeRec *Mode = xnfcalloc(1, sizeof(DisplayModeRec));
+ DisplayModeRec *Mode = XNFcallocarray(1, sizeof(DisplayModeRec));
char *tmp;
libxcvt_mode_info =
diff --git a/hw/xfree86/modes/xf86gtf.c b/hw/xfree86/modes/xf86gtf.c
index c6a738422..b67233f90 100644
--- a/hw/xfree86/modes/xf86gtf.c
+++ b/hw/xfree86/modes/xf86gtf.c
@@ -100,7 +100,7 @@
DisplayModePtr
xf86GTFMode(int h_pixels, int v_lines, float freq, int interlaced, int margins)
{
- DisplayModeRec *mode = xnfcalloc(1, sizeof(DisplayModeRec));
+ DisplayModeRec *mode = XNFcallocarray(1, sizeof(DisplayModeRec));
float h_pixels_rnd;
float v_lines_rnd;
diff --git a/hw/xfree86/os-support/bus/Sbus.c b/hw/xfree86/os-support/bus/Sbus.c
index 4a18afdd6..e27a13dfa 100644
--- a/hw/xfree86/os-support/bus/Sbus.c
+++ b/hw/xfree86/os-support/bus/Sbus.c
@@ -427,7 +427,7 @@ sparcPromAssignNodes(void)
xf86ErrorF("Inconsistent /proc/fb with FBIOGATTR\n");
}
else if (!devicePtrs[fbNum]) {
- devicePtrs[fbNum] = psdp = xnfcalloc(1, sizeof(sbusDevice));
+ devicePtrs[fbNum] = psdp = XNFcallocarray(1, sizeof(sbusDevice));
psdp->devId = devId;
psdp->fbNum = fbNum;
psdp->fd = -2;
diff --git a/hw/xfree86/os-support/linux/int10/linux.c b/hw/xfree86/os-support/linux/int10/linux.c
index 42f872dd2..62fdaa434 100644
--- a/hw/xfree86/os-support/linux/int10/linux.c
+++ b/hw/xfree86/os-support/linux/int10/linux.c
@@ -135,7 +135,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
}
}
- pInt = (xf86Int10InfoPtr) xnfcalloc(1, sizeof(xf86Int10InfoRec));
+ pInt = (xf86Int10InfoPtr) XNFcallocarray(1, sizeof(xf86Int10InfoRec));
pInt->pScrn = pScrn;
pInt->entityIndex = entityIndex;
pInt->dev = xf86GetPciInfoForEntity(entityIndex);
@@ -144,9 +144,9 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
goto error0;
pInt->mem = &linuxMem;
pagesize = getpagesize();
- pInt->private = (void *) xnfcalloc(1, sizeof(linuxInt10Priv));
+ pInt->private = (void *) XNFcallocarray(1, sizeof(linuxInt10Priv));
((linuxInt10Priv *) pInt->private)->alloc =
- (void *) xnfcalloc(1, ALLOC_ENTRIES(pagesize));
+ (void *) XNFcallocarray(1, ALLOC_ENTRIES(pagesize));
if (!xf86IsEntityPrimary(entityIndex)) {
DebugF("Mapping high memory area\n");
diff --git a/hw/xfree86/vgahw/vgaHW.c b/hw/xfree86/vgahw/vgaHW.c
index f8a1409fc..663f96ea3 100644
--- a/hw/xfree86/vgahw/vgaHW.c
+++ b/hw/xfree86/vgahw/vgaHW.c
@@ -1627,7 +1627,7 @@ vgaHWGetHWRec(ScrnInfoPtr scrp)
*/
if (VGAHWPTR(scrp))
return TRUE;
- hwp = VGAHWPTRLVAL(scrp) = xnfcalloc(1, sizeof(vgaHWRec));
+ hwp = VGAHWPTRLVAL(scrp) = XNFcallocarray(1, sizeof(vgaHWRec));
regp = &VGAHWPTR(scrp)->ModeReg;
if ((!vgaHWAllocDefaultRegs(&VGAHWPTR(scrp)->SavedReg)) ||
@@ -1921,7 +1921,7 @@ vgaHWddc1SetSpeed(ScrnInfoPtr pScrn, xf86ddcSpeed speed)
if (hwp->ddc != NULL)
break;
- hwp->ddc = xnfcalloc(1, sizeof(struct _vgaDdcSave));
+ hwp->ddc = XNFcallocarray(1, sizeof(struct _vgaDdcSave));
save = (struct _vgaDdcSave *) hwp->ddc;
/* Lightpen register disable - allow access to cr10 & 11; just in case */
save->cr03 = hwp->readCrtc(hwp, 0x03);
diff --git a/hw/xwayland/xwayland-glamor-xv.c b/hw/xwayland/xwayland-glamor-xv.c
index f1c5ca1b2..68bae5737 100644
--- a/hw/xwayland/xwayland-glamor-xv.c
+++ b/hw/xwayland/xwayland-glamor-xv.c
@@ -203,7 +203,7 @@ xwl_glamor_xv_add_formats(XvAdaptorPtr pa)
int i;
totFormat = NUM_FORMATS;
- pFormat = xnfcalloc(totFormat, sizeof(XvFormatRec));
+ pFormat = XNFcallocarray(totFormat, sizeof(XvFormatRec));
pScreen = pa->pScreen;
for (pf = pFormat, i = 0, numFormat = 0; i < NUM_FORMATS; i++) {
numVisuals = pScreen->numVisuals;
@@ -246,10 +246,10 @@ xwl_glamor_xv_add_ports(XvAdaptorPtr pa)
int nPorts;
int i;
- pPorts = xnfcalloc(NUM_PORTS, sizeof(XvPortRec));
+ pPorts = XNFcallocarray(NUM_PORTS, sizeof(XvPortRec));
xwlXvScreen = dixLookupPrivate(&(pa->pScreen)->devPrivates,
xwlXvScreenPrivateKey);
- xwlXvScreen->port_privates = xnfcalloc(NUM_PORTS,
+ xwlXvScreen->port_privates = XNFcallocarray(NUM_PORTS,
sizeof(glamor_port_private));
PortResource = XvGetRTPort();
@@ -280,7 +280,7 @@ xwl_glamor_xv_add_attributes(XvAdaptorPtr pa)
{
int i;
- pa->pAttributes = xnfcalloc(glamor_xv_num_attributes, sizeof(XvAttributeRec));
+ pa->pAttributes = XNFcallocarray(glamor_xv_num_attributes, sizeof(XvAttributeRec));
memcpy(pa->pAttributes, glamor_xv_attributes,
glamor_xv_num_attributes * sizeof(XvAttributeRec));
@@ -293,7 +293,7 @@ xwl_glamor_xv_add_attributes(XvAdaptorPtr pa)
static void
xwl_glamor_xv_add_images(XvAdaptorPtr pa)
{
- pa->pImages = xnfcalloc(glamor_xv_num_images, sizeof(XvImageRec));
+ pa->pImages = XNFcallocarray(glamor_xv_num_images, sizeof(XvImageRec));
memcpy(pa->pImages, glamor_xv_images, glamor_xv_num_images * sizeof(XvImageRec));
pa->nImages = glamor_xv_num_images;
@@ -307,7 +307,7 @@ xwl_glamor_xv_add_encodings(XvAdaptorPtr pa)
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &texsize);
- pe = xnfcalloc(1, sizeof(XvEncodingRec));
+ pe = XNFcallocarray(1, sizeof(XvEncodingRec));
pe->id = 0;
pe->pScreen = pa->pScreen;
pe->name = strdup(ENCODER_NAME);
@@ -337,7 +337,7 @@ xwl_glamor_xv_add_adaptors(ScreenPtr pScreen)
XvScreen->nAdaptors = 0;
XvScreen->pAdaptors = NULL;
- pa = xnfcalloc(1, sizeof(XvAdaptorRec));
+ pa = XNFcallocarray(1, sizeof(XvAdaptorRec));
pa->pScreen = pScreen;
pa->type = (unsigned char) (XvInputMask | XvImageMask);
pa->ddStopVideo = xwl_glamor_xv_stop_video;
diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c
index 619050079..4e56ed41e 100644
--- a/hw/xwayland/xwayland-window.c
+++ b/hw/xwayland/xwayland-window.c
@@ -1067,7 +1067,7 @@ xwl_window_enter_output(struct xwl_window *xwl_window, struct xwl_output *xwl_ou
{
struct xwl_window_output *window_output;
- window_output = xnfcalloc(1, sizeof(struct xwl_window_output));
+ window_output = XNFcallocarray(1, sizeof(struct xwl_window_output));
window_output->xwl_output = xwl_output;
xorg_list_add(&window_output->link, &xwl_window->xwl_output_list);
}
@@ -1630,7 +1630,7 @@ release_wl_surface_for_window_legacy_delay(struct xwl_window *xwl_window)
* and Wayland processing so that the compositor has the time to
* establish the association before the wl_surface is destroyed.
*/
- xwl_wl_surface = xnfcalloc(1, sizeof *xwl_wl_surface);
+ xwl_wl_surface = XNFcallocarray(1, sizeof *xwl_wl_surface);
xwl_wl_surface->wl_surface = xwl_window->surface;
xorg_list_add(&xwl_wl_surface->link,
&xwl_window->xwl_screen->pending_wl_surface_destroy);
commit 9ec31d1a882549ee26f9b91251ed2d37f979353a
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date: Wed May 8 17:36:00 2024 +0200
treewide: replace strdup() calls to Xstrdup()
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.
Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1529>
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 98cbd6d0b..687769c31 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -272,7 +272,7 @@ StringToBusType(const char *busID, const char **retID)
return BUS_PCI;
}
- s = xstrdup(busID);
+ s = Xstrdup(busID);
p = strtok(s, ":");
if (p == NULL || *p == 0) {
free(s);
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 482816f48..0c9b97335 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -720,7 +720,7 @@ MergeInputClasses(const InputInfoPtr idev, const InputAttributes * attrs)
classopts = xf86optionListDup(cl->option_lst);
if (cl->driver) {
free((void *) idev->driver);
- idev->driver = xstrdup(cl->driver);
+ idev->driver = Xstrdup(cl->driver);
if (!idev->driver) {
xf86Msg(X_ERROR, "Failed to allocate memory while merging "
"InputClass configuration");
@@ -1047,7 +1047,7 @@ NewInputDeviceRequest(InputOption *options, InputAttributes * attrs,
rval = BadRequest;
goto unwind;
}
- pInfo->driver = xstrdup(value);
+ pInfo->driver = Xstrdup(value);
if (!pInfo->driver) {
rval = BadAlloc;
goto unwind;
@@ -1059,7 +1059,7 @@ NewInputDeviceRequest(InputOption *options, InputAttributes * attrs,
rval = BadRequest;
goto unwind;
}
- pInfo->name = xstrdup(value);
+ pInfo->name = Xstrdup(value);
if (!pInfo->name) {
rval = BadAlloc;
goto unwind;
diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index 586ca9a9d..d2af996da 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -272,7 +272,7 @@ xf86ParsePciBusString(const char *busID, int *bus, int *device, int *func)
if (StringToBusType(busID, &id) != BUS_PCI)
return FALSE;
- s = xstrdup(id);
+ s = Xstrdup(id);
p = strtok(s, ":");
if (p == NULL || *p == 0) {
free(s);
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index f8a44827f..fd7afa884 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -733,7 +733,7 @@ LoadModule(const char *module, void *options, const XF86ModReqInfo *modreq,
* check the elements in the path
*/
if (PathIsAbsolute(module))
- found = xstrdup(module);
+ found = Xstrdup(module);
path_elem = pathlist;
while (!found && *path_elem != NULL) {
found = FindModule(m, *path_elem, patterns);
diff --git a/hw/xfree86/modes/xf86Modes.c b/hw/xfree86/modes/xf86Modes.c
index 0cf1eddac..e8283db0c 100644
--- a/hw/xfree86/modes/xf86Modes.c
+++ b/hw/xfree86/modes/xf86Modes.c
@@ -681,7 +681,7 @@ xf86GetConfigModes(XF86ConfModeLinePtr conf_mode)
mode = calloc(1, sizeof(DisplayModeRec));
if (!mode)
continue;
- mode->name = xstrdup(conf_mode->ml_identifier);
+ mode->name = Xstrdup(conf_mode->ml_identifier);
if (!mode->name) {
free(mode);
continue;
diff --git a/hw/xwayland/xwayland-xtest.c b/hw/xwayland/xwayland-xtest.c
index 91006dde0..0a6493953 100644
--- a/hw/xwayland/xwayland-xtest.c
+++ b/hw/xwayland/xwayland-xtest.c
@@ -360,7 +360,7 @@ setup_ei(ClientPtr client)
}
xwl_ei_client = calloc(1, sizeof *xwl_ei_client);
- xwl_ei_client->cmdline = xstrdup(cmdname);
+ xwl_ei_client->cmdline = Xstrdup(cmdname);
if (!xwl_ei_client) {
error_ei("OOM, cannot setup EI\n");
goto out;
diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
index cdd5eb004..7ad50fc2f 100644
--- a/xkb/xkbUtils.c
+++ b/xkb/xkbUtils.c
@@ -1466,8 +1466,8 @@ _XkbCopyGeom(XkbDescPtr src, XkbDescPtr dst)
strcpy(dprop->value, sprop->value);
}
else {
- dprop->name = xstrdup(sprop->name);
- dprop->value = xstrdup(sprop->value);
+ dprop->name = Xstrdup(sprop->name);
+ dprop->value = Xstrdup(sprop->value);
}
}
@@ -1520,7 +1520,7 @@ _XkbCopyGeom(XkbDescPtr src, XkbDescPtr dst)
strcpy(dcolor->spec, scolor->spec);
}
else {
- dcolor->spec = xstrdup(scolor->spec);
+ dcolor->spec = Xstrdup(scolor->spec);
}
dcolor->pixel = scolor->pixel;
}
commit a1fd7e7ba5aadc770af8a71edfd152c99fe419d3
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date: Wed May 8 17:31:28 2024 +0200
treewide: replace xnfrealloc() calls to XNFrealloc()
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.
Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1529>
diff --git a/dix/dixutils.c b/dix/dixutils.c
index ac5c0f962..9a950c6f2 100644
--- a/dix/dixutils.c
+++ b/dix/dixutils.c
@@ -800,7 +800,7 @@ CreateCallbackList(CallbackListPtr *pcbl)
}
}
- listsToCleanup = (CallbackListPtr **) xnfrealloc(listsToCleanup,
+ listsToCleanup = (CallbackListPtr **) XNFrealloc(listsToCleanup,
sizeof(CallbackListPtr *) *
(numCallbackListsToCleanup
+ 1));
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 25d23b85b..a6edccba7 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1339,7 +1339,7 @@ xf86MatchDevice(const char *drivername, GDevPtr ** sectlist)
/*
* we have a matching driver that wasn't claimed, yet
*/
- pgdp = xnfrealloc(pgdp, (i + 2) * sizeof(GDevPtr));
+ pgdp = XNFrealloc(pgdp, (i + 2) * sizeof(GDevPtr));
pgdp[i++] = screensecptr->gpu_devices[k];
}
}
diff --git a/hw/xfree86/modes/xf86Modes.c b/hw/xfree86/modes/xf86Modes.c
index 3dde2b14c..0cf1eddac 100644
--- a/hw/xfree86/modes/xf86Modes.c
+++ b/hw/xfree86/modes/xf86Modes.c
@@ -288,7 +288,7 @@ xf86ModesEqual(const DisplayModeRec * pMode1, const DisplayModeRec * pMode2)
static void
add(char **p, const char *new)
{
- *p = xnfrealloc(*p, strlen(*p) + strlen(new) + 2);
+ *p = XNFrealloc(*p, strlen(*p) + strlen(new) + 2);
strcat(*p, " ");
strcat(*p, new);
}
diff --git a/hw/xwayland/xwayland-dmabuf.c b/hw/xwayland/xwayland-dmabuf.c
index e7a5af23c..1676a82da 100644
--- a/hw/xwayland/xwayland-dmabuf.c
+++ b/hw/xwayland/xwayland-dmabuf.c
@@ -410,7 +410,7 @@ xwl_add_format_and_mod_to_list(struct xwl_format **formats,
if (xwl_format == NULL) {
(*num_formats)++;
- *formats = xnfrealloc(*formats, *num_formats * sizeof(*xwl_format));
+ *formats = XNFrealloc(*formats, *num_formats * sizeof(*xwl_format));
xwl_format = &(*formats)[*num_formats - 1];
xwl_format->format = format;
xwl_format->num_modifiers = 0;
@@ -424,7 +424,7 @@ xwl_add_format_and_mod_to_list(struct xwl_format **formats,
}
xwl_format->num_modifiers++;
- xwl_format->modifiers = xnfrealloc(xwl_format->modifiers,
+ xwl_format->modifiers = XNFrealloc(xwl_format->modifiers,
xwl_format->num_modifiers * sizeof(uint64_t));
xwl_format->modifiers[xwl_format->num_modifiers - 1] = modifier;
}
@@ -596,7 +596,7 @@ xwl_dmabuf_feedback_tranche_done(void *data,
if (!appended) {
xwl_feedback->dev_formats_len++;
- xwl_feedback->dev_formats = xnfrealloc(xwl_feedback->dev_formats,
+ xwl_feedback->dev_formats = XNFrealloc(xwl_feedback->dev_formats,
sizeof(struct xwl_device_formats) *
xwl_feedback->dev_formats_len);
commit 61233adbcab4c8964e2093563ecaa94d76a0e2a4
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date: Wed May 8 13:32:04 2024 +0200
treewide: replace xnfreallocarray macro call by XNFreallocarray()
The xnfreallocarray was added along (and just as an alias to) XNFreallocarray
back a decade ago. It's just used in a few places and it's only saves us from
passing the first parameter (NULL), so the actual benefit isn't really huge.
No (known) driver is using it, so the macro can be dropped entirely.
Fixes: ae75d50395fdd7a6bc382ba73e923c460764c702
Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1529>
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 6bfc9a6de..71384254d 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -615,7 +615,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
if (from->button->xkb_acts) {
size_t maxbuttons = max(to->button->numButtons, from->button->numButtons);
- to->button->xkb_acts = xnfreallocarray(to->button->xkb_acts,
+ to->button->xkb_acts = XNFreallocarray(to->button->xkb_acts,
maxbuttons,
sizeof(XkbAction));
memset(to->button->xkb_acts, 0, maxbuttons * sizeof(XkbAction));
diff --git a/dix/devices.c b/dix/devices.c
index 9ffe52c45..d63cebbb3 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -2569,7 +2569,7 @@ RecalculateMasterButtons(DeviceIntPtr slave)
master->button->numButtons = maxbuttons;
if (last_num_buttons < maxbuttons) {
- master->button->xkb_acts = xnfreallocarray(master->button->xkb_acts,
+ master->button->xkb_acts = XNFreallocarray(master->button->xkb_acts,
maxbuttons,
sizeof(XkbAction));
memset(&master->button->xkb_acts[last_num_buttons],
diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c
index 65773ef00..7311d8ddc 100644
--- a/hw/xfree86/common/xf86AutoConfig.c
+++ b/hw/xfree86/common/xf86AutoConfig.c
@@ -107,7 +107,7 @@ AppendToList(const char *s, const char ***list, int *lines)
str = xnfstrdup(s);
for (p = strtok(str, "\n"); p; p = strtok(NULL, "\n")) {
(*lines)++;
- *list = xnfreallocarray(*list, *lines + 1, sizeof(**list));
+ *list = XNFreallocarray(*list, *lines + 1, sizeof(**list));
newstr = XNFalloc(strlen(p) + 2);
strcpy(newstr, p);
strcat(newstr, "\n");
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 6c5c730a1..98cbd6d0b 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -297,7 +297,7 @@ int
xf86AllocateEntity(void)
{
xf86NumEntities++;
- xf86Entities = xnfreallocarray(xf86Entities,
+ xf86Entities = XNFreallocarray(xf86Entities,
xf86NumEntities, sizeof(EntityPtr));
xf86Entities[xf86NumEntities - 1] = xnfcalloc(1, sizeof(EntityRec));
xf86Entities[xf86NumEntities - 1]->entityPrivates =
@@ -355,11 +355,11 @@ xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex)
}
pScrn->numEntities++;
- pScrn->entityList = xnfreallocarray(pScrn->entityList,
+ pScrn->entityList = XNFreallocarray(pScrn->entityList,
pScrn->numEntities, sizeof(int));
pScrn->entityList[pScrn->numEntities - 1] = entityIndex;
xf86Entities[entityIndex]->inUse = TRUE;
- pScrn->entityInstanceList = xnfreallocarray(pScrn->entityInstanceList,
+ pScrn->entityInstanceList = XNFreallocarray(pScrn->entityInstanceList,
pScrn->numEntities,
sizeof(int));
pScrn->entityInstanceList[pScrn->numEntities - 1] = 0;
@@ -457,7 +457,7 @@ xf86AddDevToEntity(int entityIndex, GDevPtr dev)
pEnt = xf86Entities[entityIndex];
pEnt->numInstances++;
- pEnt->devices = xnfreallocarray(pEnt->devices,
+ pEnt->devices = XNFreallocarray(pEnt->devices,
pEnt->numInstances, sizeof(GDevPtr));
pEnt->devices[pEnt->numInstances - 1] = dev;
dev->claimed = TRUE;
@@ -651,7 +651,7 @@ xf86AllocateEntityPrivateIndex(void)
idx = xf86EntityPrivateCount++;
for (i = 0; i < xf86NumEntities; i++) {
pEnt = xf86Entities[i];
- nprivs = xnfreallocarray(pEnt->entityPrivates,
+ nprivs = XNFreallocarray(pEnt->entityPrivates,
xf86EntityPrivateCount, sizeof(DevUnion));
/* Zero the new private */
memset(&nprivs[idx], 0, sizeof(DevUnion));
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index d64138bb4..8c4c9842c 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1014,7 +1014,7 @@ addDevice(InputInfoPtr * list, InputInfoPtr pInfo)
for (devs = list; devs && *devs; devs++)
count++;
- list = xnfreallocarray(list, count + 1, sizeof(InputInfoPtr));
+ list = XNFreallocarray(list, count + 1, sizeof(InputInfoPtr));
list[count] = NULL;
list[count - 1] = pInfo;
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index 1da9aa613..c342829e3 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -115,7 +115,7 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData,
/* Allocate new structure occurrence */
i = nDevToConfig++;
DevToConfig =
- xnfreallocarray(DevToConfig, nDevToConfig, sizeof(DevToConfigRec));
+ XNFreallocarray(DevToConfig, nDevToConfig, sizeof(DevToConfigRec));
memset(DevToConfig + i, 0, sizeof(DevToConfigRec));
DevToConfig[i].GDev.chipID =
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 9794b9cb0..25d23b85b 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -81,7 +81,7 @@ xf86AddDriver(DriverPtr driver, void *module, int flags)
xf86NumDrivers = 0;
xf86NumDrivers++;
- xf86DriverList = xnfreallocarray(xf86DriverList,
+ xf86DriverList = XNFreallocarray(xf86DriverList,
xf86NumDrivers, sizeof(DriverPtr));
xf86DriverList[xf86NumDrivers - 1] = XNFalloc(sizeof(DriverRec));
*xf86DriverList[xf86NumDrivers - 1] = *driver;
@@ -114,7 +114,7 @@ xf86AddInputDriver(InputDriverPtr driver, void *module, int flags)
xf86NumInputDrivers = 0;
xf86NumInputDrivers++;
- xf86InputDriverList = xnfreallocarray(xf86InputDriverList,
+ xf86InputDriverList = XNFreallocarray(xf86InputDriverList,
xf86NumInputDrivers,
sizeof(InputDriverPtr));
xf86InputDriverList[xf86NumInputDrivers - 1] =
@@ -170,7 +170,7 @@ xf86AllocateScreen(DriverPtr drv, int flags)
if (xf86GPUScreens == NULL)
xf86NumGPUScreens = 0;
i = xf86NumGPUScreens++;
- xf86GPUScreens = xnfreallocarray(xf86GPUScreens, xf86NumGPUScreens,
+ xf86GPUScreens = XNFreallocarray(xf86GPUScreens, xf86NumGPUScreens,
sizeof(ScrnInfoPtr));
xf86GPUScreens[i] = xnfcalloc(1, sizeof(ScrnInfoRec));
pScrn = xf86GPUScreens[i];
@@ -181,7 +181,7 @@ xf86AllocateScreen(DriverPtr drv, int flags)
xf86NumScreens = 0;
i = xf86NumScreens++;
- xf86Screens = xnfreallocarray(xf86Screens, xf86NumScreens,
+ xf86Screens = XNFreallocarray(xf86Screens, xf86NumScreens,
sizeof(ScrnInfoPtr));
xf86Screens[i] = xnfcalloc(1, sizeof(ScrnInfoRec));
pScrn = xf86Screens[i];
@@ -292,7 +292,7 @@ xf86AllocateScrnInfoPrivateIndex(void)
idx = xf86ScrnInfoPrivateCount++;
for (i = 0; i < xf86NumScreens; i++) {
pScr = xf86Screens[i];
- nprivs = xnfreallocarray(pScr->privates,
+ nprivs = XNFreallocarray(pScr->privates,
xf86ScrnInfoPrivateCount, sizeof(DevUnion));
/* Zero the new private */
memset(&nprivs[idx], 0, sizeof(DevUnion));
@@ -300,7 +300,7 @@ xf86AllocateScrnInfoPrivateIndex(void)
}
for (i = 0; i < xf86NumGPUScreens; i++) {
pScr = xf86GPUScreens[i];
- nprivs = xnfreallocarray(pScr->privates,
+ nprivs = XNFreallocarray(pScr->privates,
xf86ScrnInfoPrivateCount, sizeof(DevUnion));
/* Zero the new private */
memset(&nprivs[idx], 0, sizeof(DevUnion));
@@ -560,7 +560,7 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp,
if (i == scrp->confScreen->numdisplays) {
scrp->confScreen->numdisplays++;
scrp->confScreen->displays =
- xnfreallocarray(scrp->confScreen->displays,
+ XNFreallocarray(scrp->confScreen->displays,
scrp->confScreen->numdisplays, sizeof(DispPtr));
xf86DrvMsg(scrp->scrnIndex, X_INFO,
"Creating default Display subsection in Screen section\n"
@@ -1329,7 +1329,7 @@ xf86MatchDevice(const char *drivername, GDevPtr ** sectlist)
/*
* we have a matching driver that wasn't claimed, yet
*/
- pgdp = xnfreallocarray(pgdp, i + 2, sizeof(GDevPtr));
+ pgdp = XNFreallocarray(pgdp, i + 2, sizeof(GDevPtr));
pgdp[i++] = screensecptr->device;
}
for (k = 0; k < screensecptr->num_gpu_devices; k++) {
@@ -1352,7 +1352,7 @@ xf86MatchDevice(const char *drivername, GDevPtr ** sectlist)
if (gdp->driver && !gdp->claimed &&
!xf86NameCmp(gdp->driver, drivername)) {
/* we have a matching driver that wasn't claimed yet */
- pgdp = xnfreallocarray(pgdp, i + 2, sizeof(GDevPtr));
+ pgdp = XNFreallocarray(pgdp, i + 2, sizeof(GDevPtr));
pgdp[i++] = gdp;
}
j++;
diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index 15c304d26..586ca9a9d 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -102,7 +102,7 @@ xf86PciProbe(void)
while ((info = pci_device_next(iter)) != NULL) {
if (PCIINFOCLASSES(info->device_class)) {
num++;
- xf86PciVideoInfo = xnfreallocarray(xf86PciVideoInfo,
+ xf86PciVideoInfo = XNFreallocarray(xf86PciVideoInfo,
num + 1,
sizeof(struct pci_device *));
xf86PciVideoInfo[num] = NULL;
@@ -979,7 +979,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
/* Allocate an entry in the lists to be returned */
numFound++;
- retEntities = xnfreallocarray(retEntities, numFound, sizeof(int));
+ retEntities = XNFreallocarray(retEntities, numFound, sizeof(int));
retEntities[numFound - 1] = xf86ClaimPciSlot(pPci, drvp,
instances[i].chip,
instances[i].dev,
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index eeeff2b88..2a2387ed7 100644
--- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c
@@ -65,7 +65,7 @@ struct xf86_platform_device *xf86_platform_devices;
int
xf86_add_platform_device(struct OdevAttributes *attribs, Bool unowned)
{
- xf86_platform_devices = xnfreallocarray(xf86_platform_devices,
+ xf86_platform_devices = XNFreallocarray(xf86_platform_devices,
xf86_num_platform_devices + 1,
sizeof(struct xf86_platform_device));
diff --git a/hw/xfree86/common/xf86sbusBus.c b/hw/xfree86/common/xf86sbusBus.c
index eeee3ebfd..7048f1d16 100644
--- a/hw/xfree86/common/xf86sbusBus.c
+++ b/hw/xfree86/common/xf86sbusBus.c
@@ -68,7 +68,7 @@ CheckSbusDevice(const char *device, int fbNum)
if (!sbusDeviceTable[i].devId)
return;
xf86SbusInfo =
- xnfreallocarray(xf86SbusInfo, ++xf86nSbusInfo + 1, sizeof(psdp));
+ XNFreallocarray(xf86SbusInfo, ++xf86nSbusInfo + 1, sizeof(psdp));
xf86SbusInfo[xf86nSbusInfo] = NULL;
xf86SbusInfo[xf86nSbusInfo - 1] = psdp = xnfcalloc(1, sizeof(sbusDevice));
psdp->devId = sbusDeviceTable[i].devId;
@@ -406,7 +406,7 @@ xf86MatchSbusInstances(const char *driverName, int sbusDevId,
if (psdp->fd == -2)
continue;
++allocatedInstances;
- instances = xnfreallocarray(instances,
+ instances = XNFreallocarray(instances,
allocatedInstances, sizeof(struct Inst));
instances[allocatedInstances - 1].sbus = psdp;
instances[allocatedInstances - 1].dev = NULL;
@@ -532,7 +532,7 @@ xf86MatchSbusInstances(const char *driverName, int sbusDevId,
/* Allocate an entry in the lists to be returned */
numFound++;
- retEntities = xnfreallocarray(retEntities, numFound, sizeof(int));
+ retEntities = XNFreallocarray(retEntities, numFound, sizeof(int));
retEntities[numFound - 1]
= xf86ClaimSbusSlot(psdp, drvp, instances[i].dev,
instances[i].dev->active ? TRUE : FALSE);
diff --git a/hw/xfree86/i2c/xf86i2c.c b/hw/xfree86/i2c/xf86i2c.c
index 59733b032..3c295b6dd 100644
--- a/hw/xfree86/i2c/xf86i2c.c
+++ b/hw/xfree86/i2c/xf86i2c.c
@@ -872,7 +872,7 @@ xf86I2CGetScreenBuses(int scrnIndex, I2CBusPtr ** pppI2CBus)
if (!pppI2CBus)
continue;
- *pppI2CBus = xnfreallocarray(*pppI2CBus, n, sizeof(I2CBusPtr));
+ *pppI2CBus = XNFreallocarray(*pppI2CBus, n, sizeof(I2CBusPtr));
(*pppI2CBus)[n - 1] = pI2CBus;
}
diff --git a/hw/xfree86/os-support/bus/Sbus.c b/hw/xfree86/os-support/bus/Sbus.c
index 3c7119d46..4a18afdd6 100644
--- a/hw/xfree86/os-support/bus/Sbus.c
+++ b/hw/xfree86/os-support/bus/Sbus.c
@@ -440,7 +440,7 @@ sparcPromAssignNodes(void)
for (i = 0, j = 0; i < 32; i++)
if (devicePtrs[i] && devicePtrs[i]->fbNum == -1)
j++;
- xf86SbusInfo = xnfreallocarray(xf86SbusInfo, n + j + 1, sizeof(psdp));
+ xf86SbusInfo = XNFreallocarray(xf86SbusInfo, n + j + 1, sizeof(psdp));
for (i = 0, psdpp = xf86SbusInfo; i < 32; i++)
if (devicePtrs[i]) {
if (devicePtrs[i]->fbNum == -1) {
diff --git a/hw/xwayland/xwayland-dmabuf.c b/hw/xwayland/xwayland-dmabuf.c
index e485e5b1c..e7a5af23c 100644
--- a/hw/xwayland/xwayland-dmabuf.c
+++ b/hw/xwayland/xwayland-dmabuf.c
@@ -204,7 +204,7 @@ xwl_dmabuf_get_formats_for_device(struct xwl_dmabuf_feedback *xwl_feedback, drmD
struct xwl_device_formats *dev_formats = &xwl_feedback->dev_formats[i];
/* Append the formats from this tranche to the list */
- ret = xnfreallocarray(ret, count + dev_formats->num_formats, sizeof(CARD32));
+ ret = XNFreallocarray(ret, count + dev_formats->num_formats, sizeof(CARD32));
for (int j = 0; j < dev_formats->num_formats; j++) {
Bool found = FALSE;
diff --git a/hw/xwayland/xwayland-glamor-xv.c b/hw/xwayland/xwayland-glamor-xv.c
index 23e7100e4..f1c5ca1b2 100644
--- a/hw/xwayland/xwayland-glamor-xv.c
+++ b/hw/xwayland/xwayland-glamor-xv.c
@@ -216,7 +216,7 @@ xwl_glamor_xv_add_formats(XvAdaptorPtr pa)
void *moreSpace;
totFormat *= 2;
- moreSpace = xnfreallocarray(pFormat, totFormat,
+ moreSpace = XNFreallocarray(pFormat, totFormat,
sizeof(XvFormatRec));
pFormat = moreSpace;
pf = pFormat + numFormat;
diff --git a/include/os.h b/include/os.h
index 4f89f9696..0c81818b0 100644
--- a/include/os.h
+++ b/include/os.h
@@ -81,7 +81,6 @@ typedef struct _NewClientRec *NewClientPtr;
#define xnfstrdup(s) XNFstrdup(s)
#define xallocarray(num, size) reallocarray(NULL, (num), (size))
-#define xnfreallocarray(ptr, num, size) XNFreallocarray((ptr), (num), (size))
#endif
#include <stdio.h>
diff --git a/os/connection.c b/os/connection.c
index c47cf6ea7..f7eb95b1e 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -1034,9 +1034,9 @@ ListenOnOpenFD(int fd, int noxauth)
/* Allocate space to store it */
ListenTransFds =
- xnfreallocarray(ListenTransFds, ListenTransCount + 1, sizeof(int));
+ XNFreallocarray(ListenTransFds, ListenTransCount + 1, sizeof(int));
ListenTransConns =
- xnfreallocarray(ListenTransConns, ListenTransCount + 1,
+ XNFreallocarray(ListenTransConns, ListenTransCount + 1,
sizeof(XtransConnInfo));
/* Store it */
commit 6b3c916030ae7780bf1aab025065a9d608448f9c
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date: Wed May 8 10:49:43 2024 +0200
treewide: replace xnfallocarray() calls by XNFreallocarray
The xnfallocarray was added along (and just as an alias to) XNFreallocarray
back a decade ago.
No (known) driver is using it, so the macro can be dropped entirely.
Fixes: ae75d50395fdd7a6bc382ba73e923c460764c702
Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1529>
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 15310dc35..d64138bb4 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -364,8 +364,8 @@ xf86ModulelistFromConfig(void ***optlist)
/*
* allocate the memory and walk the list again to fill in the pointers
*/
- modulearray = xnfallocarray(count + 1, sizeof(char *));
- optarray = xnfallocarray(count + 1, sizeof(void *));
+ modulearray = XNFreallocarray(NULL, count + 1, sizeof(char *));
+ optarray = XNFreallocarray(NULL, count + 1, sizeof(void *));
count = 0;
if (xf86configptr->conf_modules) {
modp = xf86configptr->conf_modules->mod_load_lst;
@@ -432,7 +432,7 @@ xf86DriverlistFromConfig(void)
/*
* allocate the memory and walk the list again to fill in the pointers
*/
- modulearray = xnfallocarray(count + 1, sizeof(char *));
+ modulearray = XNFreallocarray(NULL, count + 1, sizeof(char *));
count = 0;
slp = xf86ConfigLayout.screens;
while (slp->screen) {
@@ -500,7 +500,7 @@ xf86InputDriverlistFromConfig(void)
/*
* allocate the memory and walk the list again to fill in the pointers
*/
- modulearray = xnfallocarray(count + 1, sizeof(char *));
+ modulearray = XNFreallocarray(NULL, count + 1, sizeof(char *));
count = 0;
idp = xf86ConfigLayout.inputs;
while (idp && *idp) {
@@ -1554,7 +1554,7 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
}
DebugF("Found %d inactive devices in the layout section %s\n",
count, conf_layout->lay_identifier);
- gdp = xnfallocarray(count + 1, sizeof(GDevRec));
+ gdp = XNFreallocarray(NULL, count + 1, sizeof(GDevRec));
gdp[count].identifier = NULL;
idp = conf_layout->lay_inactive_lst;
count = 0;
@@ -1674,7 +1674,7 @@ configXvAdaptor(confXvAdaptorPtr adaptor, XF86ConfVideoAdaptorPtr conf_adaptor)
count++;
conf_port = (XF86ConfVideoPortPtr) conf_port->list.next;
}
- adaptor->ports = xnfallocarray(count, sizeof(confXvPortRec));
+ adaptor->ports = XNFreallocarray(NULL, count, sizeof(confXvPortRec));
adaptor->numports = count;
count = 0;
conf_port = conf_adaptor->va_port_lst;
@@ -1805,7 +1805,7 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
count++;
dispptr = (XF86ConfDisplayPtr) dispptr->list.next;
}
- screenp->displays = xnfallocarray(count, sizeof(DispPtr));
+ screenp->displays = XNFreallocarray(NULL, count, sizeof(DispPtr));
screenp->numdisplays = count;
for (count = 0, dispptr = conf_screen->scrn_display_lst;
@@ -1834,7 +1834,7 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
count++;
conf_adaptor = (XF86ConfAdaptorLinkPtr) conf_adaptor->list.next;
}
- screenp->xvadaptors = xnfallocarray(count, sizeof(confXvAdaptorRec));
+ screenp->xvadaptors = XNFreallocarray(NULL, count, sizeof(confXvAdaptorRec));
screenp->numxvadaptors = 0;
conf_adaptor = conf_screen->scrn_adaptor_lst;
while (conf_adaptor) {
@@ -2073,7 +2073,7 @@ configDisplay(DispPtr displayp, XF86ConfDisplayPtr conf_display)
count++;
modep = (XF86ModePtr) modep->list.next;
}
- displayp->modes = xnfallocarray(count + 1, sizeof(char *));
+ displayp->modes = XNFreallocarray(NULL, count + 1, sizeof(char *));
modep = conf_display->disp_mode_lst;
count = 0;
while (modep) {
diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index 68e3f35fc..15c304d26 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -682,7 +682,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
}
pci_iterator_destroy(iter);
- instances = xnfallocarray(max_entries, sizeof(struct Inst));
+ instances = XNFreallocarray(NULL, max_entries, sizeof(struct Inst));
}
iter = pci_slot_match_iterator_create(NULL);
diff --git a/include/os.h b/include/os.h
index 105c5e08e..4f89f9696 100644
--- a/include/os.h
+++ b/include/os.h
@@ -81,7 +81,6 @@ typedef struct _NewClientRec *NewClientPtr;
#define xnfstrdup(s) XNFstrdup(s)
#define xallocarray(num, size) reallocarray(NULL, (num), (size))
-#define xnfallocarray(num, size) XNFreallocarray(NULL, (num), (size))
#define xnfreallocarray(ptr, num, size) XNFreallocarray((ptr), (num), (size))
#endif
commit c55ddd072bb39966185f919e1e4aaf3ac2ebcb74
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date: Wed May 8 10:29:32 2024 +0200
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: ded6147bfb5d75ff1e67c858040a628b61bc17d1
Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1529>
diff --git a/dri3/dri3_screen.c b/dri3/dri3_screen.c
index 2430505fb..ec8d025c4 100644
--- a/dri3/dri3_screen.c
+++ b/dri3/dri3_screen.c
@@ -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));
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index 86455c407..c2f49131b 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -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);
diff --git a/glamor/glamor_transfer.c b/glamor/glamor_transfer.c
index 9404e899c..eefeb552b 100644
--- a/glamor/glamor_transfer.c
+++ b/glamor/glamor_transfer.c
@@ -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);
diff --git a/glamor/glamor_vbo.c b/glamor/glamor_vbo.c
index 000c3e827..3b91bd8b5 100644
--- a/glamor/glamor_vbo.c
+++ b/glamor/glamor_vbo.c
@@ -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
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 822515a86..2321be922 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -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);
diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index 5cd9fcfd4..e766e2579 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -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);
}
diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index be894bd36..ace7bc5bd 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -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);
diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c
index 6eb3705c2..65773ef00 100644
--- a/hw/xfree86/common/xf86AutoConfig.c
+++ b/hw/xfree86/common/xf86AutoConfig.c
@@ -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;
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index ec84748ea..15310dc35 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -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;
}
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index afa1328a0..1da9aa613 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -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;
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 43c775717..9794b9cb0 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -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);
diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
index a28973ead..c20334dde 100644
--- a/hw/xfree86/common/xf86Mode.c
+++ b/hw/xfree86/common/xf86Mode.c
@@ -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) {
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 92215b28f..482816f48 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -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);
diff --git a/hw/xfree86/ddc/ddc.c b/hw/xfree86/ddc/ddc.c
index 621ef5336..effeff6fc 100644
--- a/hw/xfree86/ddc/ddc.c
+++ b/hw/xfree86/ddc/ddc.c
@@ -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);
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 56ab5ee9d..488522ca9 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -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);
diff --git a/hw/xfree86/exa/examodule.c b/hw/xfree86/exa/examodule.c
index 0bbd93e34..8cb6a7aa4 100644
--- a/hw/xfree86/exa/examodule.c
+++ b/hw/xfree86/exa/examodule.c
@@ -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);
diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c
index 885f5e96e..602e39932 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.c
+++ b/hw/xfree86/fbdevhw/fbdevhw.c
@@ -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);
}
}
diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c
index 9e52305d9..ec4e4c175 100644
--- a/hw/xfree86/int10/generic.c
+++ b/hw/xfree86/int10/generic.c
@@ -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;
diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c
index c7c8478e6..ccfecf15d 100644
--- a/hw/xfree86/int10/helper_exec.c
+++ b/hw/xfree86/int10/helper_exec.c
@@ -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);
}
diff --git a/hw/xfree86/int10/vbe.c b/hw/xfree86/int10/vbe.c
index 3c0f0761b..48878cd40 100644
--- a/hw/xfree86/int10/vbe.c
+++ b/hw/xfree86/int10/vbe.c
@@ -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:
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index cf84112b1..647e2a5f5 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -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,
diff --git a/hw/xfree86/modes/xf86Modes.c b/hw/xfree86/modes/xf86Modes.c
index 00586c457..3dde2b14c 100644
--- a/hw/xfree86/modes/xf86Modes.c
+++ b/hw/xfree86/modes/xf86Modes.c
@@ -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;
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index d7e0a125a..c078e6a5c 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -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);
diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c
index 7c8ebd49a..42569f73d 100644
--- a/hw/xwayland/xwayland-output.c
+++ b/hw/xwayland/xwayland-output.c
@@ -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);
}
diff --git a/mi/mioverlay.c b/mi/mioverlay.c
index b8b7a5ba8..57d07cdf3 100644
--- a/mi/mioverlay.c
+++ b/mi/mioverlay.c
@@ -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;
diff --git a/mi/miwindow.c b/mi/miwindow.c
index 39c279e18..dfdb0701e 100644
--- a/mi/miwindow.c
+++ b/mi/miwindow.c
@@ -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;
diff --git a/xkb/xkbtext.c b/xkb/xkbtext.c
index 7bc93bfac..35841dd2b 100644
--- a/xkb/xkbtext.c
+++ b/xkb/xkbtext.c
@@ -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;
More information about the xorg-commit
mailing list