diff options
author | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-05-06 01:44:06 +0700 |
---|---|---|
committer | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-05-13 00:22:37 +0700 |
commit | 3f3ff971ecff9936cebafc813af9193b97bba89c (patch) | |
tree | fdbbad794a42488b7ffe41eed7aba4e498335f55 /hw/xfree86/common/xf86Config.c | |
parent | 96c7ab27c383ec767f62a7a11e5fd76f86363fbc (diff) |
Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to
plain alloc/calloc/realloc/free/strdup.
X* functions are still exported from server and x* macros are still defined in
header file, so both ABI and API are not affected by this change.
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'hw/xfree86/common/xf86Config.c')
-rw-r--r-- | hw/xfree86/common/xf86Config.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 9a2837e7b..a4813683c 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -184,7 +184,7 @@ xf86ValidateFontPath(char *path) int flag; int dirlen; - tmp_path = xcalloc(1,strlen(path)+1); + tmp_path = calloc(1,strlen(path)+1); out_pnt = tmp_path; path_elem = NULL; next = path; @@ -205,7 +205,7 @@ xf86ValidateFontPath(char *path) if (flag != 0) { xf86Msg(X_WARNING, "The directory \"%s\" does not exist.\n", dir_elem); xf86ErrorF("\tEntry deleted from font path.\n"); - xfree(dir_elem); + free(dir_elem); continue; } else { @@ -216,18 +216,18 @@ xf86ValidateFontPath(char *path) if (flag == 0) if (!S_ISREG(stat_buf.st_mode)) flag = -1; - xfree(p1); + free(p1); if (flag != 0) { xf86Msg(X_WARNING, "`fonts.dir' not found (or not valid) in \"%s\".\n", dir_elem); xf86ErrorF("\tEntry deleted from font path.\n"); xf86ErrorF("\t(Run 'mkfontdir' on \"%s\").\n", dir_elem); - xfree(dir_elem); + free(dir_elem); continue; } } - xfree(dir_elem); + free(dir_elem); } /* @@ -363,7 +363,7 @@ xf86ModulelistFromConfig(pointer **optlist) if (optlist) *optlist = optarray; else - xfree(optarray); + free(optarray); return modulearray; } @@ -622,7 +622,7 @@ configFiles(XF86ConfFilesPtr fileconf) /* xf86ValidateFontPath modifies its argument, but returns a copy of it. */ temp_path = must_copy ? xnfstrdup(defaultFontPath) : defaultFontPath; defaultFontPath = xf86ValidateFontPath(temp_path); - xfree(temp_path); + free(temp_path); /* make fontpath more readable in the logfiles */ countDirs = 1; @@ -647,7 +647,7 @@ configFiles(XF86ConfFilesPtr fileconf) *(temp_path++) = '\t'; strcpy(temp_path, start); xf86Msg(pathFrom, "FontPath set to:\n%s\n", log_buf); - xfree(log_buf); + free(log_buf); /* ModulePath */ @@ -1199,7 +1199,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) for (devs = servlayoutp->inputs; devs && *devs; devs++) if (*devs == corePointer) { - xfree(*devs); + free(*devs); *devs = (IDevPtr)0x1; /* ensure we dont skip next loop*/ break; } @@ -1341,7 +1341,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) for (devs = servlayoutp->inputs; devs && *devs; devs++) if (*devs == coreKeyboard) { - xfree(*devs); + free(*devs); *devs = (IDevPtr)0x1; /* ensure we dont skip next loop */ break; } @@ -1503,8 +1503,8 @@ configInputDevices(XF86ConfLayoutPtr layout, serverLayoutPtr servlayoutp) indp[count] = xnfalloc(sizeof(IDevRec)); if (!configInput(indp[count], irp->iref_inputdev, X_CONFIG)) { while(count--) - xfree(indp[count]); - xfree(indp); + free(indp[count]); + free(indp); return FALSE; } indp[count]->extraOptions = irp->iref_option_lst; @@ -1595,7 +1595,7 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout, scrnum = adjp->adj_scrnum; if (!configScreen(slp[count].screen, adjp->adj_screen, scrnum, X_CONFIG)) { - xfree(slp); + free(slp); return FALSE; } slp[count].x = adjp->adj_x; @@ -1640,8 +1640,8 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout, slp[0].screen = xnfcalloc(1, sizeof(confScreenRec)); if (!configScreen(slp[0].screen, xf86configptr->conf_screen_lst, 0, X_CONFIG)) { - xfree(slp[0].screen); - xfree(slp); + free(slp[0].screen); + free(slp); return FALSE; } } @@ -1700,7 +1700,7 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout, count = 0; while (idp) { if (!configDevice(&gdp[count], idp->inactive_device, FALSE)) { - xfree(gdp); + free(gdp); return FALSE; } count++; @@ -1760,7 +1760,7 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen, slp[0].screen = xnfcalloc(1, sizeof(confScreenRec)); slp[1].screen = NULL; if (!configScreen(slp[0].screen, conf_screen, 0, from)) { - xfree(slp); + free(slp); return FALSE; } servlayoutp->id = "(implicit)"; @@ -2306,7 +2306,7 @@ configExtensions(XF86ConfExtensionsPtr conf_ext) enable = !enable; } else { xf86Msg(X_WARNING, "Ignoring unrecognized value \"%s\"\n", val); - xfree(n); + free(n); continue; } @@ -2317,7 +2317,7 @@ configExtensions(XF86ConfExtensionsPtr conf_ext) xf86Msg(X_WARNING, "Ignoring unrecognized extension \"%s\"\n", name); } - xfree(n); + free(n); } } } @@ -2365,7 +2365,7 @@ addDefaultModes(MonPtr monitorp) monitorp->Modes = xf86ModesAdd(monitorp->Modes, mode); last = mode; } else { - xfree(mode); + free(mode); } } monitorp->Last = last; @@ -2402,7 +2402,7 @@ checkInput(serverLayoutPtr layout, Bool implicit_layout) { xf86Msg(X_WARNING, "Disabling %s\n", (*dev)->identifier); current = dev; - xfree(*dev); + free(*dev); do { *current = *(current + 1); |