Per Inge Mathisen schreef:
> This is the kind of change that I would love to have been able to
> discuss before it was committed. There was no reason to hurry it
> though.

Then lets discuss it now. Unfortunately I'm not too good at estimating
what kind of changes you would like to discuss before committing and
which not. So we'll just have to take comfort in the fact that we use a
version control system which supports reverting of revisions if it
should prove necessary.

> So my most pertinent question. What is wrong with
> 
>          void checkDroid(const DROID *droid, const int line, const char 
> *file);
> 
>          /* assert if droid is bad */
>          #define CHECK_DROID(droid) checkDroid(droid, __LINE__, __FILE__)
> 
> ?
> 
> And I strongly dislike AT_MACRO. Hiding the fact that __LINE__ and
> __FILE__ are used is uncalled for.
> 
> To me it just looks like this commit and the next just added a lot of
> complexity for no good reason.

Just to get this straight: the only thing you don't like about that ^^
change is the change from __LINE__ + __FILE__ to AT_MACRO? I only
changed it to that because it seemed more intuitive at the time. Though
I can see how you don't like it obscuring the underlying usage of
__LINE__ and __FILE__.

The change to AT_MACRO wasn't the "main" part of that commit though (not
intentionally at the least). The main part was the separation of
ASSERT_HELPER's contents out of ASSERT so that it could be used separately.

That is of course assuming that you mean this revision (r5865 [1]).
Because the code you're quoting ("checkDroid") was changed with r5866
[2]. The main change of that was "Make CHECK_OBJECT, CHECK_PROJECTILE
and CHECK_STRUCTURE macros that redirect to a function" and "Change
checkDroid to use ASSERT_HELPER to provide the source of the assertion".

NOTE: About AT_MACRO the only real advantage of that over __FILE__ +
__LINE__ is that AT_MACRO yields a string at compile time (due to the
way the preprocessor works with it). As __LINE__ is a number.

[1] http://developer.wz2100.net/changeset/5865
[2] http://developer.wz2100.net/changeset/5866

-- 
Giel

Attachment: signature.asc
Description: OpenPGP digital signature

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

Reply via email to