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
=== modified file 'compizconfig/gconf/src/gconf.c'
--- compizconfig/gconf/src/gconf.c 2012-08-16 17:00:25 +0000
+++ compizconfig/gconf/src/gconf.c 2012-11-20 14:15:25 +0000
@@ -970,7 +970,7 @@
970static char*970static char*
971getCurrentProfileName (void)971getCurrentProfileName (void)
972{972{
973 GConfSchema *schema = NULL;973 GConfSchema *schema;
974974
975 schema = gconf_client_get_schema (client,975 schema = gconf_client_get_schema (client,
976 COMPIZCONFIG "/current_profile", NULL);976 COMPIZCONFIG "/current_profile", NULL);
977977
=== modified file 'compizconfig/gsettings/gsettings_backend_shared/ccs_gsettings_backend.c'
--- compizconfig/gsettings/gsettings_backend_shared/ccs_gsettings_backend.c 2012-10-09 10:56:58 +0000
+++ compizconfig/gsettings/gsettings_backend_shared/ccs_gsettings_backend.c 2012-11-20 14:15:25 +0000
@@ -96,7 +96,7 @@
96 const char *path,96 const char *path,
97 CCSContext *context)97 CCSContext *context)
98{98{
99 CCSGSettingsWrapper *settingsObj = NULL;99 CCSGSettingsWrapper *settingsObj;
100 gchar *schemaName = getSchemaNameForPlugin (plugin);100 gchar *schemaName = getSchemaNameForPlugin (plugin);
101 GVariant *writtenPlugins;101 GVariant *writtenPlugins;
102 gsize newWrittenPluginsSize;102 gsize newWrittenPluginsSize;
103103
=== modified file 'compizconfig/gsettings/gsettings_backend_shared/gsettings_util.c'
--- compizconfig/gsettings/gsettings_backend_shared/gsettings_util.c 2012-11-16 16:17:59 +0000
+++ compizconfig/gsettings/gsettings_backend_shared/gsettings_util.c 2012-11-20 14:15:25 +0000
@@ -77,7 +77,7 @@
77gchar *77gchar *
78getSchemaNameForPlugin (const char *plugin)78getSchemaNameForPlugin (const char *plugin)
79{79{
80 gchar *schemaName = NULL;80 gchar *schemaName;
8181
82 schemaName = g_strconcat (PLUGIN_SCHEMA_ID_PREFIX, plugin, NULL);82 schemaName = g_strconcat (PLUGIN_SCHEMA_ID_PREFIX, plugin, NULL);
8383
@@ -96,8 +96,8 @@
96char *96char *
97translateUnderscoresToDashesForGSettings (const char *truncated)97translateUnderscoresToDashesForGSettings (const char *truncated)
98{98{
99 gchar *clean = NULL;99 gchar *clean;
100 gchar **delimited = NULL;100 gchar **delimited;
101101
102 /* Replace underscores with dashes */102 /* Replace underscores with dashes */
103 delimited = g_strsplit (truncated, "_", 0);103 delimited = g_strsplit (truncated, "_", 0);
@@ -136,8 +136,8 @@
136gchar *136gchar *
137translateKeyForCCS (const char *gsettingName)137translateKeyForCCS (const char *gsettingName)
138{138{
139 gchar *clean = NULL;139 gchar *clean;
140 gchar **delimited = NULL;140 gchar **delimited;
141141
142 /* Replace dashes with underscores */142 /* Replace dashes with underscores */
143 delimited = g_strsplit (gsettingName, "-", 0);143 delimited = g_strsplit (gsettingName, "-", 0);
@@ -1065,7 +1065,7 @@
1065CCSGSettingsWrapper *1065CCSGSettingsWrapper *
1066getSettingsObjectForCCSSetting (CCSBackend *backend, CCSSetting *setting)1066getSettingsObjectForCCSSetting (CCSBackend *backend, CCSSetting *setting)
1067{1067{
1068 CCSGSettingsWrapper *ret = NULL;1068 CCSGSettingsWrapper *ret;
1069 gchar *pathName = makeSettingPath (ccsGSettingsBackendGetCurrentProfile (backend), setting);1069 gchar *pathName = makeSettingPath (ccsGSettingsBackendGetCurrentProfile (backend), setting);
10701070
1071 ret = ccsGSettingsGetSettingsObjectForPluginWithPath (backend,1071 ret = ccsGSettingsGetSettingsObjectForPluginWithPath (backend,
@@ -1085,7 +1085,7 @@
1085 GVariant *plugins;1085 GVariant *plugins;
1086 GVariant *profiles;1086 GVariant *profiles;
1087 const char *currentProfile = ccsGSettingsBackendGetCurrentProfile (backend);1087 const char *currentProfile = ccsGSettingsBackendGetCurrentProfile (backend);
1088 gboolean ret = FALSE;1088 gboolean ret;
10891089
1090 plugins = ccsGSettingsBackendGetPluginsWithSetKeys (backend);1090 plugins = ccsGSettingsBackendGetPluginsWithSetKeys (backend);
1091 profiles = ccsGSettingsBackendGetExistingProfiles (backend);1091 profiles = ccsGSettingsBackendGetExistingProfiles (backend);
10921092
=== modified file 'compizconfig/integration/gnome/src/ccs_gnome_integration.c'
--- compizconfig/integration/gnome/src/ccs_gnome_integration.c 2012-10-18 06:29:46 +0000
+++ compizconfig/integration/gnome/src/ccs_gnome_integration.c 2012-11-20 14:15:25 +0000
@@ -639,7 +639,7 @@
639 }639 }
640 else640 else
641 {641 {
642 CCSPlugin *plugin = NULL;642 CCSPlugin *plugin;
643 CCSSetting *setting;643 CCSSetting *setting;
644644
645 plugin = ccsFindPlugin (priv->context, pluginName);645 plugin = ccsFindPlugin (priv->context, pluginName);
646646
=== modified file 'compizconfig/libcompizconfig/backend/src/ini.c'
--- compizconfig/libcompizconfig/backend/src/ini.c 2012-08-01 10:25:15 +0000
+++ compizconfig/libcompizconfig/backend/src/ini.c 2012-11-20 14:15:25 +0000
@@ -56,7 +56,7 @@
56static char*56static char*
57getIniFileName (char *profile)57getIniFileName (char *profile)
58{58{
59 char *configDir = NULL;59 char *configDir;
60 char *fileName = NULL;60 char *fileName = NULL;
6161
62 configDir = getenv ("XDG_CONFIG_HOME");62 configDir = getenv ("XDG_CONFIG_HOME");
@@ -644,7 +644,7 @@
644 CCSStringList ret = NULL;644 CCSStringList ret = NULL;
645 char *filePath = NULL;645 char *filePath = NULL;
646 char *homeDir = NULL;646 char *homeDir = NULL;
647 char *configDir = NULL;647 char *configDir;
648 648
649 configDir = getenv ("XDG_CONFIG_HOME");649 configDir = getenv ("XDG_CONFIG_HOME");
650 if (configDir && strlen (configDir))650 if (configDir && strlen (configDir))
651651
=== modified file 'compizconfig/libcompizconfig/src/compiz.cpp'
--- compizconfig/libcompizconfig/src/compiz.cpp 2012-08-15 10:19:02 +0000
+++ compizconfig/libcompizconfig/src/compiz.cpp 2012-11-20 14:15:25 +0000
@@ -729,7 +729,7 @@
729 const OptionMetadata & option)729 const OptionMetadata & option)
730{730{
731 const char *name;731 const char *name;
732 Bool readonly = FALSE;732 Bool readonly;
733733
734 name = option.name ().c_str ();734 name = option.name ().c_str ();
735735
@@ -1158,7 +1158,7 @@
1158static Bool1158static Bool
1159nodeExists (xmlNode * node, const char *path)1159nodeExists (xmlNode * node, const char *path)
1160{1160{
1161 xmlNode **nodes = NULL;1161 xmlNode **nodes;
1162 int num;1162 int num;
1163 nodes = getNodesFromXPath (node->doc, node, path, &num);1163 nodes = getNodesFromXPath (node->doc, node, path, &num);
11641164
11651165
=== modified file 'compizconfig/libcompizconfig/src/config.c'
--- compizconfig/libcompizconfig/src/config.c 2012-05-21 09:36:37 +0000
+++ compizconfig/libcompizconfig/src/config.c 2012-11-20 14:15:25 +0000
@@ -32,7 +32,7 @@
32static char*32static char*
33getConfigFileName (void)33getConfigFileName (void)
34{34{
35 char *configDir = NULL;35 char *configDir;
36 char *fileName = NULL;36 char *fileName = NULL;
3737
38 configDir = getenv ("XDG_CONFIG_HOME");38 configDir = getenv ("XDG_CONFIG_HOME");
3939
=== modified file 'compizconfig/libcompizconfig/src/main.c'
--- compizconfig/libcompizconfig/src/main.c 2012-11-19 06:07:45 +0000
+++ compizconfig/libcompizconfig/src/main.c 2012-11-20 14:15:25 +0000
@@ -3031,7 +3031,7 @@
3031{3031{
3032 CCSPluginList ap = ccsGetActivePluginList (context);3032 CCSPluginList ap = ccsGetActivePluginList (context);
3033 CCSPluginList list;3033 CCSPluginList list;
3034 CCSPlugin *p = NULL;3034 CCSPlugin *p;
3035 CCSString *strCore = calloc (1, sizeof (CCSString));3035 CCSString *strCore = calloc (1, sizeof (CCSString));
30363036
3037 strCore->value = strdup ("core");3037 strCore->value = strdup ("core");
@@ -4022,8 +4022,8 @@
4022static void4022static void
4023addBackendInfo (CCSBackendInfoList * bl, char *file)4023addBackendInfo (CCSBackendInfoList * bl, char *file)
4024{4024{
4025 void *dlhand = NULL;4025 void *dlhand;
4026 char *err = NULL;4026 char *err;
4027 Bool found = FALSE;4027 Bool found = FALSE;
40284028
4029 dlerror ();4029 dlerror ();
@@ -4696,7 +4696,7 @@
4696ccsSettingsUpgradeNew (const char *path, const char *name)4696ccsSettingsUpgradeNew (const char *path, const char *name)
4697{4697{
4698 CCSSettingsUpgrade *upgrade = calloc (1, sizeof (CCSSettingsUpgrade));4698 CCSSettingsUpgrade *upgrade = calloc (1, sizeof (CCSSettingsUpgrade));
4699 char *upgradeName = strdup (name);4699 char *upgradeName;
4700 unsigned int fnlen = strlen (path) + strlen (name) + 1;4700 unsigned int fnlen = strlen (path) + strlen (name) + 1;
47014701
4702 upgrade->file = calloc (fnlen + 1, sizeof (char));4702 upgrade->file = calloc (fnlen + 1, sizeof (char));
47034703
=== modified file 'gtk/window-decorator/events.c'
--- gtk/window-decorator/events.c 2012-10-06 16:11:05 +0000
+++ gtk/window-decorator/events.c 2012-11-20 14:15:25 +0000
@@ -827,7 +827,7 @@
827827
828 if (d)828 if (d)
829 {829 {
830 event_callback cb = NULL;830 event_callback cb;
831 Bool send_enter = FALSE;831 Bool send_enter = FALSE;
832 Bool send_leave = FALSE;832 Bool send_leave = FALSE;
833 BoxPtr entered_box;833 BoxPtr entered_box;
834834
=== modified file 'gtk/window-decorator/gwd-settings-notified.c'
--- gtk/window-decorator/gwd-settings-notified.c 2012-09-06 10:12:08 +0000
+++ gtk/window-decorator/gwd-settings-notified.c 2012-11-20 14:15:25 +0000
@@ -256,7 +256,7 @@
256 static const guint gwd_settings_notified_impl_n_construction_properties = 1;256 static const guint gwd_settings_notified_impl_n_construction_properties = 1;
257 GValue wnck_screen_value = G_VALUE_INIT;257 GValue wnck_screen_value = G_VALUE_INIT;
258 GParameter params[gwd_settings_notified_impl_n_construction_properties];258 GParameter params[gwd_settings_notified_impl_n_construction_properties];
259 GWDSettingsNotified *notified = NULL;259 GWDSettingsNotified *notified;
260260
261 g_value_init (&wnck_screen_value, G_TYPE_OBJECT);261 g_value_init (&wnck_screen_value, G_TYPE_OBJECT);
262 g_value_set_object (&wnck_screen_value, G_OBJECT (screen));262 g_value_set_object (&wnck_screen_value, G_OBJECT (screen));
263263
=== modified file 'gtk/window-decorator/gwd-settings-storage-gconf.c'
--- gtk/window-decorator/gwd-settings-storage-gconf.c 2012-09-06 10:08:25 +0000
+++ gtk/window-decorator/gwd-settings-storage-gconf.c 2012-11-20 14:15:25 +0000
@@ -409,7 +409,7 @@
409 GValue writable_value = G_VALUE_INIT;409 GValue writable_value = G_VALUE_INIT;
410 static const guint gwd_settings_storage_gconf_n_construction_params = 1;410 static const guint gwd_settings_storage_gconf_n_construction_params = 1;
411 GParameter param[gwd_settings_storage_gconf_n_construction_params];411 GParameter param[gwd_settings_storage_gconf_n_construction_params];
412 GWDSettingsStorage *storage = NULL;412 GWDSettingsStorage *storage;
413413
414 g_value_init (&writable_value, G_TYPE_POINTER);414 g_value_init (&writable_value, G_TYPE_POINTER);
415 g_value_set_pointer (&writable_value, writable);415 g_value_set_pointer (&writable_value, writable);
416416
=== modified file 'gtk/window-decorator/gwd-settings-storage-gsettings.c'
--- gtk/window-decorator/gwd-settings-storage-gsettings.c 2012-09-10 09:19:31 +0000
+++ gtk/window-decorator/gwd-settings-storage-gsettings.c 2012-11-20 14:15:25 +0000
@@ -400,7 +400,7 @@
400 GValue gwd_value = G_VALUE_INIT;400 GValue gwd_value = G_VALUE_INIT;
401 GValue writable_value = G_VALUE_INIT;401 GValue writable_value = G_VALUE_INIT;
402402
403 GWDSettingsStorage *storage = NULL;403 GWDSettingsStorage *storage;
404404
405 g_return_val_if_fail (writable != NULL, NULL);405 g_return_val_if_fail (writable != NULL, NULL);
406406
407407
=== modified file 'gtk/window-decorator/gwd-settings-xproperty-storage.c'
--- gtk/window-decorator/gwd-settings-xproperty-storage.c 2012-09-06 10:08:25 +0000
+++ gtk/window-decorator/gwd-settings-xproperty-storage.c 2012-11-20 14:15:25 +0000
@@ -262,7 +262,7 @@
262{262{
263 static const guint gwd_settings_xprop_storage_n_construction_params = 3;263 static const guint gwd_settings_xprop_storage_n_construction_params = 3;
264 GParameter param[gwd_settings_xprop_storage_n_construction_params];264 GParameter param[gwd_settings_xprop_storage_n_construction_params];
265 GWDSettingsXPropertyStorage *storage = NULL;265 GWDSettingsXPropertyStorage *storage;
266266
267 GValue display_value = G_VALUE_INIT;267 GValue display_value = G_VALUE_INIT;
268 GValue root_window_value = G_VALUE_INIT;268 GValue root_window_value = G_VALUE_INIT;
269269
=== modified file 'kde/window-decorator-kde4/switcher.cpp'
--- kde/window-decorator-kde4/switcher.cpp 2012-08-05 14:21:43 +0000
+++ kde/window-decorator-kde4/switcher.cpp 2012-11-20 14:15:25 +0000
@@ -222,7 +222,7 @@
222void222void
223KWD::Switcher::updateWindowProperties ()223KWD::Switcher::updateWindowProperties ()
224{224{
225 long *data = NULL;225 long *data;
226 decor_quad_t quads[N_QUADS_MAX];226 decor_quad_t quads[N_QUADS_MAX];
227 unsigned int nOffset = 1, frameType = 0, frameState = 0, frameActions = 0;227 unsigned int nOffset = 1, frameType = 0, frameState = 0, frameActions = 0;
228 int nQuad;228 int nQuad;
229229
=== modified file 'kde/window-decorator-kde4/window.cpp'
--- kde/window-decorator-kde4/window.cpp 2012-11-14 10:17:09 +0000
+++ kde/window-decorator-kde4/window.cpp 2012-11-20 14:15:25 +0000
@@ -1257,7 +1257,6 @@
1257 mDecor->borders (normExtents.left, normExtents.right,1257 mDecor->borders (normExtents.left, normExtents.right,
1258 normExtents.top, normExtents.bottom);1258 normExtents.top, normExtents.bottom);
1259 mState = saveState;1259 mState = saveState;
1260 mState = saveState;
1261 mDecor->borders (mBorder.left, mBorder.right, mBorder.top, mBorder.bottom);1260 mDecor->borders (mBorder.left, mBorder.right, mBorder.top, mBorder.bottom);
12621261
1263 left = mExtents.left;1262 left = mExtents.left;
@@ -1337,7 +1336,7 @@
1337 else1336 else
1338 {1337 {
1339 decor_quad_t *q = quads;1338 decor_quad_t *q = quads;
1340 int n = 0;1339 int n;
1341 1340
1342 // top1341 // top
1343 n = decor_set_horz_quad_line (q, left, 0, right, 0, -top, 0,1342 n = decor_set_horz_quad_line (q, left, 0, right, 0, -top, 0,
13441343
=== modified file 'plugins/bicubic/src/bicubic.cpp'
--- plugins/bicubic/src/bicubic.cpp 2010-09-30 22:21:03 +0000
+++ plugins/bicubic/src/bicubic.cpp 2012-11-20 14:15:25 +0000
@@ -150,7 +150,7 @@
150 {150 {
151 GLFragment::Attrib fa = attrib;151 GLFragment::Attrib fa = attrib;
152 int function, param;152 int function, param;
153 int unit = 0;153 int unit;
154 154
155 param = fa.allocParameters (3);155 param = fa.allocParameters (3);
156 unit = fa.allocTextureUnits (1);156 unit = fa.allocTextureUnits (1);
157157
=== modified file 'plugins/cube/src/cube.cpp'
--- plugins/cube/src/cube.cpp 2012-10-16 09:28:45 +0000
+++ plugins/cube/src/cube.cpp 2012-11-20 14:15:25 +0000
@@ -1311,7 +1311,7 @@
1311 bool wasCulled = false;1311 bool wasCulled = false;
1312 bool paintCaps;1312 bool paintCaps;
1313 int cullNorm, cullInv;1313 int cullNorm, cullInv;
1314 int output = 0;1314 int output;
13151315
1316 output = ((unsigned int) outputPtr->id () != (unsigned int) ~0) ?1316 output = ((unsigned int) outputPtr->id () != (unsigned int) ~0) ?
1317 outputPtr->id () : 0;1317 outputPtr->id () : 0;
13181318
=== modified file 'plugins/dbus/src/dbus.cpp'
--- plugins/dbus/src/dbus.cpp 2012-08-03 10:12:25 +0000
+++ plugins/dbus/src/dbus.cpp 2012-11-20 14:15:25 +0000
@@ -326,7 +326,7 @@
326 DBusMessage *message,326 DBusMessage *message,
327 char **path)327 char **path)
328{328{
329 CompOption *option = NULL;329 CompOption *option;
330 int nOptions;330 int nOptions;
331331
332 xmlTextWriterPtr writer;332 xmlTextWriterPtr writer;
333333
=== modified file 'plugins/decor/src/decor.cpp'
--- plugins/decor/src/decor.cpp 2012-11-05 20:50:59 +0000
+++ plugins/decor/src/decor.cpp 2012-11-20 14:15:25 +0000
@@ -2552,7 +2552,7 @@
2552 if (dw->inputFrame ==2552 if (dw->inputFrame ==
2553 ((XShapeEvent *) event)->window)2553 ((XShapeEvent *) event)->window)
2554 {2554 {
2555 XRectangle *shapeRects = 0;2555 XRectangle *shapeRects;
2556 int order, n;2556 int order, n;
25572557
2558 dw->frameRegion = CompRegion ();2558 dw->frameRegion = CompRegion ();
@@ -2578,7 +2578,7 @@
2578 else if (dw->outputFrame ==2578 else if (dw->outputFrame ==
2579 ((XShapeEvent *) event)->window)2579 ((XShapeEvent *) event)->window)
2580 {2580 {
2581 XRectangle *shapeRects = 0;2581 XRectangle *shapeRects;
2582 int order, n;2582 int order, n;
25832583
2584 dw->frameRegion = CompRegion ();2584 dw->frameRegion = CompRegion ();
25852585
=== modified file 'plugins/grid/src/grid.cpp'
--- plugins/grid/src/grid.cpp 2012-11-18 12:18:19 +0000
+++ plugins/grid/src/grid.cpp 2012-11-20 14:15:25 +0000
@@ -128,7 +128,7 @@
128 bool key)128 bool key)
129{129{
130 Window xid;130 Window xid;
131 CompWindow *cw = 0;131 CompWindow *cw;
132132
133 xid = CompOption::getIntOptionNamed (option, "window");133 xid = CompOption::getIntOptionNamed (option, "window");
134 cw = screen->findWindow (xid);134 cw = screen->findWindow (xid);
135135
=== modified file 'plugins/opengl/src/texture.cpp'
--- plugins/opengl/src/texture.cpp 2012-09-19 12:18:34 +0000
+++ plugins/opengl/src/texture.cpp 2012-11-20 14:15:25 +0000
@@ -479,7 +479,7 @@
479479
480 GLTexture::List rv (1);480 GLTexture::List rv (1);
481 EglTexture *tex = NULL;481 EglTexture *tex = NULL;
482 EGLImageKHR eglImage = NULL;482 EGLImageKHR eglImage;
483 GLTexture::Matrix matrix = _identity_matrix;483 GLTexture::Matrix matrix = _identity_matrix;
484484
485 const EGLint img_attribs[] = {485 const EGLint img_attribs[] = {
486486
=== modified file 'plugins/resize/src/logic/src/resize-logic.cpp'
--- plugins/resize/src/logic/src/resize-logic.cpp 2012-09-05 16:42:03 +0000
+++ plugins/resize/src/logic/src/resize-logic.cpp 2012-11-20 14:15:25 +0000
@@ -1365,8 +1365,6 @@
1365 bool sb = mScreen->outputDevs ().at (output).workArea ().bottom () <1365 bool sb = mScreen->outputDevs ().at (output).workArea ().bottom () <
1366 w->serverGeometry ().bottom ();1366 w->serverGeometry ().bottom ();
13671367
1368 lco = tco = bco = rco = output;
1369
1370 /* Prevent resizing beyond work area edges when resize is1368 /* Prevent resizing beyond work area edges when resize is
1371 initiated externally (e.g. with window frame or menu)1369 initiated externally (e.g. with window frame or menu)
1372 and not with a key (e.g. alt+button) */1370 and not with a key (e.g. alt+button) */
13731371
=== modified file 'plugins/workarounds/src/workarounds.cpp'
--- plugins/workarounds/src/workarounds.cpp 2012-08-09 07:09:41 +0000
+++ plugins/workarounds/src/workarounds.cpp 2012-11-20 14:15:25 +0000
@@ -567,7 +567,7 @@
567void567void
568WorkaroundsScreen::setWindowState (unsigned int state, Window id)568WorkaroundsScreen::setWindowState (unsigned int state, Window id)
569{569{
570 int i = 0;570 int i;
571 Atom data[32];571 Atom data[32];
572572
573 i = compiz::window::fillStateData (state, data);573 i = compiz::window::fillStateData (state, data);
574574
=== modified file 'src/screen.cpp'
--- src/screen.cpp 2012-11-13 07:56:49 +0000
+++ src/screen.cpp 2012-11-20 14:15:25 +0000
@@ -1583,7 +1583,7 @@
1583void1583void
1584PrivateScreen::setWindowState (unsigned int state, Window id)1584PrivateScreen::setWindowState (unsigned int state, Window id)
1585{1585{
1586 int i = 0;1586 int i;
1587 Atom data[32];1587 Atom data[32];
15881588
1589 i = compiz::window::fillStateData (state, data);1589 i = compiz::window::fillStateData (state, data);

Subscribers

People subscribed via source and target branches