Opened 2 years ago

Closed 2 years ago

#10277 closed defect (fixed)

TITANIC: Use of uninitialised variable

Reported by: csnover Owned by: dreammaster
Priority: normal Component: Engine: Titanic
Keywords: Cc:
Game: Starship Titanic

Description

scummvm/engines/titanic/true_talk/tt_npc_script.cpp:313:10: warning: variable 'rangeLimit' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
                                        if (dialRegion != 1) {
                                            ^~~~~~~~~~~~~~~
scummvm/engines/titanic/true_talk/tt_npc_script.cpp:320:63: note: uninitialized use occurs here
                                dialogueId = ((remainder + _quotes._incr) % 100) >= (uint)rangeLimit
                                                                                          ^~~~~~~~~~
scummvm/engines/titanic/true_talk/tt_npc_script.cpp:313:6: note: remove the 'if' if its condition is always true
                                        if (dialRegion != 1) {
                                        ^~~~~~~~~~~~~~~~~~~~~
scummvm/engines/titanic/true_talk/tt_npc_script.cpp:309:19: note: initialize the variable 'rangeLimit' to silence this warning
                                int rangeLimit;
                                              ^
                                               = 0

Build: 8d555acc0dcc2c32fee1250b8ae9c7b7020e24ea

Change History (1)

comment:1 by dreammaster, 2 years ago

Owner: set to dreammaster
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.