Merge lp:~vanvugt/compiz-core/Werror into lp:compiz-core/0.9.5

Proposed by Daniel van Vugt
Status: Merged
Approved by: Sam Spilsbury
Approved revision: 2914
Merged at revision: 2914
Proposed branch: lp:~vanvugt/compiz-core/Werror
Merge into: lp:compiz-core/0.9.5
Diff against target: 123 lines (+34/-13)
7 files modified
cmake/CompizCommon.cmake (+23/-8)
libdecoration/decoration.c (+1/-1)
plugins/decor/decor.xml.in (+6/-0)
plugins/opengl/src/texture.cpp (+1/-1)
src/screen.cpp (+1/-1)
src/timer/src/timer.cpp (+1/-1)
src/window.cpp (+1/-1)
To merge this branch: bzr merge lp:~vanvugt/compiz-core/Werror
Reviewer Review Type Date Requested Status
Alan Griffiths Approve
Review via email: mp+88811@code.launchpad.net

Description of the change

Fix all compiler warnings and (optionally) treat all future warnings as errors.

This is controlled by the cmake option COMPIZ_WERROR, which defaults to ON for compiz-core, and OFF for all other projects.

To post a comment you must log in.
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cmake/CompizCommon.cmake'
2--- cmake/CompizCommon.cmake 2011-12-19 07:06:22 +0000
3+++ cmake/CompizCommon.cmake 2012-01-17 05:24:23 +0000
4@@ -42,15 +42,30 @@
5 COMPIZ_I18N_DIR ${COMPIZ_I18N_DIR} CACHE PATH "Translation file directory"
6 )
7
8-option (COMPIZ_SIGN_WARNINGS "Should compiz use -Wsign-conversion during compilation." OFF)
9-
10-if (COMPIZ_SIGN_WARNINGS)
11- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wsign-conversion")
12- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wsign-conversion")
13+set (COMMON_FLAGS "-Wall")
14+
15+option (COMPIZ_DEPRECATED_WARNINGS "Warn about declarations marked deprecated" OFF)
16+if (NOT COMPIZ_DEPRECATED_WARNINGS)
17+ set (COMMON_FLAGS "${COMMON_FLAGS} -Wno-deprecated-declarations")
18+endif ()
19+
20+option (COMPIZ_SIGN_WARNINGS "Should compiz use -Wsign-conversion during compilation." ON)
21+if (NOT COMPIZ_SIGN_WARNINGS)
22+ set (COMMON_FLAGS "${COMMON_FLAGS} -Wno-sign-conversion")
23+endif ()
24+
25+if (${CMAKE_PROJECT_NAME} STREQUAL "compiz")
26+ set (COMPIZ_WERROR_DEFAULT ON)
27 else ()
28- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
29- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
30-endif ()
31+ set (COMPIZ_WERROR_DEFAULT OFF)
32+endif ()
33+option (COMPIZ_WERROR "Treat warnings as errors" ${COMPIZ_WERROR_DEFAULT})
34+if (COMPIZ_WERROR)
35+ set (COMMON_FLAGS "${COMMON_FLAGS} -Werror")
36+endif ()
37+
38+set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_FLAGS}")
39+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS}")
40
41 if (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.git)
42 set(IS_GIT_REPO 1)
43
44=== modified file 'libdecoration/decoration.c'
45--- libdecoration/decoration.c 2011-05-07 17:31:23 +0000
46+++ libdecoration/decoration.c 2012-01-17 05:24:23 +0000
47@@ -134,7 +134,7 @@
48 decor_alloc_property (unsigned int n,
49 unsigned int type)
50 {
51- unsigned int propSize;
52+ unsigned int propSize = 0;
53 long *data;
54
55 if (type == WINDOW_DECORATION_TYPE_WINDOW)
56
57=== modified file 'plugins/decor/decor.xml.in'
58--- plugins/decor/decor.xml.in 2011-10-13 11:31:37 +0000
59+++ plugins/decor/decor.xml.in 2012-01-17 05:24:23 +0000
60@@ -38,6 +38,12 @@
61 <option name="active_shadow_color" type="color">
62 <_short>Shadow Color</_short>
63 <_long>Drop shadow color</_long>
64+ <default>
65+ <red>0x0000</red>
66+ <green>0x0000</green>
67+ <blue>0x0000</blue>
68+ <alpha>0x8000</alpha>
69+ </default>
70 </option>
71 <option name="active_shadow_x_offset" type="int">
72 <_short>Shadow Offset X</_short>
73
74=== modified file 'plugins/opengl/src/texture.cpp'
75--- plugins/opengl/src/texture.cpp 2011-10-31 13:51:00 +0000
76+++ plugins/opengl/src/texture.cpp 2012-01-17 05:24:23 +0000
77@@ -287,7 +287,7 @@
78 GLenum format,
79 GLenum type)
80 {
81-#warning Add support for multiple textures
82+/* TODO Add support for multiple textures */
83 if ((int) width > GL::maxTextureSize || (int) height > GL::maxTextureSize)
84 return GLTexture::List ();
85
86
87=== modified file 'src/screen.cpp'
88--- src/screen.cpp 2012-01-16 08:36:54 +0000
89+++ src/screen.cpp 2012-01-17 05:24:23 +0000
90@@ -2204,7 +2204,7 @@
91 atoms.push_back (Atoms::winOpacity);
92 atoms.push_back (Atoms::winBrightness);
93
94-#warning fixme
95+/* FIXME */
96 #if 0
97 if (canDoSaturated)
98 {
99
100=== modified file 'src/timer/src/timer.cpp'
101--- src/timer/src/timer.cpp 2012-01-12 09:09:35 +0000
102+++ src/timer/src/timer.cpp 2012-01-17 05:24:23 +0000
103@@ -248,7 +248,7 @@
104
105 if (priv->mCallBack.empty ())
106 {
107-#warning compLogMessage needs to be testable
108+/* FIXME: compLogMessage needs to be testable */
109 #if 0
110 compLogMessage ("core", CompLogLevelWarn,
111 "Attempted to start timer without callback.");
112
113=== modified file 'src/window.cpp'
114--- src/window.cpp 2012-01-16 09:10:42 +0000
115+++ src/window.cpp 2012-01-17 05:24:23 +0000
116@@ -91,7 +91,7 @@
117 {
118 int maxSize;
119
120-#warning fixme to max Texture size
121+/* FIXME to max Texture size */
122 maxSize = MAXSHORT;
123 maxSize -= serverGeometry.border () * 2;
124

Subscribers

People subscribed via source and target branches