Fix some GCC warnings

Former-commit-id: 31c8460b4656c29ac165d7aa28f335851f2565df
This commit is contained in:
Lynix
2016-05-25 13:52:10 +02:00
parent 840b03691a
commit 8a3339badf
19 changed files with 113 additions and 54 deletions

View File

@@ -385,7 +385,7 @@ namespace Nz
}
/*!
* \brief Sets the position of the cursor
* \brief Sets the position of the cursor
* \return true if cursor is successfully positioned
*
* \param pos Position of the cursor
@@ -404,7 +404,7 @@ namespace Nz
}
/*!
* \brief Sets the position of the cursor
* \brief Sets the position of the cursor
* \return true if cursor is successfully positioned
*
* \param offset Offset according to the cursor begin position
@@ -906,5 +906,5 @@ namespace Nz
}
return true;
};
}
}

View File

@@ -94,6 +94,7 @@ namespace Nz
break;
}
case ParameterType_Color:
case ParameterType_Float:
case ParameterType_None:
case ParameterType_Pointer:
@@ -198,6 +199,7 @@ namespace Nz
}
case ParameterType_Boolean:
case ParameterType_Color:
case ParameterType_None:
case ParameterType_Pointer:
case ParameterType_Userdata:
@@ -207,7 +209,7 @@ namespace Nz
NazaraError("Parameter value is not representable as a float");
return false;
}
/*!
* \brief Gets a parameter as an integer
* \return true if the parameter could be represented as an integer
@@ -263,6 +265,7 @@ namespace Nz
break;
}
case ParameterType_Color:
case ParameterType_None:
case ParameterType_Pointer:
case ParameterType_Userdata:
@@ -331,6 +334,7 @@ namespace Nz
return true;
case ParameterType_Boolean:
case ParameterType_Color:
case ParameterType_Float:
case ParameterType_Integer:
case ParameterType_None:
@@ -411,7 +415,7 @@ namespace Nz
NazaraInternalError("Parameter value is not valid");
return false;
}
/*!
* \brief Gets a parameter as an userdata
* \return true if the parameter could be represented as a userdata
@@ -584,7 +588,7 @@ namespace Nz
parameter.type = ParameterType_Integer;
parameter.value.intVal = value;
}
/*!
* \brief Sets a pointer parameter named `name`
*
@@ -593,7 +597,7 @@ namespace Nz
* \param name Name of the parameter
* \param value The pointer value
*
* \remark This sets a raw pointer, this class takes no responsibility toward it,
* \remark This sets a raw pointer, this class takes no responsibility toward it,
if you wish to destroy the pointed variable along with the parameter list, you should set a userdata
*/
void ParameterList::SetParameter(const String& name, void* value)
@@ -639,6 +643,7 @@ namespace Nz
switch (it->second.type)
{
case ParameterType_Boolean:
case ParameterType_Color:
case ParameterType_Float:
case ParameterType_Integer:
case ParameterType_Pointer:

View File

@@ -524,9 +524,9 @@ namespace Nz
Vector3f viewerPos = viewer->GetEyePosition();
Vector3f viewerNormal = viewer->GetForward();
for (auto& pair : layers)
for (auto& layerPair : layers)
{
Layer& layer = pair.second;
Layer& layer = layerPair.second;
std::sort(layer.transparentModels.begin(), layer.transparentModels.end(), [&layer, &nearPlane, &viewerNormal] (unsigned int index1, unsigned int index2)
{
@@ -562,7 +562,7 @@ namespace Nz
auto it = layers.find(i);
if (it == layers.end())
it = layers.insert(std::make_pair(i, Layer())).first;
Layer& layer = it->second;
layer.clearCount = 0;

View File

@@ -57,11 +57,14 @@ namespace Nz
case PixelFormatContent_Stencil:
return AttachmentPoint_Stencil;
case PixelFormatContent_Undefined:
break;
}
NazaraInternalError("Unexpected pixel format content: 0x" + String::Number(info.content, 16));
return AttachmentPoint_Max;
};
}
GLuint lockedPrevious = 0;
UInt8 lockedLevel = 0;

View File

@@ -105,9 +105,9 @@ namespace Nz
for (unsigned int i = 0; i < recursionLevel; ++i)
{
std::size_t triangleCount = triangles.size();
for (std::size_t i = 0; i < triangleCount; ++i)
for (std::size_t j = 0; j < triangleCount; ++j)
{
Vector3ui& triangle = triangles[i];
Vector3ui& triangle = triangles[j];
unsigned int a = GetMiddleVertex(triangle.x, triangle.y);
unsigned int b = GetMiddleVertex(triangle.y, triangle.z);