summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cim/cim_gp.c8
-rw-r--r--src/cim/cim_msr.c12
-rw-r--r--src/cim/cim_vg.c22
-rw-r--r--src/geode.h4
-rw-r--r--src/geode_ddc.c4
-rw-r--r--src/gfx/disp_gu2.c3
-rw-r--r--src/gx_accel.c9
-rw-r--r--src/gx_driver.c2
-rw-r--r--src/gx_video.c56
-rw-r--r--src/lx_driver.c4
-rw-r--r--src/lx_output.c2
-rw-r--r--src/lx_panel.c6
-rw-r--r--src/lx_video.c6
-rw-r--r--src/panel/cen9211.c2
-rw-r--r--src/panel/platform.c12
-rw-r--r--src/z4l.c23
16 files changed, 84 insertions, 91 deletions
diff --git a/src/cim/cim_gp.c b/src/cim/cim_gp.c
index 2085d4f..4ab909f 100644
--- a/src/cim/cim_gp.c
+++ b/src/cim/cim_gp.c
@@ -2642,7 +2642,7 @@ gp_masked_blt(unsigned long dstoffset, unsigned long width,
unsigned long total_dwords, size_dwords;
unsigned long dword_count, byte_count;
unsigned long srcoffset, size;
- unsigned long i, ch3_offset, base;
+ unsigned long j, ch3_offset, base;
unsigned long flags = 0;
if (gp3_blt_flags & CIMGP_BLTFLAGS_INVERTMONO)
@@ -2688,7 +2688,7 @@ gp_masked_blt(unsigned long dstoffset, unsigned long width,
WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next);
gp3_cmd_current = gp3_cmd_next;
- for (i = 0; i < height; i++) {
+ for (j = 0; j < height; j++) {
/* UPDATE THE COMMAND POINTER
* The WRITE_COMMANDXX macros use a pointer to the current buffer
* space. This is created by adding gp3_cmd_current to the base
@@ -2880,7 +2880,7 @@ gp_screen_to_screen_masked(unsigned long dstoffset, unsigned long srcoffset,
unsigned long total_dwords, size_dwords;
unsigned long dword_count, byte_count;
unsigned long srcoff, size;
- unsigned long i, base;
+ unsigned long j, base;
unsigned long flags = 0;
if (gp3_blt_flags & CIMGP_BLTFLAGS_INVERTMONO)
@@ -2926,7 +2926,7 @@ gp_screen_to_screen_masked(unsigned long dstoffset, unsigned long srcoffset,
WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next);
gp3_cmd_current = gp3_cmd_next;
- for (i = 0; i < height; i++) {
+ for (j = 0; j < height; j++) {
/* UPDATE THE COMMAND POINTER
* The WRITE_COMMANDXX macros use a pointer to the current buffer
* space. This is created by adding gp3_cmd_current to the base
diff --git a/src/cim/cim_msr.c b/src/cim/cim_msr.c
index d43bc4b..0d3c571 100644
--- a/src/cim/cim_msr.c
+++ b/src/cim/cim_msr.c
@@ -35,7 +35,7 @@
/* as well as a lookup table for easy device addressing. */
/*--------------------------------------------------------------*/
-GEODELINK_NODE gliu_nodes[24];
+GEODELINK_NODE gliu_node_list[24];
GEODELINK_NODE msr_dev_lookup[MSR_DEVICE_EMPTY];
#define GET_DEVICE_ID(macrohigh, macrolow) ((macrolow >> 12) & 0xFF)
@@ -79,7 +79,7 @@ msr_init_table(void)
if (return_value == CIM_STATUS_OK) {
/* BUILD LOCAL COPY OF THE GEODELINK BUS */
- msr_create_geodelink_table(gliu_nodes);
+ msr_create_geodelink_table(gliu_node_list);
/* CLEAR TABLE STATUS */
@@ -107,7 +107,7 @@ msr_init_table(void)
for (i = 0; i < MSR_DEVICE_EMPTY; i++) {
if (msr_dev_lookup[i].device_id == MSR_DEVICE_NOTFOUND) {
for (j = 0; j < 24; j++) {
- if (gliu_nodes[j].device_id == i)
+ if (gliu_node_list[j].device_id == i)
break;
}
@@ -116,7 +116,7 @@ msr_init_table(void)
else {
msr_dev_lookup[i].device_id = MSR_DEVICE_PRESENT;
msr_dev_lookup[i].address_from_cpu =
- gliu_nodes[j].address_from_cpu;
+ gliu_node_list[j].address_from_cpu;
}
}
}
@@ -125,8 +125,8 @@ msr_init_table(void)
/* ERROR OUT THE GEODELINK TABLES */
for (i = 0; i < 24; i++) {
- gliu_nodes[i].address_from_cpu = 0xFFFFFFFF;
- gliu_nodes[i].device_id = MSR_DEVICE_EMPTY;
+ gliu_node_list[i].address_from_cpu = 0xFFFFFFFF;
+ gliu_node_list[i].device_id = MSR_DEVICE_EMPTY;
}
for (i = 0; i < MSR_DEVICE_EMPTY; i++) {
diff --git a/src/cim/cim_vg.c b/src/cim/cim_vg.c
index 46984b5..a8a875b 100644
--- a/src/cim/cim_vg.c
+++ b/src/cim/cim_vg.c
@@ -1381,8 +1381,6 @@ vg_get_current_display_mode(VG_DISPLAY_MODE * current_display, int *bpp)
/* Cimarron when returning the current mode information. */
if (vg3_panel_enable) {
- Q_WORD msr_value;
-
flags |= VG_MODEFLAG_PANELOUT;
current_display->panel_width = vg3_panel_width;
@@ -2736,7 +2734,7 @@ vg_save_state(VG_SAVE_RESTORE * vg_state)
int
vg_restore_state(VG_SAVE_RESTORE * vg_state)
{
- unsigned long irqfilt, i;
+ unsigned long irqfilt, j;
unsigned long memoffset;
/* TEMPORARILY UNLOCK ALL REGISTERS */
@@ -2801,27 +2799,27 @@ vg_restore_state(VG_SAVE_RESTORE * vg_state)
/* RESTORE THE PALETTE */
WRITE_REG32(DC3_PAL_ADDRESS, 0);
- for (i = 0; i < 261; i++)
- WRITE_REG32(DC3_PAL_DATA, vg_state->palette[i]);
+ for (j = 0; j < 261; j++)
+ WRITE_REG32(DC3_PAL_DATA, vg_state->palette[j]);
/* RESTORE THE HORIZONTAL FILTER COEFFICIENTS */
irqfilt = READ_REG32(DC3_IRQ_FILT_CTL);
irqfilt |= DC3_IRQFILT_H_FILT_SEL;
- for (i = 0; i < 256; i++) {
- WRITE_REG32(DC3_IRQ_FILT_CTL, ((irqfilt & 0xFFFFFF00L) | i));
- WRITE_REG32(DC3_FILT_COEFF1, vg_state->h_coeff[(i << 1)]);
- WRITE_REG32(DC3_FILT_COEFF2, vg_state->h_coeff[(i << 1) + 1]);
+ for (j = 0; j < 256; j++) {
+ WRITE_REG32(DC3_IRQ_FILT_CTL, ((irqfilt & 0xFFFFFF00L) | j));
+ WRITE_REG32(DC3_FILT_COEFF1, vg_state->h_coeff[(j << 1)]);
+ WRITE_REG32(DC3_FILT_COEFF2, vg_state->h_coeff[(j << 1) + 1]);
}
/* RESTORE VERTICAL COEFFICIENTS */
irqfilt &= ~DC3_IRQFILT_H_FILT_SEL;
- for (i = 0; i < 256; i++) {
- WRITE_REG32(DC3_IRQ_FILT_CTL, ((irqfilt & 0xFFFFFF00L) | i));
- WRITE_REG32(DC3_FILT_COEFF1, vg_state->v_coeff[i]);
+ for (j = 0; j < 256; j++) {
+ WRITE_REG32(DC3_IRQ_FILT_CTL, ((irqfilt & 0xFFFFFF00L) | j));
+ WRITE_REG32(DC3_FILT_COEFF1, vg_state->v_coeff[j]);
}
/* RESTORE THE CURSOR DATA */
diff --git a/src/geode.h b/src/geode.h
index 65f6f84..5e6d422 100644
--- a/src/geode.h
+++ b/src/geode.h
@@ -378,7 +378,7 @@ Bool RegionsEqual(RegionPtr A, RegionPtr B);
void GeodeProbeDDC(ScrnInfoPtr pScrni, int index);
xf86MonPtr GeodeDoDDC(ScrnInfoPtr pScrni, int index);
-Bool GeodeI2CInit(ScrnInfoPtr pScrni, I2CBusPtr * ptr, char *name);
+Bool GeodeI2CInit(ScrnInfoPtr pScrni, I2CBusPtr * ptr, const char *name);
int GeodeGetFPGeometry(const char *str, int *width, int *height);
void GeodePointerMoved(ScrnInfoPtr pScrn, int x, int y);
@@ -436,7 +436,7 @@ void LXSetupOutput(ScrnInfoPtr);
/* lx_panel.c */
DisplayModePtr LXGetLegacyPanelMode(ScrnInfoPtr pScrni);
-DisplayModePtr LXGetManualPanelMode(char *modestr);
+DisplayModePtr LXGetManualPanelMode(const char *modestr);
void LXAdjustFrame(ScrnInfoPtr pScrni, int x, int y);
diff --git a/src/geode_ddc.c b/src/geode_ddc.c
index 8227207..0a873c4 100644
--- a/src/geode_ddc.c
+++ b/src/geode_ddc.c
@@ -117,7 +117,7 @@ geode_ddc_getbits(I2CBusPtr b, int *scl, int *sda)
}
Bool
-GeodeI2CInit(ScrnInfoPtr pScrni, I2CBusPtr * ptr, char *name)
+GeodeI2CInit(ScrnInfoPtr pScrni, I2CBusPtr * ptr, const char *name)
{
I2CBusPtr bus;
unsigned int ddciobase;
@@ -150,7 +150,7 @@ GeodeI2CInit(ScrnInfoPtr pScrni, I2CBusPtr * ptr, char *name)
if (!bus)
return FALSE;
- bus->BusName = name;
+ bus->BusName = (char *)name;
bus->scrnIndex = pScrni->scrnIndex;
bus->I2CGetBits = geode_ddc_getbits;
diff --git a/src/gfx/disp_gu2.c b/src/gfx/disp_gu2.c
index 381b4ef..8bd89e9 100644
--- a/src/gfx/disp_gu2.c
+++ b/src/gfx/disp_gu2.c
@@ -1257,13 +1257,12 @@ void
gfx_set_display_video_enable(int enable)
#endif
{
- unsigned long lock, gcfg, dcfg;
+ unsigned long lock, gcfg;
/* READ CURRENT VALUES */
lock = READ_REG32(MDC_UNLOCK);
gcfg = READ_REG32(MDC_GENERAL_CFG);
- dcfg = READ_REG32(MDC_DISPLAY_CFG);
/* SET OR CLEAR VIDEO ENABLE IN GENERAL_CFG */
diff --git a/src/gx_accel.c b/src/gx_accel.c
index 89c7486..8e68486 100644
--- a/src/gx_accel.c
+++ b/src/gx_accel.c
@@ -1482,7 +1482,7 @@ amd_gx_exa_UploadToScreen(PixmapPtr pDst, int x, int y, int w, int h,
char *src, int src_pitch)
{
GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pDst);
- char *dst = pGeode->pExa->memoryBase + exaGetPixmapOffset(pDst);
+ unsigned char *dst = pGeode->pExa->memoryBase + exaGetPixmapOffset(pDst);
int dst_pitch = exaGetPixmapPitch(pDst);
int bpp = pDst->drawable.bitsPerPixel;
@@ -1498,7 +1498,7 @@ amd_gx_exa_DownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h,
char *dst, int dst_pitch)
{
GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pSrc);
- char *src = pGeode->pExa->memoryBase + exaGetPixmapOffset(pSrc);
+ unsigned char *src = pGeode->pExa->memoryBase + exaGetPixmapOffset(pSrc);
int src_pitch = exaGetPixmapPitch(pSrc);
int bpp = pSrc->drawable.bitsPerPixel;
@@ -1734,10 +1734,9 @@ amd_gx_exa_PrepareComposite(int op, PicturePtr pSrc, PicturePtr pMsk,
PixmapPtr pxDst)
{
int srcPitch;
- if (!pxSrc || !pSrc->pDrawable) return FALSE;
-
- GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pxDst);
amd_gx_exa_fmt_t *sfp, *dfp;
+ GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pxDst);
+ if (!pxSrc || !pSrc->pDrawable) return FALSE;
//ErrorF("amd_gx_exa_PrepareComposite()\n");
diff --git a/src/gx_driver.c b/src/gx_driver.c
index be1bd17..1850deb 100644
--- a/src/gx_driver.c
+++ b/src/gx_driver.c
@@ -403,7 +403,7 @@ GXPreInit(ScrnInfoPtr pScrni, int flags)
EntityInfoPtr pEnt;
rgb defaultWeight = { 0, 0, 0 };
int modecnt;
- char *s, *panelgeo;
+ const char *s, *panelgeo;
Bool useVGA;
if (pScrni->numEntities != 1)
diff --git a/src/gx_video.c b/src/gx_video.c
index 70c0410..7c0c162 100644
--- a/src/gx_video.c
+++ b/src/gx_video.c
@@ -105,8 +105,6 @@ void GXSetVideoPosition(int x, int y, int width, int height,
short src_w, short src_h, short drw_w,
short drw_h, int id, int offset, ScrnInfoPtr pScrni);
-extern void GXAccelSync(ScrnInfoPtr pScrni);
-
extern int DeltaX, DeltaY;
unsigned long graphics_lut[256];
@@ -224,11 +222,11 @@ static XF86VideoFormatRec Formats[NUM_FORMATS] = {
static XF86AttributeRec Attributes[NUM_ATTRIBUTES] = {
#if DBUF
- {XvSettable | XvGettable, 0, 1, "XV_DOUBLE_BUFFER"},
+ {XvSettable | XvGettable, 0, 1, (char *)"XV_DOUBLE_BUFFER"},
#endif
- {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"},
- {XvSettable | XvGettable, 0, 1, "XV_FILTER"},
- {XvSettable | XvGettable, 0, 1, "XV_COLORKEYMODE"}
+ {XvSettable | XvGettable, 0, (1 << 24) - 1, (char *)"XV_COLORKEY"},
+ {XvSettable | XvGettable, 0, 1, (char *)"XV_FILTER"},
+ {XvSettable | XvGettable, 0, 1, (char *)"XV_COLORKEYMODE"}
};
#define NUM_IMAGES 8
@@ -759,11 +757,11 @@ GXAllocateMemory(ScrnInfoPtr pScrni, void **memp, int numlines)
return 0;
}
-static BoxRec dstBox;
+static BoxRec global_dstBox;
static int srcPitch = 0, srcPitch2 = 0, dstPitch = 0, dstPitch2 = 0;
static INT32 Bx1, Bx2, By1, By2;
static int top, left, npixels, nlines;
-static int offset, s1offset = 0, s2offset = 0, s3offset = 0;
+static int global_offset, s1offset = 0, s2offset = 0, s3offset = 0;
static unsigned char *dst_start;
static int d2offset = 0, d3offset = 0;
@@ -1074,15 +1072,15 @@ GXPutImage(ScrnInfoPtr pScrni,
if ((Bx1 >= Bx2) || (By1 >= By2))
return Success;
- dstBox.x1 = drw_x;
- dstBox.x2 = drw_x + drw_w;
- dstBox.y1 = drw_y;
- dstBox.y2 = drw_y + drw_h;
+ global_dstBox.x1 = drw_x;
+ global_dstBox.x2 = drw_x + drw_w;
+ global_dstBox.y1 = drw_y;
+ global_dstBox.y2 = drw_y + drw_h;
- dstBox.x1 -= pScrni->frameX0;
- dstBox.x2 -= pScrni->frameX0;
- dstBox.y1 -= pScrni->frameY0;
- dstBox.y2 -= pScrni->frameY0;
+ global_dstBox.x1 -= pScrni->frameX0;
+ global_dstBox.x2 -= pScrni->frameX0;
+ global_dstBox.y1 -= pScrni->frameY0;
+ global_dstBox.y2 -= pScrni->frameY0;
switch (id) {
case FOURCC_YV12:
@@ -1138,13 +1136,13 @@ GXPutImage(ScrnInfoPtr pScrni,
top &= ~1;
- offset = pPriv->offset + (top * dstPitch);
+ global_offset = pPriv->offset + (top * dstPitch);
#if DBUF
if (pPriv->doubleBuffer && pPriv->currentBuffer)
- offset += (new_h >> 1) * pGeode->Pitch;
+ global_offset += (new_h >> 1) * pGeode->Pitch;
#endif
- dst_start = pGeode->FBBase + offset + left;
+ dst_start = pGeode->FBBase + global_offset + left;
tmp = ((top >> 1) * srcPitch2) + (left >> 1);
s2offset += tmp;
s3offset += tmp;
@@ -1164,13 +1162,13 @@ GXPutImage(ScrnInfoPtr pScrni,
left <<= 1;
buf += (top * srcPitch) + left;
nlines = By2 - top;
- offset = (pPriv->offset) + (top * dstPitch);
+ global_offset = (pPriv->offset) + (top * dstPitch);
#if DBUF
if (pPriv->doubleBuffer && pPriv->currentBuffer)
- offset += (new_h >> 1) * pGeode->Pitch;
+ global_offset += (new_h >> 1) * pGeode->Pitch;
#endif
- dst_start = pGeode->FBBase + offset + left;
+ dst_start = pGeode->FBBase + global_offset + left;
break;
}
s1offset = (top * srcPitch) + left;
@@ -1182,8 +1180,8 @@ GXPutImage(ScrnInfoPtr pScrni,
xf86XVFillKeyHelper(pScrni->pScreen, pPriv->colorKey, clipBoxes);
}
- GXDisplayVideo(pScrni, id, offset, width, height, dstPitch,
- Bx1, By1, Bx2, By2, &dstBox, src_w, src_h, drw_w, drw_h);
+ GXDisplayVideo(pScrni, id, global_offset, width, height, dstPitch,
+ Bx1, By1, Bx2, By2, &global_dstBox, src_w, src_h, drw_w, drw_h);
}
#endif
switch (id) {
@@ -1216,8 +1214,8 @@ GXPutImage(ScrnInfoPtr pScrni,
REGION_NUM_RECTS(clipBoxes), REGION_RECTS(clipBoxes));
}
- GXDisplayVideo(pScrni, id, offset, width, height, dstPitch,
- Bx1, By1, Bx2, By2, &dstBox, src_w, src_h, drw_w, drw_h);
+ GXDisplayVideo(pScrni, id, global_offset, width, height, dstPitch,
+ Bx1, By1, Bx2, By2, &global_dstBox, src_w, src_h, drw_w, drw_h);
#endif
#if XV_PROFILE
@@ -1400,7 +1398,7 @@ GXAllocateSurface(ScrnInfoPtr pScrni,
fbpitch = pScrni->bitsPerPixel * pScrni->displayWidth >> 3;
numlines = ((pitch * h) + fbpitch - 1) / fbpitch;
- if (!(offset = GXAllocateMemory(pScrni, &area, numlines)))
+ if (!(global_offset = GXAllocateMemory(pScrni, &area, numlines)))
return BadAlloc;
surface->width = w;
@@ -1421,14 +1419,14 @@ GXAllocateSurface(ScrnInfoPtr pScrni,
}
pPriv->area = area;
- pPriv->offset = offset;
+ pPriv->offset = global_offset;
pPriv->isOn = FALSE;
surface->pScrn = pScrni;
surface->id = id;
surface->pitches[0] = pitch;
- surface->offsets[0] = offset;
+ surface->offsets[0] = global_offset;
surface->devPrivate.ptr = (pointer) pPriv;
return Success;
diff --git a/src/lx_driver.c b/src/lx_driver.c
index 29d8948..5ab88db 100644
--- a/src/lx_driver.c
+++ b/src/lx_driver.c
@@ -306,7 +306,7 @@ LXPreInit(ScrnInfoPtr pScrni, int flags)
EntityInfoPtr pEnt;
OptionInfoRec *GeodeOptions = &LX_GeodeOptions[0];
rgb defaultWeight = { 0, 0, 0 };
- char *s;
+ const char *s;
if (pScrni->numEntities != 1)
return FALSE;
@@ -469,7 +469,7 @@ LXPreInit(ScrnInfoPtr pScrni, int flags)
pGeode->Output = OUTPUT_PANEL | OUTPUT_DCON;
}
else if (pGeode->Output & OUTPUT_PANEL) {
- char *pmode = xf86GetOptValString(GeodeOptions, LX_OPTION_PANEL_MODE);
+ const char *pmode = xf86GetOptValString(GeodeOptions, LX_OPTION_PANEL_MODE);
if (pmode != NULL)
pGeode->panelMode = LXGetManualPanelMode(pmode);
diff --git a/src/lx_output.c b/src/lx_output.c
index 4cd5b64..fbe21ab 100644
--- a/src/lx_output.c
+++ b/src/lx_output.c
@@ -47,7 +47,7 @@ static void
lx_create_resources(xf86OutputPtr output)
{
int ret;
- char *s;
+ const char *s;
ScrnInfoPtr pScrni = output->scrn;
GeodeRec *pGeode = GEODEPTR(pScrni);
diff --git a/src/lx_panel.c b/src/lx_panel.c
index 8dfd68c..4a304a9 100644
--- a/src/lx_panel.c
+++ b/src/lx_panel.c
@@ -110,7 +110,7 @@ LXGetLegacyPanelMode(ScrnInfoPtr pScrni)
/* Construct a moderec from the specified panel mode */
DisplayModePtr
-LXGetManualPanelMode(char *modestr)
+LXGetManualPanelMode(const char *modestr)
{
int clock;
int hactive, hsstart, hsend, htotal;
@@ -133,8 +133,8 @@ LXGetManualPanelMode(char *modestr)
sprintf(sname, "%dx%d", hactive, vactive);
- mode->name = XNFalloc(strlen(sname) + 1);
- strcpy(mode->name, sname);
+ mode->name = (char *)XNFalloc(strlen(sname) + 1);
+ strcpy((char *)mode->name, sname);
mode->type = M_T_DRIVER | M_T_PREFERRED;
mode->Clock = clock;
diff --git a/src/lx_video.c b/src/lx_video.c
index f3bcf4a..a941557 100644
--- a/src/lx_video.c
+++ b/src/lx_video.c
@@ -84,9 +84,9 @@ static XF86VideoFormatRec Formats[] = {
};
static XF86AttributeRec Attributes[] = {
- {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"},
- {XvSettable | XvGettable, 0, 1, "XV_FILTER"},
- {XvSettable | XvGettable, 0, 1, "XV_COLORKEYMODE"}
+ {XvSettable | XvGettable, 0, (1 << 24) - 1, (char *)"XV_COLORKEY"},
+ {XvSettable | XvGettable, 0, 1, (char *)"XV_FILTER"},
+ {XvSettable | XvGettable, 0, 1, (char *)"XV_COLORKEYMODE"}
};
static XF86ImageRec Images[] = {
diff --git a/src/panel/cen9211.c b/src/panel/cen9211.c
index d9cbc42..7a36a56 100644
--- a/src/panel/cen9211.c
+++ b/src/panel/cen9211.c
@@ -730,11 +730,9 @@ CentaurusProgramFRMload(void)
};
unsigned char i;
- unsigned short index;
unsigned long data;
Centaurus_write_gpio(FOUR_BYTES, CS92xx_FRM_MEMORY_INDEX, 0);
- index = CS92xx_FRM_MEMORY_DATA;
for (i = 0; i < 64; i += 2) {
data = CentaurusFRMtable[i];
Centaurus_write_gpio(FOUR_BYTES, CS92xx_FRM_MEMORY_DATA, data);
diff --git a/src/panel/platform.c b/src/panel/platform.c
index 3e5afe3..812e762 100644
--- a/src/panel/platform.c
+++ b/src/panel/platform.c
@@ -68,7 +68,7 @@ SYS_BOARD_INFO Sys_board_info_array[] = {
static int Num_sys_board_type = NUM_SYS_BOARD_TYPES;
SYS_BOARD_INFO *Sys_board_array_base = Sys_board_info_array;
-int FindStringInSeg(unsigned int, char *);
+int FindStringInSeg(unsigned int, const char *);
static unsigned char get_sys_board_type(SYS_BOARD_INFO *, SYS_BOARD_INFO *);
/* Detect the Platform */
@@ -81,7 +81,7 @@ Detect_Platform(void)
}
static int
-Strncmp(char *str1, char *str2, int len)
+Strncmp(const char *str1, char *str2, int len)
{
int i;
@@ -99,7 +99,7 @@ Strncmp(char *str1, char *str2, int len)
}
static char *
-Strcpy(char *dst, char *src)
+Strcpy(char *dst, const char *src)
{
int i;
@@ -113,7 +113,7 @@ Strcpy(char *dst, char *src)
}
static int
-Strlen(char *str)
+Strlen(const char *str)
{
int i;
@@ -135,7 +135,7 @@ Strlen(char *str)
************************************************************************
*/
int
-FindStringInSeg(unsigned int segment_address, char *string_ptr)
+FindStringInSeg(unsigned int segment_address, const char *string_ptr)
{
int string_length = Strlen(string_ptr);
char *psegment_buf;
@@ -186,7 +186,7 @@ get_sys_board_type(SYS_BOARD_INFO * sys_info,
SYS_BOARD_INFO * sys_board_array_base)
{
int index;
- char *xpress_rom_string_ptr = "XpressStart";
+ const char *xpress_rom_string_ptr = "XpressStart";
unsigned int segment = LINUX_ROM_SEGMENT;
/* See if XpressStart is present in the BIOS area.
diff --git a/src/z4l.c b/src/z4l.c
index e5fe729..a20470e 100644
--- a/src/z4l.c
+++ b/src/z4l.c
@@ -83,7 +83,7 @@ int debuglvl = 0;
#define MAX_OVLY_WIDTH 2048
#define MAX_OVLY_HEIGHT 2048
-static char *z4l_dev_paths[] = {
+static const char *z4l_dev_paths[] = {
"/dev/videox", NULL
};
@@ -579,7 +579,7 @@ static int
z4l_ovly_set_encoding(Z4lPortPrivRec * pPriv, int id)
{
int l, n, inp;
- char *cp;
+ const char *cp;
t_std_data *sp;
XF86VideoEncodingPtr enc;
XF86VideoAdaptorPtr adpt;
@@ -992,7 +992,7 @@ Z4lEncodingName(char *ename, int l, char *inp_name, char *std_name, char *fmt)
}
static int
-Z4lAddEncoding(XF86VideoEncodingPtr enc, char *name, int id, int width,
+Z4lAddEncoding(XF86VideoEncodingPtr enc, const char *name, int id, int width,
int height, int numer, int denom, int inp, v4l2_std_id std,
unsigned int fmt)
{
@@ -1314,7 +1314,8 @@ Z4lInit(ScrnInfoPtr pScrni, XF86VideoAdaptorPtr ** adaptors)
XF86VideoEncodingPtr encs, enc;
XF86ImagePtr ip, img, imgs;
Z4lPortPrivRec *pPriv;
- char *dp, *msg;
+ char *dp;
+ const char *msg;
char enc_name[256], attr_name[256];
int attrIds[V4L2_CID_LASTP1 - V4L2_CID_BASE + ATTR_MAX_ID];
struct v4l2_capability capability;
@@ -1499,7 +1500,7 @@ Z4lInit(ScrnInfoPtr pScrni, XF86VideoAdaptorPtr ** adaptors)
if ((attr = Z4lNewAttribute(&attrs, &nattrs)) == NULL)
goto fail;
Z4lAttributeName(&attr_name[0], sizeof(attr_name),
- (char *) &queryctrl.name[0]);
+ (char *)&queryctrl.name[0]);
if (Z4lAddAttribute(attr, &attr_name[0],
queryctrl.minimum, queryctrl.maximum,
XvSettable | XvGettable) == 0)
@@ -1508,7 +1509,7 @@ Z4lInit(ScrnInfoPtr pScrni, XF86VideoAdaptorPtr ** adaptors)
attrIds[nattrs] = ATTR_ENCODING_ID;
if ((attr = Z4lNewAttribute(&attrs, &nattrs)) == NULL)
goto fail;
- Z4lAttributeName(&attr_name[0], sizeof(attr_name), ATTR_ENCODING);
+ Z4lAttributeName(&attr_name[0], sizeof(attr_name), (char *)ATTR_ENCODING);
if (Z4lAddAttribute(attr, &attr_name[0], 0, nencs - 1,
XvSettable | XvGettable) == 0)
goto fail;
@@ -1521,14 +1522,14 @@ Z4lInit(ScrnInfoPtr pScrni, XF86VideoAdaptorPtr ** adaptors)
attrIds[nattrs] = ATTR_KEYMODE_ID;
if ((attr = Z4lNewAttribute(&attrs, &nattrs)) == NULL)
goto fail;
- Z4lAttributeName(&attr_name[0], sizeof(attr_name), ATTR_KEYMODE);
+ Z4lAttributeName(&attr_name[0], sizeof(attr_name), (char *)ATTR_KEYMODE);
if (Z4lAddAttribute(attr, &attr_name[0], 0, 1,
XvSettable | XvGettable) == 0)
goto fail;
attrIds[nattrs] = ATTR_COLORKEY_ID;
if ((attr = Z4lNewAttribute(&attrs, &nattrs)) == NULL)
goto fail;
- Z4lAttributeName(&attr_name[0], sizeof(attr_name), ATTR_COLORKEY);
+ Z4lAttributeName(&attr_name[0], sizeof(attr_name), (char *)ATTR_COLORKEY);
if (Z4lAddAttribute(attr, &attr_name[0], 0, 0xffffff,
XvSettable | XvGettable) == 0)
goto fail;
@@ -1613,7 +1614,7 @@ Z4lInit(ScrnInfoPtr pScrni, XF86VideoAdaptorPtr ** adaptors)
if (encs != NULL) {
for (i = 0; i < nencs; ++i) {
if (encs[i].name != NULL)
- free(encs[i].name);
+ free((char *)encs[i].name);
}
free(encs);
}
@@ -1625,7 +1626,7 @@ Z4lInit(ScrnInfoPtr pScrni, XF86VideoAdaptorPtr ** adaptors)
for (i = 0; i < nadpts; ++i) {
if ((adpt = adpts[i]) != NULL) {
if (adpt->name != NULL)
- free(adpt->name);
+ free((char *)adpt->name);
if ((attrs = adpt->pAttributes) != NULL) {
for (i = 0; i < adpt->nAttributes; ++i)
if (attrs[i].name != NULL)
@@ -1635,7 +1636,7 @@ Z4lInit(ScrnInfoPtr pScrni, XF86VideoAdaptorPtr ** adaptors)
if ((encs = adpt->pEncodings) != NULL) {
for (i = 0; i < adpt->nEncodings; ++i, ++enc)
if (encs[i].name != NULL)
- free(encs[i].name);
+ free((char *)encs[i].name);
free(encs);
}
if ((imgs = adpt->pImages) != NULL)