ã¢ã¡ãªã«ã®äŒç€ŸElectronicArts IncïŒEAïŒã¯ãã²ãŒã CommandïŒConquerïŒTiberian Dawnããã³CommandïŒConquerïŒRedAlertã®ãªãŒãã³ãœãŒã¹ã³ãŒãããªãªãŒã¹ããŸãããPVS-Studioã¢ãã©ã€ã¶ãŒã䜿çšãããœãŒã¹ã³ãŒãã§æ°åã®ãã°ãèŠã€ãããŸãããèŠã€ãã£ãæ¬ é¥ã®èª¬æã®ç¶ããæè¿ããŸãã
åæžã
CommandïŒConquerã¯ããªã¢ã«ã¿ã€ã æŠç¥ã®ãžã£ã³ã«ã®äžé£ã®ã³ã³ãã¥ãŒã¿ãŒã²ãŒã ã§ããã·ãªãŒãºã®æåã®ã²ãŒã ã¯1995幎ã«ãªãªãŒã¹ãããŸãããã²ãŒã ã®ãœãŒã¹ã³ãŒãã¯ãCommandïŒConquerRemasteredã³ã¬ã¯ã·ã§ã³ã®ãªãªãŒã¹ãšãšãã«å ¬éãããŸããã ã³ãŒãå ã®ãšã©ãŒãèŠã€ããããã«ãPVS-Studioã¢ãã©ã€ã¶ãŒã䜿çšãããŸãããããã¯ãCãC ++ãCïŒãããã³Javaã§èšè¿°ãããããã°ã©ã ã®ãœãŒã¹ã³ãŒãã®ãšã©ãŒãšæœåšçãªè匱æ§ãç¹å®ããããã®ããŒã«ã§ãã æåã®ãã°ã®æŠèŠãžã®ãªã³ã¯ïŒãã³ãã³ãïŒã³ã³ã«ãŒã²ãŒã ïŒ90幎代ã®ãã°ã第1å·»ãã
æ¡ä»¶ã®ãšã©ãŒ
V583 '?:'æŒç®åã¯ãæ¡ä»¶åŒã«é¢ä¿ãªããåžžã«1ã€ã®åãå€ãè¿ããŸãïŒ3072ãSTARTUP.CPP1136
void Read_Setup_Options( RawFileClass *config_file )
{
....
ScreenHeight = ini.Get_Bool("Options", "Resolution", false) ? 3072 : 3072;
....
}
ãŠãŒã¶ãŒãäžéšã®èšå®ã«åœ±é¿ãäžããããšãã§ããªãã£ãããšãå€æããŸãããããæ£ç¢ºã«ã¯ã圌ãã¯äœããããŸããããäžå æŒç®åãåžžã«1ã€ã®å€ãè¿ããšããäºå®ã®ããã«ãå®éã«ã¯äœãå€æŽãããŠããŸããã
V590'i <8 && i <4 'åŒã®æ€æ»ãæ€èšããŠãã ãããè¡šçŸãå€ããããã誀æ€ãå«ãŸããŠããŸãã DLLInterface.cpp 2238
// Maximum number of multi players possible.
#define MAX_PLAYERS 8 // max # of players we can have
for (int i = 0; i < MAX_PLAYERS && i < 4; i++) {
if (GlyphxPlayerIDs[i] == player_id) {
MultiplayerStartPositions[i] = XY_Cell(x, y);
}
}
ãµã€ã¯ã«ãééã£ãŠããããããã¹ãŠã®ãã¬ãŒã€ãŒã«äœçœ®ãèšå®ãããŠããŸãããäžæ¹ã§ã¯ãå®æ°MAX_PLAYERS 8ã衚瀺ãããããããã¬ãŒã€ãŒã®æ倧æ°ã§ãããšæ³å®ããŠããŸããäžæ¹ãæ¡ä»¶i <4ãš&&æŒç®åã衚瀺ãããŸãããããã£ãŠãã«ãŒãã8åç¹°ãè¿ãããããšã¯ãããŸããããããããéçºã®åæ段éã§ã¯ãããã°ã©ããŒã¯å®æ°ã䜿çšãããéå§ãããšãã«ãã³ãŒãããå€ãæ°å€ãåé€ããã®ãå¿ããŠããŸããã
V648ã&&ãæäœã®åªå 床ã¯ã||ãã®åªå 床ãããé«ãæäœã INFANTRY.CPP 1003
void InfantryClass::Assign_Target(TARGET target)
{
....
if (building && building->Class->IsCaptureable &&
(GameToPlay != GAME_NORMAL || *building != STRUCT_EYE && Scenario < 13)) {
Assign_Destination(target);
}
....
}
|| æŒç®åã®æäœã®åªå 床ãæå®ããªãã ãã§ãã³ãŒãããããã«ããããïŒãããŠãããããšã©ãŒã«ããïŒããšãã§ããŸããããã³&&ããããééãã§ãããã©ããã¯ããã§ã¯å®å šã«äžæã§ãããããããããã®ãããžã§ã¯ãã®ã³ãŒãã®å šäœçãªå質ãèæ ®ããŠããããä»ã®ããã€ãã®å Žæã§ãæäœã®åªå é äœã«èª€ãããããšä»®å®ããŸãããã
- V648ã&&ãæäœã®åªå 床ã¯ã||ãã®åªå 床ãããé«ã æäœãTEAM.CPP 456
- V648ã&&ãæäœã®åªå 床ã¯ã||ãã®åªå 床ãããé«ã æäœãDISPLAY.CPP 1160
- V648ã&&ãæäœã®åªå 床ã¯ã||ãã®åªå 床ãããé«ã æäœãDISPLAY.CPP 1571
- V648ã&&ãæäœã®åªå 床ã¯ã||ãã®åªå 床ãããé«ã æäœãHOUSE.CPP 2594
- V648ã&&ãæäœã®åªå 床ã¯ã||ãã®åªå 床ãããé«ã æäœãINIT.CPP 2541
V617ç¶æ ã®æ€æ»ãæ€èšããŠãã ããã'|'ã® 'ïŒïŒ1L << STRUCT_CHRONOSPHEREïŒïŒ'åŒæ° ãããåäœã®æäœã«ãŒã以å€ã®å€ãå«ãŸããŠããŸããHOUSE.CPP 5089
typedef enum StructType : char {
STRUCT_NONE=-1,
STRUCT_ADVANCED_TECH,
STRUCT_IRON_CURTAIN,
STRUCT_WEAP,
STRUCT_CHRONOSPHERE, // 3
....
}
#define STRUCTF_CHRONOSPHERE (1L << STRUCT_CHRONOSPHERE)
UrgencyType HouseClass::Check_Build_Power(void) const
{
....
if (State == STATE_THREATENED || State == STATE_ATTACKED) {
if (BScan | (STRUCTF_CHRONOSPHERE)) { // <=
urgency = URGENCY_HIGH;
}
}
....
}
å€æ°ã®ç¹å®ã®ããããèšå®ãããŠãããã©ããã確èªããã«ã¯ã|ã§ã¯ãªãïŒæŒç®åã䜿çšããŸãããã®ã³ãŒãã®ã¿ã€ããã¹ã«ãããæ¡ä»¶ã¯åžžã«çã§ãã
V768åæå®æ° 'WWKEY_RLS_BIT'ã¯ãããŒã«åã®å€æ°ãšããŠäœ¿çšãããŸããKEYBOARD.CPP 286
typedef enum {
WWKEY_SHIFT_BIT = 0x100,
WWKEY_CTRL_BIT = 0x200,
WWKEY_ALT_BIT = 0x400,
WWKEY_RLS_BIT = 0x800,
WWKEY_VK_BIT = 0x1000,
WWKEY_DBL_BIT = 0x2000,
WWKEY_BTN_BIT = 0x8000,
} WWKey_Type;
int WWKeyboardClass::To_ASCII(int key)
{
if ( key && WWKEY_RLS_BIT)
return(KN_NONE);
return(key);
}
ã㌠ãã©ã¡ãŒã¿ã§ãWWKEY_RLS_BITãã¹ã¯ã§æå®ãããç¹å®ã®ãããããã§ãã¯ãããã£ãã®ã§ãããã¿ã€ããã¹ããããšæããŸããããŒã³ãŒãã®ãã§ãã¯ã«ã¯ã&&ã§ã¯ãªããããåäœã®æŒç®åïŒã䜿çšããå¿ èŠããããŸããã
çããããã©ãŒããã
V523ãthenãã¹ããŒãã¡ã³ãã¯ãelseãã¹ããŒãã¡ã³ããšåçã§ããRADAR.CPP 1827
void RadarClass::Player_Names(bool on)
{
IsPlayerNames = on;
IsToRedraw = true;
if (on) {
Flag_To_Redraw(true);
// Flag_To_Redraw(false);
} else {
Flag_To_Redraw(true); // force drawing of the plate
}
}
æã ãéçºè ã¯ãããã°çšã®ã³ãŒãã«ã€ããŠã³ã¡ã³ãããŠããŸããããã以æ¥ãã³ãŒãã¯ãç°ãªããã©ã³ãã«åãæŒç®åãæã€æ¡ä»¶ä»ãæŒç®åã®ãŸãŸã§ãã
ãŸã£ããåãå Žæãããã«2ã€èŠã€ãããŸããã
- V523ãthenãã¹ããŒãã¡ã³ãã¯ãelseãã¹ããŒãã¡ã³ããšåçã§ããCELL.CPP 1792
- V523ãthenãã¹ããŒãã¡ã³ãã¯ãelseãã¹ããŒãã¡ã³ããšåçã§ããRADAR.CPP 2274
V705'else 'ãããã¯ãå¿ããããããã³ã¡ã³ãã¢ãŠãããããããŠãããã°ã©ã ã®æäœããžãã¯ãå€æŽãããå¯èœæ§ããããŸããNETDLG.CPP 1506
static int Net_Join_Dialog(void)
{
....
/*...............................................................
F4/SEND/'M' = edit a message
...............................................................*/
if (Messages.Get_Edit_Buf()==NULL) {
....
} else
/*...............................................................
If we're already editing a message and the user clicks on
'Send', translate our input to a Return so Messages.Input() will
work properly.
...............................................................*/
if (input==(BUTTON_SEND | KN_BUTTON)) {
input = KN_RETURN;
}
....
}
ã³ã¡ã³ãã倧ãããããéçºè ã¯äžèšã®æªå®çŸ©ã®æ¡ä»¶æŒç®åãèŠãŸããã§ãããelseããŒã¯ãŒãã®æ®ãã®éšåã¯ã以äžã®æ¡ä»¶ã§else ifæ§æã圢æããŸããããã¯ãå ã®ããžãã¯ãžã®å€æŽã§ããå¯èœæ§ããããŸãã
V519ãScoresPresentãå€æ°ã«ã¯2åé£ç¶ããŠå€ãå²ãåœãŠãããŸããããããããã¯ééãã§ãããã§ãã¯ã©ã€ã³ïŒ539ã541ãINIT.CPP 541
bool Init_Game(int , char *[])
{
....
ScoresPresent = false;
//if (CCFileClass("SCORES.MIX").Is_Available()) {
ScoresPresent = true;
if (!ScoreMix) {
ScoreMix = new MixFileClass("SCORES.MIX");
ThemeClass::Scan();
}
//}
æªå®äºã®ãªãã¡ã¯ã¿ãªã³ã°ã«ããå¥ã®æœåšçãªæ¬ é¥ãä»ã§ã¯æããã§ã¯ãªãScoresPresentã®ãã©ããã®å€æ°ãã§ãªããã°ãªããªãçããŸãã¯ãŸã åœã
ã¡ã¢ãªã®å²ãåœãŠè§£é€ãšã©ãŒ
V611ã¡ã¢ãªã¯ãnewT []ãæŒç®åã䜿çšããŠå²ãåœãŠãããŸãããããdeleteãæŒç®åã䜿çšããŠè§£æŸãããŸããããã®ã³ãŒãã調ã¹ãããšãæ€èšããŠãã ããã'delete [] poke_data;'ã䜿çšããããšããå§ãããŸããCCDDE.CPP 410
BOOL Send_Data_To_DDE_Server (char *data, int length, int packet_type)
{
....
char *poke_data = new char [length + 2*sizeof(int)]; // <=
....
if(DDE_Class->Poke_Server( .... ) == FALSE) {
CCDebugString("C&C95 - POKE failed!\n");
DDE_Class->Close_Poke_Connection();
delete poke_data; // <=
return (FALSE);
}
DDE_Class->Close_Poke_Connection();
delete poke_data; // <=
return (TRUE);
}
ã¢ãã©ã€ã¶ãŒã¯ãäºææ§ã®ãªãæ¹æ³ã§ã¡ã¢ãªãå²ãåœãŠãã解æŸãããã§ãããšããäºå®ã«é¢é£ãããšã©ãŒãæ€åºããŸãããã¢ã¬ã€ã«å²ãåœãŠãããã¡ã¢ãªã解æŸããã«ã¯ãdeleteã§ã¯ãªãdelete []æŒç®åã䜿çšããå¿ èŠããããŸãã
ãã®ãããªå Žæãããã€ãããããããã¯ãã¹ãŠå®è¡äžã®ã¢ããªã±ãŒã·ã§ã³ïŒã²ãŒã ïŒã«åŸã ã«å®³ãåãŒããŸãã
- V611ã¡ã¢ãªã¯ãnewT []ãæŒç®åã䜿çšããŠå²ãåœãŠãããŸãããããdeleteãæŒç®åã䜿çšããŠè§£æŸãããŸããããã®ã³ãŒãã調ã¹ãããšãæ€èšããŠãã ããã'delete [] poke_data;'ã䜿çšããããšããå§ãããŸããCCDDE.CPP 416
- V611 The memory was allocated using 'new T[]' operator but was released using the 'delete' operator. Consider inspecting this code. It's probably better to use 'delete [] temp_buffer;'. INIT.CPP 1302
- V611 The memory was allocated using 'new T[]' operator but was released using the 'delete' operator. Consider inspecting this code. It's probably better to use 'delete [] progresspalette;'. MAPSEL.CPP 795
- V611 The memory was allocated using 'new T[]' operator but was released using the 'delete' operator. Consider inspecting this code. It's probably better to use 'delete [] grey2palette;'. MAPSEL.CPP 796
- V611ã¡ã¢ãªã¯ãnewT []ãæŒç®åã䜿çšããŠå²ãåœãŠãããŸãããããdeleteãæŒç®åã䜿çšããŠè§£æŸãããŸããããã®ã³ãŒãã調ã¹ãããšãæ€èšããŠãã ããã'delete [] poke_data;'ã䜿çšããããšããå§ãããŸããCCDDE.CPP 422
- V611ã¡ã¢ãªã¯ãnewT []ãæŒç®åã䜿çšããŠå²ãåœãŠãããŸãããããdeleteãæŒç®åã䜿çšããŠè§£æŸãããŸããããã®ã³ãŒãã調ã¹ãããšãæ€èšããŠãã ããã'delete [] temp_buffer;'ã䜿çšããããšããå§ãããŸããINIT.CPP 1139
V772voidãã€ã³ã¿ã«å¯ŸããŠãdeleteãæŒç®åãåŒã³åºããšæªå®çŸ©ã®åäœãçºçããŸããENDING.CPP 254
void GDI_Ending(void)
{
....
void * localpal = Load_Alloc_Data(CCFileClass("SATSEL.PAL"));
....
delete [] localpal;
....
}
åé€ æŒç®åãšåé€[]æŒç®åã¯ãçç±ã«ããåé¢ãããŠããŸãã圌ãã¯ã¡ã¢ãªãã¯ãªãŒã³ã¢ãããããšããå¥ã®ä»äºãããŸãããŸããåæå®ãããŠããªããã€ã³ã¿ãŒã䜿çšããå Žåãã³ã³ãã€ã©ãŒã¯ãã€ã³ã¿ãŒãæããŠããããŒã¿ã¿ã€ããèªèããŸãããC ++èšèªæšæºã§ã¯ãã³ã³ãã€ã©ã®åäœã¯å®çŸ©ãããŠããŸããã
ãã®çš®ã®ã¢ãã©ã€ã¶ãŒã®èŠåãå€æ°èŠã€ãããŸããã
- V772voidãã€ã³ã¿ã«å¯ŸããŠãdeleteãæŒç®åãåŒã³åºããšæªå®çŸ©ã®åäœãçºçããŸããHEAP.CPP 284
- V772voidãã€ã³ã¿ã«å¯ŸããŠãdeleteãæŒç®åãåŒã³åºããšæªå®çŸ©ã®åäœãçºçããŸããINIT.CPP 728
- V772voidãã€ã³ã¿ã«å¯ŸããŠãdeleteãæŒç®åãåŒã³åºããšæªå®çŸ©ã®åäœãçºçããŸããMIXFILE.CPP 134
- V772voidãã€ã³ã¿ã«å¯ŸããŠãdeleteãæŒç®åãåŒã³åºããšæªå®çŸ©ã®åäœãçºçããŸããMIXFILE.CPP 391
- V772 Calling a 'delete' operator for a void pointer will cause undefined behavior. MSGBOX.CPP 423
- V772 Calling a 'delete' operator for a void pointer will cause undefined behavior. SOUNDDLG.CPP 407
- V772 Calling a 'delete' operator for a void pointer will cause undefined behavior. BUFFER.CPP 126
- V772 Calling a 'delete' operator for a void pointer will cause undefined behavior. BUFF.CPP 162
- V772 Calling a 'delete' operator for a void pointer will cause undefined behavior. BUFF.CPP 212
- V772 Calling a 'delete' operator for a void pointer will cause undefined behavior. BFIOFILE.CPP 330
- V772 Calling a 'delete' operator for a void pointer will cause undefined behavior. EVENT.CPP 934
- V772 Calling a 'delete' operator for a void pointer will cause undefined behavior. HEAP.CPP 318
- V772 Calling a 'delete' operator for a void pointer will cause undefined behavior. INIT.CPP 3851
- V772 Calling a 'delete' operator for a void pointer will cause undefined behavior. MIXFILE.CPP 130
- V772 Calling a 'delete' operator for a void pointer will cause undefined behavior. MIXFILE.CPP 430
- V772 Calling a 'delete' operator for a void pointer will cause undefined behavior. MIXFILE.CPP 447
- V772 Calling a 'delete' operator for a void pointer will cause undefined behavior. MIXFILE.CPP 481
- V772 Calling a 'delete' operator for a void pointer will cause undefined behavior. MSGBOX.CPP 461
- V772 Calling a 'delete' operator for a void pointer will cause undefined behavior. QUEUE.CPP 2982
- V772 Calling a 'delete' operator for a void pointer will cause undefined behavior. QUEUE.CPP 3167
- V772voidãã€ã³ã¿ã«å¯ŸããŠãdeleteãæŒç®åãåŒã³åºããšæªå®çŸ©ã®åäœãçºçããŸããSOUNDDLG.CPP 406
V773'progresspalette 'ãã€ã³ã¿ãŒã解æŸããã«é¢æ°ãçµäºããŸãããã¡ã¢ãªãªãŒã¯ãçºçããå¯èœæ§ããããŸããMAPSEL.CPP 258
void Map_Selection(void)
{
....
unsigned char *grey2palette = new unsigned char[768];
unsigned char *progresspalette = new unsigned char[768];
....
scenario = Scenario + ((house == HOUSE_GOOD) ? 0 : 14);
if (house == HOUSE_GOOD) {
lastscenario = (Scenario == 14);
if (Scenario == 15) return;
} else {
lastscenario = (Scenario == 12);
if (Scenario == 13) return;
}
....
}
ãã¡ã¢ãªããŸã£ãã解æŸããªããŠããæŒç®åãéžæããéã«ééãã¯ãããŸããïŒã-ããããããã°ã©ããŒã¯èããŸããã
ãããããã®åŸãã¡ã¢ãªãªãŒã¯ãçºçããŸããããããšã©ãŒã§ããé¢æ°ã®æåŸã®ã©ããã§ã¡ã¢ãªã解æŸãããŸããããã®åã«é¢æ°ã®æ¡ä»¶ä»ãçµäºãçºçããå Žæãå€ãããã€ã³ã¿grey2paletteãšprogresspalettã«ããã¡ã¢ãªã解æŸãããŸããã
ãã®ä»
V570'hdr-> MagicNumber 'å€æ°ãããèªäœã«å²ãåœãŠãããŸããCOMBUF.CPP 806
struct CommHdr {
unsigned short MagicNumber;
unsigned char Code;
unsigned long PacketID;
} *hdr;
void CommBufferClass::Mono_Debug_Print(int refresh)
{
....
hdr = (CommHdr *)SendQueue[i].Buffer;
hdr->MagicNumber = hdr->MagicNumber;
hdr->Code = hdr->Code;
....
}
CommHdræ§é ã®2ã€ã®ãã£ãŒã«ãã¯ãç¬èªã®å€ã§åæåãããŸããç§ã®æèŠã§ã¯ãç¡æå³ãªæäœã§ãããããã¯äœåºŠãå®è¡ãããŸãïŒ
- V570'hdr-> Code 'å€æ°ãããèªäœã«å²ãåœãŠãããŠããŸããCOMBUF.CPP 807
- V570'hdr-> MagicNumber 'å€æ°ãããèªäœã«å²ãåœãŠãããŸããCOMBUF.CPP 931
- V570'hdr-> Code 'å€æ°ãããèªäœã«å²ãåœãŠãããŠããŸããCOMBUF.CPP 932
- V570'hdr-> MagicNumber 'å€æ°ãããèªäœã«å²ãåœãŠãããŸããCOMBUF.CPP 987
- V570'hdr-> Code 'å€æ°ãããèªäœã«å²ãåœãŠãããŠããŸããCOMBUF.CPP 988
- V570'obj 'å€æ°ãããèªäœã«å²ãåœãŠãããŠããŸããMAP.CPP 1132
- V570'hdr-> MagicNumber 'å€æ°ãããèªäœã«å²ãåœãŠãããŸããCOMBUF.CPP 910
- V570'hdr-> Code 'å€æ°ãããèªäœã«å²ãåœãŠãããŠããŸããCOMBUF.CPP 911
- V570'hdr-> MagicNumber 'å€æ°ãããèªäœã«å²ãåœãŠãããŸããCOMBUF.CPP 1040
- V570'hdr-> Code 'å€æ°ãããèªäœã«å²ãåœãŠãããŠããŸããCOMBUF.CPP 1041
- V570'hdr-> MagicNumber 'å€æ°ãããèªäœã«å²ãåœãŠãããŸããCOMBUF.CPP 1104
- V570'hdr-> Code 'å€æ°ãããèªäœã«å²ãåœãŠãããŠããŸããCOMBUF.CPP 1105
- V570'obj 'å€æ°ãããèªäœã«å²ãåœãŠãããŠããŸããMAP.CPP 1279
V591évoidé¢æ°ã¯å€ãè¿ãå¿ èŠããããŸããHEAP.H 123
int FixedHeapClass::Free(void * pointer);
template<class T>
class TFixedHeapClass : public FixedHeapClass
{
....
virtual int Free(T * pointer) {FixedHeapClass::Free(pointer);};
};
Freeã¯ã©ã¹TFixedHeapClass ã®é¢æ°noæŒç®åã®returnã¹ããŒãã¡ã³ããæãèå³æ·±ãã®ã¯ãåŒã³åºãããé¢æ°FixedHeapClass :: Freeã®æ»ãå€ãintåã§ãããšããããšã§ããã»ãšãã©ã®å Žåãããã°ã©ããŒã¯returnã¹ããŒãã¡ã³ããæžãã®ãå¿ããã ãã§ãé¢æ°ã¯ç解ã§ããªãå€ãè¿ããŸãã
V672ããã§æ°ãããdamageãå€æ°ãäœæããå¿ èŠã¯ãããããããŸãããé¢æ°ã®åŒæ°ã®1ã€ã¯åãååãæã¡ããã®åŒæ°ã¯åç §ã§ãããã§ãã¯ã©ã€ã³ïŒ1219ã1278ãBUILDING.CPP 1278
ResultType BuildingClass::Take_Damage(int & damage, ....)
{
....
if (tech && tech->IsActive && ....) {
int damage = 500;
tech->Take_Damage(damage, 0, WARHEAD_AP, source, forced);
}
....
}
æå·ãã©ã¡ãŒã¿ã¯åç §ã«ãã£ãŠæž¡ãããŸãããããã£ãŠããã®å€æ°ã®å€ã®å€æŽã¯ãé¢æ°ã®æ¬äœã§äºæãããŠããŸããããããããå Žæã§ã¯ãéçºè ã¯åãååã®å€æ°ã宣èšããŸããããã®ãããå€500ã¯ãé¢æ°ãã©ã¡ãŒã¿ãŒã§ã¯ãªããããŒã«ã«å€æ°damageã«æ ŒçŽãããŸãããããããå¥ã®åäœãæå³ãããŠããŸããã
å¥ã®ãã®ãããªå ŽæïŒ
- V672ããã§æ°ãããdamageãå€æ°ãäœæããå¿ èŠã¯ãããããããŸãããé¢æ°ã®åŒæ°ã®1ã€ã¯åãååãæã¡ããã®åŒæ°ã¯åç §ã§ãããã§ãã¯ã©ã€ã³ïŒ4031ã4068ãTECHNO.CPP 4068
V762ä»®æ³é¢æ°ã誀ã£ãŠãªãŒããŒã©ã€ããããå¯èœæ§ããããŸãã掟çã¯ã©ã¹ãBulletClassãããã³åºæ¬ã¯ã©ã¹ãObjectClassãã®é¢æ°ãOccupy_Listãã®æåã®åŒæ°ãåç §ããŠãã ãããBULLET.H 90
class ObjectClass : public AbstractClass
{
....
virtual short const * Occupy_List(bool placement=false) const; // <=
virtual short const * Overlap_List(void) const;
....
};
class BulletClass : public ObjectClass,
public FlyClass,
public FuseClass
{
....
virtual short const * Occupy_List(void) const; // <=
virtual short const * Overlap_List(void) const {return Occupy_List();};
....
};
ã¢ãã©ã€ã¶ãŒã¯ãOccupy_Listä»®æ³é¢æ°ã®ãªãŒããŒã©ã€ãäžã«æœåšçãªãšã©ãŒãæ€åºããŸãããããã«ãããå®è¡æã«ééã£ãé¢æ°ãåŒã³åºãããå¯èœæ§ããããŸãã
ããã«ããã€ãã®çãããå ŽæïŒ
- V762ä»®æ³é¢æ°ã誀ã£ãŠãªãŒããŒã©ã€ããããå¯èœæ§ããããŸãã掟çã¯ã©ã¹ãTurretClassãããã³åºæ¬ã¯ã©ã¹ãDriveClassãã®é¢æ°ãOk_To_Moveãã®ä¿®é£Ÿåãåç §ããŠãã ãããTURRET.H 76
- V762ä»®æ³é¢æ°ã誀ã£ãŠãªãŒããŒã©ã€ããããå¯èœæ§ããããŸãã掟çã¯ã©ã¹ãHelpClassãããã³åºæ¬ã¯ã©ã¹ãDisplayClassãã®é¢æ°ãHelp_Textãã®4çªç®ã®åŒæ°ãåç §ããŠãã ãããHELP.H 55
- V762ä»®æ³é¢æ°ã誀ã£ãŠãªãŒããŒã©ã€ããããå¯èœæ§ããããŸãã掟çã¯ã©ã¹ãMapEditClassãããã³åºæ¬ã¯ã©ã¹ãHelpClassãã®é¢æ°ãDraw_Itãã®æåã®åŒæ°ãåç §ããŠãã ãããMAPEDIT.H 187
- V762 It is possible a virtual function was overridden incorrectly. See first argument of function 'Occupy_List' in derived class 'AnimClass' and base class 'ObjectClass'. ANIM.H 80
- V762 It is possible a virtual function was overridden incorrectly. See first argument of function 'Overlap_List' in derived class 'BulletClass' and base class 'ObjectClass'. BULLET.H 102
- V762 It is possible a virtual function was overridden incorrectly. See qualifiers of function 'Remap_Table' in derived class 'BuildingClass' and base class 'TechnoClass'. BUILDING.H 281
- V762 It is possible a virtual function was overridden incorrectly. See fourth argument of function 'Help_Text' in derived class 'HelpClass' and base class 'DisplayClass'. HELP.H 58
- V762ä»®æ³é¢æ°ã誀ã£ãŠãªãŒããŒã©ã€ããããå¯èœæ§ããããŸãã掟çã¯ã©ã¹ãAnimClassãããã³åºæ¬ã¯ã©ã¹ãObjectClassãã®é¢æ°ãOverlap_Listãã®æåã®åŒæ°ãåç §ããŠãã ãããANIM.H 90
V763ãã©ã¡ãŒã¿ 'coord'ã¯ã䜿çšãããåã«åžžã«é¢æ°æ¬äœã§æžãæããããŸããDISPLAY.CPP 4031
void DisplayClass::Set_Tactical_Position(COORDINATE coord)
{
int xx = 0;
int yy = 0;
Confine_Rect(&xx, &yy, TacLeptonWidth, TacLeptonHeight,
Cell_To_Lepton(MapCellWidth) + GlyphXClientSidebarWidthInLeptons,
Cell_To_Lepton(MapCellHeight));
coord = XY_Coord(xx + Cell_To_Lepton(MapCellX), yy + Cell_To_Lepton(....));
if (ScenarioInit) {
TacticalCoord = coord;
}
DesiredTacticalCoord = coord;
IsToRedraw = true;
Flag_To_Redraw(false);
}
coord ãã©ã¡ãŒã¿ãŒã¯ãé¢æ°ã®æ¬äœã§ããã«äžæžããããŸããå€ãå€ã¯äœ¿çšãããŸããã§ãããé¢æ°ã«åŒæ°ãããããããã«äŸåããŠããªãå Žåãããã¯éåžžã«çãããã§ãããããŠãããã€ãã®åº§æšããããŸãã
ãããŠããã®å Žæã¯ãã§ãã¯ãã䟡å€ããããŸãïŒ
- V763ãã©ã¡ãŒã¿ 'coord'ã¯ã䜿çšãããåã«åžžã«é¢æ°æ¬äœã§æžãæããããŸããDISPLAY.CPP 4251
V507ããŒã«ã«é å 'localpalette'ãžã®ãã€ã³ã¿ãŒã¯ããã®é åã®ã¹ã³ãŒãå€ã«æ ŒçŽãããŸãããã®ãããªãã€ã³ã¿ã¯ç¡å¹ã«ãªããŸããMAPSEL.CPP 757
extern "C" unsigned char *InterpolationPalette;
void Map_Selection(void)
{
unsigned char localpalette[768];
....
InterpolationPalette = localpalette;
....
}
ã²ãŒã ã³ãŒãã«ã¯å€ãã®ã°ããŒãã«å€æ°ããããŸããããã¯ããããåœæã®ã³ãŒãã£ã³ã°ã«å¯Ÿããäžè¬çãªã¢ãããŒãã§ãããããããä»ã§ã¯ããã¯æªããããã«ã¯å±éºã§ãããšèããããŠããŸãã
ããŒã«ã«é ålocalpaletteã¯ãInterpolationPaletteãã€ã³ã¿ãŒã«æ ŒçŽãããŸããããã¯ãé¢æ°ãçµäºãããšç¡å¹ã«ãªããŸãã
ããã«å±éºãªå Žæãããã€ããããŸãã
- V507ããŒã«ã«é å 'localpalette'ãžã®ãã€ã³ã¿ãŒã¯ããã®é åã®ã¹ã³ãŒãå€ã«æ ŒçŽãããŸãããã®ãããªãã€ã³ã¿ã¯ç¡å¹ã«ãªããŸããMAPSEL.CPP 769
- V507ããŒã«ã«é å 'buffer'ãžã®ãã€ã³ã¿ãŒã¯ããã®é åã®ã¹ã³ãŒãå€ã«æ ŒçŽãããŸãããã®ãããªãã€ã³ã¿ã¯ç¡å¹ã«ãªããŸããWINDOWS.CPP 458
çµè«
æåã®ã¬ããŒãã§æžããããã«ãElectronicArtsã®æ°ãããããžã§ã¯ãã®å質ãåäžããããšãæåŸ ããŸããããäžè¬çã«ãã²ãŒã éçºè ã¯ç©æ¥µçã«PVS-Studioãè³Œå ¥ããŠããŸããçŸåšãã²ãŒã ã®äºç®ã¯éåžžã«å€§ãããããæ¬çªç°å¢ã§ãã°ãä¿®æ£ããããã®è¿œå ã³ã¹ãã¯å¿ èŠãããŸããããŸããã³ãŒãã£ã³ã°ã®åæ段éã§ãšã©ãŒãä¿®æ£ããããšã¯ãæéããã®ä»ã®ãªãœãŒã¹ãå®è³ªçã«å¿ èŠãšããŸããã
åœç€Ÿã®ãŠã§ããµã€ãäžã®ãã¹ãŠã®ãããžã§ã¯ãã§PVS-StudioãããŠã³ããŒãããŠãè©Šããã ããã
ãã®èšäºãè±èªã話ãèŽè¡ãšå ±æãããå Žåã¯ã翻蚳ãªã³ã¯SvyatoslavRazmyslovã䜿çšããŠãã ãããã³ãã³ãïŒã³ã³ã«ãŒã²ãŒã ã®ã³ãŒãïŒ90幎代ã®ãã°ã第2å·»ã