LayerManagerSerivce: removed some minor compiler warnings
authorTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Fri, 20 Jul 2012 07:04:13 +0000 (00:04 -0700)
committerTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Fri, 20 Jul 2012 07:04:13 +0000 (00:04 -0700)
LayerManagerExamples/GLXApplicationExample/CMakeLists.txt
LayerManagerExamples/GLXApplicationExample/src/glx_helper.cpp
LayerManagerPlugins/IpcModules/TcpIpcModule/tests/LoopbackTest.cpp
LayerManagerPlugins/Renderers/Platform/GLXRenderer/src/X11GLXRenderer.cpp
LayerManagerService/tests/SurfaceTest.cpp

index d41de52..e6793a7 100644 (file)
@@ -39,7 +39,7 @@ find_package (OpenGL REQUIRED)
 include_directories(${OPENGL_INCLUDE_DIR})
 
 find_package(X11 REQUIRED)
-include_directories(X11_INCLUDE_DIR)
+include_directories(${X11_INCLUDE_DIR})
 
 set(LIBS ${LIBS} ${OPENGL_LIBRARIES} ${X11_LIBRARIES} LayerManagerUtils) 
 target_link_libraries(GLX11ApplicationExample ${LIBS} ilmClient)
index fcf3b5e..c54c6fe 100644 (file)
@@ -121,7 +121,6 @@ t_ilm_bool createX11Context(t_ilm_int width, t_ilm_int height)
 
 t_ilm_bool createGLXContext(t_ilm_int width, t_ilm_int height)
 {
-    t_ilm_bool result = ILM_TRUE;
     int glxMajor;
     int glxMinor;
 
@@ -144,45 +143,34 @@ t_ilm_bool createGLXContext(t_ilm_int width, t_ilm_int height)
     t_ilm_layer layerid = (t_ilm_layer) LAYER_EXAMPLE_X_APPLICATIONS; // TODO: remove all C stylec asts in C++ code
     t_ilm_surface surfaceid = (t_ilm_surface) SURFACE_EXAMPLE_GLXX11_APPLICATION;
 
-    //if (error == ILM_FAILED) return ILM_FALSE;
-
     printf("create a surface %lu\n", (t_ilm_nativehandle) (g_x11ContextStruct.x11Window));
 
-    ilmErrorTypes error = ilm_surfaceCreate((t_ilm_nativehandle) g_x11ContextStruct.x11Window, width, height, ILM_PIXELFORMAT_RGBA_8888, &surfaceid);
-
-    //if (error == ILM_FAILED) return ILM_FALSE;
+    ilm_surfaceCreate((t_ilm_nativehandle) g_x11ContextStruct.x11Window, width, height, ILM_PIXELFORMAT_RGBA_8888, &surfaceid);
 
     printf("set surface dest region\n");
-    error = ilm_surfaceSetDestinationRectangle(surfaceid, 0, 0, width, height);
-
-    //if (error == ILM_FAILED) return ILM_FALSE;
+    ilm_surfaceSetDestinationRectangle(surfaceid, 0, 0, width, height);
 
     printf("set surface src region\n");
-    error = ilm_surfaceSetSourceRectangle(surfaceid, 0, 0, width, height);
-
-    //if (error == ILM_FAILED) return ILM_FALSE;
+    ilm_surfaceSetSourceRectangle(surfaceid, 0, 0, width, height);
 
     printf("add surface to layer\n");
-    error = ilm_layerAddSurface(layerid, surfaceid);
+    ilm_layerAddSurface(layerid, surfaceid);
 
     printf("Set surface visible\n");
-    error = ilm_surfaceSetVisibility(surfaceid, ILM_TRUE);
+    ilm_surfaceSetVisibility(surfaceid, ILM_TRUE);
 
     printf("Set surface opacity\n");
-    error = ilm_surfaceSetOpacity(surfaceid, 0.75f);
-
-    //if (error == ILM_FAILED) return ILM_FALSE;
+    ilm_surfaceSetOpacity(surfaceid, 0.75f);
 
 #ifdef WITH_INPUT_EVENTS
     xeventInitialiaze(g_x11ContextStruct.x11Display, surfaceid, 0, 0, width, height);
 #endif
 
     printf("commit\n");
-    error = ilm_commitChanges();
+    // commit will indicate error, if any command failed
+    ilmErrorTypes error = ilm_commitChanges();
 
-    //if (error == ILM_FAILED) return ILM_FALSE;
-
-    return result;
+    return (error != ILM_FAILED) ? ILM_TRUE : ILM_FALSE;
 }
 
 void destroyGLXContext()
index 5fe4194..2de0bf0 100644 (file)
@@ -39,7 +39,7 @@ public:
         unsigned int* base = (unsigned int*)ipcModule;
         for (int i = 0; i < apiEntryCount; ++i)
         {
-            ASSERT_NE(0, base[i]);
+            ASSERT_NE(0u, base[i]);
         }
     }
 
index c58c292..d75074b 100644 (file)
@@ -107,16 +107,14 @@ void X11GLXRenderer::doScreenShotOfSurface(std::string fileToSave, uint id, uint
 
 uint X11GLXRenderer::getNumberOfHardwareLayers(uint screenID)
 {
-    uint screen_id;
-    screen_id = screenID;
+    (void)screenID;
     return 0; // TODO
 }
 
 uint* X11GLXRenderer::getScreenResolution(uint screenID)
 {
-    uint screen_id;
-    screen_id = screenID;
-    
+    (void)screenID;
+
     uint * resolution = new uint[2];
     resolution[0] = m_width;
     resolution[1] = m_height;
index d80f658..488b152 100644 (file)
@@ -55,7 +55,7 @@ TEST_F(SurfaceTest, defaultConstructor)
     EXPECT_EQ(0, surface.OriginalSourceWidth);
 
     /// make sure, surface has default visibility
-    EXPECT_EQ(false, surface.getVisibility());
+    EXPECT_FALSE(surface.getVisibility());
 
     /// make sure, surface has default opacity
     EXPECT_DOUBLE_EQ(1.0, surface.getOpacity());
@@ -100,7 +100,7 @@ TEST_F(SurfaceTest, specialConstructor)
     EXPECT_EQ(0, surface.OriginalSourceWidth);
 
     /// make sure, surface has default visibility
-    EXPECT_EQ(false, surface.getVisibility());
+    EXPECT_FALSE(surface.getVisibility());
 
     /// make sure, surface has default opacity
     EXPECT_DOUBLE_EQ(1.0, surface.getOpacity());