comparison src/video/ggi/SDL_ggivideo.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
81 return (vis != NULL); 81 return (vis != NULL);
82 } 82 }
83 83
84 static void GGI_DeleteDevice(SDL_VideoDevice *device) 84 static void GGI_DeleteDevice(SDL_VideoDevice *device)
85 { 85 {
86 free(device->hidden); 86 SDL_free(device->hidden);
87 free(device); 87 SDL_free(device);
88 } 88 }
89 89
90 static SDL_VideoDevice *GGI_CreateDevice(int devindex) 90 static SDL_VideoDevice *GGI_CreateDevice(int devindex)
91 { 91 {
92 SDL_VideoDevice *device; 92 SDL_VideoDevice *device;
93 93
94 /* Initialize all variables that we clean on shutdown */ 94 /* Initialize all variables that we clean on shutdown */
95 device = (SDL_VideoDevice *)malloc(sizeof(SDL_VideoDevice)); 95 device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
96 if ( device ) { 96 if ( device ) {
97 memset(device, 0, (sizeof *device)); 97 SDL_memset(device, 0, (sizeof *device));
98 device->hidden = (struct SDL_PrivateVideoData *) 98 device->hidden = (struct SDL_PrivateVideoData *)
99 malloc((sizeof *device->hidden)); 99 SDL_malloc((sizeof *device->hidden));
100 } 100 }
101 if ( (device == NULL) || (device->hidden == NULL) ) { 101 if ( (device == NULL) || (device->hidden == NULL) ) {
102 SDL_OutOfMemory(); 102 SDL_OutOfMemory();
103 if ( device ) { 103 if ( device ) {
104 free(device); 104 SDL_free(device);
105 } 105 }
106 return(0); 106 return(0);
107 } 107 }
108 memset(device->hidden, 0, (sizeof *device->hidden)); 108 SDL_memset(device->hidden, 0, (sizeof *device->hidden));
109 109
110 /* Set the function pointers */ 110 /* Set the function pointers */
111 device->VideoInit = GGI_VideoInit; 111 device->VideoInit = GGI_VideoInit;
112 device->ListModes = GGI_ListModes; 112 device->ListModes = GGI_ListModes;
113 device->SetVideoMode = GGI_SetVideoMode; 113 device->SetVideoMode = GGI_SetVideoMode;
160 ggi_color pal[256], map[256]; 160 ggi_color pal[256], map[256];
161 const ggi_directbuffer *db; 161 const ggi_directbuffer *db;
162 int err, num_bufs; 162 int err, num_bufs;
163 ggi_pixel white, black; 163 ggi_pixel white, black;
164 164
165 priv = malloc(sizeof(struct private_hwdata)); 165 priv = SDL_malloc(sizeof(struct private_hwdata));
166 if (priv == NULL) 166 if (priv == NULL)
167 { 167 {
168 SDL_SetError("Unhandled GGI mode type!\n"); 168 SDL_SetError("Unhandled GGI mode type!\n");
169 GGI_VideoQuit(NULL); 169 GGI_VideoQuit(NULL);
170 } 170 }