Fixed Clang warnings.

This commit is contained in:
Mathew Sutcliffe
2014-11-16 21:36:35 +00:00
parent 9b06bb1a1e
commit 2cda546ceb
5 changed files with 29 additions and 19 deletions

View File

@@ -34,12 +34,12 @@
inline void BMP_EndianFlipInt(int * x) { int t = Endian32_Swap(*x); *x = t; }
inline void BMP_EndianFlipShort(short * x) { short t = Endian16_Swap(*x); *x = t; }
#else
#define BMP_EndianFlipInt(x) (x)
#define BMP_EndianFlipShort(x) (x)
#define BMP_EndianFlipInt(x)
#define BMP_EndianFlipShort(x)
#endif
#else
#define BMP_EndianFlipInt(x) (x)
#define BMP_EndianFlipShort(x) (x)
#define BMP_EndianFlipInt(x)
#define BMP_EndianFlipShort(x)
#endif
#if BITMAP_USE_JPEG

View File

@@ -151,6 +151,7 @@ bool OGL_UtilsInit()
firstTime = false;
}
#if IBM
// Make sure everything got initialized
if(glBindBufferARB &&
glActiveTextureARB &&
@@ -162,5 +163,8 @@ bool OGL_UtilsInit()
}
else
return false;
#else
return true;
#endif
}

View File

@@ -48,8 +48,8 @@ bool XObjRead(const char * inFile, XObj& outObj)
vec_tex vst;
vec_rgb vrgb;
float scanned_st_rgb[4][3]={0,0,0 , 0,0,0,// [corner][color or st]
0,0,0 , 0,0,0};
float scanned_st_rgb[4][3]={{0,0,0} , {0,0,0},// [corner][color or st]
{0,0,0} , {0,0,0}};
outObj.cmds.clear();

View File

@@ -182,6 +182,7 @@ char * fgets_multiplatform(char * s, int n, FILE * file)
// Only bother to read if we have enough space in the char buf.
if (n)
{
do
{
c = getc(file);
@@ -204,19 +205,20 @@ char * fgets_multiplatform(char * s, int n, FILE * file)
// Note that the \r\n IS written to the line.
while (c != '\n' && c != '\r' && --n);
// Ben's special code: eat a \n if it follows a \r, etc. Mac stdio
// swizzles these guys a bit, so we will consolidate BOTH \r\n and \n\r into
// just the first.
if (c == '\r')
{
c1 = getc(file);
if (c1 != '\n') ungetc(c1, file);
}
if (c == '\n')
{
c1 = getc(file);
if (c1 != '\r') ungetc(c1, file);
}
// Ben's special code: eat a \n if it follows a \r, etc. Mac stdio
// swizzles these guys a bit, so we will consolidate BOTH \r\n and \n\r into
// just the first.
if (c == '\r')
{
c1 = getc(file);
if (c1 != '\n') ungetc(c1, file);
}
if (c == '\n')
{
c1 = getc(file);
if (c1 != '\r') ungetc(c1, file);
}
}
// Unless we're bailing with NULL, we MUST null terminate.
*p = 0;

View File

@@ -551,7 +551,9 @@ void OBJ_PlotModel(int model, int texID, int litTexID, float inDistance, double
GLint xpBuffer;
// See if the card even has VBO. If it does, save xplane's pointer
// and bind to 0 for us.
#if IBM
if(glBindBufferARB)
#endif
{
glGetIntegerv(GL_ARRAY_BUFFER_BINDING_ARB, &xpBuffer);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
@@ -595,7 +597,9 @@ void OBJ_PlotModel(int model, int texID, int litTexID, float inDistance, double
glPopClientAttrib();
// If we bound before, we need to put xplane back where it was
#if IBM
if(glBindBufferARB)
#endif
glBindBufferARB(GL_ARRAY_BUFFER_ARB, xpBuffer);
sObjects[model].lods[lodIdx].triangleList.clear();