summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2013-09-28 09:17:51 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2013-09-28 09:17:51 +0200
commit224179774f0657a3f6cc8e65402fcebfb648a445 (patch)
treea3b3fcd0e8d3f145a33f417a2a8621ae09bc8c9b
parentac0847ed6b27757a0fade691594427bd004fff01 (diff)
Fix -Werror problems in release builds
-rw-r--r--CMakeLists.txt4
-rw-r--r--ufo/CMakeLists.txt4
-rw-r--r--ufo/ufo-buffer.c3
-rw-r--r--ufo/ufo-resources.c2
-rw-r--r--ufo/ufo-task-graph.c3
5 files changed, 9 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eeee652..d4b119d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -95,10 +95,6 @@ if (CMAKE_COMPILER_IS_GNUCC)
endif()
add_definitions(-DG_LOG_DOMAIN=\"Ufo\")
-
-if(CMAKE_BUILD_TYPE MATCHES "Release")
- add_definitions(-DG_DISABLE_ASSERT)
-endif()
#}}}
#{{{ Subdirectories
diff --git a/ufo/CMakeLists.txt b/ufo/CMakeLists.txt
index cd69a24..c47aac3 100644
--- a/ufo/CMakeLists.txt
+++ b/ufo/CMakeLists.txt
@@ -71,6 +71,10 @@ set(INCLUDEDIR "include/ufo")
add_definitions(-DUFO_COMPILATION)
+if(CMAKE_BUILD_TYPE MATCHES "Release")
+ add_definitions(-DG_DISABLE_ASSERT)
+endif()
+
add_library(ufo SHARED
${ufocore_SRCS}
${ufocore_NODOC_SRCS}
diff --git a/ufo/ufo-buffer.c b/ufo/ufo-buffer.c
index 00209ce..92d9d01 100644
--- a/ufo/ufo-buffer.c
+++ b/ufo/ufo-buffer.c
@@ -163,9 +163,9 @@ alloc_device_image (UfoBufferPrivate *priv)
{
cl_image_format format;
cl_mem_flags flags;
- cl_mem mem;
cl_int err;
gsize width, height, depth;
+ cl_mem mem = NULL;
g_assert ((priv->requisition.n_dims == 2) ||
(priv->requisition.n_dims == 3));
@@ -195,6 +195,7 @@ alloc_device_image (UfoBufferPrivate *priv)
}
UFO_RESOURCES_CHECK_CLERR (err);
+ g_assert (mem != NULL);
priv->device_image = mem;
}
#endif
diff --git a/ufo/ufo-resources.c b/ufo/ufo-resources.c
index b455491..83f360f 100644
--- a/ufo/ufo-resources.c
+++ b/ufo/ufo-resources.c
@@ -258,7 +258,7 @@ get_preferably_gpu_based_platform (void)
{
cl_platform_id *platforms;
cl_uint n_platforms;
- cl_platform_id candidate;
+ cl_platform_id candidate = 0;
UFO_RESOURCES_CHECK_CLERR (clGetPlatformIDs (0, NULL, &n_platforms));
platforms = g_malloc0 (n_platforms * sizeof (cl_platform_id));
diff --git a/ufo/ufo-task-graph.c b/ufo/ufo-task-graph.c
index a74e4c7..f682a0f 100644
--- a/ufo/ufo-task-graph.c
+++ b/ufo/ufo-task-graph.c
@@ -317,7 +317,7 @@ build_remote_graph (UfoTaskGraph *remote_graph,
GList *first,
GList *last)
{
- UfoTaskNode *node;
+ UfoTaskNode *node = NULL;
UfoTaskNode *predecessor = NULL;
for (GList *it = g_list_next (first); it != last; it = g_list_next (it)) {
@@ -329,6 +329,7 @@ build_remote_graph (UfoTaskGraph *remote_graph,
predecessor = node;
}
+ g_assert (node != NULL);
return node;
}