comparison src/joystick/os2/SDL_sysjoystick.c @ 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
comparison
equal deleted inserted replaced
1335:c39265384763 1336:3692456e7b0f
324 { 324 {
325 int index; /* Index shortcut for index in joystick structure */ 325 int index; /* Index shortcut for index in joystick structure */
326 int i; /* Generic Counter */ 326 int i; /* Generic Counter */
327 327
328 /* allocate memory for system specific hardware data */ 328 /* allocate memory for system specific hardware data */
329 joystick->hwdata = (struct joystick_hwdata *) malloc(sizeof(*joystick->hwdata)); 329 joystick->hwdata = (struct joystick_hwdata *) SDL_malloc(sizeof(*joystick->hwdata));
330 if (joystick->hwdata == NULL) 330 if (joystick->hwdata == NULL)
331 { 331 {
332 SDL_OutOfMemory(); 332 SDL_OutOfMemory();
333 return(-1); 333 return(-1);
334 } 334 }
335 /* Reset Hardware Data */ 335 /* Reset Hardware Data */
336 memset(joystick->hwdata, 0, sizeof(*joystick->hwdata)); 336 SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
337 337
338 /* ShortCut Pointer */ 338 /* ShortCut Pointer */
339 index = joystick->index; 339 index = joystick->index;
340 /* Define offsets and scales for all axes */ 340 /* Define offsets and scales for all axes */
341 joystick->hwdata->id = SYS_JoyData[index].id; 341 joystick->hwdata->id = SYS_JoyData[index].id;
515 void SDL_SYS_JoystickClose(SDL_Joystick *joystick) 515 void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
516 { 516 {
517 if (joystick->hwdata != NULL) 517 if (joystick->hwdata != NULL)
518 { 518 {
519 /* free system specific hardware data */ 519 /* free system specific hardware data */
520 free(joystick->hwdata); 520 SDL_free(joystick->hwdata);
521 } 521 }
522 } 522 }
523 523
524 524
525 525
600 int joyGetEnv(struct _joycfg * joydata) 600 int joyGetEnv(struct _joycfg * joydata)
601 { 601 {
602 char *joyenv; /* Pointer to tested character */ 602 char *joyenv; /* Pointer to tested character */
603 char tempnumber[5]; /* Temporary place to put numeric texts */ 603 char tempnumber[5]; /* Temporary place to put numeric texts */
604 604
605 joyenv = getenv("SDL_OS2_JOYSTICK"); 605 joyenv = SDL_getenv("SDL_OS2_JOYSTICK");
606 if (joyenv == NULL) return 0; 606 if (joyenv == NULL) return 0;
607 /* Joystick Environment is defined! */ 607 /* Joystick Environment is defined! */
608 while (*joyenv==' ' && *joyenv!=0) joyenv++; /* jump spaces... */ 608 while (*joyenv==' ' && *joyenv!=0) joyenv++; /* jump spaces... */
609 /* If the string name starts with '... get if fully */ 609 /* If the string name starts with '... get if fully */
610 if (*joyenv=='\'') joyenv+=joyGetData(++joyenv,joydata->name,'\'',sizeof(joydata->name)); 610 if (*joyenv=='\'') joyenv+=joyGetData(++joyenv,joydata->name,'\'',sizeof(joydata->name));