Re: [Warzone-dev] More patches for warnings

2006-11-05 Thread Stefan Huehner
On Sun, Nov 05, 2006 at 12:17:42PM +0100, Dennis Schridde wrote:
> Am Sonntag, 5. November 2006 05:21 schrieb [EMAIL PROTECTED]:
> > On Thu, 02 Nov 2006 16:27:51 -0500 Troman <[EMAIL PROTECTED]> wrote:
> 
> > I also forgot who it was, but the person doing the 64bit port, are
> > they still around?
> Haven't seem him for long, sadly. Perhaps he just takes a break like me, but 
> is more consequent in doing it. ;)

I'm still around but haven't been doing any warzone hacking for some
time now. No time atm, as im prepraring for an test for university and
doing random stuff elsewere. But as the port isn't nearly finished i'll
keep working on that as time permits.

Stefan


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


Re: [Warzone-dev] More patches for warnings

2006-11-05 Thread Dennis Schridde
Am Sonntag, 5. November 2006 05:21 schrieb [EMAIL PROTECTED]:
> On Thu, 02 Nov 2006 16:27:51 -0500 Troman <[EMAIL PROTECTED]> wrote:
> >It is a cleaner approach, but for me it is more intuitively to use
> >MALLOC
> >since already the name implies that malloc functionality will be
> >used at
> >some point. And these 2 new macros will not replace all occurances
> >of
> >MALLOC, so we are just introducing more macros for the same
> >functionality.
> >
> >But anyway, I will be an impartial executor of a collective
> >opinion. To make
> >it painless for everyone if no objections will be raised until
> >tomorrow
> >evening I will just go on and apply the patch.
> >
> >Troman
>
> Also keep in mind that when using VS, and your using their debug
> libs to catch memory errors via the _CrtDumpMemoryLeaks() call in
> the debugger, having more macros on top of other macros gets very
> messy.
>
> Are people actually testing all these patches by playing a few
> different skirmish games, and then some campaign games, and seeing
> if something breaks?
I usually try to start 1 game and see if something I know easily breaks is 
broken. This is the singleplayer cutscenes, sounds, menus etc...

> I also forgot who it was, but the person doing the 64bit port, are
> they still around?
Haven't seem him for long, sadly. Perhaps he just takes a break like me, but 
is more consequent in doing it. ;)

--Dennis


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


Re: [Warzone-dev] More patches for warnings

2006-11-04 Thread vs2k5
On Thu, 02 Nov 2006 16:27:51 -0500 Troman <[EMAIL PROTECTED]> wrote:
>It is a cleaner approach, but for me it is more intuitively to use 
>MALLOC 
>since already the name implies that malloc functionality will be 
>used at 
>some point. And these 2 new macros will not replace all occurances 
>of 
>MALLOC, so we are just introducing more macros for the same 
>functionality.
>
>But anyway, I will be an impartial executor of a collective 
>opinion. To make 
>it painless for everyone if no objections will be raised until 
>tomorrow 
>evening I will just go on and apply the patch.
>
>Troman 
>
Also keep in mind that when using VS, and your using their debug 
libs to catch memory errors via the _CrtDumpMemoryLeaks() call in 
the debugger, having more macros on top of other macros gets very 
messy.

Are people actually testing all these patches by playing a few 
different skirmish games, and then some campaign games, and seeing 
if something breaks?

I also forgot who it was, but the person doing the 64bit port, are 
they still around?








Concerned about your privacy? Instantly send FREE secure email, no account 
required
http://www.hushmail.com/send?l=480

Get the best prices on SSL certificates from Hushmail
https://www.hushssl.com?l=485


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


Re: [Warzone-dev] More patches for warnings

2006-11-03 Thread Troman


- Original Message - 
From: "Troman" <[EMAIL PROTECTED]>

To: "Development list" 
Sent: Friday, November 03, 2006 10:16 PM
Subject: Re: [Warzone-dev] More patches for warnings




- Original Message - 
From: "Gerard Krol" <[EMAIL PROTECTED]>

To: "Development list" 
Sent: Friday, November 03, 2006 12:21 PM
Subject: Re: [Warzone-dev] More patches for warnings


[...]
The alternative is that I add casts to all MALLOC's that not yet have 
them, this would fix a lot of warnings too.


- Gerard


Maybe this is a better alternative to using NEW as an additional marco? 
Whether to get rid of MALLOC in favor or malloc or something else is 
another question, although judging from what Per said it will probably 
take a bit more effort to do this.


Anyway, delaying the commit until we clarify this.

Troman


As a result of a small IRC discussion with Devurandom I guess we are putting 
this on hold for now.


Troman 



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


Re: [Warzone-dev] More patches for warnings

2006-11-03 Thread Troman


- Original Message - 
From: "Gerard Krol" <[EMAIL PROTECTED]>

To: "Development list" 
Sent: Friday, November 03, 2006 12:21 PM
Subject: Re: [Warzone-dev] More patches for warnings


[...]
The alternative is that I add casts to all MALLOC's that not yet have 
them, this would fix a lot of warnings too.


- Gerard


Maybe this is a better alternative to using NEW as an additional marco? 
Whether to get rid of MALLOC in favor or malloc or something else is another 
question, although judging from what Per said it will probably take a bit 
more effort to do this.


Anyway, delaying the commit until we clarify this.

Troman 



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


Re: [Warzone-dev] More patches for warnings

2006-11-03 Thread Dennis Schridde
Am Freitag, 3. November 2006 12:21 schrieb Gerard Krol:
> Dennis Schridde wrote:
> > Am Donnerstag, 2. November 2006 22:27 schrieb Troman:
> >>> - Original Message -
> >>> From: "Dennis Schridde" <[EMAIL PROTECTED]>
> >>> To: "Development list" 
> >>> Sent: Wednesday, November 01, 2006 11:50 PM
> >>> Subject: Re: [Warzone-dev] More patches for warnings
> >>>
> >>> Am Mittwoch, 1. November 2006 23:03 schrieb Gerard Krol:
> >>>> Hi,
> >>>>
> >>>> This evenings work ;)
> >>>>
> >>>> new.patch contains the addition of two macro's, and the use of them to
> >>>> replace MALLOC
> >>>
> >>> MALLOC itself is a macro around some custom wrapper around malloc...
> >>> So perhaps we should also check if we (additionally to using this NEW
> >>> wrapper)
> >>> could drop that MALLOC malloc wrapper...
> >>> (I don't really know what exact functionality MALLOC and FREE provide,
> >>> besides
> >>> that FREE checks for NULL pointers, what is useless as free() is
> >>> defined by the C std to do nothing in that case.)
> >>>
> >>> --Dennis
> >>>
> >>> PS: Idea seems good, didn't look at the patch.
> >>
> >> It is a cleaner approach, but for me it is more intuitively to use
> >> MALLOC since already the name implies that malloc functionality will be
> >> used at some point. And these 2 new macros will not replace all
> >> occurances of MALLOC, so we are just introducing more macros for the
> >> same functionality.
> >>
> >> But anyway, I will be an impartial executor of a collective opinion. To
> >> make it painless for everyone if no objections will be raised until
> >> tomorrow evening I will just go on and apply the patch.
> >
> > Well, then make it MALLOC instead. NEW is also more C++ style...
> > I'd be ok with it, but it doesn't bring much real benefit, though you
> > could even don't use NEW. Also most ppl would probably not use NEW anyway
> > as they are used to MALLOC/malloc and that's what's used in most of the
> > code. You are right YaWM (Yet another Wrapper Macro) is probably not
> > needed and would clutter the code even more.
>
> I have a lot more experience using the C++ new than the C malloc, as you
> guessed, so the new seems more natural to me.
> And how about calling it "MALLOC_NEW"?
That's ugly, if that NEW thingy is added I'd do it as NEW and don't mix it up 
with MALLOC and whatnot...
On one hand NEW is smaller, less to type and easier to read.
On the other hand it is another wrapper.
Actually I thought it would replace the MALLOC...

Additionally MALLOC has this NULL checks which don't do nothing, so we could 
also skip them. Or create some debug output if someone wants to free a NULL 
pointer, as Per suggested? The latter sounds sensible in debug mode. In 
ndebug I'd just remove it (if it is present there, too).

And actually I'd really love to get rid of this MALLOC thingy if possible and 
sensible. I guess that it doesn't bring much benefit on modern machines and 
was mostly needed for PSX or similar. If we need to optimize the mallocing 
with a memory pool or similar one day, we can add it back then.

--Dennis


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


Re: [Warzone-dev] More patches for warnings

2006-11-03 Thread Gerard Krol

Dennis Schridde wrote:

Am Donnerstag, 2. November 2006 22:27 schrieb Troman:
  

- Original Message -
From: "Dennis Schridde" <[EMAIL PROTECTED]>
To: "Development list" 
Sent: Wednesday, November 01, 2006 11:50 PM
Subject: Re: [Warzone-dev] More patches for warnings
Am Mittwoch, 1. November 2006 23:03 schrieb Gerard Krol:
  

Hi,

This evenings work ;)

new.patch contains the addition of two macro's, and the use of them to
replace MALLOC


MALLOC itself is a macro around some custom wrapper around malloc...
So perhaps we should also check if we (additionally to using this NEW
wrapper)
could drop that MALLOC malloc wrapper...
(I don't really know what exact functionality MALLOC and FREE provide,
besides
that FREE checks for NULL pointers, what is useless as free() is defined
by the C std to do nothing in that case.)

--Dennis

PS: Idea seems good, didn't look at the patch.
  

It is a cleaner approach, but for me it is more intuitively to use MALLOC
since already the name implies that malloc functionality will be used at
some point. And these 2 new macros will not replace all occurances of
MALLOC, so we are just introducing more macros for the same functionality.

But anyway, I will be an impartial executor of a collective opinion. To
make it painless for everyone if no objections will be raised until
tomorrow evening I will just go on and apply the patch.


Well, then make it MALLOC instead. NEW is also more C++ style...
I'd be ok with it, but it doesn't bring much real benefit, though you could 
even don't use NEW. Also most ppl would probably not use NEW anyway as they 
are used to MALLOC/malloc and that's what's used in most of the code.
You are right YaWM (Yet another Wrapper Macro) is probably not needed and 
would clutter the code even more.
  
I have a lot more experience using the C++ new than the C malloc, as you 
guessed, so the new seems more natural to me.
And how about calling it "MALLOC_NEW"? It is indeed YaWM, but it saves a 
cast and a sizeof.
And I find (SOME_LONG_TYPENAME*)MALLOC(sizeof(SOME_LONG_TYPENAME)*a*b) 
not so nice to look at as

MALLOC_NEW_ARRAY(SOME_LONG_TYPENAME, a*b)
But I guess the former is more "C".
If someone wonders what this macro does, he can take an easy look at mem.h
Shall I try to completely remove all MALLOC calls and replace them with 
MALLOC_NEW?
The MALLOC calls left are for strings and texture pages and such, but 
they can then be replaced with:

MALLOC_NEW_ARRAY(char, size)

The alternative is that I add casts to all MALLOC's that not yet have 
them, this would fix a lot of warnings too.


- Gerard

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


Re: [Warzone-dev] More patches for warnings

2006-11-02 Thread Dennis Schridde
Am Donnerstag, 2. November 2006 22:27 schrieb Troman:
> >- Original Message -
> >From: "Dennis Schridde" <[EMAIL PROTECTED]>
> >To: "Development list" 
> >Sent: Wednesday, November 01, 2006 11:50 PM
> >Subject: Re: [Warzone-dev] More patches for warnings
> >Am Mittwoch, 1. November 2006 23:03 schrieb Gerard Krol:
> >> Hi,
> >>
> >> This evenings work ;)
> >>
> >> new.patch contains the addition of two macro's, and the use of them to
> >> replace MALLOC
> >
> >MALLOC itself is a macro around some custom wrapper around malloc...
> >So perhaps we should also check if we (additionally to using this NEW
> >wrapper)
> >could drop that MALLOC malloc wrapper...
> >(I don't really know what exact functionality MALLOC and FREE provide,
> >besides
> >that FREE checks for NULL pointers, what is useless as free() is defined
> > by the C std to do nothing in that case.)
> >
> >--Dennis
> >
> >PS: Idea seems good, didn't look at the patch.
>
> It is a cleaner approach, but for me it is more intuitively to use MALLOC
> since already the name implies that malloc functionality will be used at
> some point. And these 2 new macros will not replace all occurances of
> MALLOC, so we are just introducing more macros for the same functionality.
>
> But anyway, I will be an impartial executor of a collective opinion. To
> make it painless for everyone if no objections will be raised until
> tomorrow evening I will just go on and apply the patch.
Well, then make it MALLOC instead. NEW is also more C++ style...
I'd be ok with it, but it doesn't bring much real benefit, though you could 
even don't use NEW. Also most ppl would probably not use NEW anyway as they 
are used to MALLOC/malloc and that's what's used in most of the code.
You are right YaWM (Yet another Wrapper Macro) is probably not needed and 
would clutter the code even more.

Whatever you decide, it's ok.

--Dennis


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


Re: [Warzone-dev] More patches for warnings

2006-11-02 Thread Troman
- Original Message - 
From: "Dennis Schridde" <[EMAIL PROTECTED]>

To: "Development list" 
Sent: Wednesday, November 01, 2006 11:50 PM
Subject: Re: [Warzone-dev] More patches for warnings




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

Am Mittwoch, 1. November 2006 23:03 schrieb Gerard Krol:

Hi,

This evenings work ;)

new.patch contains the addition of two macro's, and the use of them to
replace MALLOC

MALLOC itself is a macro around some custom wrapper around malloc...
So perhaps we should also check if we (additionally to using this NEW 
wrapper)

could drop that MALLOC malloc wrapper...
(I don't really know what exact functionality MALLOC and FREE provide, 
besides

that FREE checks for NULL pointers, what is useless as free() is defined by
the C std to do nothing in that case.)

--Dennis

PS: Idea seems good, didn't look at the patch.



It is a cleaner approach, but for me it is more intuitively to use MALLOC 
since already the name implies that malloc functionality will be used at 
some point. And these 2 new macros will not replace all occurances of 
MALLOC, so we are just introducing more macros for the same functionality.


But anyway, I will be an impartial executor of a collective opinion. To make 
it painless for everyone if no objections will be raised until tomorrow 
evening I will just go on and apply the patch.


Troman 



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


Re: [Warzone-dev] More patches for warnings

2006-11-02 Thread Dennis Schridde
Am Donnerstag, 2. November 2006 10:45 schrieb Per Inge Mathisen:
> On 11/1/06, Dennis Schridde <[EMAIL PROTECTED]> wrote:
> > MALLOC itself is a macro around some custom wrapper around malloc...
> > So perhaps we should also check if we (additionally to using this NEW
> > wrapper) could drop that MALLOC malloc wrapper...
> > (I don't really know what exact functionality MALLOC and FREE provide,
> > besides that FREE checks for NULL pointers, what is useless as free() is
> > defined by the C std to do nothing in that case.)
>
> IIRC, Warzone uses its own malloc for its memory pool system. I had a
> go at replacing it with standard malloc and ditch the memory pool
> system a while ago, and it turned out to be non-trivial. Checking for
> free of null pointers would be nice if they were reported as runtime
> warnings or errors; although valgrind can do that, too.
k, so perhaps we can enhance that FREE macro for debug builds with extra 
output in case we free a NULL pointer...

--Dennis


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


Re: Re: [Warzone-dev] More patches for warnings

2006-11-02 Thread Per Inge Mathisen

On 11/1/06, Dennis Schridde <[EMAIL PROTECTED]> wrote:

MALLOC itself is a macro around some custom wrapper around malloc...
So perhaps we should also check if we (additionally to using this NEW wrapper)
could drop that MALLOC malloc wrapper...
(I don't really know what exact functionality MALLOC and FREE provide, besides
that FREE checks for NULL pointers, what is useless as free() is defined by
the C std to do nothing in that case.)


IIRC, Warzone uses its own malloc for its memory pool system. I had a
go at replacing it with standard malloc and ditch the memory pool
system a while ago, and it turned out to be non-trivial. Checking for
free of null pointers would be nice if they were reported as runtime
warnings or errors; although valgrind can do that, too.

 - Per

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


Re: [Warzone-dev] More patches for warnings

2006-11-01 Thread Dennis Schridde
Am Mittwoch, 1. November 2006 23:03 schrieb Gerard Krol:
> Hi,
>
> This evenings work ;)
>
> new.patch contains the addition of two macro's, and the use of them to
> replace MALLOC
MALLOC itself is a macro around some custom wrapper around malloc...
So perhaps we should also check if we (additionally to using this NEW wrapper) 
could drop that MALLOC malloc wrapper...
(I don't really know what exact functionality MALLOC and FREE provide, besides 
that FREE checks for NULL pointers, what is useless as free() is defined by 
the C std to do nothing in that case.)

--Dennis

PS: Idea seems good, didn't look at the patch.


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