Merge pull request #4515 from ricardoquesada/more_warning_fixes

More warning fixes
This commit is contained in:
Ricardo Quesada 2013-12-17 14:34:29 -08:00
commit 9f10054a99
4 changed files with 11 additions and 12 deletions

View File

@ -23,7 +23,7 @@ QuadCommand::QuadCommand()
_quad = nullptr; _quad = nullptr;
} }
void QuadCommand::init(int viewport, int32_t depth, GLuint textureID, GLProgram* shader, BlendFunc blendType, V3F_C4B_T2F_Quad* quad, int quadCount, const kmMat4 &mv) void QuadCommand::init(int viewport, int32_t depth, GLuint textureID, GLProgram* shader, BlendFunc blendType, V3F_C4B_T2F_Quad* quad, ssize_t quadCount, const kmMat4 &mv)
{ {
_viewport = viewport; _viewport = viewport;
_depth = depth; _depth = depth;

View File

@ -23,7 +23,7 @@ public:
~QuadCommand(); ~QuadCommand();
public: public:
void init(int viewport, int32_t depth, GLuint texutreID, GLProgram* shader, BlendFunc blendType, V3F_C4B_T2F_Quad* quad, int quadCount, void init(int viewport, int32_t depth, GLuint texutreID, GLProgram* shader, BlendFunc blendType, V3F_C4B_T2F_Quad* quad, ssize_t quadCount,
const kmMat4& mv); const kmMat4& mv);
// +----------+----------+-----+-----------------------------------+ // +----------+----------+-----+-----------------------------------+
@ -44,7 +44,7 @@ public:
inline V3F_C4B_T2F_Quad* getQuad() { return _quad; } inline V3F_C4B_T2F_Quad* getQuad() { return _quad; }
inline int getQuadCount() { return _quadCount; } inline ssize_t getQuadCount() { return _quadCount; }
inline GLProgram* getShader() { return _shader; } inline GLProgram* getShader() { return _shader; }
@ -70,8 +70,8 @@ protected:
BlendFunc _blendType; BlendFunc _blendType;
V3F_C4B_T2F_Quad* _quad; V3F_C4B_T2F_Quad* _quad;
int _quadCount; ssize_t _quadCount;
int _capacity; ssize_t _capacity;
public: public:
friend class RenderCommandPool<QuadCommand>; friend class RenderCommandPool<QuadCommand>;

View File

@ -73,7 +73,7 @@ bool ActionObject::getLoop()
void ActionObject::setUnitTime(float fTime) void ActionObject::setUnitTime(float fTime)
{ {
_fUnitTime = fTime; _fUnitTime = fTime;
int nodeNum = _actionNodeList->count(); auto nodeNum = _actionNodeList->count();
for ( int i = 0; i < nodeNum; i++ ) for ( int i = 0; i < nodeNum; i++ )
{ {
ActionNode* actionNode = (ActionNode*)_actionNodeList->getObjectAtIndex(i); ActionNode* actionNode = (ActionNode*)_actionNodeList->getObjectAtIndex(i);
@ -139,7 +139,7 @@ void ActionObject::play()
{ {
stop(); stop();
this->updateToFrameByTime(0.0f); this->updateToFrameByTime(0.0f);
int frameNum = _actionNodeList->count(); auto frameNum = _actionNodeList->count();
for ( int i = 0; i < frameNum; i++ ) for ( int i = 0; i < frameNum; i++ )
{ {
ActionNode* actionNode = (ActionNode*)_actionNodeList->getObjectAtIndex(i); ActionNode* actionNode = (ActionNode*)_actionNodeList->getObjectAtIndex(i);
@ -158,7 +158,7 @@ void ActionObject::pause()
void ActionObject::stop() void ActionObject::stop()
{ {
int frameNum = _actionNodeList->count(); auto frameNum = _actionNodeList->count();
for ( int i = 0; i < frameNum; i++ ) for ( int i = 0; i < frameNum; i++ )
{ {
@ -174,7 +174,7 @@ void ActionObject::updateToFrameByTime(float fTime)
{ {
_currentTime = fTime; _currentTime = fTime;
int nodeNum = _actionNodeList->count(); auto nodeNum = _actionNodeList->count();
for ( int i = 0; i < nodeNum; i++ ) for ( int i = 0; i < nodeNum; i++ )
{ {
@ -189,7 +189,7 @@ void ActionObject::simulationActionUpdate(float dt)
if (_loop) if (_loop)
{ {
bool isEnd = true; bool isEnd = true;
int nodeNum = _actionNodeList->count(); auto nodeNum = _actionNodeList->count();
for ( int i = 0; i < nodeNum; i++ ) for ( int i = 0; i < nodeNum; i++ )
{ {

View File

@ -73,7 +73,6 @@ void _SkeletonJson_setError (SkeletonJson* self, Json* root, const char* value1,
static float toColor (const char* value, int index) { static float toColor (const char* value, int index) {
char digits[3]; char digits[3];
char *error; char *error;
int color;
if (strlen(value) != 8) return -1; if (strlen(value) != 8) return -1;
value += index * 2; value += index * 2;
@ -81,7 +80,7 @@ static float toColor (const char* value, int index) {
digits[0] = *value; digits[0] = *value;
digits[1] = *(value + 1); digits[1] = *(value + 1);
digits[2] = '\0'; digits[2] = '\0';
color = strtoul(digits, &error, 16); auto color = strtoul(digits, &error, 16);
if (*error != 0) return -1; if (*error != 0) return -1;
return color / (float)255; return color / (float)255;
} }