summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-11-15 17:43:46 +0900
committerKeith Packard <keithp@keithp.com>2014-01-12 10:14:49 -0800
commit493d992501b586d95823e045d1dc994bd6c00d27 (patch)
tree09e116eecab120805ada9b87b80c2175f7b4857a /hw
parentc78be3a4b714deb7ad75cacd54042ca1b51d6261 (diff)
More warning fixes in hw/xfree86
Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/i2c/bt829.c17
-rw-r--r--hw/xfree86/i2c/msp3430.c6
-rw-r--r--hw/xfree86/vbe/vbeModes.c4
3 files changed, 15 insertions, 12 deletions
diff --git a/hw/xfree86/i2c/bt829.c b/hw/xfree86/i2c/bt829.c
index 070cb2044..991c26eab 100644
--- a/hw/xfree86/i2c/bt829.c
+++ b/hw/xfree86/i2c/bt829.c
@@ -500,6 +500,7 @@ bt829_Detect(I2CBusPtr b, I2CSlaveAddr addr)
{
BT829Ptr bt;
I2CByte a;
+ char *devname;
bt = calloc(1, sizeof(BT829Rec));
if (bt == NULL)
@@ -520,31 +521,31 @@ bt829_Detect(I2CBusPtr b, I2CSlaveAddr addr)
bt->id = btread(bt, IDCODE);
- free(bt->d.DevName);
- bt->d.DevName = calloc(200, sizeof(char));
+ free((void *) bt->d.DevName);
+ bt->d.DevName = devname = calloc(200, sizeof(char));
switch (BTVERSION) {
case BT815:
- sprintf(bt->d.DevName, "bt815a video decoder, revision %d",
+ sprintf(devname, "bt815a video decoder, revision %d",
bt->id & 0xf);
break;
case BT817:
- sprintf(bt->d.DevName, "bt817a video decoder, revision %d",
+ sprintf(devname, "bt817a video decoder, revision %d",
bt->id & 0xf);
break;
case BT819:
- sprintf(bt->d.DevName, "bt819a video decoder, revision %d",
+ sprintf(devname, "bt819a video decoder, revision %d",
bt->id & 0xf);
break;
case BT827:
- sprintf(bt->d.DevName, "bt827a/b video decoder, revision %d",
+ sprintf(devname, "bt827a/b video decoder, revision %d",
bt->id & 0xf);
break;
case BT829:
- sprintf(bt->d.DevName, "bt829a/b video decoder, revision %d",
+ sprintf(devname, "bt829a/b video decoder, revision %d",
bt->id & 0xf);
break;
default:
- sprintf(bt->d.DevName,
+ sprintf(devname,
"bt8xx/unknown video decoder version %d, revision %d",
bt->id >> 4, bt->id & 0xf);
break;
diff --git a/hw/xfree86/i2c/msp3430.c b/hw/xfree86/i2c/msp3430.c
index 312a2d1d1..a501489ee 100644
--- a/hw/xfree86/i2c/msp3430.c
+++ b/hw/xfree86/i2c/msp3430.c
@@ -163,7 +163,7 @@ DetectMSP3430(I2CBusPtr b, I2CSlaveAddr addr)
m->d.ByteTimeout = b->ByteTimeout;
if (!I2C_WriteRead(&(m->d), NULL, 0, &a, 1)) {
- free(m->d.DevName);
+ free((void *) m->d.DevName);
free(m);
return NULL;
}
@@ -250,12 +250,12 @@ DetectMSP3430(I2CBusPtr b, I2CSlaveAddr addr)
supported ? "" : " (unsupported)", rom_version, m->chip_id);
if (!supported) {
- free(m->d.DevName);
+ free((void *) m->d.DevName);
free(m);
return NULL;
}
if (!I2CDevInit(&(m->d))) {
- free(m->d.DevName);
+ free((void *) m->d.DevName);
free(m);
return NULL;
}
diff --git a/hw/xfree86/vbe/vbeModes.c b/hw/xfree86/vbe/vbeModes.c
index 415167d0e..40bd985ce 100644
--- a/hw/xfree86/vbe/vbeModes.c
+++ b/hw/xfree86/vbe/vbeModes.c
@@ -356,8 +356,10 @@ VBESetModeNames(DisplayModePtr pMode)
pMode->name = strdup("BADMODE");
}
else {
- XNFasprintf(&pMode->name, "%dx%d",
+ char *tmp;
+ XNFasprintf(&tmp, "%dx%d",
pMode->HDisplay, pMode->VDisplay);
+ pMode->name = tmp;
}
}
pMode = pMode->next;