[airstrike] [Fwd: Re: Bug in mech.c]
oak at welho.com
Tue Jun 1 16:29:10 EDT 2004
I reverted all the casts in the CVS + the array 'array' field renaming to
'next' (as it actually is array and not a next pointer :-)). This should
have fixed the CR/LF vs. CR issue too.
> > 2) Changes in: sprites/bonus.c, sprites/draco.c, sprites/zeppelin.c
> > Description:
> > I changed '|=' and '&=' in '=', I do not understand where difficult to
> > understand construction like |= and &= are necessary in the source code
> > of this sprites. I know what the mean but it seems to me that they are
> > not necessary. I replaced them and tested them to see of there where
> > different results, but I any case the results are the same (equal or
> > one).
> The intent of the flags member of the sprite struct is to hold
> different kinds of binary flags for each sprite. This means that we
> can hold 32 flags (we require at least 32 bit int's). If you replace
> |= with = you clear all the other bits, which is not what we want. If
> you for some reason want to avoid the usage of the |= operator you
> should tranform x |= y to x = x | y, but we consider this to be bad
> style in Airstrike.
> The real problem is that sprite.flags is an enum, we should change it
> to an unsigned int, although the present usage is valid C.
I fixed this in sprite.h. 'flags' field is now unsigned int.
Everything should now be fixed in the CVS, it just needs to be
checked that stuff can be still compiled on Windows using a
standards compliant C-compiler.
> I put a new file for all the OS specific code: src/core/compat.h You
> can add a src/core/compat.c if you need it for some reason. It would
> be nice if all platform specific code is in this file, although it may
> not be possible in all cases.
As we have now more compatibility & some rules on how this
co-development should work, the end result is pretty good.
 Hopefully soon on the Airstrike page too... :-)
More information about the airstrike