fixed trivial compiler warnings without changing behaviour.
removed mostly unsed vars.
t_ilm_bool createEGLContext(t_ilm_int width, t_ilm_int height)
{
- t_ilm_bool result = ILM_TRUE;
g_eglContextStruct.eglDisplay = NULL;
g_eglContextStruct.eglSurface = NULL;
g_eglContextStruct.eglContext = NULL;
- ilmErrorTypes error = ILM_FAILED;
g_eglContextStruct.eglDisplay = eglGetDisplay((EGLNativeDisplayType) g_x11ContextStruct.x11Display); // TODO: remove all C style casts in C++ code; use C++ casts
EGLint eglstatus = eglGetError();
t_ilm_layer layerid = (t_ilm_layer)LAYER_EXAMPLE_GLES_APPLICATIONS;
t_ilm_surface surfaceid = (t_ilm_surface)SURFACE_EXAMPLE_EGLX11_APPLICATION;
- // TODO: if (error == ILM_FAILED) return ILM_FALSE;
-
printf("create a surface %lu\n", (t_ilm_nativehandle) g_x11ContextStruct.x11Window);
- error = ilm_surfaceCreate( (t_ilm_nativehandle) g_x11ContextStruct.x11Window, width, height,
+ ilm_surfaceCreate( (t_ilm_nativehandle) g_x11ContextStruct.x11Window, width, height,
ILM_PIXELFORMAT_RGBA_8888, &surfaceid);
- // TODO: if (error == ILM_FAILED) return ILM_FALSE;
-
printf("set surface dest region\n");
- error = ilm_surfaceSetDestinationRectangle(surfaceid, 0, 0, width, height);
-
- // TODO: 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);
-
- // TODO: 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);
- printf("Set surface opacity\n");
- error = ilm_surfaceSetOpacity(surfaceid, 0.75f);
+ ilm_surfaceSetVisibility(surfaceid, ILM_TRUE);
- //if (error == ILM_FAILED) return ILM_FALSE;
+ printf("Set surface opacity\n");
+ ilm_surfaceSetOpacity(surfaceid, 0.75f);
printf("commit\n");
- error = ilm_commitChanges();
-
- //if (error == ILM_FAILED) return ILM_FALSE;
-
- return result;
+ return (ILM_SUCCESS == ilm_commitChanges()) ? ILM_TRUE : ILM_FALSE;
}
void destroyEglContext()
bool OpenGLES2App::setupLayerMangement(SurfaceConfiguration* config)
{
- ilmErrorTypes error = ILM_FAILED;
-
// register surfaces to layermanager
t_ilm_layer layerid = (t_ilm_layer)config->layerId;//LAYER_EXAMPLE_GLES_APPLICATIONS;
t_ilm_surface surfaceid = (t_ilm_surface)config->surfaceId;//SURFACE_EXAMPLE_EGLX11_APPLICATION;
int height = config->surfaceHeight;
cout << "creating surface " << surfaceid << "\n";
- error = ilm_surfaceCreate( (t_ilm_nativehandle) m_x11ContextStruct.x11Window, width, height,
+ ilm_surfaceCreate( (t_ilm_nativehandle) m_x11ContextStruct.x11Window, width, height,
ILM_PIXELFORMAT_RGBA_8888, &surfaceid);
cout << "set surface " << surfaceid << " dest region " << 0 << ", " << 0 << ", " << width << ", " << height << "\n";
- error = ilm_surfaceSetDestinationRectangle(surfaceid, 0, 0, width, height);
+ ilm_surfaceSetDestinationRectangle(surfaceid, 0, 0, width, height);
cout << "set surface " << surfaceid << " src region " << 0 << ", " << 0 << ", " << width << ", " << height << "\n";
- error = ilm_surfaceSetSourceRectangle(surfaceid, 0, 0, width, height);
+ ilm_surfaceSetSourceRectangle(surfaceid, 0, 0, width, height);
cout << "Set surface " << surfaceid << " visible\n";
- error = ilm_surfaceSetVisibility(surfaceid, ILM_TRUE);
+ ilm_surfaceSetVisibility(surfaceid, ILM_TRUE);
cout << "Set surface " << surfaceid << " opacity 1.0\n";
- error = ilm_surfaceSetOpacity(surfaceid, 1.0f);
+ ilm_surfaceSetOpacity(surfaceid, 1.0f);
cout << "add surface " << surfaceid << " to layer " << layerid << "\n";
- error = ilm_layerAddSurface(layerid, surfaceid);
+ ilm_layerAddSurface(layerid, surfaceid);
cout << "commit\n";
- error = ilm_commitChanges();
-
- return ILM_TRUE;
+ return (ILM_SUCCESS == ilm_commitChanges()) ? true : false;
}
void OpenGLES2App::destroyEglContext()
void DBUSCommunicator::unregisterMessageFunc(DBusConnection* conn, void *user_data)
{
- DBusConnection* connection = NULL;
- DBUSCommunicator* cominstance = NULL;
- connection = conn;
- cominstance = (DBUSCommunicator*)user_data;
+ (void)conn;
+ (void)user_data;
}
void DBUSCommunicator::ListLayersOfLayergroup(DBusConnection* conn, DBusMessage* msg)
bool m_initialized;
bool m_success;
X11WindowSystemStates m_systemState;
- char* m_displayEnvironment;
+ const char* m_displayEnvironment;
protected:
Display* x11Display;
void GLESGraphicsystem::activateGraphicContext()
{
- EGLBoolean eglStatus = false;
- eglStatus = eglMakeCurrent(m_eglDisplay, m_eglSurface, m_eglSurface, m_eglContext);
-
+ eglMakeCurrent(m_eglDisplay, m_eglSurface, m_eglSurface, m_eglContext);
}
void GLESGraphicsystem::releaseGraphicContext()
{
- EGLBoolean eglStatus = false;
- eglStatus = eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
-}
+ eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+}
bool GLESGraphicsystem::init(EGLNativeDisplayType display, EGLNativeWindowType NativeWindow)
{
}
LOG_INFO("GLESGraphicsystem", "EGL make current ...");
// Make the context and surface current for rendering
- EGLBoolean eglStatus = false;
- eglStatus = eglMakeCurrent(m_eglDisplay, m_eglSurface, m_eglSurface, m_eglContext);
+ eglMakeCurrent(m_eglDisplay, m_eglSurface, m_eglSurface, m_eglContext);
LOG_INFO("GLESGraphicsystem", "made current");
eglSwapInterval(m_eglDisplay, 1); // TODO: does not seem to work
void X11WindowSystem::ManageXInputEvent(XEvent *pevent)
{
- XEvent* currentEvent = pevent;
+ (void)pevent;
+
#ifdef WITH_INPUT_EVENTS
+ XEvent* currentEvent = pevent;
Surface * surf;
int *pX = NULL;
int *pY = NULL;
pevent->xany.window = surf->getNativeContent();
XSendEvent(x11Display, currentEvent->xany.window, false, 0, currentEvent);
}
-#endif
currentEvent = NULL;
+#endif
}
uint X11GLESRenderer::getNumberOfHardwareLayers(uint screenID)
{
- uint screen_id;
- screen_id = screenID;
+ (void)screenID;
return 0; // TODO provide real value here
}
uint* X11GLESRenderer::getScreenResolution(uint screenID)
{
- uint screen_id;
- screen_id = screenID;
+ (void)screenID;
+
// TODO provide value of real screen here
uint * resolution = new uint[2];
resolution[0] = m_width;
void Log::log(LogContext logContext, LOG_MODES logMode, const std::string& moduleName, const std::basic_string<char>& output)
{
+ (void)logContext;
+
std::string logString[LOG_MAX_LEVEL] = {"","ERROR","INFO","WARNING","DEBUG"};
std::string logOutLevelString = logString[LOG_INFO];
- LogContext currentContext = logContext;
pthread_mutex_lock(&m_LogBufferMutex);
if ( logMode < LOG_MAX_LEVEL )
{
#ifdef WITH_DLT
if ( dltLogLevel >= logMode )
{
- LogToDltDaemon(currentContext, logMode, moduleName, output);
+ LogToDltDaemon(logContext, logMode, moduleName, output);
}
#endif
pthread_mutex_unlock(&m_LogBufferMutex);
- currentContext = NULL;
}
void Log::LogToFile(std::string logMode, const std::string& moduleName,const std::basic_string<char>& output)