Merge lp:~mc-return/compiz/compiz.merge-performance-do-not-assign-values-that-are-never-used into lp:compiz/0.9.9

Proposed by MC Return
Status: Rejected
Rejected by: Daniel van Vugt
Proposed branch: lp:~mc-return/compiz/compiz.merge-performance-do-not-assign-values-that-are-never-used
Merge into: lp:compiz/0.9.9
Diff against target: 406 lines (+35/-38)
24 files modified
compizconfig/gconf/src/gconf.c (+1/-1)
compizconfig/gsettings/gsettings_backend_shared/ccs_gsettings_backend.c (+1/-1)
compizconfig/gsettings/gsettings_backend_shared/gsettings_util.c (+7/-7)
compizconfig/integration/gnome/src/ccs_gnome_integration.c (+1/-1)
compizconfig/libcompizconfig/backend/src/ini.c (+2/-2)
compizconfig/libcompizconfig/src/compiz.cpp (+2/-2)
compizconfig/libcompizconfig/src/config.c (+1/-1)
compizconfig/libcompizconfig/src/main.c (+4/-4)
gtk/window-decorator/events.c (+1/-1)
gtk/window-decorator/gwd-settings-notified.c (+1/-1)
gtk/window-decorator/gwd-settings-storage-gconf.c (+1/-1)
gtk/window-decorator/gwd-settings-storage-gsettings.c (+1/-1)
gtk/window-decorator/gwd-settings-xproperty-storage.c (+1/-1)
kde/window-decorator-kde4/switcher.cpp (+1/-1)
kde/window-decorator-kde4/window.cpp (+1/-2)
plugins/bicubic/src/bicubic.cpp (+1/-1)
plugins/cube/src/cube.cpp (+1/-1)
plugins/dbus/src/dbus.cpp (+1/-1)
plugins/decor/src/decor.cpp (+2/-2)
plugins/grid/src/grid.cpp (+1/-1)
plugins/opengl/src/texture.cpp (+1/-1)
plugins/resize/src/logic/src/resize-logic.cpp (+0/-2)
plugins/workarounds/src/workarounds.cpp (+1/-1)
src/screen.cpp (+1/-1)
To merge this branch: bzr merge lp:~mc-return/compiz/compiz.merge-performance-do-not-assign-values-that-are-never-used
Reviewer Review Type Date Requested Status
Daniel van Vugt Disapprove
Sam Spilsbury Needs Information
Review via email: mp+135150@code.launchpad.net

Commit message

Minor Performance Optimization:
Do not assign values to variables, if those variables are assigned a new value, before the old one was ever used.

To post a comment you must log in.
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

IMO its good defensive coding practise to initialize every variable before use because it insures against further changes using uninitialized variables.

I'd like to hear the converse argument though. I think the compiler will just optimize out any redundancy really.

review: Needs Information
Revision history for this message
MC Return (mc-return) wrote :

> IMO its good defensive coding practise to initialize every variable before use
> because it insures against further changes using uninitialized variables.
>
> I'd like to hear the converse argument though. I think the compiler will just
> optimize out any redundancy really.

I do not trust every compiler to be that intelligent. If you assign a value to a local variable and then several instructions later reassign another value to it, without having used the first, the compiler will probably do what he is told to and make this first redundant assignment...

Also it is really ugly to find something in the code like this:

mState = saveState;
mState = saveState;

...even if the compiler would remove that one probably...

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

On Tue, Nov 20, 2012 at 7:04 AM, MC Return <email address hidden> wrote:
>> IMO its good defensive coding practise to initialize every variable before use
>> because it insures against further changes using uninitialized variables.
>>
>> I'd like to hear the converse argument though. I think the compiler will just
>> optimize out any redundancy really.
>
> I do not trust every compiler to be that intelligent.

We are only using gcc . Clang is used to do some additional error
checking but that's about it.

> If you assign a value to a local variable and then several instructions later reassign another value to it, without having used the first, the compiler will probably do what he is told to and make this first redundant assignment...

The compiler can optimize out all zero-initializations in C for non
plain-old-data types allocated on the stack frame as long as they
aren't marked volatile:

http://en.wikipedia.org/wiki/Dead_store

That's not the case for C++ classes though, which can change program
state when their constructors run, so it is good style to only declare
those variables when they are actually needed.

I guess the point I'm trying to make here is that zero initialization
makes sense when the code changes and is later recompiled, for
example:

Foo *foo = NULL;

/* blah blah blah */

foo = new Foo ();

changed to:

Foo *foo = NULL;

if (foo)
{
    /* do something with foo */
}

It becomes immediately obvious to the person who changed it that foo
needs to be assigned to a value first, rather than:

Foo *foo;

if (foo)
{
}

Where foo could be anything and that if condition will pass (and the
program then becomes undefined)

>
> Also it is really ugly to find something in the code like this:
>
> mState = saveState;
> mState = saveState;

In which case the second assignment is probably the one you want to remove.

>
> ...even if the compiler would remove that one probably...
>
>
> --
> https://code.launchpad.net/~mc-return/compiz/compiz.merge-performance-do-not-assign-values-that-are-never-used/+merge/135150
> You are reviewing the proposed merge of lp:~mc-return/compiz/compiz.merge-performance-do-not-assign-values-that-are-never-used into lp:compiz.

--
Sam Spilsbury

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I agree the nicest way to achieve this is usually to do it on a single line:
    Foo *x = something
However that's only valid in C++ and not in C.

So in C, I think the existing redundant initialization is the preferred method of defence.

Also note, this is not a significant performance issue. Assigning a word-sized variable to zero or NULL is such a simple instruction that any modern CPU from the last 20 years can do several of them per clock cycle. You'd have to be doing millions or billions of redundant assignments for it to be a problem (for example in a very tight performance-sensitive loop).

review: Disapprove
Revision history for this message
MC Return (mc-return) wrote :

> I agree the nicest way to achieve this is usually to do it on a single line:
> Foo *x = something
> However that's only valid in C++ and not in C.
>
> So in C, I think the existing redundant initialization is the preferred method
> of defence.
>

I can remove the changes to the NULL pointer initialization in the .c files of course,
but I do want to note here that all of those pointers get to point to something else
a few lines later and of course are not used without pointing to something and being
initialized first.

> Also note, this is not a significant performance issue. Assigning a word-sized
> variable to zero or NULL is such a simple instruction that any modern CPU from
> the last 20 years can do several of them per clock cycle. You'd have to be
> doing millions or billions of redundant assignments for it to be a problem
> (for example in a very tight performance-sensitive loop).

I am sorry, but I cannot help myself - If I see something that *might* produce any
unneeded instructions I want to remove it, because it hurts my eyes ;)

Revision history for this message
Sam Spilsbury (smspillaz) wrote :
Download full text (4.1 KiB)

On Thu, Nov 22, 2012 at 7:49 AM, MC Return <email address hidden> wrote:
>> I agree the nicest way to achieve this is usually to do it on a single line:
>> Foo *x = something
>> However that's only valid in C++ and not in C.
>>
>> So in C, I think the existing redundant initialization is the preferred method
>> of defence.
>>
>
> I can remove the changes to the NULL pointer initialization in the .c files of course,
> but I do want to note here that all of those pointers get to point to something else
> a few lines later and of course are not used without pointing to something and being
> initialized first.

If one compiled without optimization this would be an issue, however
just for show, for a simple C program
that looks like this:

#include <stdio.h>

int main()
{
        int a = 5;
        int *i;

        a = 1;
        a = a + 1;
        a = a + 2;

        i = &a;

        printf ("%d\n", *i);
        return 0;
}

Will output assembly:

        .file "main.c"
        .section .rodata.str1.1,"aMS",@progbits,1
.LC0:
        .string "%d\n"
        .section .text.startup,"ax",@progbits
        .p2align 4,,15
        .globl main
        .type main, @function
main:
.LFB24:
        .cfi_startproc
        subq $8, %rsp
        .cfi_def_cfa_offset 16
        movl $4, %edx
        movl $.LC0, %esi
        movl $1, %edi
        xorl %eax, %eax
        call __printf_chk
        xorl %eax, %eax
        addq $8, %rsp
        .cfi_def_cfa_offset 8
        ret
        .cfi_endproc
.LFE24:
        .size main, .-main
        .ident "GCC: (Ubuntu/Linaro 4.7.2-11ubuntu1) 4.7.2"
        .section .note.GNU-stack,"",@progbits

And a similar program with i initialized to null:

        .file "main.c"
        .section .rodata.str1.1,"aMS",@progbits,1
.LC0:
        .string "%d\n"
        .section .text.startup,"ax",@progbits
        .p2align 4,,15
        .globl main
        .type main, @function
main:
.LFB24:
        .cfi_startproc
        subq $8, %rsp
        .cfi_def_cfa_offset 16
        movl $4, %edx
        movl $.LC0, %esi
        movl $1, %edi
        xorl %eax, %eax
        call __printf_chk
        xorl %eax, %eax
        addq $8, %rsp
        .cfi_def_cfa_offset 8
        ret
        .cfi_endproc
.LFE24:
        .size main, .-main
        .ident "GCC: (Ubuntu/Linaro 4.7.2-11ubuntu1) 4.7.2"
        .section .note.GNU-stack,"",@progbits

So the null initialization is effectively removed by the compiler if
it isn't used.

>
>> Also note, this is not a significant performance issue. Assigning a word-sized
>> variable to zero or NULL is such a simple instruction that any modern CPU from
>> the last 20 years can do several of them per clock cycle. You'd have to be
>> doing millions or billions of redundant assignments for it to be a problem
>> (for example in a very tight performance-sensitive loop).
>
> I am sorry, but I cannot help myself - If I see something that *might* produce any
> unneeded instructions I want to remove it, because it hurts my eyes ;)

Well, there's a difference between un-needed instructions generally in
the most performant ve...

Read more...

Unmerged revisions

3511. By MC Return

Do not assign 0 to int i, because this value is never used

3510. By MC Return

Do not assign 0 to int i, because this value is never used

3509. By MC Return

Do not assign output to the ints lco, tco, bco and rco, because this value is never used afterwards

3508. By MC Return

Do not assign NULL to EGLImageKHR eglImage, because this value is not used afterwards

3507. By MC Return

Do not assign 0 to CompWindow *cw, because this value is not used afterwards

3506. By MC Return

Do not assign 0 to XRectangle *shapeRects, because this value is not used afterwards

3505. By MC Return

Do not assign 0 to Xrectangle *shapeRects, because this value is not used afterwards

3504. By MC Return

Do not assign NULL to CompOption *option, because this value is not used afterwards

3503. By MC Return

Do not assign 0 to int output, because this value never gets used

3502. By MC Return

Do not assign 0 to int unit, because this value is never used

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'compizconfig/gconf/src/gconf.c'
2--- compizconfig/gconf/src/gconf.c 2012-08-16 17:00:25 +0000
3+++ compizconfig/gconf/src/gconf.c 2012-11-20 14:15:25 +0000
4@@ -970,7 +970,7 @@
5 static char*
6 getCurrentProfileName (void)
7 {
8- GConfSchema *schema = NULL;
9+ GConfSchema *schema;
10
11 schema = gconf_client_get_schema (client,
12 COMPIZCONFIG "/current_profile", NULL);
13
14=== modified file 'compizconfig/gsettings/gsettings_backend_shared/ccs_gsettings_backend.c'
15--- compizconfig/gsettings/gsettings_backend_shared/ccs_gsettings_backend.c 2012-10-09 10:56:58 +0000
16+++ compizconfig/gsettings/gsettings_backend_shared/ccs_gsettings_backend.c 2012-11-20 14:15:25 +0000
17@@ -96,7 +96,7 @@
18 const char *path,
19 CCSContext *context)
20 {
21- CCSGSettingsWrapper *settingsObj = NULL;
22+ CCSGSettingsWrapper *settingsObj;
23 gchar *schemaName = getSchemaNameForPlugin (plugin);
24 GVariant *writtenPlugins;
25 gsize newWrittenPluginsSize;
26
27=== modified file 'compizconfig/gsettings/gsettings_backend_shared/gsettings_util.c'
28--- compizconfig/gsettings/gsettings_backend_shared/gsettings_util.c 2012-11-16 16:17:59 +0000
29+++ compizconfig/gsettings/gsettings_backend_shared/gsettings_util.c 2012-11-20 14:15:25 +0000
30@@ -77,7 +77,7 @@
31 gchar *
32 getSchemaNameForPlugin (const char *plugin)
33 {
34- gchar *schemaName = NULL;
35+ gchar *schemaName;
36
37 schemaName = g_strconcat (PLUGIN_SCHEMA_ID_PREFIX, plugin, NULL);
38
39@@ -96,8 +96,8 @@
40 char *
41 translateUnderscoresToDashesForGSettings (const char *truncated)
42 {
43- gchar *clean = NULL;
44- gchar **delimited = NULL;
45+ gchar *clean;
46+ gchar **delimited;
47
48 /* Replace underscores with dashes */
49 delimited = g_strsplit (truncated, "_", 0);
50@@ -136,8 +136,8 @@
51 gchar *
52 translateKeyForCCS (const char *gsettingName)
53 {
54- gchar *clean = NULL;
55- gchar **delimited = NULL;
56+ gchar *clean;
57+ gchar **delimited;
58
59 /* Replace dashes with underscores */
60 delimited = g_strsplit (gsettingName, "-", 0);
61@@ -1065,7 +1065,7 @@
62 CCSGSettingsWrapper *
63 getSettingsObjectForCCSSetting (CCSBackend *backend, CCSSetting *setting)
64 {
65- CCSGSettingsWrapper *ret = NULL;
66+ CCSGSettingsWrapper *ret;
67 gchar *pathName = makeSettingPath (ccsGSettingsBackendGetCurrentProfile (backend), setting);
68
69 ret = ccsGSettingsGetSettingsObjectForPluginWithPath (backend,
70@@ -1085,7 +1085,7 @@
71 GVariant *plugins;
72 GVariant *profiles;
73 const char *currentProfile = ccsGSettingsBackendGetCurrentProfile (backend);
74- gboolean ret = FALSE;
75+ gboolean ret;
76
77 plugins = ccsGSettingsBackendGetPluginsWithSetKeys (backend);
78 profiles = ccsGSettingsBackendGetExistingProfiles (backend);
79
80=== modified file 'compizconfig/integration/gnome/src/ccs_gnome_integration.c'
81--- compizconfig/integration/gnome/src/ccs_gnome_integration.c 2012-10-18 06:29:46 +0000
82+++ compizconfig/integration/gnome/src/ccs_gnome_integration.c 2012-11-20 14:15:25 +0000
83@@ -639,7 +639,7 @@
84 }
85 else
86 {
87- CCSPlugin *plugin = NULL;
88+ CCSPlugin *plugin;
89 CCSSetting *setting;
90
91 plugin = ccsFindPlugin (priv->context, pluginName);
92
93=== modified file 'compizconfig/libcompizconfig/backend/src/ini.c'
94--- compizconfig/libcompizconfig/backend/src/ini.c 2012-08-01 10:25:15 +0000
95+++ compizconfig/libcompizconfig/backend/src/ini.c 2012-11-20 14:15:25 +0000
96@@ -56,7 +56,7 @@
97 static char*
98 getIniFileName (char *profile)
99 {
100- char *configDir = NULL;
101+ char *configDir;
102 char *fileName = NULL;
103
104 configDir = getenv ("XDG_CONFIG_HOME");
105@@ -644,7 +644,7 @@
106 CCSStringList ret = NULL;
107 char *filePath = NULL;
108 char *homeDir = NULL;
109- char *configDir = NULL;
110+ char *configDir;
111
112 configDir = getenv ("XDG_CONFIG_HOME");
113 if (configDir && strlen (configDir))
114
115=== modified file 'compizconfig/libcompizconfig/src/compiz.cpp'
116--- compizconfig/libcompizconfig/src/compiz.cpp 2012-08-15 10:19:02 +0000
117+++ compizconfig/libcompizconfig/src/compiz.cpp 2012-11-20 14:15:25 +0000
118@@ -729,7 +729,7 @@
119 const OptionMetadata & option)
120 {
121 const char *name;
122- Bool readonly = FALSE;
123+ Bool readonly;
124
125 name = option.name ().c_str ();
126
127@@ -1158,7 +1158,7 @@
128 static Bool
129 nodeExists (xmlNode * node, const char *path)
130 {
131- xmlNode **nodes = NULL;
132+ xmlNode **nodes;
133 int num;
134 nodes = getNodesFromXPath (node->doc, node, path, &num);
135
136
137=== modified file 'compizconfig/libcompizconfig/src/config.c'
138--- compizconfig/libcompizconfig/src/config.c 2012-05-21 09:36:37 +0000
139+++ compizconfig/libcompizconfig/src/config.c 2012-11-20 14:15:25 +0000
140@@ -32,7 +32,7 @@
141 static char*
142 getConfigFileName (void)
143 {
144- char *configDir = NULL;
145+ char *configDir;
146 char *fileName = NULL;
147
148 configDir = getenv ("XDG_CONFIG_HOME");
149
150=== modified file 'compizconfig/libcompizconfig/src/main.c'
151--- compizconfig/libcompizconfig/src/main.c 2012-11-19 06:07:45 +0000
152+++ compizconfig/libcompizconfig/src/main.c 2012-11-20 14:15:25 +0000
153@@ -3031,7 +3031,7 @@
154 {
155 CCSPluginList ap = ccsGetActivePluginList (context);
156 CCSPluginList list;
157- CCSPlugin *p = NULL;
158+ CCSPlugin *p;
159 CCSString *strCore = calloc (1, sizeof (CCSString));
160
161 strCore->value = strdup ("core");
162@@ -4022,8 +4022,8 @@
163 static void
164 addBackendInfo (CCSBackendInfoList * bl, char *file)
165 {
166- void *dlhand = NULL;
167- char *err = NULL;
168+ void *dlhand;
169+ char *err;
170 Bool found = FALSE;
171
172 dlerror ();
173@@ -4696,7 +4696,7 @@
174 ccsSettingsUpgradeNew (const char *path, const char *name)
175 {
176 CCSSettingsUpgrade *upgrade = calloc (1, sizeof (CCSSettingsUpgrade));
177- char *upgradeName = strdup (name);
178+ char *upgradeName;
179 unsigned int fnlen = strlen (path) + strlen (name) + 1;
180
181 upgrade->file = calloc (fnlen + 1, sizeof (char));
182
183=== modified file 'gtk/window-decorator/events.c'
184--- gtk/window-decorator/events.c 2012-10-06 16:11:05 +0000
185+++ gtk/window-decorator/events.c 2012-11-20 14:15:25 +0000
186@@ -827,7 +827,7 @@
187
188 if (d)
189 {
190- event_callback cb = NULL;
191+ event_callback cb;
192 Bool send_enter = FALSE;
193 Bool send_leave = FALSE;
194 BoxPtr entered_box;
195
196=== modified file 'gtk/window-decorator/gwd-settings-notified.c'
197--- gtk/window-decorator/gwd-settings-notified.c 2012-09-06 10:12:08 +0000
198+++ gtk/window-decorator/gwd-settings-notified.c 2012-11-20 14:15:25 +0000
199@@ -256,7 +256,7 @@
200 static const guint gwd_settings_notified_impl_n_construction_properties = 1;
201 GValue wnck_screen_value = G_VALUE_INIT;
202 GParameter params[gwd_settings_notified_impl_n_construction_properties];
203- GWDSettingsNotified *notified = NULL;
204+ GWDSettingsNotified *notified;
205
206 g_value_init (&wnck_screen_value, G_TYPE_OBJECT);
207 g_value_set_object (&wnck_screen_value, G_OBJECT (screen));
208
209=== modified file 'gtk/window-decorator/gwd-settings-storage-gconf.c'
210--- gtk/window-decorator/gwd-settings-storage-gconf.c 2012-09-06 10:08:25 +0000
211+++ gtk/window-decorator/gwd-settings-storage-gconf.c 2012-11-20 14:15:25 +0000
212@@ -409,7 +409,7 @@
213 GValue writable_value = G_VALUE_INIT;
214 static const guint gwd_settings_storage_gconf_n_construction_params = 1;
215 GParameter param[gwd_settings_storage_gconf_n_construction_params];
216- GWDSettingsStorage *storage = NULL;
217+ GWDSettingsStorage *storage;
218
219 g_value_init (&writable_value, G_TYPE_POINTER);
220 g_value_set_pointer (&writable_value, writable);
221
222=== modified file 'gtk/window-decorator/gwd-settings-storage-gsettings.c'
223--- gtk/window-decorator/gwd-settings-storage-gsettings.c 2012-09-10 09:19:31 +0000
224+++ gtk/window-decorator/gwd-settings-storage-gsettings.c 2012-11-20 14:15:25 +0000
225@@ -400,7 +400,7 @@
226 GValue gwd_value = G_VALUE_INIT;
227 GValue writable_value = G_VALUE_INIT;
228
229- GWDSettingsStorage *storage = NULL;
230+ GWDSettingsStorage *storage;
231
232 g_return_val_if_fail (writable != NULL, NULL);
233
234
235=== modified file 'gtk/window-decorator/gwd-settings-xproperty-storage.c'
236--- gtk/window-decorator/gwd-settings-xproperty-storage.c 2012-09-06 10:08:25 +0000
237+++ gtk/window-decorator/gwd-settings-xproperty-storage.c 2012-11-20 14:15:25 +0000
238@@ -262,7 +262,7 @@
239 {
240 static const guint gwd_settings_xprop_storage_n_construction_params = 3;
241 GParameter param[gwd_settings_xprop_storage_n_construction_params];
242- GWDSettingsXPropertyStorage *storage = NULL;
243+ GWDSettingsXPropertyStorage *storage;
244
245 GValue display_value = G_VALUE_INIT;
246 GValue root_window_value = G_VALUE_INIT;
247
248=== modified file 'kde/window-decorator-kde4/switcher.cpp'
249--- kde/window-decorator-kde4/switcher.cpp 2012-08-05 14:21:43 +0000
250+++ kde/window-decorator-kde4/switcher.cpp 2012-11-20 14:15:25 +0000
251@@ -222,7 +222,7 @@
252 void
253 KWD::Switcher::updateWindowProperties ()
254 {
255- long *data = NULL;
256+ long *data;
257 decor_quad_t quads[N_QUADS_MAX];
258 unsigned int nOffset = 1, frameType = 0, frameState = 0, frameActions = 0;
259 int nQuad;
260
261=== modified file 'kde/window-decorator-kde4/window.cpp'
262--- kde/window-decorator-kde4/window.cpp 2012-11-14 10:17:09 +0000
263+++ kde/window-decorator-kde4/window.cpp 2012-11-20 14:15:25 +0000
264@@ -1257,7 +1257,6 @@
265 mDecor->borders (normExtents.left, normExtents.right,
266 normExtents.top, normExtents.bottom);
267 mState = saveState;
268- mState = saveState;
269 mDecor->borders (mBorder.left, mBorder.right, mBorder.top, mBorder.bottom);
270
271 left = mExtents.left;
272@@ -1337,7 +1336,7 @@
273 else
274 {
275 decor_quad_t *q = quads;
276- int n = 0;
277+ int n;
278
279 // top
280 n = decor_set_horz_quad_line (q, left, 0, right, 0, -top, 0,
281
282=== modified file 'plugins/bicubic/src/bicubic.cpp'
283--- plugins/bicubic/src/bicubic.cpp 2010-09-30 22:21:03 +0000
284+++ plugins/bicubic/src/bicubic.cpp 2012-11-20 14:15:25 +0000
285@@ -150,7 +150,7 @@
286 {
287 GLFragment::Attrib fa = attrib;
288 int function, param;
289- int unit = 0;
290+ int unit;
291
292 param = fa.allocParameters (3);
293 unit = fa.allocTextureUnits (1);
294
295=== modified file 'plugins/cube/src/cube.cpp'
296--- plugins/cube/src/cube.cpp 2012-10-16 09:28:45 +0000
297+++ plugins/cube/src/cube.cpp 2012-11-20 14:15:25 +0000
298@@ -1311,7 +1311,7 @@
299 bool wasCulled = false;
300 bool paintCaps;
301 int cullNorm, cullInv;
302- int output = 0;
303+ int output;
304
305 output = ((unsigned int) outputPtr->id () != (unsigned int) ~0) ?
306 outputPtr->id () : 0;
307
308=== modified file 'plugins/dbus/src/dbus.cpp'
309--- plugins/dbus/src/dbus.cpp 2012-08-03 10:12:25 +0000
310+++ plugins/dbus/src/dbus.cpp 2012-11-20 14:15:25 +0000
311@@ -326,7 +326,7 @@
312 DBusMessage *message,
313 char **path)
314 {
315- CompOption *option = NULL;
316+ CompOption *option;
317 int nOptions;
318
319 xmlTextWriterPtr writer;
320
321=== modified file 'plugins/decor/src/decor.cpp'
322--- plugins/decor/src/decor.cpp 2012-11-05 20:50:59 +0000
323+++ plugins/decor/src/decor.cpp 2012-11-20 14:15:25 +0000
324@@ -2552,7 +2552,7 @@
325 if (dw->inputFrame ==
326 ((XShapeEvent *) event)->window)
327 {
328- XRectangle *shapeRects = 0;
329+ XRectangle *shapeRects;
330 int order, n;
331
332 dw->frameRegion = CompRegion ();
333@@ -2578,7 +2578,7 @@
334 else if (dw->outputFrame ==
335 ((XShapeEvent *) event)->window)
336 {
337- XRectangle *shapeRects = 0;
338+ XRectangle *shapeRects;
339 int order, n;
340
341 dw->frameRegion = CompRegion ();
342
343=== modified file 'plugins/grid/src/grid.cpp'
344--- plugins/grid/src/grid.cpp 2012-11-18 12:18:19 +0000
345+++ plugins/grid/src/grid.cpp 2012-11-20 14:15:25 +0000
346@@ -128,7 +128,7 @@
347 bool key)
348 {
349 Window xid;
350- CompWindow *cw = 0;
351+ CompWindow *cw;
352
353 xid = CompOption::getIntOptionNamed (option, "window");
354 cw = screen->findWindow (xid);
355
356=== modified file 'plugins/opengl/src/texture.cpp'
357--- plugins/opengl/src/texture.cpp 2012-09-19 12:18:34 +0000
358+++ plugins/opengl/src/texture.cpp 2012-11-20 14:15:25 +0000
359@@ -479,7 +479,7 @@
360
361 GLTexture::List rv (1);
362 EglTexture *tex = NULL;
363- EGLImageKHR eglImage = NULL;
364+ EGLImageKHR eglImage;
365 GLTexture::Matrix matrix = _identity_matrix;
366
367 const EGLint img_attribs[] = {
368
369=== modified file 'plugins/resize/src/logic/src/resize-logic.cpp'
370--- plugins/resize/src/logic/src/resize-logic.cpp 2012-09-05 16:42:03 +0000
371+++ plugins/resize/src/logic/src/resize-logic.cpp 2012-11-20 14:15:25 +0000
372@@ -1365,8 +1365,6 @@
373 bool sb = mScreen->outputDevs ().at (output).workArea ().bottom () <
374 w->serverGeometry ().bottom ();
375
376- lco = tco = bco = rco = output;
377-
378 /* Prevent resizing beyond work area edges when resize is
379 initiated externally (e.g. with window frame or menu)
380 and not with a key (e.g. alt+button) */
381
382=== modified file 'plugins/workarounds/src/workarounds.cpp'
383--- plugins/workarounds/src/workarounds.cpp 2012-08-09 07:09:41 +0000
384+++ plugins/workarounds/src/workarounds.cpp 2012-11-20 14:15:25 +0000
385@@ -567,7 +567,7 @@
386 void
387 WorkaroundsScreen::setWindowState (unsigned int state, Window id)
388 {
389- int i = 0;
390+ int i;
391 Atom data[32];
392
393 i = compiz::window::fillStateData (state, data);
394
395=== modified file 'src/screen.cpp'
396--- src/screen.cpp 2012-11-13 07:56:49 +0000
397+++ src/screen.cpp 2012-11-20 14:15:25 +0000
398@@ -1583,7 +1583,7 @@
399 void
400 PrivateScreen::setWindowState (unsigned int state, Window id)
401 {
402- int i = 0;
403+ int i;
404 Atom data[32];
405
406 i = compiz::window::fillStateData (state, data);

Subscribers

People subscribed via source and target branches