mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 16:55:36 +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_EndianFlipInt(int * x) { int t = Endian32_Swap(*x); *x = t; }
|
||||||
inline void BMP_EndianFlipShort(short * x) { short t = Endian16_Swap(*x); *x = t; }
|
inline void BMP_EndianFlipShort(short * x) { short t = Endian16_Swap(*x); *x = t; }
|
||||||
#else
|
#else
|
||||||
#define BMP_EndianFlipInt(x) (x)
|
#define BMP_EndianFlipInt(x)
|
||||||
#define BMP_EndianFlipShort(x) (x)
|
#define BMP_EndianFlipShort(x)
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#define BMP_EndianFlipInt(x) (x)
|
#define BMP_EndianFlipInt(x)
|
||||||
#define BMP_EndianFlipShort(x) (x)
|
#define BMP_EndianFlipShort(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if BITMAP_USE_JPEG
|
#if BITMAP_USE_JPEG
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ bool OGL_UtilsInit()
|
|||||||
firstTime = false;
|
firstTime = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IBM
|
||||||
// Make sure everything got initialized
|
// Make sure everything got initialized
|
||||||
if(glBindBufferARB &&
|
if(glBindBufferARB &&
|
||||||
glActiveTextureARB &&
|
glActiveTextureARB &&
|
||||||
@@ -162,5 +163,8 @@ bool OGL_UtilsInit()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
#else
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ bool XObjRead(const char * inFile, XObj& outObj)
|
|||||||
vec_tex vst;
|
vec_tex vst;
|
||||||
vec_rgb vrgb;
|
vec_rgb vrgb;
|
||||||
|
|
||||||
float scanned_st_rgb[4][3]={0,0,0 , 0,0,0,// [corner][color or st]
|
float scanned_st_rgb[4][3]={{0,0,0} , {0,0,0},// [corner][color or st]
|
||||||
0,0,0 , 0,0,0};
|
{0,0,0} , {0,0,0}};
|
||||||
|
|
||||||
outObj.cmds.clear();
|
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.
|
// Only bother to read if we have enough space in the char buf.
|
||||||
if (n)
|
if (n)
|
||||||
|
{
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
c = getc(file);
|
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.
|
// Note that the \r\n IS written to the line.
|
||||||
while (c != '\n' && c != '\r' && --n);
|
while (c != '\n' && c != '\r' && --n);
|
||||||
|
|
||||||
// Ben's special code: eat a \n if it follows a \r, etc. Mac stdio
|
// 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
|
// swizzles these guys a bit, so we will consolidate BOTH \r\n and \n\r into
|
||||||
// just the first.
|
// just the first.
|
||||||
if (c == '\r')
|
if (c == '\r')
|
||||||
{
|
{
|
||||||
c1 = getc(file);
|
c1 = getc(file);
|
||||||
if (c1 != '\n') ungetc(c1, file);
|
if (c1 != '\n') ungetc(c1, file);
|
||||||
}
|
}
|
||||||
if (c == '\n')
|
if (c == '\n')
|
||||||
{
|
{
|
||||||
c1 = getc(file);
|
c1 = getc(file);
|
||||||
if (c1 != '\r') ungetc(c1, file);
|
if (c1 != '\r') ungetc(c1, file);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Unless we're bailing with NULL, we MUST null terminate.
|
// Unless we're bailing with NULL, we MUST null terminate.
|
||||||
*p = 0;
|
*p = 0;
|
||||||
|
|||||||
@@ -551,7 +551,9 @@ void OBJ_PlotModel(int model, int texID, int litTexID, float inDistance, double
|
|||||||
GLint xpBuffer;
|
GLint xpBuffer;
|
||||||
// See if the card even has VBO. If it does, save xplane's pointer
|
// See if the card even has VBO. If it does, save xplane's pointer
|
||||||
// and bind to 0 for us.
|
// and bind to 0 for us.
|
||||||
|
#if IBM
|
||||||
if(glBindBufferARB)
|
if(glBindBufferARB)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
glGetIntegerv(GL_ARRAY_BUFFER_BINDING_ARB, &xpBuffer);
|
glGetIntegerv(GL_ARRAY_BUFFER_BINDING_ARB, &xpBuffer);
|
||||||
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
|
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
|
||||||
@@ -595,7 +597,9 @@ void OBJ_PlotModel(int model, int texID, int litTexID, float inDistance, double
|
|||||||
glPopClientAttrib();
|
glPopClientAttrib();
|
||||||
|
|
||||||
// If we bound before, we need to put xplane back where it was
|
// If we bound before, we need to put xplane back where it was
|
||||||
|
#if IBM
|
||||||
if(glBindBufferARB)
|
if(glBindBufferARB)
|
||||||
|
#endif
|
||||||
glBindBufferARB(GL_ARRAY_BUFFER_ARB, xpBuffer);
|
glBindBufferARB(GL_ARRAY_BUFFER_ARB, xpBuffer);
|
||||||
|
|
||||||
sObjects[model].lods[lodIdx].triangleList.clear();
|
sObjects[model].lods[lodIdx].triangleList.clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user