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@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1529>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-05-10 11:15:20 +02:00 committed by Marge Bot
parent f446235b71
commit dec57e5796
12 changed files with 51 additions and 51 deletions

View File

@ -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 *

View File

@ -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)

View File

@ -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';

View File

@ -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)

View File

@ -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;

View File

@ -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)

View File

@ -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;

View File

@ -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;
}

View File

@ -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);

View File

@ -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;

View File

@ -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",

View File

@ -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