Re: [AD] Proposed changes for Allegro 5 (6?)

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


Shawn Hargreaves wrote:

Sven Sandberg writes:
 >  - `bmp_read8()' & co currently use longs instead of pointers. I think
 > this is an old djgpp-ism, because `_farnspokew()' take longs as
 > arguments. If someone knows a good reason why it must be this way,
 > please say it. Otherwise, can we please replace `unsigned long' by
 > `unsigned char *', `unsigned short *', and `unsigned long *'?

The thinking behind using longs is that this makes the pointers
opaque, ie. can't be dereferenced directly by the user, so
people are forced to always access them with the bmp_read*()
macros. If they were pointers, it would be easy to accidentally
write *ptr, which would work on some platforms but fail on
others.


Those functions are of the fairly advanced level, so I don't see users who haven't understood pointers use them :) If they write *ptr instead of ptr, then it's a bug in the user's program, not Allegro. It's also bad for portability. I32P64 x86 chips are due out very soon, and Allegro will be broken at that point. Better to fix it now, then having Allegro not run on half the world's computers in a few years :)


[snip]


--
- Robert J Ohannessian
"Microsoft code is probably O(n^20)" (my CS prof)
http://pages.infinit.net/voidstar/



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