dinput: Constify some variables

Vitaliy Margolen wine-devel at kievinfo.com
Mon Apr 23 20:23:30 CDT 2007


Andrew Talbot wrote:
> Changelog:
>     dinput: Constify some variables.

> -static LONG map_axis(JoystickImpl * This, short val, short index)
> +static LONG map_axis(const JoystickImpl *This, short val, short index)
>  {
>      double    fval = val;
>      double    fmin = This->props[index].lMin;
> diff -urN a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c
> --- a/dlls/dinput/joystick_linuxinput.c	2007-03-08 21:37:02.000000000 +0000
> +++ b/dlls/dinput/joystick_linuxinput.c	2007-04-23 20:28:26.000000000 +0100
> @@ -586,7 +586,7 @@
>   * adapts values accordingly.
>   */
>  static int
> -map_axis(JoystickImpl* This, int axis, int val) {
> +map_axis(const JoystickImpl *This, int axis, int val) {
>      int hmax = This->props[axis].havemax;
>      int hmin = This->props[axis].havemin;
>      int	wmin = This->props[axis].wantmin;

Please don't make a pointer to This a const. Same objections as with any
COM object.

Vitaliy.



More information about the wine-devel mailing list