glide2x, h3, linhwc.c: fix a strict aliasing issue (same as in sst96.)

also make some stuff static.
This commit is contained in:
sezero
2018-08-20 19:56:02 +03:00
parent c8f2b9f621
commit 8ee1de4bcf

View File

@@ -103,7 +103,7 @@ static int screenNum = 0;
static int screenWidth = 0;
static int screenHeight= 0;
static int screenDepth = 0;
static void* screenPhys = 0;
static void* screenPhys = 0;/* not really used */
static int screenMem = 0;
static XF86VidModeModeInfo **vidModes = 0;
static int inDGA = 0;
@@ -124,7 +124,7 @@ typedef struct envitem_t {
static envitem *first=0;
static int envinit=0;
static void loadEnvFile() {
static void loadEnvFile(void) {
FILE *file;
char data[128];
char *env, *val;
@@ -162,7 +162,8 @@ static void loadEnvFile() {
}
}
static void deleteEnvData() {
#if 0 /* not used */
static void deleteEnvData(void) {
envitem *ptr, *next;
ptr=first;
@@ -176,9 +177,10 @@ static void deleteEnvData() {
first=0;
envinit=0;
}
#endif
const char *
hwcGetErrorString()
hwcGetErrorString(void)
{
#define FN_NAME "hwcGetErrorString"
return errorString;
@@ -188,6 +190,7 @@ hwcGetErrorString()
static int initX(int index) {
int eventbase, errorbase, flags;
int banksize;
unsigned int baseaddr;
if (dpy!=0) return FXTRUE;
dpy=XOpenDisplay("");
@@ -205,8 +208,9 @@ static int initX(int index) {
}
}
screenNum=DefaultScreen(dpy);
XF86DGAGetVideoLL(dpy, screenNum, (int*)&screenPhys, &screenWidth, &banksize,
XF86DGAGetVideoLL(dpy, screenNum, &baseaddr, &screenWidth, &banksize,
&screenMem);
screenPhys = (void *)baseaddr;
screenMem*=1024;
screenHeight=DisplayHeight(dpy, screenNum);
screenDepth=DefaultDepth(dpy, screenNum);
@@ -678,7 +682,6 @@ hwcInitVideoOverlaySurface(
HWC_IO_LOAD((*rInfo), vidDesktopOverlayStride, doStride);
doStride &= ~(SST_OVERLAY_LINEAR_STRIDE | SST_OVERLAY_TILE_STRIDE);
/* Overlay Hack: leave the stride alone for the hack */
if (!GETENV ("SSTH3_DESKTOP_OVERLAY"))
{
@@ -919,7 +922,7 @@ hwcInitVideo(hwcBoardInfo *bInfo, FxBool tiled, FxVideoTimingInfo
return FXTRUE;
}
void repaintX() {
static void repaintX(void) {
XSetWindowAttributes xswa;
unsigned long mask=0;
Visual visual;
@@ -1005,7 +1008,6 @@ calcBufferHeightInTiles(FxU32 yres)
FxU32
heightInTiles; /* Height of buffer in tiles */
/* Calculate tile height stuff */
heightInTiles = yres >> 5;
@@ -1203,7 +1205,6 @@ hwcGammaRGB(hwcBoardInfo *bInfo, float gammaR, float gammaG, float gammaB)
gbRamp[i] = (FxU32)((pow(i/255.0F, 1.0F/gammaB)) * 255.0F + 0.5F);
}
hwcGammaTable(bInfo, 256, grRamp, ggRamp, gbRamp);
/*