Re: [AD] Allegro 4.2.0 RC2 -- small const fix

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


Elias Pschernig wrote:
On Sun, 2005-08-28 at 12:00 +0200, Michal Molhanec wrote:

small const fix

plain text document attachment (wmouse.c.diff)
--- wmouse.c.old	Sun May 15 01:54:52 2005
+++ wmouse.c	Sun Aug 28 11:46:05 2005
@@ -49,7 +49,7 @@
static void mouse_directx_set_range(int x1, int y1, int x2, int y2);
static void mouse_directx_set_speed(int xspeed, int yspeed);
static void mouse_directx_get_mickeys(int *mickeyx, int *mickeyy);
-static void mouse_directx_enable_hardware_cursor(int mode);
+static void mouse_directx_enable_hardware_cursor(AL_CONST int mode);
static int mouse_directx_select_system_cursor(AL_CONST int cursor);


Only pointers should be const. Declaring an int parameter as const is
something which is only relevant for the implementation, but not the
API, so shouldn't be done. But the const below in "AL_CONST int cursor"
should be removed.

I don't understand. mouse_directx_enable_hardware_cursor is not part of API, is it?

Anyway if MOUSE_DRIVER is defined as

typedef struct MOUSE_DRIVER
{
   int  id;
   AL_CONST char *name;
   AL_CONST char *desc;
   AL_CONST char *ascii_name;
   AL_METHOD(int,  init, (void));
   AL_METHOD(void, exit, (void));
   AL_METHOD(void, poll, (void));
   AL_METHOD(void, timer_poll, (void));
   AL_METHOD(void, position, (int x, int y));
   AL_METHOD(void, set_range, (int x1, int y_1, int x2, int y2));
   AL_METHOD(void, set_speed, (int xspeed, int yspeed));
   AL_METHOD(void, get_mickeys, (int *mickeyx, int *mickeyy));
   AL_METHOD(int,  analyse_data, (AL_CONST char *buffer, int size));
   AL_METHOD(void, enable_hardware_cursor, (AL_CONST int mode));
   AL_METHOD(int,  select_system_cursor, (AL_CONST int cursor));
} MOUSE_DRIVER;

then it incorrect to assign to enable_hardware_cursor function without const parameter

--
Regards,
    Michal

ICQ# 175762750




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