Re: [AD] Code consistency across platforms

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


On 2008-12-17, Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:
> While comparing the code used on different platforms, I noticed that  
> very similar tasks are sometime performed very differently on  
> different platforms. In the case of OS X, this is sometimes necessary  
> because of the use of Objective-C, but in other cases it appears to be  
> just random or personal preference of whoever wrote the code.
> This isn't a big problem, but from a maintainability point of view it  
> might be a good idea to compare how different operations are  
> implemented on different platforms and try to "unify" the approach  
> somewhat. This will also make it easier to implement things or fix  
> bugs across different platforms by people who are not as familiar with  
> some of them.
> 
> Another consistency point:
> on OS X we have:
> qzmouse.m
> keybd.m
> osxgl.m
> system.m
> 
> On X11 the equivalent files are
> xmousenu.c
> xkeyboard.c
> xdisplay.c / xsystem.c (both contain equivalent functions to osxgl.m,  
> maybe also xglx_config.c)
> xsystem.c
> 
> On Windows:
> wmouse.c
> wkeybdnu.c
> wgl_disp.c/wnewwin.c
> wnewsys.c
> 
> (Windows of course also has the D3D driver in d3d_disp.cpp)
> 
> And we have the generic UNIX files
> umouse.c
> ukeybd.c
> usystem.c
> 
> That should probably also be synchronised a bit. It would be nice if  
> functions for certain tasks can be found together in certain files on  
> each platform, but the way some platforms work may make this hard  
> (don't know, but I suppose it could).
> I don't think we actually need a platform prefix ("x", "w", "osx") for  
> these files, since they're all in their own subdirectories, but it  
> might be useful in some cases.

I insist on the prefixes.

> I would suggest the following "standard" filenames across platforms  
> (with or without prefix):
> 
> mouse
> keyboard
> opengl (or plain gl)
> system
> cursor
> joy (or joystick?)
> 
> Thoughts?

I don't really mind.  But please rename the OS X files to give them
prefixes :)

> Also, there seem to a lot of old/unused files still around, for  
> instance in the OS X port. Is it ok to remove these to get rid of some  
> of the clutter?

Yes.  We already did some of it.

Another thing which I'd like to see more of is prefixes on static
functions to make them unique.  It makes reading, grepping and
navigating the code that much easier.

Peter





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