Re: [hlcoders] Proper way to iterate a CUtlDict?

2008-04-15 Thread Jeffrey botman Broome
Yahn Bernier wrote:
 No, there are no remaining bugs in the code.  Well done.

I call bullshit.  There's always one more bug!  ;)

-- 
Jeffrey botman Broome

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Proper way to iterate a CUtlDict?

2008-04-15 Thread Tobias Kammersgaard
I call sarcasm in the Internet.

/ScarT


On 15/04/2008, Jeffrey botman Broome [EMAIL PROTECTED] wrote:

 Yahn Bernier wrote:
  No, there are no remaining bugs in the code.  Well done.

 I call bullshit.  There's always one more bug!  ;)

 --
 Jeffrey botman Broome

 ___
 To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders


___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Proper way to iterate a CUtlDict?

2008-04-15 Thread Tony omega Sergi
No, we have this bug killer that goes beyond space and time eradicating bugs
both in the real and digital worlds, but there's a catch it uses proprietary
technology, you'll need to buy a license before you can use it.
-Tony


On Tue, Apr 15, 2008 at 9:57 AM, Jeffrey botman Broome 
[EMAIL PROTECTED] wrote:

 Yahn Bernier wrote:
  No, there are no remaining bugs in the code.  Well done.

 I call bullshit.  There's always one more bug!  ;)

 --
 Jeffrey botman Broome

 ___
 To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders




-- 
-omega
___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



[hlcoders] Proper way to iterate a CUtlDict?

2008-04-14 Thread Tim Baker
I was tracking down a crash in ai_speech.cpp CConceptHistoriesDataOps::Save.
It looks as though m_ConceptHistories is not being iterated over properly?

CUtlDict ConceptHistory_t, int  *ch = ...;
int count = ch-Count();
for (int i = 0; i  count; i++ ) { ... }

CUtlDict uses a CUtlRBTree for storage and that class has methods
for testing whether an index is valid or not.  Nodes in the tree aren't
stored like an array, so going from 0-count seems wrong.  The correct
way seems to be this:

for ( int i = ch-First(); i != ch-InvalidIndex(); i = ch-Next( i ) )

But there are so many places in the code that iterate over CUtlDicts
from 0-count I'm wondering what is going on here.

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Proper way to iterate a CUtlDict?

2008-04-14 Thread Yahn Bernier
Those places are all bogus and should be considered bugs.  If nothing is
deleted from the tree then it might work in most cases, but it's the
wrong iteration pattern.

Yahn

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tim Baker
Sent: Monday, April 14, 2008 2:38 PM
To: hlcoders@list.valvesoftware.com
Subject: [hlcoders] Proper way to iterate a CUtlDict?

I was tracking down a crash in ai_speech.cpp
CConceptHistoriesDataOps::Save.
It looks as though m_ConceptHistories is not being iterated over
properly?

CUtlDict ConceptHistory_t, int  *ch = ...;
int count = ch-Count();
for (int i = 0; i  count; i++ ) { ... }

CUtlDict uses a CUtlRBTree for storage and that class has methods
for testing whether an index is valid or not.  Nodes in the tree aren't
stored like an array, so going from 0-count seems wrong.  The correct
way seems to be this:

for ( int i = ch-First(); i != ch-InvalidIndex(); i = ch-Next( i ) )

But there are so many places in the code that iterate over CUtlDicts
from 0-count I'm wondering what is going on here.

___
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders


___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Proper way to iterate a CUtlDict?

2008-04-14 Thread Nick
LOL Is there any other bugs we should know about?

On Mon, Apr 14, 2008 at 5:31 PM, Yahn Bernier
[EMAIL PROTECTED] wrote:
 Those places are all bogus and should be considered bugs.  If nothing is
  deleted from the tree then it might work in most cases, but it's the
  wrong iteration pattern.

  Yahn



  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of Tim Baker
  Sent: Monday, April 14, 2008 2:38 PM
  To: hlcoders@list.valvesoftware.com
  Subject: [hlcoders] Proper way to iterate a CUtlDict?

  I was tracking down a crash in ai_speech.cpp
  CConceptHistoriesDataOps::Save.
  It looks as though m_ConceptHistories is not being iterated over
  properly?

  CUtlDict ConceptHistory_t, int  *ch = ...;
  int count = ch-Count();
  for (int i = 0; i  count; i++ ) { ... }

  CUtlDict uses a CUtlRBTree for storage and that class has methods
  for testing whether an index is valid or not.  Nodes in the tree aren't
  stored like an array, so going from 0-count seems wrong.  The correct
  way seems to be this:

  for ( int i = ch-First(); i != ch-InvalidIndex(); i = ch-Next( i ) )

  But there are so many places in the code that iterate over CUtlDicts
  from 0-count I'm wondering what is going on here.

  ___
  To unsubscribe, edit your list preferences, or view the list archives,
  please visit:
  http://list.valvesoftware.com/mailman/listinfo/hlcoders


  ___
  To unsubscribe, edit your list preferences, or view the list archives, 
 please visit:
  http://list.valvesoftware.com/mailman/listinfo/hlcoders



___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Proper way to iterate a CUtlDict?

2008-04-14 Thread Yahn Bernier
No, there are no remaining bugs in the code.  Well done.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Nick
Sent: Monday, April 14, 2008 5:04 PM
To: Discussion of Half-Life Programming
Subject: Re: [hlcoders] Proper way to iterate a CUtlDict?

LOL Is there any other bugs we should know about?

On Mon, Apr 14, 2008 at 5:31 PM, Yahn Bernier
[EMAIL PROTECTED] wrote:
 Those places are all bogus and should be considered bugs.  If nothing
is
  deleted from the tree then it might work in most cases, but it's the
  wrong iteration pattern.

  Yahn



  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of Tim
Baker
  Sent: Monday, April 14, 2008 2:38 PM
  To: hlcoders@list.valvesoftware.com
  Subject: [hlcoders] Proper way to iterate a CUtlDict?

  I was tracking down a crash in ai_speech.cpp
  CConceptHistoriesDataOps::Save.
  It looks as though m_ConceptHistories is not being iterated over
  properly?

  CUtlDict ConceptHistory_t, int  *ch = ...;
  int count = ch-Count();
  for (int i = 0; i  count; i++ ) { ... }

  CUtlDict uses a CUtlRBTree for storage and that class has methods
  for testing whether an index is valid or not.  Nodes in the tree
aren't
  stored like an array, so going from 0-count seems wrong.  The
correct
  way seems to be this:

  for ( int i = ch-First(); i != ch-InvalidIndex(); i = ch-Next( i )
)

  But there are so many places in the code that iterate over CUtlDicts
  from 0-count I'm wondering what is going on here.

  ___
  To unsubscribe, edit your list preferences, or view the list
archives,
  please visit:
  http://list.valvesoftware.com/mailman/listinfo/hlcoders


  ___
  To unsubscribe, edit your list preferences, or view the list
archives, please visit:
  http://list.valvesoftware.com/mailman/listinfo/hlcoders



___
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders


___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Proper way to iterate a CUtlDict?

2008-04-14 Thread Nick
Wow great job! Not only are you a 10x better coder than me, you maek
me lul. Um, do you have any tips on coding for us? Sometimes I have
really bad bugs in my codes, and have no idea how to fix them :(

On Mon, Apr 14, 2008 at 7:40 PM, Yahn Bernier
[EMAIL PROTECTED] wrote:
 No, there are no remaining bugs in the code.  Well done.


  -Original Message-
  From: [EMAIL PROTECTED]


 [mailto:[EMAIL PROTECTED] On Behalf Of Nick
  Sent: Monday, April 14, 2008 5:04 PM
  To: Discussion of Half-Life Programming
  Subject: Re: [hlcoders] Proper way to iterate a CUtlDict?

  LOL Is there any other bugs we should know about?

  On Mon, Apr 14, 2008 at 5:31 PM, Yahn Bernier
  [EMAIL PROTECTED] wrote:
   Those places are all bogus and should be considered bugs.  If nothing
  is
deleted from the tree then it might work in most cases, but it's the
wrong iteration pattern.
  
Yahn
  
  
  
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tim
  Baker
Sent: Monday, April 14, 2008 2:38 PM
To: hlcoders@list.valvesoftware.com
Subject: [hlcoders] Proper way to iterate a CUtlDict?
  
I was tracking down a crash in ai_speech.cpp
CConceptHistoriesDataOps::Save.
It looks as though m_ConceptHistories is not being iterated over
properly?
  
CUtlDict ConceptHistory_t, int  *ch = ...;
int count = ch-Count();
for (int i = 0; i  count; i++ ) { ... }
  
CUtlDict uses a CUtlRBTree for storage and that class has methods
for testing whether an index is valid or not.  Nodes in the tree
  aren't
stored like an array, so going from 0-count seems wrong.  The
  correct
way seems to be this:
  
for ( int i = ch-First(); i != ch-InvalidIndex(); i = ch-Next( i )
  )
  
But there are so many places in the code that iterate over CUtlDicts
from 0-count I'm wondering what is going on here.
  
___
To unsubscribe, edit your list preferences, or view the list
  archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders
  
  
___
To unsubscribe, edit your list preferences, or view the list
  archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders
  
  

  ___
  To unsubscribe, edit your list preferences, or view the list archives,
  please visit:
  http://list.valvesoftware.com/mailman/listinfo/hlcoders


  ___
  To unsubscribe, edit your list preferences, or view the list archives, 
 please visit:
  http://list.valvesoftware.com/mailman/listinfo/hlcoders



___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders