comparison src/video/picogui/SDL_pgvideo.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
83 return(1); 83 return(1);
84 } 84 }
85 85
86 static void PG_DeleteDevice(SDL_VideoDevice *device) 86 static void PG_DeleteDevice(SDL_VideoDevice *device)
87 { 87 {
88 free(device->hidden); 88 SDL_free(device->hidden);
89 free(device); 89 SDL_free(device);
90 } 90 }
91 91
92 static SDL_VideoDevice *PG_CreateDevice(int devindex) 92 static SDL_VideoDevice *PG_CreateDevice(int devindex)
93 { 93 {
94 SDL_VideoDevice *device; 94 SDL_VideoDevice *device;
95 95
96 /* Initialize all variables that we clean on shutdown */ 96 /* Initialize all variables that we clean on shutdown */
97 device = (SDL_VideoDevice *)malloc(sizeof(SDL_VideoDevice)); 97 device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
98 if ( device ) { 98 if ( device ) {
99 memset(device, 0, (sizeof *device)); 99 SDL_memset(device, 0, (sizeof *device));
100 device->hidden = (struct SDL_PrivateVideoData *) 100 device->hidden = (struct SDL_PrivateVideoData *)
101 malloc((sizeof *device->hidden)); 101 SDL_malloc((sizeof *device->hidden));
102 } 102 }
103 if ( (device == NULL) || (device->hidden == NULL) ) { 103 if ( (device == NULL) || (device->hidden == NULL) ) {
104 SDL_OutOfMemory(); 104 SDL_OutOfMemory();
105 if ( device ) { 105 if ( device ) {
106 free(device); 106 SDL_free(device);
107 } 107 }
108 return(0); 108 return(0);
109 } 109 }
110 memset(device->hidden, 0, (sizeof *device->hidden)); 110 SDL_memset(device->hidden, 0, (sizeof *device->hidden));
111 111
112 /* Set the function pointers */ 112 /* Set the function pointers */
113 device->VideoInit = PG_VideoInit; 113 device->VideoInit = PG_VideoInit;
114 device->ListModes = PG_ListModes; 114 device->ListModes = PG_ListModes;
115 device->SetVideoMode = PG_SetVideoMode; 115 device->SetVideoMode = PG_SetVideoMode;