Skip to content

Commit

Permalink
Plugins (gforce): Fix GCC 'may be used uninitialized' warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaixiong committed Mar 31, 2023
1 parent 29e9ed4 commit 0e730c1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,12 @@ long XStrList::Add( const UtilStr& inStr ) {


long XStrList::FetchBestMatch( const UtilStr& inStr ) {
long best, bestScore, score, i;
UtilStr* str;

best = 0;
long bestScore = 0;
long best = 0;
UtilStr* str;

for ( i = 1; mStrings.Fetch( i, (void**) &str ); i++ ) {
score = str -> LCSMatchScore( inStr );
for ( long i = 1; mStrings.Fetch( i, (void**) &str ); i++ ) {
long score = str -> LCSMatchScore( inStr );
if ( score > bestScore || i == 1 ) {
best = i;
bestScore = score;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
halfW = ( tw ) >> 1;

if ( tw < 12 ) {
const char* c_shape;
const char* c_shape = nullptr;
__circ( tw, c_shape )
for ( j = 0; j < tw; j++ ) {
c_x = c_shape[ j ];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ short int CEgIStream::GetShort() {


unsigned char CEgIStream::GetByte() {
unsigned char c;
unsigned char c = 0;

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


unsigned char CEgIStream::PeekByte() {
unsigned char c;
unsigned char c = 0;

if ( mIsTied ) {
if ( mPos != 0 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ void GF_Palette::Assign( const ArgList& inArgs ) {


void GF_Palette::Evaluate( PixPalEntry outPalette[ 256 ] ) {
int i;
float H, S, V, inc = 1.0 / 255.0;
float H = 0.0;
float S = 0.0;
float V = 0.0;
float inc = 1.0 / 255.0;

*mIntensity = 0;

Expand All @@ -50,7 +52,7 @@ void GF_Palette::Evaluate( PixPalEntry outPalette[ 256 ] ) {
if ( ! mS_I_Dep ) S = mS.Evaluate();
if ( ! mV_I_Dep ) V = mV.Evaluate();

for ( i = 0; i < 256; i++, *mIntensity += inc ) {
for ( int i = 0; i < 256; i++, *mIntensity += inc ) {

// Don't reevaluate vars that are indep of i
if ( mH_I_Dep ) H = mH.Evaluate();
Expand Down

0 comments on commit 0e730c1

Please sign in to comment.