summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Lotterbach <timo.lotterbach@bmw-carit.de>2013-03-15 16:17:32 +0100
committerTimo Lotterbach <timo.lotterbach@bmw-carit.de>2013-03-18 09:56:55 +0100
commitdbd6d47caeb2ecdc181d5c637a103ae037ecf034 (patch)
tree78d697a256756bd44c2f57eafcebddbfa7b3ad08
parent41855e444a57f40ed26b3ef63bd3756b29c8e699 (diff)
downloadlayer_management-dbd6d47caeb2ecdc181d5c637a103ae037ecf034.tar.gz
LayerManagement: fixed several warnings raised by cppcheck
Signed-off-by: Timo Lotterbach <timo.lotterbach@bmw-carit.de>
-rw-r--r--LayerManagerClient/ilmControl/src/ilm_control.c46
-rw-r--r--LayerManagerControl/src/sceneio.cpp2
-rw-r--r--LayerManagerPlugins/Renderers/Graphic/src/GraphicSystems/GLESGraphicSystem.cpp12
-rw-r--r--LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/WaylandBaseWindowSystem.cpp4
-rw-r--r--LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/WaylandDrmWindowSystem.cpp2
-rw-r--r--LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp4
6 files changed, 36 insertions, 34 deletions
diff --git a/LayerManagerClient/ilmControl/src/ilm_control.c b/LayerManagerClient/ilmControl/src/ilm_control.c
index 4405a51..8bbc290 100644
--- a/LayerManagerClient/ilmControl/src/ilm_control.c
+++ b/LayerManagerClient/ilmControl/src/ilm_control.c
@@ -60,30 +60,32 @@ ilmErrorTypes ilm_getPropertiesOfScreen(t_ilm_display screenID, struct ilmScreen
{
ilmErrorTypes returnValue = ILM_FAILED;
- t_ilm_message response = 0;
- t_ilm_message command = gIpcModule.createMessage("GetPropertiesOfScreen");
- if (pScreenProperties
- && command
- && gIpcModule.appendUint(command, screenID)
- && sendAndWaitForResponse(command, &response, RESPONSE_TIMEOUT_IN_MS, &returnValue)
- && gIpcModule.getUintArray(response, &pScreenProperties->layerIds, (int*)(&pScreenProperties->layerCount))
- && gIpcModule.getUint(response, &pScreenProperties->harwareLayerCount)
- && gIpcModule.getUint(response, &pScreenProperties->screenWidth)
- && gIpcModule.getUint(response, &pScreenProperties->screenHeight))
+ if (pScreenProperties)
{
- returnValue = ILM_SUCCESS;
- }
- else
- {
- pScreenProperties->layerCount = 0;
- pScreenProperties->harwareLayerCount = 0;
- pScreenProperties->layerIds = NULL;
- pScreenProperties->screenWidth = 0;
- pScreenProperties->screenHeight = 0;
- }
+ t_ilm_message response = 0;
+ t_ilm_message command = gIpcModule.createMessage("GetPropertiesOfScreen");
+ if (command
+ && gIpcModule.appendUint(command, screenID)
+ && sendAndWaitForResponse(command, &response, RESPONSE_TIMEOUT_IN_MS, &returnValue)
+ && gIpcModule.getUintArray(response, &pScreenProperties->layerIds, (int*)(&pScreenProperties->layerCount))
+ && gIpcModule.getUint(response, &pScreenProperties->harwareLayerCount)
+ && gIpcModule.getUint(response, &pScreenProperties->screenWidth)
+ && gIpcModule.getUint(response, &pScreenProperties->screenHeight))
+ {
+ returnValue = ILM_SUCCESS;
+ }
+ else
+ {
+ pScreenProperties->layerCount = 0;
+ pScreenProperties->harwareLayerCount = 0;
+ pScreenProperties->layerIds = NULL;
+ pScreenProperties->screenWidth = 0;
+ pScreenProperties->screenHeight = 0;
+ }
- gIpcModule.destroyMessage(response);
- gIpcModule.destroyMessage(command);
+ gIpcModule.destroyMessage(response);
+ gIpcModule.destroyMessage(command);
+ }
return returnValue;
}
diff --git a/LayerManagerControl/src/sceneio.cpp b/LayerManagerControl/src/sceneio.cpp
index 39bd5f9..7c15998 100644
--- a/LayerManagerControl/src/sceneio.cpp
+++ b/LayerManagerControl/src/sceneio.cpp
@@ -728,7 +728,7 @@ void exportXtext(string fileName, string grammar, string url)
list<string> doneTypes;
list<StringMapTree*> waitingNodes;
waitingNodes.push_back(&grammarTree);
- while (waitingNodes.size() != 0)
+ while (!waitingNodes.empty())
{
//pop first element of the waiting types
StringMapTree* typeNode = *(waitingNodes.begin());
diff --git a/LayerManagerPlugins/Renderers/Graphic/src/GraphicSystems/GLESGraphicSystem.cpp b/LayerManagerPlugins/Renderers/Graphic/src/GraphicSystems/GLESGraphicSystem.cpp
index 5711d89..6b0dcfd 100644
--- a/LayerManagerPlugins/Renderers/Graphic/src/GraphicSystems/GLESGraphicSystem.cpp
+++ b/LayerManagerPlugins/Renderers/Graphic/src/GraphicSystems/GLESGraphicSystem.cpp
@@ -368,7 +368,7 @@ void GLESGraphicsystem::renderSWLayer(Layer *layer, bool clear)
}
SurfaceList surfaces = m_currentLayer->getAllSurfaces();
- for (std::list<Surface*>::const_iterator currentS = surfaces.begin(); currentS != surfaces.end(); currentS++)
+ for (std::list<Surface*>::const_iterator currentS = surfaces.begin(); currentS != surfaces.end(); ++currentS)
{
if ((*currentS)->hasNativeContent() && (*currentS)->visibility && (*currentS)->opacity>0.0f)
{
@@ -596,7 +596,7 @@ void GLESGraphicsystem::renderSWLayers(LayerList layers, bool clear)
bool blend = !clear;
- for (std::list<MultiSurfaceRegion*>::const_iterator region = regions.begin(); region != regions.end(); region++)
+ for (std::list<MultiSurfaceRegion*>::const_iterator region = regions.begin(); region != regions.end(); ++region)
{
renderRegion(*region, blend);
}
@@ -616,7 +616,7 @@ void GLESGraphicsystem::renderSWLayers(LayerList layers, bool clear)
LayerList singleLayer;
singleLayer.push_back(*layer);
std::list<MultiSurfaceRegion*> regions = computeRegions(singleLayer, true); //do clear
- for (std::list<MultiSurfaceRegion*>::const_iterator region = regions.begin(); region != regions.end(); region++)
+ for (std::list<MultiSurfaceRegion*>::const_iterator region = regions.begin(); region != regions.end(); ++region)
{
renderRegion(*region, false); //don't blend
}
@@ -1271,7 +1271,7 @@ std::list<MultiSurfaceRegion*> GLESGraphicsystem::computeRegions(std::list<Layer
MultiSurfaceRegion *region = new MultiSurfaceRegion();
region->m_rect = FloatRectangle(x1, y1, x2-x1, y2-y1);
std::list<OrderedSurface>::iterator si;
- for (si = regionsurfaces.begin(); si != regionsurfaces.end(); si++)
+ for (si = regionsurfaces.begin(); si != regionsurfaces.end(); ++si)
{
if ((*si).surface)
{
@@ -1280,7 +1280,7 @@ std::list<MultiSurfaceRegion*> GLESGraphicsystem::computeRegions(std::list<Layer
}
// Add the new region to the list we return. Only create
// empty regions when 'clear' was requested
- if (clear || regionsurfaces.size() > 0)
+ if (clear || !regionsurfaces.empty())
{
regions.push_back(region);
}
@@ -1298,7 +1298,7 @@ std::list<MultiSurfaceRegion*> GLESGraphicsystem::computeRegions(std::list<Layer
// be able to render with the surfaces layered properly.
bool inserted = false;
std::list<OrderedSurface>::iterator si;
- for (si = regionsurfaces.begin(); si != regionsurfaces.end(); si++)
+ for (si = regionsurfaces.begin(); si != regionsurfaces.end(); ++si)
{
if ((*si).depth >= xlimits[x].orderedSurface.depth)
{
diff --git a/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/WaylandBaseWindowSystem.cpp b/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/WaylandBaseWindowSystem.cpp
index 429fe54..b9df97f 100644
--- a/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/WaylandBaseWindowSystem.cpp
+++ b/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/WaylandBaseWindowSystem.cpp
@@ -326,7 +326,7 @@ void WaylandBaseWindowSystem::calculateFps()
sprintf(floatStringBuffer, "Overall fps: %f", FPS);
timeSinceLastCalc = (float)(tv.tv_sec-tv0_forRender.tv_sec) + 0.000001*((float)(tv.tv_usec-tv0_forRender.tv_usec));
- for (std::list<Layer*>::const_iterator current = layers.begin(); current != layers.end(); current++)
+ for (std::list<Layer*>::const_iterator current = layers.begin(); current != layers.end(); ++current)
{
SurfaceList surfaceList = (*current)->getAllSurfaces();
SurfaceListIterator surfaceIter = surfaceList.begin();
@@ -359,7 +359,7 @@ void WaylandBaseWindowSystem::RedrawAllLayers(bool clear, bool swap)
}
#endif /* WL_OMIT_CLEAR_GB */
}
- for (std::list<Layer*>::const_iterator current = layers.begin(); current != layers.end(); current++)
+ for (std::list<Layer*>::const_iterator current = layers.begin(); current != layers.end(); ++current)
{
if ((*current)->getLayerType() == Hardware)
{
diff --git a/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/WaylandDrmWindowSystem.cpp b/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/WaylandDrmWindowSystem.cpp
index 4f4b8d2..b892970 100644
--- a/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/WaylandDrmWindowSystem.cpp
+++ b/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/WaylandDrmWindowSystem.cpp
@@ -199,7 +199,7 @@ void WaylandDrmWindowSystem::RedrawAllLayers(bool clear, bool swap)
graphicSystem->clearBackground();
}
}
- for (std::list<Layer*>::const_iterator current = layers.begin(); current != layers.end(); current++)
+ for (std::list<Layer*>::const_iterator current = layers.begin(); current != layers.end(); ++current)
{
if ((*current)->getLayerType() == Hardware)
{
diff --git a/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp b/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp
index 060ba54..1dc6014 100644
--- a/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp
+++ b/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp
@@ -590,7 +590,7 @@ void X11WindowSystem::calculateFps()
FPS = ((float)(Frame)) / timeSinceLastCalc;
char floatStringBuffer[256];
sprintf(floatStringBuffer, "Overall fps: %f", FPS);
- for (std::list<Layer*>::const_iterator current = layers.begin(); current != layers.end(); current++)
+ for (std::list<Layer*>::const_iterator current = layers.begin(); current != layers.end(); ++current)
{
SurfaceList surfaceList = (*current)->getAllSurfaces();
SurfaceListIterator surfaceIter = surfaceList.begin();
@@ -612,7 +612,7 @@ void X11WindowSystem::RedrawAllLayers(bool clear, bool swap)
LayerList swLayers;
// Refresh HW Layers, find SW Layers
- for (LayerListConstIterator current = layers.begin(); current != layers.end(); current++)
+ for (LayerListConstIterator current = layers.begin(); current != layers.end(); ++current)
{
if ((*current)->getLayerType() == Hardware)
{