Skip to content

Commit

Permalink
gpu-gles: fix wrong long usage
Browse files Browse the repository at this point in the history
No idea if there is any point touching this code but the warnings were
annoying.
  • Loading branch information
notaz committed Jul 8, 2023
1 parent 679d5ee commit 5fa6cb1
Show file tree
Hide file tree
Showing 8 changed files with 263 additions and 262 deletions.
6 changes: 3 additions & 3 deletions plugins/gpu-gles/gpuDraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ BOOL bCheckMask=FALSE;
int iUseMask=0;
int iSetMask=0;
unsigned short sSetMask=0;
unsigned long lSetMask=0;
unsigned int lSetMask=0;

// drawing/coord vars

Expand Down Expand Up @@ -921,14 +921,14 @@ void offsetST(void)

/////////////////////////////////////////////////////////

void offsetScreenUpload(long Position)
void offsetScreenUpload(int Position)
{
if(bDisplayNotSet)
SetOGLDisplaySettings(1);

if(Position==-1)
{
long lmdx,lmdy;
int lmdx,lmdy;

lmdx=xrUploadArea.x0;
lmdy=xrUploadArea.y0;
Expand Down
2 changes: 1 addition & 1 deletion plugins/gpu-gles/gpuDraw.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ unsigned short offsetline(void);
#endif
void offsetST(void);
void offsetBlk(void);
void offsetScreenUpload(long Position);
void offsetScreenUpload(int Position);
void assignTexture3(void);
void assignTexture4(void);
void assignTextureSprite(void);
Expand Down
80 changes: 40 additions & 40 deletions plugins/gpu-gles/gpuExternals.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ extern void ( APIENTRY * glPixelStorei )(GLenum pname, GLint param);
#define bool unsigned short
#endif
#define LOWORD(l) ((unsigned short)(l))
#define HIWORD(l) ((unsigned short)(((unsigned long)(l) >> 16) & 0xFFFF))
#define HIWORD(l) ((unsigned short)(((unsigned int)(l) >> 16) & 0xFFFF))
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
#define DWORD unsigned long
#define DWORD unsigned int

typedef struct RECTTAG
{
Expand All @@ -173,8 +173,8 @@ typedef struct VRAMLOADTAG

typedef struct PSXPOINTTAG
{
long x;
long y;
int x;
int y;
} PSXPoint_t;

typedef struct PSXSPOINTTAG
Expand Down Expand Up @@ -211,19 +211,19 @@ typedef struct PSXDISPLAYTAG
PSXPoint_t DisplayPosition;
PSXPoint_t DisplayEnd;

long Double;
long Height;
long PAL;
long InterlacedNew;
long Interlaced;
long InterlacedTest;
long RGB24New;
long RGB24;
int Double;
int Height;
int PAL;
int InterlacedNew;
int Interlaced;
int InterlacedTest;
int RGB24New;
int RGB24;
PSXSPoint_t DrawOffset;
PSXRect_t DrawArea;
PSXPoint_t GDrawOffset;
PSXPoint_t CumulOffset;
long Disabled;
int Disabled;
PSXRect_t Range;
} PSXDisplay_t;

Expand All @@ -242,7 +242,7 @@ typedef struct OGLVertexTag
COLTAG
{
unsigned char col[4];
unsigned long lcol;
unsigned int lcol;
} c;

} OGLVertex;
Expand All @@ -256,7 +256,7 @@ typedef union EXShortTag
typedef union EXLongTag
{
unsigned char c[4];
unsigned long l;
unsigned int l;
EXShort s[2];
} EXLong;

Expand Down Expand Up @@ -299,7 +299,7 @@ extern int iSetMask;
extern int iDepthFunc;
extern BOOL bCheckMask;
extern unsigned short sSetMask;
extern unsigned long lSetMask;
extern unsigned int lSetMask;
extern BOOL bSetClip;
extern GLuint gTexScanName;

Expand All @@ -309,8 +309,8 @@ extern GLuint gTexScanName;

#ifndef _IN_SOFT

extern long GlobalTextAddrX,GlobalTextAddrY,GlobalTextTP;
extern long GlobalTextREST,GlobalTextABR,GlobalTextPAGE;
extern int GlobalTextAddrX,GlobalTextAddrY,GlobalTextTP;
extern int GlobalTextREST,GlobalTextABR,GlobalTextPAGE;
extern short ly0,lx0,ly1,lx1,ly2,lx2,ly3,lx3;
extern short g_m1;
extern short g_m2;
Expand Down Expand Up @@ -347,22 +347,22 @@ extern GLubyte ubGloAlpha;
extern short sSprite_ux2;
extern short sSprite_vy2;
extern BOOL bRenderFrontBuffer;
extern unsigned long ulOLDCOL;
extern unsigned long ulClutID;
extern unsigned int ulOLDCOL;
extern unsigned int ulClutID;
extern void (*primTableJ[256])(unsigned char *);
extern void (*primTableSkip[256])(unsigned char *);
extern unsigned short usMirror;
extern unsigned long dwCfgFixes;
extern unsigned long dwActFixes;
extern unsigned long dwEmuFixes;
extern unsigned int dwCfgFixes;
extern unsigned int dwActFixes;
extern unsigned int dwEmuFixes;
extern BOOL bUseFixes;
extern int iSpriteTex;
extern int iDrawnSomething;

extern long drawX;
extern long drawY;
extern long drawW;
extern long drawH;
extern int drawX;
extern int drawY;
extern int drawW;
extern int drawH;
extern short sxmin;
extern short sxmax;
extern short symin;
Expand All @@ -383,10 +383,10 @@ extern GLint giWantedRGBA;
extern GLint giWantedFMT;
extern GLint giWantedTYPE;
extern void (*LoadSubTexFn) (int,int,short,short);
extern long GlobalTexturePage;
extern unsigned long (*TCF[]) (unsigned long);
extern int GlobalTexturePage;
extern unsigned int (*TCF[]) (unsigned int );
extern unsigned short (*PTCF[]) (unsigned short);
extern unsigned long (*PalTexturedColourFn) (unsigned long);
extern unsigned int (*PalTexturedColourFn) (unsigned int);
extern BOOL bUseFastMdec;
extern BOOL bUse15bitMdec;
extern int iFrameTexType;
Expand Down Expand Up @@ -420,32 +420,32 @@ extern char szDispBuf[];
extern char szGPUKeys[];
extern PSXDisplay_t PSXDisplay;
extern PSXDisplay_t PreviousPSXDisplay;
//extern unsigned long ulKeybits;
//extern unsigned int ulKeybits;
extern TWin_t TWin;
extern BOOL bDisplayNotSet;
extern long lGPUstatusRet;
extern int lGPUstatusRet;
extern short imageX0,imageX1;
extern short imageY0,imageY1;
extern long lClearOnSwap,lClearOnSwapColor;
extern int lClearOnSwap,lClearOnSwapColor;
extern unsigned char * psxVub;
extern char * psxVsb;
extern unsigned short * psxVuw;
extern signed short * psxVsw;
extern unsigned long * psxVul;
extern signed long * psxVsl;
extern unsigned int * psxVul;
extern signed int * psxVsl;
extern GLfloat gl_z;
extern BOOL bNeedRGB24Update;
extern BOOL bChangeWinMode;
extern GLuint uiScanLine;
extern int iUseScanLines;
extern long lSelectedSlot;
extern int lSelectedSlot;
extern int iScanBlend;
extern BOOL bInitCap;
extern int iBlurBuffer;
extern int iLastRGB24;
extern int iRenderFVR;
extern int iNoScreenSaver;
extern unsigned long ulGPUInfoVals[];
extern unsigned int ulGPUInfoVals[];
extern BOOL bNeedInterlaceUpdate;
extern BOOL bNeedWriteUpload;
extern BOOL bSkipNextFrame;
Expand All @@ -461,7 +461,7 @@ extern int bFullScreen;

#ifndef _IN_MENU

//extern unsigned long dwCoreFlags;
//extern unsigned int dwCoreFlags;
extern GLuint gTexPicName;
//extern PSXPoint_t ptCursorPoint[];
//extern unsigned short usCursorActive;
Expand Down Expand Up @@ -539,15 +539,15 @@ typedef struct {

#ifndef _IN_KEY

//extern unsigned long ulKeybits;
//extern unsigned int ulKeybits;

#endif

//-----------------------------------------------------//

#ifndef _IN_ZN

extern unsigned long dwGPUVersion;
extern unsigned int dwGPUVersion;
extern int iGPUHeight;
extern int iGPUHeightMask;
extern int GlobalTextIL;
Expand Down
Loading

0 comments on commit 5fa6cb1

Please sign in to comment.