Skip to content

Commit

Permalink
Fixed most of clang warnings.
Browse files Browse the repository at this point in the history
This fixes all non dynarec warnings reported by clang.

git-svn-id: https://yabause.svn.sourceforge.net/svnroot/yabause/trunk@2938 d7be59e3-070e-4b9a-85a1-4646befae34d
  • Loading branch information
Guillaumito committed Sep 4, 2012
1 parent 7834cda commit 2d53568
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 12 deletions.
2 changes: 2 additions & 0 deletions yabause/src/osdcore.c
Expand Up @@ -84,6 +84,8 @@ int OSDChangeCore(int coreid)
{
OSDDeInit();
OSDInit(coreid);

return 0;
}

void OSDPushMessage(int msgtype, int ttl, const char * format, ...)
Expand Down
2 changes: 1 addition & 1 deletion yabause/src/sh2int.c
Expand Up @@ -1053,7 +1053,7 @@ static void FASTCALL SH2macl(SH2_struct * sh)
sh->regs.R[m] += 4;

if ((s32) (tempn^tempm) < 0)
fnLmL =- 1;
fnLmL = -1;
else
fnLmL = 0;
if (tempn < 0)
Expand Down
2 changes: 1 addition & 1 deletion yabause/src/smpc.c
Expand Up @@ -432,7 +432,7 @@ static void SmpcINTBACK(void) {

//we think rayman sets 0x40 so that it breaks the intback command immediately when it blocks,
//rather than having to set 0x40 in response to an interrupt
if (SmpcInternalVars->intbackIreg0 = (SmpcRegs->IREG[0] & 1)) {
if ((SmpcInternalVars->intbackIreg0 = (SmpcRegs->IREG[0] & 1))) {
// Return non-peripheral data
SmpcInternalVars->firstPeri = 1;
SmpcInternalVars->intback = (SmpcRegs->IREG[1] & 0x8) >> 3; // does the program want peripheral data too?
Expand Down
12 changes: 6 additions & 6 deletions yabause/src/vidogl.c
Expand Up @@ -263,14 +263,14 @@ static void FASTCALL Vdp1ReadTexture(vdp1cmd_struct *cmd, YglSprite *sprite, Ygl

// Pixel 1
if (((dot >> 4) == 0) && !SPD) *texture->textdata++ = 0x00;
else if( (dot >> 4) == 0x0F &!END ) *texture->textdata++ = 0x00;
else if( ((dot >> 4) == 0x0F) && !END ) *texture->textdata++ = 0x00;
else if( MSB ) *texture->textdata++ = (alpha<<24);
else *texture->textdata++ = Vdp2ColorRamGetColor(((dot >> 4) | colorBank) + colorOffset, alpha);
j += 1;

// Pixel 2
if (((dot & 0xF) == 0) && !SPD) *texture->textdata++ = 0x00;
else if( (dot & 0xF) == 0x0F &!END ) *texture->textdata++ = 0x00;
else if( ((dot & 0xF) == 0x0F) && !END ) *texture->textdata++ = 0x00;
else if( MSB ) *texture->textdata++ = (alpha<<24);
else *texture->textdata++ = Vdp2ColorRamGetColor(((dot & 0xF) | colorBank) + colorOffset, alpha);
j += 1;
Expand Down Expand Up @@ -453,7 +453,7 @@ static void FASTCALL Vdp1ReadTexture(vdp1cmd_struct *cmd, YglSprite *sprite, Ygl
charAddr++;

if ((dot == 0) && !SPD) *texture->textdata++ = 0x00;
else if( dot==0xFF&!END ) *texture->textdata++ = 0x00;
else if( (dot == 0xFF) && !END ) *texture->textdata++ = 0x00;
else if( MSB ) *texture->textdata++ = (alpha<<24);
else *texture->textdata++ = Vdp2ColorRamGetColor((dot | colorBank) + colorOffset, alpha);
}
Expand All @@ -476,7 +476,7 @@ static void FASTCALL Vdp1ReadTexture(vdp1cmd_struct *cmd, YglSprite *sprite, Ygl
charAddr++;

if ((dot == 0) && !SPD) *texture->textdata++ = 0x00;
else if( dot == 0xFF & !END ) *texture->textdata++ = 0x00;
else if( (dot == 0xFF) && !END ) *texture->textdata++ = 0x00;
else if( MSB ) *texture->textdata++ = (alpha<<24);
else *texture->textdata++ = Vdp2ColorRamGetColor((dot | colorBank) + colorOffset, alpha);
}
Expand All @@ -499,7 +499,7 @@ static void FASTCALL Vdp1ReadTexture(vdp1cmd_struct *cmd, YglSprite *sprite, Ygl
charAddr++;

if ((dot == 0) && !SPD) *texture->textdata++ = 0x00;
else if( dot == 0xFF & !END ) *texture->textdata++ = 0x0;
else if( (dot == 0xFF) && !END ) *texture->textdata++ = 0x0;
else if( MSB ) *texture->textdata++ = (alpha<<24);
else *texture->textdata++ = Vdp2ColorRamGetColor((dot | colorBank) + colorOffset, alpha);
}
Expand All @@ -520,7 +520,7 @@ static void FASTCALL Vdp1ReadTexture(vdp1cmd_struct *cmd, YglSprite *sprite, Ygl

//if (!(dot & 0x8000) && (Vdp2Regs->SPCTL & 0x20)) printf("mixed mode\n");
if (!(dot & 0x8000) && !SPD) *texture->textdata++ = 0x00;
else if( dot == 0x7FFF & !END ) *texture->textdata++ = 0x0;
else if( (dot == 0x7FFF) && !END ) *texture->textdata++ = 0x0;
else if( MSB ) *texture->textdata++ = (alpha<<24);
else *texture->textdata++ = SAT2YAB1(alpha, dot);
}
Expand Down
2 changes: 1 addition & 1 deletion yabause/src/vidsoft.c
Expand Up @@ -623,7 +623,7 @@ static u8 FASTCALL GetAlpha(vdp2draw_struct * info, u32 color)
if (((info->specialcolormode == 1) || (info->specialcolormode == 2)) && ((info->specialcolorfunction & 1) == 0)) {
/* special color calculation mode 1 and 2 enables color calculation only when special color function = 1 */
return 0x3F;
} else if ((info->specialcolormode == 2)) {
} else if (info->specialcolormode == 2) {
/* special color calculation 2 enables color calculation according to lower bits of the color */
if ((info->specialcode & (1 << ((color & 0xF) >> 1))) == 0) {
return 0x3F;
Expand Down
6 changes: 3 additions & 3 deletions yabause/src/ygl.c
Expand Up @@ -140,7 +140,7 @@ GLchar s_msg_no_opengl2[]="Your GPU driver does not support OpenGL 2.0.\nOpenGL
void STDCALL glGetShaderivdmy(GLuint shader,GLenum pname,GLint * params)
{
if( pname == GL_COMPILE_STATUS ) *params = GL_FALSE;
if( pname == GL_INFO_LOG_LENGTH ) *params = strlen(s_msg_no_opengl2)+1;
if( pname == GL_INFO_LOG_LENGTH ) *params = strlen((const char *) s_msg_no_opengl2)+1;
return;
}
void STDCALL glGetShaderInfoLogdmy(GLuint a,GLsizei b,GLsizei *c,GLchar *d)
Expand All @@ -161,7 +161,7 @@ GLAPI GLboolean APIENTRY glIsFramebufferdmy (GLuint framebuffer){return GL_FALSE
GLAPI void APIENTRY glBindFramebufferdmy (GLenum target, GLuint framebuffer){}
GLAPI void APIENTRY glDeleteFramebuffersdmy (GLsizei n, const GLuint *framebuffers){}
GLAPI void APIENTRY glGenFramebuffersdmy (GLsizei n, GLuint *framebuffers){}
GLAPI GLenum APIENTRY glCheckFramebufferStatusdmy (GLenum target){}
GLAPI GLenum APIENTRY glCheckFramebufferStatusdmy (GLenum target){return 0;}
GLAPI void APIENTRY glFramebufferTexture1Ddmy (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level){}
GLAPI void APIENTRY glFramebufferTexture2Ddmy (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level){}
GLAPI void APIENTRY glFramebufferTexture3Ddmy (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset){}
Expand Down Expand Up @@ -611,7 +611,7 @@ int YglInit(int width, int height, unsigned int depth) {
glCreateProgram = (GLuint (STDCALL *)(void)) yglGetProcAddress("glCreateProgram");
if( glCreateProgram == NULL )
{
YuiErrorMsg(s_msg_no_opengl2);
YuiErrorMsg((const char *) s_msg_no_opengl2);
glCreateProgram = glCreateProgramdmy;
}
glCreateShader = (GLuint (STDCALL *)(GLenum))yglGetProcAddress("glCreateShader");
Expand Down
3 changes: 3 additions & 0 deletions yabause/src/ygl.h
Expand Up @@ -188,6 +188,9 @@ int Ygl_uniformVDP2DrawFramebuffer( float from, float to , float * offsetcol );

void YglNeedToUpdateWindow();

int YglProgramInit();
int YglProgramChange( YglLevel * level, int prgid );

#if 1 // Does anything need this? It breaks a bunch of prototypes if
// GLchar is typedef'd instead of #define'd --AC
#ifndef GLchar
Expand Down
2 changes: 2 additions & 0 deletions yabause/src/yglshader.c
Expand Up @@ -414,6 +414,8 @@ int Ygl_uniformVDP2DrawFramebuffer( float from, float to , float * offsetcol )
glUniform1f(idfrom,from);
glUniform1f(idto,to);
glUniform4f(idcoloroffset,offsetcol[0],offsetcol[1],offsetcol[2],offsetcol[3]);

return 0;
}


Expand Down

0 comments on commit 2d53568

Please sign in to comment.