Re: [Warzone-dev] Re: [Warzone-commits] r686 - /trunk/src/projectile.c

2007-01-29 Thread Giel van Schijndel
On Sun, 28 Jan 2007 20:59:17 -0800, The Watermelon [EMAIL PROTECTED] wrote:
 On 1/28/07, Giel van Schijndel [EMAIL PROTECTED] wrote:

 Author: muggenhor
 Date: Sun Jan 28 19:19:32 2007
 New Revision: 686

 URL: http://svn.gna.org/viewcvs/warzone?rev=686view=rev
 Log:
 Modification 8 by Watermelon's bugfix patch:
 * Changed establishTargetHeight in projectile.c to use pIMD rather than
 displayImd for structures to fix some weird height problems(hopefully).
 * Giel: Slightly changed the patch's modifications to increase code
 readability

 Refer: Message-ID: 
 [EMAIL PROTECTED]

 Modified:
trunk/src/projectile.c
 
 some of your change swapped the correct order and causes crash:
 
  *  height = asBodyStats[psDroid-asBits[COMP_BODY].nStat].pIMD-ymax -
 asBodyStats[psDroid-asBits[COMP_BODY].nStat].pIMD-ymin;*
 
 *   psDroid = (DROID*)psTarget;*
 
 it tried to access psDroid pointer before it gets initialized as
 (DROID*)psTarget,the original/correct order is:
 
 *   psDroid = (DROID*)psTarget;
height = asBodyStats[psDroid-asBits[COMP_BODY].nStat].pIMD-ymax -
 asBodyStats[psDroid-asBits[COMP_BODY].nStat].pIMD-ymin;*
 
 

It seems Ari fixed this in r688. Would have been nice if the compiler would 
just kick my ass on this sorts of cases (dereferencing uninitialized pointers).

-- 
Giel


___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Re: [Warzone-commits] r686 - /trunk/src/projectile.c

2007-01-29 Thread Dennis Schridde
Am Montag, 29. Januar 2007 schrieb Giel van Schijndel:
 On Sun, 28 Jan 2007 20:59:17 -0800, The Watermelon 
[EMAIL PROTECTED] wrote:
  On 1/28/07, Giel van Schijndel [EMAIL PROTECTED] wrote:
  Author: muggenhor
  Date: Sun Jan 28 19:19:32 2007
  New Revision: 686
 
  URL: http://svn.gna.org/viewcvs/warzone?rev=686view=rev
  Log:
  Modification 8 by Watermelon's bugfix patch:
  * Changed establishTargetHeight in projectile.c to use pIMD rather than
  displayImd for structures to fix some weird height problems(hopefully).
  * Giel: Slightly changed the patch's modifications to increase code
  readability
 
  Refer: Message-ID: 
  [EMAIL PROTECTED]
 
  Modified:
 trunk/src/projectile.c
 
  some of your change swapped the correct order and causes crash:
 
   *  height = asBodyStats[psDroid-asBits[COMP_BODY].nStat].pIMD-ymax -
  asBodyStats[psDroid-asBits[COMP_BODY].nStat].pIMD-ymin;*
 
  *   psDroid = (DROID*)psTarget;*
 
  it tried to access psDroid pointer before it gets initialized as
  (DROID*)psTarget,the original/correct order is:
 
  *   psDroid = (DROID*)psTarget;
 height = asBodyStats[psDroid-asBits[COMP_BODY].nStat].pIMD-ymax -
  asBodyStats[psDroid-asBits[COMP_BODY].nStat].pIMD-ymin;*

 It seems Ari fixed this in r688. Would have been nice if the compiler would
 just kick my ass on this sorts of cases (dereferencing uninitialized
 pointers).

I thought GCC does with -Wall...


pgpUvsnKFNrds.pgp
Description: PGP signature
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Re: [Warzone-commits] r686 - /trunk/src/projectile.c

2007-01-29 Thread Giel van Schijndel
On Mon, 29 Jan 2007 13:00:43 +0100, Dennis Schridde [EMAIL PROTECTED] wrote:
 Am Montag, 29. Januar 2007 schrieb Giel van Schijndel:
 On Sun, 28 Jan 2007 20:59:17 -0800, The Watermelon 
 [EMAIL PROTECTED] wrote:
  On 1/28/07, Giel van Schijndel [EMAIL PROTECTED] wrote:
  Author: muggenhor
  Date: Sun Jan 28 19:19:32 2007
  New Revision: 686
 
  URL: http://svn.gna.org/viewcvs/warzone?rev=686view=rev
  Log:
  Modification 8 by Watermelon's bugfix patch:
  * Changed establishTargetHeight in projectile.c to use pIMD rather
 than
  displayImd for structures to fix some weird height
 problems(hopefully).
  * Giel: Slightly changed the patch's modifications to increase code
  readability
 
  Refer: Message-ID: 
  [EMAIL PROTECTED]
 
  Modified:
 trunk/src/projectile.c
 
  some of your change swapped the correct order and causes crash:
 
   *  height = asBodyStats[psDroid-asBits[COMP_BODY].nStat].pIMD-ymax
 -
  asBodyStats[psDroid-asBits[COMP_BODY].nStat].pIMD-ymin;*
 
  *   psDroid = (DROID*)psTarget;*
 
  it tried to access psDroid pointer before it gets initialized as
  (DROID*)psTarget,the original/correct order is:
 
  *   psDroid = (DROID*)psTarget;
 height = asBodyStats[psDroid-asBits[COMP_BODY].nStat].pIMD-ymax -
  asBodyStats[psDroid-asBits[COMP_BODY].nStat].pIMD-ymin;*

 It seems Ari fixed this in r688. Would have been nice if the compiler
 would
 just kick my ass on this sorts of cases (dereferencing uninitialized
 pointers).
 
 I thought GCC does with -Wall...
 
 

I believe it does, yes. The only problem is that I need to distinguish those 
warnings from the ones already present.

Hmm, maybe that's a nice idea for some spare time: writing a diff-utility that 
generates diffs on compiler warnings/errors. Although maybe a bit far fetched.

-- 
Giel


___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Re: [Warzone-commits] r686 - /trunk/src/projectile.c

2007-01-29 Thread Per Inge Mathisen

On 1/29/07, Giel van Schijndel [EMAIL PROTECTED] wrote:

Hmm, maybe that's a nice idea for some spare time: writing a diff-utility that 
generates diffs  on compiler warnings/errors.


Or just fixing those already present?

I have to say, though: adding a ton of new warning flags to gcc for
the debug builds may not have been a very bright idea. I think it
would be better with the general rule that you do not add a new flag
before you have removed the warnings it would generate *first* (ie the
flag is there to avoid regressions, not to nag people about your TODO
list).

 - Per

___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Re: [Warzone-commits] r686 - /trunk/src/projectile.c

2007-01-29 Thread Giel van Schijndel
On Mon, 29 Jan 2007 15:20:54 +0100, Per Inge Mathisen [EMAIL PROTECTED] 
wrote:
 On 1/29/07, Giel van Schijndel [EMAIL PROTECTED] wrote:
 Hmm, maybe that's a nice idea for some spare time: writing a
 diff-utility that generates diffs  on compiler warnings/errors.
 
 Or just fixing those already present?

Yes, and not commiting code that adds new ones.

 I have to say, though: adding a ton of new warning flags to gcc for
 the debug builds may not have been a very bright idea. I think it
 would be better with the general rule that you do not add a new flag
 before you have removed the warnings it would generate *first* (ie the
 flag is there to avoid regressions, not to nag people about your TODO
 list).

Honestly I don't know what you're talking about here. Since only -Wall is 
currently passed to gcc for generation of compiler warnings. Unless you count 
-fpermissive along, which actually turns certain (resolvable) compiler errors 
into warnings.

-- 
Giel


___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Re: [Warzone-commits] r686 - /trunk/src/projectile.c

2007-01-29 Thread Dennis Schridde
Am Montag, 29. Januar 2007 schrieb Christian Ohm:
 On Monday, 29 January 2007 at 14:55, Giel van Schijndel wrote:
  Hmm, maybe that's a nice idea for some spare time: writing a
  diff-utility that generates diffs on compiler warnings/errors.
  Although maybe a bit far fetched.

 Tried that some time ago. Not perfect, but works.


Looks nice! Why did you use tee and not output-redirection to create 
make-out.tmp?
What I wonder about is that with the sort you use lines like
 ../lib/sound/track.c: In function ‘sound_PauseTrack’:
 ../lib/sound/track.c:504: warning: comparison between signed and unsigned
might (will?) loose their connection...

Maybe the script could be enhanced so it can set a reference point (eg before 
work, so you don't have compare small incremental steps, but can also look a 
little further back and see not only what you changed in the last minutes, 
but also what you changed since your last commit.)

--Dennis


pgpB9UHYxybMt.pgp
Description: PGP signature
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Re: [Warzone-commits] r686 - /trunk/src/projectile.c

2007-01-29 Thread Christian Ohm
On Monday, 29 January 2007 at 16:39, Dennis Schridde wrote:
 Looks nice! Why did you use tee and not output-redirection to create 
 make-out.tmp?
 What I wonder about is that with the sort you use lines like
  ../lib/sound/track.c: In function ‘sound_PauseTrack’:
  ../lib/sound/track.c:504: warning: comparison between signed and unsigned
 might (will?) loose their connection...

Yeah, and I don't get error messages there as well. That's what the tee
is for, you get the usual output for context, and the diff gives the
changes in the warning messages.

 Maybe the script could be enhanced so it can set a reference point (eg before 
 work, so you don't have compare small incremental steps, but can also look a 
 little further back and see not only what you changed in the last minutes, 
 but also what you changed since your last commit.)

Well, my script is of the quick and dirty variant, it just works good
when compiling the same set of files.

-- 
I can remember when a good politician had to be 75 percent ability and 25
percent actor, but I can well see the day when the reverse could be true.
-- Harry Truman

___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev