[AD] AL_CONST BITMAP patch

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Hi,

Following the recent discussion on this list about whether or not it
makes sense for BITMAPs to be `const', I have come to agree with George
Foot. He rightly pointed out that even reading a pixel from a bitmap
might change the structure in a significant way, since the lines[] array
might be altered.

Also, there were problems with locking/releasing bitmaps: should such
bitmaps be constant or not? Whichever option we chose, it would require
somebody somewhere to cast away const.

So, to this end, I have included a link to patch which removes any
AL_CONST BITMAP code from Allegro. There is still more work to be done
on `const' correctness (most notably documentation :-), and this does
not address any such issues, but it is a start towards getting this work
done.

Here is the bzip2 version (the post gets rejected if the size is > 32000
so I cannot post the uncompressed version):

Attachment: al_const_bitmap.diff.bz2
Description: al_const_bitmap.diff.bz2

Alternatively, the uncompressed patch (84k) can be found at:
 http://www.lwithers.demon.co.uk/tmp/al_const_bitmap.diff

I have tested the patch on DJGPP (gcc 2.95.2), which compiles without
any problems when `WARNMODE' is set to 1. I have not tested for any
other platforms, so this will need to be done - but then, that is one of
the functions of maintaining a CVS repository. However, I do not believe
that there will be any problems; no Allegro code previously required
these bitmaps to be `const', so nothing should mind if we change
everything back from `const'.

This patch is also a major step towards getting `const'-correctness on
Windows - will somebody with a Windows compiler please let me know if
there are any problems with this patch applied? 

Bye for now,
-- 
Laurence Withers, lwithers@xxxxxxxxxx
                http://www.lwithers.demon.co.uk/

Attachment: signature.asc
Description: PGP signature



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/