Commit d5f9a131 authored by Alan Coopersmith's avatar Alan Coopersmith

Fix const-mismatch warnings for DisplayModePtr's

Includes fixes for:
"xf86Config.c", line 2434: warning: argument #1 is incompatible with prototype:
	prototype: pointer to struct _DisplayModeRec: "xf86.h", line 351
	argument : pointer to const struct _DisplayModeRec

"xf86EdidModes.c", line 312: warning: argument #1 is incompatible with prototype:
	prototype: pointer to struct _DisplayModeRec: "../../../hw/xfree86/common/xf86.h", line 351
	argument : pointer to const struct _DisplayModeRec

"xf86EdidModes.c", line 438: warning: assignment type mismatch:
	pointer to struct _DisplayModeRec "=" pointer to const struct _DisplayModeRec

"xf86Modes.c", line 701: warning: assignment type mismatch:
	pointer to struct _DisplayModeRec "=" pointer to const struct _DisplayModeRec
parent d5ad2968
......@@ -344,13 +344,14 @@ void xf86PruneDriverModes(ScrnInfoPtr scrp);
void xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags);
void xf86PrintModes(ScrnInfoPtr scrp);
void xf86ShowClockRanges(ScrnInfoPtr scrp, ClockRangePtr clockRanges);
double xf86ModeHSync(DisplayModePtr mode);
double xf86ModeVRefresh(DisplayModePtr mode);
double xf86ModeHSync(const DisplayModeRec *mode);
double xf86ModeVRefresh(const DisplayModeRec *mode);
void xf86SetModeDefaultName(DisplayModePtr mode);
void xf86SetModeCrtc(DisplayModePtr p, int adjustFlags);
DisplayModePtr xf86DuplicateMode(DisplayModePtr pMode);
DisplayModePtr xf86DuplicateMode(const DisplayModeRec *pMode);
DisplayModePtr xf86DuplicateModes(ScrnInfoPtr pScrn, DisplayModePtr modeList);
Bool xf86ModesEqual(DisplayModePtr pMode1, DisplayModePtr pMode2);
Bool xf86ModesEqual(const DisplayModeRec *pMode1,
const DisplayModeRec *pMode2);
void xf86PrintModeline(int scrnIndex,DisplayModePtr mode);
DisplayModePtr xf86ModesAdd(DisplayModePtr modes, DisplayModePtr new);
......
......@@ -418,7 +418,7 @@ MonitorStandardTimingLevel(xf86MonPtr DDC)
}
static int
ModeRefresh(DisplayModePtr mode)
ModeRefresh(const DisplayModeRec *mode)
{
return (int)(xf86ModeVRefresh(mode) + 0.5);
}
......@@ -432,7 +432,7 @@ static DisplayModePtr
FindDMTMode(int hsize, int vsize, int refresh, Bool rb)
{
int i;
DisplayModePtr ret;
const DisplayModeRec *ret;
for (i = 0; i < sizeof(DMTModes) / sizeof(DisplayModeRec); i++) {
ret = &DMTModes[i];
......
......@@ -52,7 +52,7 @@ extern XF86ConfigPtr xf86configptr;
* Exact copy of xf86Mode.c's.
*/
_X_EXPORT double
xf86ModeHSync(DisplayModePtr mode)
xf86ModeHSync(const DisplayModeRec *mode)
{
double hsync = 0.0;
......@@ -70,7 +70,7 @@ xf86ModeHSync(DisplayModePtr mode)
* Exact copy of xf86Mode.c's.
*/
_X_EXPORT double
xf86ModeVRefresh(DisplayModePtr mode)
xf86ModeVRefresh(const DisplayModeRec *mode)
{
double refresh = 0.0;
......@@ -89,7 +89,7 @@ xf86ModeVRefresh(DisplayModePtr mode)
}
_X_EXPORT int
xf86ModeWidth (DisplayModePtr mode, Rotation rotation)
xf86ModeWidth (const DisplayModeRec *mode, Rotation rotation)
{
switch (rotation & 0xf) {
case RR_Rotate_0:
......@@ -104,7 +104,7 @@ xf86ModeWidth (DisplayModePtr mode, Rotation rotation)
}
_X_EXPORT int
xf86ModeHeight (DisplayModePtr mode, Rotation rotation)
xf86ModeHeight (const DisplayModeRec *mode, Rotation rotation)
{
switch (rotation & 0xf) {
case RR_Rotate_0:
......@@ -206,7 +206,7 @@ xf86SetModeCrtc(DisplayModePtr p, int adjustFlags)
* Allocates and returns a copy of pMode, including pointers within pMode.
*/
_X_EXPORT DisplayModePtr
xf86DuplicateMode(DisplayModePtr pMode)
xf86DuplicateMode(const DisplayModeRec *pMode)
{
DisplayModePtr pNew;
......@@ -264,7 +264,7 @@ xf86DuplicateModes(ScrnInfoPtr pScrn, DisplayModePtr modeList)
* This isn't in xf86Modes.c, but it might deserve to be there.
*/
_X_EXPORT Bool
xf86ModesEqual(DisplayModePtr pMode1, DisplayModePtr pMode2)
xf86ModesEqual(const DisplayModeRec *pMode1, const DisplayModeRec *pMode2)
{
if (pMode1->Clock == pMode2->Clock &&
pMode1->HDisplay == pMode2->HDisplay &&
......@@ -519,7 +519,7 @@ xf86ValidateModesBandwidth(ScrnInfoPtr pScrn, DisplayModePtr modeList,
}
Bool
xf86ModeIsReduced(DisplayModePtr mode)
xf86ModeIsReduced(const DisplayModeRec *mode)
{
if ((((mode->HDisplay * 5 / 4) & ~0x07) > mode->HTotal) &&
((mode->HTotal - mode->HDisplay) == 160) &&
......@@ -698,7 +698,7 @@ xf86GetDefaultModes (Bool interlaceAllowed, Bool doubleScanAllowed)
for (i = 0; i < xf86NumDefaultModes; i++)
{
DisplayModePtr defMode = &xf86DefaultModes[i];
const DisplayModeRec *defMode = &xf86DefaultModes[i];
if (!interlaceAllowed && (defMode->Flags & V_INTERLACE))
continue;
......
......@@ -40,22 +40,23 @@
#include "xf86Rename.h"
#endif
double xf86ModeHSync(DisplayModePtr mode);
double xf86ModeVRefresh(DisplayModePtr mode);
double xf86ModeHSync(const DisplayModeRec *mode);
double xf86ModeVRefresh(const DisplayModeRec *mode);
unsigned int xf86ModeBandwidth(DisplayModePtr mode, int depth);
int
xf86ModeWidth (DisplayModePtr mode, Rotation rotation);
xf86ModeWidth (const DisplayModeRec *mode, Rotation rotation);
int
xf86ModeHeight (DisplayModePtr mode, Rotation rotation);
xf86ModeHeight (const DisplayModeRec *mode, Rotation rotation);
DisplayModePtr xf86DuplicateMode(DisplayModePtr pMode);
DisplayModePtr xf86DuplicateMode(const DisplayModeRec *pMode);
DisplayModePtr xf86DuplicateModes(ScrnInfoPtr pScrn,
DisplayModePtr modeList);
void xf86SetModeDefaultName(DisplayModePtr mode);
void xf86SetModeCrtc(DisplayModePtr p, int adjustFlags);
Bool xf86ModesEqual(DisplayModePtr pMode1, DisplayModePtr pMode2);
Bool xf86ModesEqual(const DisplayModeRec *pMode1,
const DisplayModeRec *pMode2);
void xf86PrintModeline(int scrnIndex,DisplayModePtr mode);
DisplayModePtr xf86ModesAdd(DisplayModePtr modes, DisplayModePtr new);
......@@ -65,7 +66,7 @@ DisplayModePtr xf86CVTMode(int HDisplay, int VDisplay, float VRefresh,
DisplayModePtr xf86GTFMode(int h_pixels, int v_lines, float freq, int interlaced, int margins);
Bool
xf86ModeIsReduced(DisplayModePtr mode);
xf86ModeIsReduced(const DisplayModeRec *mode);
void
xf86ValidateModesFlags(ScrnInfoPtr pScrn, DisplayModePtr modeList,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment