Mercurial > sdl-ios-xcode
diff src/joystick/beos/SDL_bejoystick.cc @ 1336:3692456e7b0f
Use SDL_ prefixed versions of C library functions.
FIXME:
Change #include <stdlib.h> to #include "SDL_stdlib.h"
Change #include <string.h> to #include "SDL_string.h"
Make sure nothing else broke because of this...
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 07 Feb 2006 06:59:48 +0000 |
parents | c9b51268668f |
children | 604d73db6802 |
line wrap: on
line diff
--- a/src/joystick/beos/SDL_bejoystick.cc Mon Feb 06 17:28:04 2006 +0000 +++ b/src/joystick/beos/SDL_bejoystick.cc Tue Feb 07 06:59:48 2006 +0000 @@ -67,8 +67,8 @@ /* Search for attached joysticks */ nports = joystick.CountDevices(); numjoysticks = 0; - memset(SDL_joyport, 0, (sizeof SDL_joyport)); - memset(SDL_joyname, 0, (sizeof SDL_joyname)); + SDL_memset(SDL_joyport, 0, (sizeof SDL_joyport)); + SDL_memset(SDL_joyname, 0, (sizeof SDL_joyname)); for ( i=0; (SDL_numjoysticks < MAX_JOYSTICKS) && (i < nports); ++i ) { if ( joystick.GetDeviceName(i, name) == B_OK ) { if ( joystick.Open(name) != B_ERROR ) { @@ -102,12 +102,12 @@ /* Create the joystick data structure */ joystick->hwdata = (struct joystick_hwdata *) - malloc(sizeof(*joystick->hwdata)); + SDL_malloc(sizeof(*joystick->hwdata)); if ( joystick->hwdata == NULL ) { SDL_OutOfMemory(); return(-1); } - memset(joystick->hwdata, 0, sizeof(*joystick->hwdata)); + SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata)); stick = new BJoystick; joystick->hwdata->stick = stick; @@ -127,9 +127,9 @@ joystick->nhats = stick->CountHats(); joystick->hwdata->new_axes = (int16 *) - malloc(joystick->naxes*sizeof(int16)); + SDL_malloc(joystick->naxes*sizeof(int16)); joystick->hwdata->new_hats = (uint8 *) - malloc(joystick->nhats*sizeof(uint8)); + SDL_malloc(joystick->nhats*sizeof(uint8)); if ( ! joystick->hwdata->new_hats || ! joystick->hwdata->new_axes ) { SDL_OutOfMemory(); SDL_SYS_JoystickClose(joystick); @@ -208,12 +208,12 @@ joystick->hwdata->stick->Close(); delete joystick->hwdata->stick; if ( joystick->hwdata->new_hats ) { - free(joystick->hwdata->new_hats); + SDL_free(joystick->hwdata->new_hats); } if ( joystick->hwdata->new_axes ) { - free(joystick->hwdata->new_axes); + SDL_free(joystick->hwdata->new_axes); } - free(joystick->hwdata); + SDL_free(joystick->hwdata); joystick->hwdata = NULL; } } @@ -224,12 +224,12 @@ int i; for ( i=0; SDL_joyport[i]; ++i ) { - free(SDL_joyport[i]); + SDL_free(SDL_joyport[i]); } SDL_joyport[0] = NULL; for ( i=0; SDL_joyname[i]; ++i ) { - free(SDL_joyname[i]); + SDL_free(SDL_joyname[i]); } SDL_joyname[0] = NULL; }