comparison src/cdrom/win32/SDL_syscdrom.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
64 int i; 64 int i;
65 65
66 if ( SDL_numcds < MAX_DRIVES ) { 66 if ( SDL_numcds < MAX_DRIVES ) {
67 /* Add this drive to our list */ 67 /* Add this drive to our list */
68 i = SDL_numcds; 68 i = SDL_numcds;
69 SDL_cdlist[i] = (char *)malloc(strlen(drive)+1); 69 SDL_cdlist[i] = (char *)SDL_malloc(SDL_strlen(drive)+1);
70 if ( SDL_cdlist[i] == NULL ) { 70 if ( SDL_cdlist[i] == NULL ) {
71 SDL_OutOfMemory(); 71 SDL_OutOfMemory();
72 return; 72 return;
73 } 73 }
74 strcpy(SDL_cdlist[i], drive); 74 SDL_strcpy(SDL_cdlist[i], drive);
75 ++SDL_numcds; 75 ++SDL_numcds;
76 #ifdef CDROM_DEBUG 76 #ifdef CDROM_DEBUG
77 fprintf(stderr, "Added CD-ROM drive: %s\n", drive); 77 fprintf(stderr, "Added CD-ROM drive: %s\n", drive);
78 #endif 78 #endif
79 } 79 }
97 SDL_CDcaps.Eject = SDL_SYS_CDEject; 97 SDL_CDcaps.Eject = SDL_SYS_CDEject;
98 SDL_CDcaps.Close = SDL_SYS_CDClose; 98 SDL_CDcaps.Close = SDL_SYS_CDClose;
99 99
100 /* Scan the system for CD-ROM drives */ 100 /* Scan the system for CD-ROM drives */
101 for ( i='A'; i<='Z'; ++i ) { 101 for ( i='A'; i<='Z'; ++i ) {
102 snprintf(drive, SDL_arraysize(drive), "%c:\\", i); 102 SDL_snprintf(drive, SDL_arraysize(drive), "%c:\\", i);
103 if ( GetDriveType(drive) == DRIVE_CDROM ) { 103 if ( GetDriveType(drive) == DRIVE_CDROM ) {
104 AddDrive(drive); 104 AddDrive(drive);
105 } 105 }
106 } 106 }
107 memset(SDL_mciID, 0, sizeof(SDL_mciID)); 107 SDL_memset(SDL_mciID, 0, sizeof(SDL_mciID));
108 return(0); 108 return(0);
109 } 109 }
110 110
111 /* General ioctl() CD-ROM command function */ 111 /* General ioctl() CD-ROM command function */
112 static int SDL_SYS_CDioctl(int id, UINT msg, DWORD flags, void *arg) 112 static int SDL_SYS_CDioctl(int id, UINT msg, DWORD flags, void *arg)
375 { 375 {
376 int i; 376 int i;
377 377
378 if ( SDL_numcds > 0 ) { 378 if ( SDL_numcds > 0 ) {
379 for ( i=0; i<SDL_numcds; ++i ) { 379 for ( i=0; i<SDL_numcds; ++i ) {
380 free(SDL_cdlist[i]); 380 SDL_free(SDL_cdlist[i]);
381 } 381 }
382 SDL_numcds = 0; 382 SDL_numcds = 0;
383 } 383 }
384 } 384 }