QuantGen / BEDMatrix

A matrix-like wrapper around PLINK .bed files
Other
18 stars 2 forks source link

Eliminate compiler warnings #8

Closed agrueneberg closed 9 years ago

agrueneberg commented 9 years ago
subsetBED.cpp:72:24: warning: variable 'mapping' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
            } else if (genotype == 1) {
                       ^~~~~~~~~~~~~
subsetBED.cpp:77:26: note: uninitialized use occurs here
            out(idx_i) = mapping;
                         ^~~~~~~
subsetBED.cpp:72:20: note: remove the 'if' if its condition is always true
            } else if (genotype == 1) {
                   ^~~~~~~~~~~~~~~~~~~
subsetBED.cpp:65:24: note: initialize the variable 'mapping' to silence this warning
            int mapping;
                       ^
                        = 0
subsetBED.cpp:176:26: warning: variable 'mapping' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
              } else if (genotype == 1) {
                         ^~~~~~~~~~~~~
subsetBED.cpp:181:35: note: uninitialized use occurs here
              out(idx_i, idx_j) = mapping;
                                  ^~~~~~~
subsetBED.cpp:176:22: note: remove the 'if' if its condition is always true
              } else if (genotype == 1) {
                     ^~~~~~~~~~~~~~~~~~~
subsetBED.cpp:169:26: note: initialize the variable 'mapping' to silence this warning
              int mapping;
                         ^
                          = 0
2 warnings generated.
agrueneberg commented 9 years ago

Fixed in e47ec77b98a6fb4327a8504266d08977f9e6661c.