src/video/x11/SDL_x11mouse.c
changeset 1336 3692456e7b0f
parent 1312 c9b51268668f
child 1338 604d73db6802
     1.1 --- a/src/video/x11/SDL_x11mouse.c	Mon Feb 06 17:28:04 2006 +0000
     1.2 +++ b/src/video/x11/SDL_x11mouse.c	Tue Feb 07 06:59:48 2006 +0000
     1.3 @@ -49,7 +49,7 @@
     1.4  		pXSync(SDL_Display, False);
     1.5  		SDL_Unlock_EventThread();
     1.6  	}
     1.7 -	free(cursor);
     1.8 +	SDL_free(cursor);
     1.9  }
    1.10  
    1.11  WMcursor *X11_CreateWMCursor(_THIS,
    1.12 @@ -66,7 +66,7 @@
    1.13  	static XColor white = { 0xffff, 0xffff, 0xffff, 0xffff };
    1.14  
    1.15  	/* Allocate the cursor memory */
    1.16 -	cursor = (WMcursor *)malloc(sizeof(WMcursor));
    1.17 +	cursor = (WMcursor *)SDL_malloc(sizeof(WMcursor));
    1.18  	if ( cursor == NULL ) {
    1.19  		SDL_OutOfMemory();
    1.20  		return(NULL);
    1.21 @@ -74,16 +74,16 @@
    1.22  
    1.23  	/* Mix the mask and the data */
    1.24  	clen = (w/8)*h;
    1.25 -	x_data = (char *)malloc(clen);
    1.26 +	x_data = (char *)SDL_malloc(clen);
    1.27  	if ( x_data == NULL ) {
    1.28 -		free(cursor);
    1.29 +		SDL_free(cursor);
    1.30  		SDL_OutOfMemory();
    1.31  		return(NULL);
    1.32  	}
    1.33 -	x_mask = (char *)malloc(clen);
    1.34 +	x_mask = (char *)SDL_malloc(clen);
    1.35  	if ( x_mask == NULL ) {
    1.36 -		free(cursor);
    1.37 -		free(x_data);
    1.38 +		SDL_free(cursor);
    1.39 +		SDL_free(x_data);
    1.40  		SDL_OutOfMemory();
    1.41  		return(NULL);
    1.42  	}
    1.43 @@ -199,15 +199,15 @@
    1.44  	int accel_value[3];
    1.45  	char *mouse_param, *mouse_param_buf, *pin;
    1.46  
    1.47 -	mouse_param_buf = (char *)malloc(strlen(accel_param)+1);
    1.48 +	mouse_param_buf = (char *)SDL_malloc(SDL_strlen(accel_param)+1);
    1.49  	if ( ! mouse_param_buf ) {
    1.50  		return;
    1.51  	}
    1.52 -	strcpy(mouse_param_buf, accel_param);
    1.53 +	SDL_strcpy(mouse_param_buf, accel_param);
    1.54  	mouse_param = mouse_param_buf;
    1.55  
    1.56  	for ( i=0; (i < 3) && mouse_param; ++i ) {
    1.57 -		pin = strchr(mouse_param, '/');
    1.58 +		pin = SDL_strchr(mouse_param, '/');
    1.59  		if ( pin ) {
    1.60  			*pin = '\0';
    1.61  		}
    1.62 @@ -221,7 +221,7 @@
    1.63  	if ( mouse_param_buf ) {
    1.64  		pXChangePointerControl(SDL_Display, True, True,
    1.65  			accel_value[0], accel_value[1], accel_value[2]);
    1.66 -		free(mouse_param_buf);
    1.67 +		SDL_free(mouse_param_buf);
    1.68  	}
    1.69  }
    1.70  
    1.71 @@ -235,7 +235,7 @@
    1.72  	   They almost never want to do this, as it seriously affects
    1.73  	   applications that rely on continuous relative mouse motion.
    1.74  	*/
    1.75 -	env_override = getenv("SDL_MOUSE_RELATIVE");
    1.76 +	env_override = SDL_getenv("SDL_MOUSE_RELATIVE");
    1.77  	if ( env_override ) {
    1.78  		enable_relative = atoi(env_override);
    1.79  	}
    1.80 @@ -256,7 +256,7 @@
    1.81  						&mouse_accel.numerator, 
    1.82  						&mouse_accel.denominator,
    1.83  						&mouse_accel.threshold);
    1.84 -				xmouse_accel=getenv("SDL_VIDEO_X11_MOUSEACCEL");
    1.85 +				xmouse_accel=SDL_getenv("SDL_VIDEO_X11_MOUSEACCEL");
    1.86  				if ( xmouse_accel ) {
    1.87  					SetMouseAccel(this, xmouse_accel);
    1.88  				}