LayerManagement: fixed several warnings raised by cppcheck
authorTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Fri, 15 Mar 2013 15:17:32 +0000 (16:17 +0100)
committerTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Mon, 18 Mar 2013 08:56:55 +0000 (09:56 +0100)
Signed-off-by: Timo Lotterbach <timo.lotterbach@bmw-carit.de>
LayerManagerClient/ilmControl/src/ilm_control.c
LayerManagerControl/src/sceneio.cpp
LayerManagerPlugins/Renderers/Graphic/src/GraphicSystems/GLESGraphicSystem.cpp
LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/WaylandBaseWindowSystem.cpp
LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/WaylandDrmWindowSystem.cpp
LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp

index 4405a51..8bbc290 100644 (file)
@@ -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;
 }
 
index 39bd5f9..7c15998 100644 (file)
@@ -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());
index 5711d89..6b0dcfd 100644 (file)
@@ -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)
                         {
index 429fe54..b9df97f 100644 (file)
@@ -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)
         {
index 4f4b8d2..b892970 100644 (file)
@@ -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)
             {
index 060ba54..1dc6014 100644 (file)
@@ -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)
         {