Description of problem: In many methods, variables have greater scope then required. An example: void foobar(...) { int res; int foo; res = ... if(!res) { foo = ... } } This can be modified to: void foobar(...) { int res; res = ... if(!res) { int foo; foo = ... } } Actual results: In the current state, encapsulation is adversely affected by inappropriate variables scope. Expected results: Variables should have "minimum viability" scope in order to enforce encapsulation. Additional info: Modifying this should be an ongoing effort and not focused on solely.
Is there a list of such instances which can be referred to for continual work on the topic reported?
(In reply to sankarshan from comment #1) > Is there a list of such instances which can be referred to for continual > work on the topic reported? I can not provide such a list, because this is something that present all over the code. Almost every method in the code behaves in this manner. I believe that the best way to address this is keep this in mind and try to change this in whatever method we change in the ongoing patches.
This type of work should be performed in the scope of Bug 1193929 - GlusterFS can be improved. Closing this.