summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-07-19 09:04:03 -0700
committerKeith Packard <keithp@keithp.com>2016-07-19 09:04:03 -0700
commit4512072ccd7eb65466402758c298dcf61215ea41 (patch)
treefa3feb49f1930277e2c5859d89dbbe0a305f050b
parent44ba273ca00359e80fde2e0e2fb12bb3df1995db (diff)
Fix const and deprecated func warnings
A few const char warnings, plus XNFcalloc is now deprecated Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/client.h4
-rw-r--r--src/driver.c12
-rw-r--r--src/xlibclient.c4
3 files changed, 11 insertions, 9 deletions
diff --git a/src/client.h b/src/client.h
index 4c73b3c..c11868c 100644
--- a/src/client.h
+++ b/src/client.h
@@ -38,12 +38,12 @@
struct NestedClientPrivate;
typedef struct NestedClientPrivate *NestedClientPrivatePtr;
-Bool NestedClientCheckDisplay(char *displayName);
+Bool NestedClientCheckDisplay(const char *displayName);
Bool NestedClientValidDepth(int depth);
NestedClientPrivatePtr NestedClientCreateScreen(int scrnIndex,
- char *displayName,
+ const char *displayName,
int width,
int height,
int originX,
diff --git a/src/driver.c b/src/driver.c
index 68b7aa8..8c2b2f1 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -162,7 +162,7 @@ _X_EXPORT XF86ModuleData nestedModuleData = {
/* These stuff should be valid to all server generations */
typedef struct NestedPrivate {
- char *displayName;
+ const char *displayName;
int originX;
int originY;
NestedClientPrivatePtr clientData;
@@ -303,7 +303,7 @@ static void NestedFreePrivate(ScrnInfoPtr pScrn) {
/* Data from here is valid to all server generations */
static Bool NestedPreInit(ScrnInfoPtr pScrn, int flags) {
NestedPrivatePtr pNested;
- char *originString = NULL;
+ const char *originString = NULL;
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "NestedPreInit\n");
@@ -492,19 +492,21 @@ NestedAddMode(ScrnInfoPtr pScrn, int width, int height) {
DisplayModePtr mode;
char nameBuf[64];
size_t len;
+ char *modeName;
if (snprintf(nameBuf, 64, "%dx%d", width, height) >= 64)
return FALSE;
- mode = XNFcalloc(sizeof(DisplayModeRec));
+ mode = xnfcalloc(sizeof(DisplayModeRec), 1);
mode->status = MODE_OK;
mode->type = M_T_DRIVER;
mode->HDisplay = width;
mode->VDisplay = height;
len = strlen(nameBuf);
- mode->name = XNFalloc(len+1);
- strcpy(mode->name, nameBuf);
+ modeName = XNFalloc(len+1);
+ strcpy(modeName, nameBuf);
+ mode->name = modeName;
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Adding mode %s\n", mode->name);
diff --git a/src/xlibclient.c b/src/xlibclient.c
index f7fe652..10ab970 100644
--- a/src/xlibclient.c
+++ b/src/xlibclient.c
@@ -78,7 +78,7 @@ struct NestedClientPrivate {
/* Checks if a display is open */
Bool
-NestedClientCheckDisplay(char *displayName) {
+NestedClientCheckDisplay(const char *displayName) {
Display *d;
d = XOpenDisplay(displayName);
@@ -159,7 +159,7 @@ NestedClientTryXShm(NestedClientPrivatePtr pPriv, int scrnIndex, int width, int
NestedClientPrivatePtr
NestedClientCreateScreen(int scrnIndex,
- char *displayName,
+ const char *displayName,
int width,
int height,
int originX,