comparison src/video/wincommon/SDL_sysmouse.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 450721ad5436
children 604d73db6802
comparison
equal deleted inserted replaced
1335:c39265384763 1336:3692456e7b0f
94 if ( cursor->curs == GetCursor() ) 94 if ( cursor->curs == GetCursor() )
95 SetCursor(NULL); 95 SetCursor(NULL);
96 if ( cursor->curs != NULL ) 96 if ( cursor->curs != NULL )
97 DestroyCursor(cursor->curs); 97 DestroyCursor(cursor->curs);
98 if ( cursor->ands != NULL ) 98 if ( cursor->ands != NULL )
99 free(cursor->ands); 99 SDL_free(cursor->ands);
100 if ( cursor->xors != NULL ) 100 if ( cursor->xors != NULL )
101 free(cursor->xors); 101 SDL_free(cursor->xors);
102 #endif /* !USE_STATIC_CURSOR */ 102 #endif /* !USE_STATIC_CURSOR */
103 free(cursor); 103 SDL_free(cursor);
104 } 104 }
105 105
106 WMcursor *WIN_CreateWMCursor(_THIS, 106 WMcursor *WIN_CreateWMCursor(_THIS,
107 Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y) 107 Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
108 { 108 {
109 #ifdef USE_STATIC_CURSOR 109 #ifdef USE_STATIC_CURSOR
110 WMcursor *cursor; 110 WMcursor *cursor;
111 111
112 /* Allocate the cursor */ 112 /* Allocate the cursor */
113 cursor = (WMcursor *)malloc(sizeof(*cursor)); 113 cursor = (WMcursor *)SDL_malloc(sizeof(*cursor));
114 if ( cursor ) { 114 if ( cursor ) {
115 cursor->curs = LoadCursor(NULL, IDC_ARROW); 115 cursor->curs = LoadCursor(NULL, IDC_ARROW);
116 } 116 }
117 return(cursor); 117 return(cursor);
118 #else 118 #else
130 allowed_x, allowed_y); 130 allowed_x, allowed_y);
131 return(NULL); 131 return(NULL);
132 } 132 }
133 133
134 /* Allocate the cursor */ 134 /* Allocate the cursor */
135 cursor = (WMcursor *)malloc(sizeof(*cursor)); 135 cursor = (WMcursor *)SDL_malloc(sizeof(*cursor));
136 if ( cursor == NULL ) { 136 if ( cursor == NULL ) {
137 SDL_SetError("Out of memory"); 137 SDL_SetError("Out of memory");
138 return(NULL); 138 return(NULL);
139 } 139 }
140 cursor->curs = NULL; 140 cursor->curs = NULL;
142 cursor->xors = NULL; 142 cursor->xors = NULL;
143 143
144 /* Pad out to the normal cursor size */ 144 /* Pad out to the normal cursor size */
145 run = PAD_BITS(w); 145 run = PAD_BITS(w);
146 pad = PAD_BITS(allowed_x)-run; 146 pad = PAD_BITS(allowed_x)-run;
147 aptr = cursor->ands = (Uint8 *)malloc((run+pad)*allowed_y); 147 aptr = cursor->ands = (Uint8 *)SDL_malloc((run+pad)*allowed_y);
148 xptr = cursor->xors = (Uint8 *)malloc((run+pad)*allowed_y); 148 xptr = cursor->xors = (Uint8 *)SDL_malloc((run+pad)*allowed_y);
149 if ( (aptr == NULL) || (xptr == NULL) ) { 149 if ( (aptr == NULL) || (xptr == NULL) ) {
150 WIN_FreeWMCursor(NULL, cursor); 150 WIN_FreeWMCursor(NULL, cursor);
151 SDL_OutOfMemory(); 151 SDL_OutOfMemory();
152 return(NULL); 152 return(NULL);
153 } 153 }
156 xptr += run; 156 xptr += run;
157 data += run; 157 data += run;
158 memnot(aptr, mask, run); 158 memnot(aptr, mask, run);
159 mask += run; 159 mask += run;
160 aptr += run; 160 aptr += run;
161 memset(xptr, 0, pad); 161 SDL_memset(xptr, 0, pad);
162 xptr += pad; 162 xptr += pad;
163 memset(aptr, ~0, pad); 163 SDL_memset(aptr, ~0, pad);
164 aptr += pad; 164 aptr += pad;
165 } 165 }
166 pad += run; 166 pad += run;
167 for ( ; i<allowed_y; ++i ) { 167 for ( ; i<allowed_y; ++i ) {
168 memset(xptr, 0, pad); 168 SDL_memset(xptr, 0, pad);
169 xptr += pad; 169 xptr += pad;
170 memset(aptr, ~0, pad); 170 SDL_memset(aptr, ~0, pad);
171 aptr += pad; 171 aptr += pad;
172 } 172 }
173 173
174 /* Create the cursor */ 174 /* Create the cursor */
175 cursor->curs = CreateCursor( 175 cursor->curs = CreateCursor(