Request::get_base_required_time: WARNING nr = 1 but count is 1, which is not allowed according to the comment for this function

Bug #601400 reported by Marty Shannon
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Low
Unassigned

Bug Description

I'm pretty sure I've been seeing this since at least Release 15, but for certain it's in bzr5412. It happens a *lot*.

Related branches

Nasenbaer (nasenbaer)
Changed in widelands:
status: New → Confirmed
Revision history for this message
Scott Howard (showard314) wrote :

Quick skim of the code: in request.cc, should the warning be thrown if (m_count < nr) not when (m_count <= nr)? I believe that the number requested can equal to the maximum size. See the original code below:

/**
 * Return the point in time at which we want the item of the given number to
 * be delivered. nr is in the range [0..m_count[
*/
int32_t Request::get_base_required_time
 (Editor_Game_Base & egbase, uint32_t const nr) const
{
 if (m_count <= nr)
  log
   ("Request::get_base_required_time: WARNING nr = %u but count is %u, "
    "which is not allowed according to the comment for this function\n",
    nr, m_count);
 int32_t const curtime = egbase.get_gametime();

David Allwicher (aber)
Changed in widelands:
milestone: none → build16-rc1
Revision history for this message
SirVer (sirver) wrote :

not critical. -> build 17

Changed in widelands:
importance: Undecided → Low
milestone: build16-rc1 → build17-rc1
David Allwicher (aber)
Changed in widelands:
status: Confirmed → In Progress
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

I'm happy someone has finally looked at this, since this warning pops up all the time. Though, for the future it would probably be better to push fixes to different bugs to different branches, to make it easier to review and merge them one at a time.

David Allwicher (aber)
Changed in widelands:
status: In Progress → Fix Committed
Revision history for this message
SirVer (sirver) wrote :

Released in build17-rc1.

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.