Page MenuHomePhabricator

epulse: e_mod_main:_gc_orient: Don't use uninitialized w, h
AbandonedPublic

Authored by c on Apr 9 2015, 7:36 AM.

Details

Reviewers
ceolin
raster
Summary
src/module/e_mod_main.c:564:6: warning: variable 'w' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
     default:
     ^~~~~~~
src/module/e_mod_main.c:568:36: note: uninitialized use occurs here
   e_gadcon_client_aspect_set(gcc, w, h);
                                   ^
src/module/e_mod_main.c:547:9: note: initialize the variable 'w' to silence this warning
   int w, h;
        ^
         = 0
src/module/e_mod_main.c:564:6: warning: variable 'h' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
     default:
     ^~~~~~~
src/module/e_mod_main.c:568:39: note: uninitialized use occurs here
   e_gadcon_client_aspect_set(gcc, w, h);
                                      ^
src/module/e_mod_main.c:547:12: note: initialize the variable 'h' to silence this warning
   int w, h;
           ^
            = 0
Test Plan

Compiled, no warnings.

Alternatively, we could initialize w, h to zero as Clang suggests. But I don't know that that is meaningful.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
c updated this revision to Diff 5316.Apr 9 2015, 7:36 AM
c retitled this revision from to epulse: e_mod_main:_gc_orient: Don't use uninitialized w, h.
c updated this object.
c edited the test plan for this revision. (Show Details)
c added a reviewer: ceolin.
c added a project: Restricted Project.
c changed the visibility from "All Users" to "Public (No Login Required)".
raster requested changes to this revision.Apr 27 2015, 1:04 AM
raster added a reviewer: raster.
raster added a subscriber: raster.

no - return .. no... or just move default up so it sets w and h to 16 always. :) as such we dont use the orientation cases here as we're always "square"

This revision now requires changes to proceed.Apr 27 2015, 1:04 AM

ping? traveling right?

c abandoned this revision.May 18 2015, 5:07 PM

Yep, although this one can just be fixed by someone with a commit bit.

ceolin edited edge metadata.May 22 2015, 6:51 PM

fixed on my master, i did exactly the current mixer does. Set w and h to 16.