Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation Warnings on ubuntu 10.10 #9

Closed
eternal1 opened this issue Aug 12, 2011 · 1 comment
Closed

Compilation Warnings on ubuntu 10.10 #9

eternal1 opened this issue Aug 12, 2011 · 1 comment

Comments

@eternal1
Copy link

Probably, you are aware of this, but this a the compilation warning on a ubuntu 10.10 system.

Battlescape/AggroBAIState.cpp: In member function ‘virtual void OpenXcom::AggroBAIState::think(OpenXcom::BattleAction*)’:
Battlescape/AggroBAIState.cpp:113: warning: unused variable ‘tu’

Savegame/SavedBattleGame.cpp: In member function ‘void OpenXcom::SavedBattleGame::load(const YAML::Node&)’:
Savegame/SavedBattleGame.cpp:114: warning: operation on ‘dp’ may be undefined

Ufopaedia/ArticleStateItem.cpp:171: warning: enumeration value ‘BT_NONE’ not handled in switch
Ufopaedia/ArticleStateItem.cpp:171: warning: enumeration value ‘BT_MELEE’ not handled in switch
Ufopaedia/ArticleStateItem.cpp:171: warning: enumeration value ‘BT_PROXIMITYGRENADE’ not handled in switch
Ufopaedia/ArticleStateItem.cpp:171: warning: enumeration value ‘BT_MEDIKIT’ not handled in switch
Ufopaedia/ArticleStateItem.cpp:171: warning: enumeration value ‘BT_SCANNER’ not handled in switch

Ufopaedia/Ufopaedia.cpp:72: warning: enumeration value ‘UFOPAEDIA_TYPE_UNKNOWN’ not handled in switch
Ufopaedia/Ufopaedia.cpp:72: warning: enumeration value ‘UFOPAEDIA_TYPE_HWP’ not handled in switch
Ufopaedia/Ufopaedia.cpp:72: warning: enumeration value ‘UFOPAEDIA_TYPE_ARMOR’ not handled in switch

I am running the new version, the make command finish without error.

regards

@eternal1
Copy link
Author

This patch file generated by the output of git diff solve all the warning .. except for this.
Savegame/SavedBattleGame.cpp: In member function ‘void OpenXcom::SavedBattleGame::load(const YAML::Node&)’:
Savegame/SavedBattleGame.cpp:114: warning: operation on ‘dp’ may be undefined

diff --git a/src/Battlescape/AggroBAIState.cpp b/src/Battlescape/AggroBAIState.cpp
index 7762fa7..6e2066a 100644
--- a/src/Battlescape/AggroBAIState.cpp
+++ b/src/Battlescape/AggroBAIState.cpp
@@ -110,7 +110,7 @@ void AggroBAIState::think(BattleAction *action)
_lastKnownPosition = _aggroTarget->getPosition();
action->target = _aggroTarget->getPosition();
action->weapon = _game->getMainHandWeapon(action->actor);

  •                   int tu = action->actor->getActionTUs(action->type, action->weapon);
    
  •                   //int tu = action->actor->getActionTUs(action->type, action->weapon);
                    if (action->weapon && action->weapon->getAmmoItem() && action->weapon->getAmmoItem()->getAmmoQuantity())
                    {
                            action->type = BA_SNAPSHOT;
    
    diff --git a/src/Ufopaedia/ArticleStateItem.cpp b/src/Ufopaedia/ArticleStateItem.cpp
    index 73771ea..4f1de6a 100644
    --- a/src/Ufopaedia/ArticleStateItem.cpp
    +++ b/src/Ufopaedia/ArticleStateItem.cpp
    @@ -199,6 +199,11 @@ namespace OpenXcom
    }
    break;
    case BT_AMMO:
  •                   case BT_NONE:
    
  •                   case BT_MELEE:
    
  •                   case BT_PROXIMITYGRENADE:
    
  •                   case BT_MEDIKIT:
    
  •                   case BT_SCANNER:
    
    diego@node05:/src/OpenXcom/src$ git diff > fix-compilation-warnings.diff
    diego@node05:
    /src/OpenXcom/src$ cat fix-compilation-warnings.diff
    diff --git a/src/Battlescape/AggroBAIState.cpp b/src/Battlescape/AggroBAIState.cpp
    index 7762fa7..6e2066a 100644
    --- a/src/Battlescape/AggroBAIState.cpp
    +++ b/src/Battlescape/AggroBAIState.cpp
    @@ -110,7 +110,7 @@ void AggroBAIState::think(BattleAction *action)
    _lastKnownPosition = _aggroTarget->getPosition();
    action->target = _aggroTarget->getPosition();
    action->weapon = _game->getMainHandWeapon(action->actor);
  •                   int tu = action->actor->getActionTUs(action->type, action->weapon);
    
  •                   //int tu = action->actor->getActionTUs(action->type, action->weapon);
                    if (action->weapon && action->weapon->getAmmoItem() && action->weapon->getAmmoItem()->getAmmoQuantity())
                    {
                            action->type = BA_SNAPSHOT;
    
    diff --git a/src/Ufopaedia/ArticleStateItem.cpp b/src/Ufopaedia/ArticleStateItem.cpp
    index 73771ea..4f1de6a 100644
    --- a/src/Ufopaedia/ArticleStateItem.cpp
    +++ b/src/Ufopaedia/ArticleStateItem.cpp
    @@ -199,6 +199,11 @@ namespace OpenXcom
    }
    break;
    case BT_AMMO:
  •                   case BT_NONE:
    
  •                   case BT_MELEE:
    
  •                   case BT_PROXIMITYGRENADE:
    
  •                   case BT_MEDIKIT:
    
  •                   case BT_SCANNER:
                    case BT_GRENADE:
                            setDamageTypeText(_txtAmmoType[0], defs->item);
    

diff --git a/src/Ufopaedia/Ufopaedia.cpp b/src/Ufopaedia/Ufopaedia.cpp
index 5b3dc41..85a70fc 100644
--- a/src/Ufopaedia/Ufopaedia.cpp
+++ b/src/Ufopaedia/Ufopaedia.cpp
@@ -92,6 +92,15 @@ namespace OpenXcom
case UFOPAEDIA_TYPE_UFO:
return new ArticleStateUfo(game, static_cast<ArticleDefinitionUfo *> (article));
break;

  •                   case UFOPAEDIA_TYPE_UNKNOWN:
    
  •                           //Need to implement case
    
  •                           break;
    
  •                   case UFOPAEDIA_TYPE_HWP:
    
  •                           //Need to implement case
    
  •                           break;
    
  •                   case UFOPAEDIA_TYPE_ARMOR:
    
  •                           //Need to implement case
    
  •                           break;
            }
            return 0;
    }
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant