Skip to content

Commit 002c29a

Browse files
committed
Plugins (gforce): Fix GCC 'may be used uninitialized' warnings.
1 parent 31e7eaa commit 002c29a

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/XStrList.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,12 @@ long XStrList::Add( const UtilStr& inStr ) {
9595

9696

9797
long XStrList::FetchBestMatch( const UtilStr& inStr ) {
98-
long best, bestScore, score, i;
99-
UtilStr* str;
100-
101-
best = 0;
98+
long bestScore = 0;
99+
long best = 0;
100+
UtilStr* str;
102101

103-
for ( i = 1; mStrings.Fetch( i, (void**) &str ); i++ ) {
104-
score = str -> LCSMatchScore( inStr );
102+
for ( long i = 1; mStrings.Fetch( i, (void**) &str ); i++ ) {
103+
long score = str -> LCSMatchScore( inStr );
105104
if ( score > bestScore || i == 1 ) {
106105
best = i;
107106
bestScore = score;

libvisual-plugins/plugins/actor/gforce/Common/UI/LineXX.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
halfW = ( tw ) >> 1;
138138

139139
if ( tw < 12 ) {
140-
const char* c_shape;
140+
const char* c_shape = nullptr;
141141
__circ( tw, c_shape )
142142
for ( j = 0; j < tw; j++ ) {
143143
c_x = c_shape[ j ];

libvisual-plugins/plugins/actor/gforce/Common/io/CEgIStream.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ short int CEgIStream::GetShort() {
5050

5151

5252
unsigned char CEgIStream::GetByte() {
53-
unsigned char c;
53+
unsigned char c = 0;
5454

5555
if ( mIsTied ) {
5656
if ( mPos != 0 ) {
@@ -74,7 +74,7 @@ unsigned char CEgIStream::GetByte() {
7474

7575

7676
unsigned char CEgIStream::PeekByte() {
77-
unsigned char c;
77+
unsigned char c = 0;
7878

7979
if ( mIsTied ) {
8080
if ( mPos != 0 )

0 commit comments

Comments
 (0)