mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
Fixed Clang warnings.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user