aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/common/xf86Config.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xfree86/common/xf86Config.c')
-rw-r--r--xorg-server/hw/xfree86/common/xf86Config.c54
1 files changed, 28 insertions, 26 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86Config.c b/xorg-server/hw/xfree86/common/xf86Config.c
index b5efc02af..5be1693d8 100644
--- a/xorg-server/hw/xfree86/common/xf86Config.c
+++ b/xorg-server/hw/xfree86/common/xf86Config.c
@@ -171,7 +171,7 @@ xf86GetPathElem(char **pnt)
static char *
xf86ValidateFontPath(char *path)
{
- char *tmp_path, *out_pnt, *path_elem, *next, *p1, *dir_elem;
+ char *next, *tmp_path, *out_pnt, *path_elem, *p1, *dir_elem;
struct stat stat_buf;
int flag;
int dirlen;
@@ -236,17 +236,17 @@ xf86ValidateFontPath(char *path)
* use the datastructure that the parser provides and pick out the parts
* that we need at this point
*/
-char **
-xf86ModulelistFromConfig(pointer **optlist)
+const char **
+xf86ModulelistFromConfig(void ***optlist)
{
int count = 0, i = 0;
- char **modulearray;
+ const char **modulearray;
const char *ignore[] = { "GLcore", "speedo", "bitmap", "drm",
"freetype", "type1",
NULL
};
- pointer *optarray;
+ void **optarray;
XF86LoadPtr modp;
Bool found;
@@ -352,7 +352,7 @@ xf86ModulelistFromConfig(pointer **optlist)
* allocate the memory and walk the list again to fill in the pointers
*/
modulearray = xnfalloc((count + 1) * sizeof(char *));
- optarray = xnfalloc((count + 1) * sizeof(pointer));
+ optarray = xnfalloc((count + 1) * sizeof(void *));
count = 0;
if (xf86configptr->conf_modules) {
modp = xf86configptr->conf_modules->mod_load_lst;
@@ -374,12 +374,12 @@ xf86ModulelistFromConfig(pointer **optlist)
return modulearray;
}
-char **
+const char **
xf86DriverlistFromConfig(void)
{
int count = 0;
int j;
- char **modulearray;
+ const char **modulearray;
screenLayoutPtr slp;
/*
@@ -446,11 +446,11 @@ xf86DriverlistFromConfig(void)
return modulearray;
}
-char **
+const char **
xf86InputDriverlistFromConfig(void)
{
int count = 0;
- char **modulearray;
+ const char **modulearray;
InputInfoPtr *idp;
/*
@@ -505,11 +505,11 @@ xf86InputDriverlistFromConfig(void)
}
static void
-fixup_video_driver_list(char **drivers)
+fixup_video_driver_list(const char **drivers)
{
static const char *fallback[4] = { "fbdev", "vesa", "wsfb", NULL };
- char **end, **drv;
- char *x;
+ const char **end, **drv;
+ const char *x;
int i;
/* walk to the end of the list */
@@ -533,10 +533,10 @@ fixup_video_driver_list(char **drivers)
}
}
-static char **
+static const char **
GenerateDriverlist(const char *dirname)
{
- char **ret;
+ const char **ret;
const char *subdirs[] = { dirname, NULL };
static const char *patlist[] = { "(.*)_drv\\.so", NULL };
ret = LoaderListDirs(subdirs, patlist);
@@ -548,10 +548,10 @@ GenerateDriverlist(const char *dirname)
return ret;
}
-char **
+const char **
xf86DriverlistFromCompile(void)
{
- static char **driverlist = NULL;
+ static const char **driverlist = NULL;
if (!driverlist)
driverlist = GenerateDriverlist("drivers");
@@ -589,33 +589,35 @@ configFiles(XF86ConfFilesPtr fileconf)
/* FontPath */
must_copy = TRUE;
- temp_path = defaultFontPath ? defaultFontPath : "";
+ temp_path = defaultFontPath ? (char *) defaultFontPath : (char *) "";
if (xf86fpFlag)
pathFrom = X_CMDLINE;
else if (fileconf && fileconf->file_fontpath) {
pathFrom = X_CONFIG;
if (xf86Info.useDefaultFontPath) {
- if (asprintf(&defaultFontPath, "%s%s%s", fileconf->file_fontpath,
+ char *new_font_path;
+ if (asprintf(&new_font_path, "%s%s%s", fileconf->file_fontpath,
*temp_path ? "," : "", temp_path) == -1)
- defaultFontPath = NULL;
+ new_font_path = NULL;
else
must_copy = FALSE;
+ defaultFontPath = new_font_path;
}
else
defaultFontPath = fileconf->file_fontpath;
}
else
pathFrom = X_DEFAULT;
- temp_path = defaultFontPath ? defaultFontPath : "";
+ temp_path = defaultFontPath ? (char *) defaultFontPath : (char *) "";
/* xf86ValidateFontPath modifies its argument, but returns a copy of it. */
- temp_path = must_copy ? xnfstrdup(defaultFontPath) : defaultFontPath;
+ temp_path = must_copy ? xnfstrdup(defaultFontPath) : (char *) defaultFontPath;
defaultFontPath = xf86ValidateFontPath(temp_path);
free(temp_path);
/* make fontpath more readable in the logfiles */
countDirs = 1;
- temp_path = defaultFontPath;
+ temp_path = (char *) defaultFontPath;
while ((temp_path = index(temp_path, ',')) != NULL) {
countDirs++;
temp_path++;
@@ -623,7 +625,7 @@ configFiles(XF86ConfFilesPtr fileconf)
log_buf = xnfalloc(strlen(defaultFontPath) + (2 * countDirs) + 1);
temp_path = log_buf;
- start = defaultFontPath;
+ start = (char *) defaultFontPath;
while ((end = index(start, ',')) != NULL) {
size = (end - start) + 1;
*(temp_path++) = '\t';
@@ -2349,7 +2351,7 @@ checkInput(serverLayoutPtr layout, Bool implicit_layout)
ConfigStatus
xf86HandleConfigFile(Bool autoconfig)
{
- char *scanptr;
+ const char *scanptr;
Bool singlecard = 0;
Bool implicit_layout = FALSE;
@@ -2444,7 +2446,7 @@ xf86HandleConfigFile(Bool autoconfig)
else {
if (xf86configptr->conf_flags != NULL) {
char *dfltlayout = NULL;
- pointer optlist = xf86configptr->conf_flags->flg_option_lst;
+ void *optlist = xf86configptr->conf_flags->flg_option_lst;
if (optlist && xf86FindOption(optlist, "defaultserverlayout"))
dfltlayout =