comparison src/video/maccommon/SDL_macmouse.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
46 }; 46 };
47 47
48 48
49 void Mac_FreeWMCursor(_THIS, WMcursor *cursor) 49 void Mac_FreeWMCursor(_THIS, WMcursor *cursor)
50 { 50 {
51 free(cursor); 51 SDL_free(cursor);
52 } 52 }
53 53
54 WMcursor *Mac_CreateWMCursor(_THIS, 54 WMcursor *Mac_CreateWMCursor(_THIS,
55 Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y) 55 Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
56 { 56 {
57 WMcursor *cursor; 57 WMcursor *cursor;
58 int row, bytes; 58 int row, bytes;
59 59
60 /* Allocate the cursor memory */ 60 /* Allocate the cursor memory */
61 cursor = (WMcursor *)malloc(sizeof(WMcursor)); 61 cursor = (WMcursor *)SDL_malloc(sizeof(WMcursor));
62 if ( cursor == NULL ) { 62 if ( cursor == NULL ) {
63 SDL_OutOfMemory(); 63 SDL_OutOfMemory();
64 return(NULL); 64 return(NULL);
65 } 65 }
66 memset(cursor, 0, sizeof(*cursor)); 66 SDL_memset(cursor, 0, sizeof(*cursor));
67 67
68 if (w > 16) 68 if (w > 16)
69 w = 16; 69 w = 16;
70 70
71 if (h > 16) 71 if (h > 16)
72 h = 16; 72 h = 16;
73 73
74 bytes = (w+7)/8; 74 bytes = (w+7)/8;
75 75
76 for ( row=0; row<h; ++row ) { 76 for ( row=0; row<h; ++row ) {
77 memcpy(&cursor->curs.data[row], data, bytes); 77 SDL_memcpy(&cursor->curs.data[row], data, bytes);
78 data += bytes; 78 data += bytes;
79 } 79 }
80 for ( row=0; row<h; ++row ) { 80 for ( row=0; row<h; ++row ) {
81 memcpy(&cursor->curs.mask[row], mask, bytes); 81 SDL_memcpy(&cursor->curs.mask[row], mask, bytes);
82 mask += bytes; 82 mask += bytes;
83 } 83 }
84 cursor->curs.hotSpot.h = hot_x; 84 cursor->curs.hotSpot.h = hot_x;
85 cursor->curs.hotSpot.v = hot_y; 85 cursor->curs.hotSpot.v = hot_y;
86 86