From b619de9c0518c7515b4d76be8313c6c3a603fbd1 Mon Sep 17 00:00:00 2001 From: Jeff Teunissen Date: Sat, 1 Apr 2000 09:59:35 +0000 Subject: [PATCH] Applied Thad Ward's patch to make win32 locase filenames. Also a few cleanups, mostly whitespace. --- common/fnmatch.c | 4 ++++ common/gl_vidnt.c | 50 +++++++++++++++++++++++++---------------------- common/quakefs.c | 45 +++++++++++++++++++----------------------- common/vid_win.c | 14 ++----------- 4 files changed, 53 insertions(+), 60 deletions(-) diff --git a/common/fnmatch.c b/common/fnmatch.c index 488f953..8752401 100644 --- a/common/fnmatch.c +++ b/common/fnmatch.c @@ -83,6 +83,10 @@ fnmatch (pattern, string, flags) /* Note that this evalutes C many times. */ #define FOLD(c) ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c)) +#ifdef _WIN32 + flags |= FNM_CASEFOLD; +#endif + while ((c = *p++) != '\0') { c = FOLD (c); diff --git a/common/gl_vidnt.c b/common/gl_vidnt.c index 25975c3..f9b5cb4 100644 --- a/common/gl_vidnt.c +++ b/common/gl_vidnt.c @@ -1954,32 +1954,33 @@ void VID_MenuDraw (void) /* -================ -VID_MenuKey -================ -*/ -void VID_MenuKey (int key) -{ - switch (key) - { - case K_ESCAPE: - S_LocalSound ("misc/menu1.wav"); - M_Menu_Options_f (); - break; + VID_MenuKey - default: - break; + Process menu keystrokes +*/ +void +VID_MenuKey ( int key ) +{ + switch (key) { + case K_ESCAPE: + S_LocalSound ("misc/menu1.wav"); + M_Menu_Options_f (); + break; + default: + break; } } -void VID_ExtraOptionDraw(unsigned int options_draw_cursor) +void +VID_ExtraOptionDraw ( unsigned int options_draw_cursor ) { // Windowed Mouse - M_Print (16, options_draw_cursor+=8, " Use Mouse"); - M_DrawCheckbox (220, options_draw_cursor, _windowed_mouse->value); + M_Print (16, options_draw_cursor+=8, " Use Mouse"); + M_DrawCheckbox (220, options_draw_cursor, _windowed_mouse->value); } -void VID_ExtraOptionCmd(int option_cursor) +void +VID_ExtraOptionCmd ( int option_cursor ) { switch(option_cursor) { case 1: // _windowed_mouse @@ -1989,17 +1990,20 @@ void VID_ExtraOptionCmd(int option_cursor) } } -void VID_InitCvars() +void +VID_InitCvars( void ) { // It may not look it, but this is important } -void VID_LockBuffer (void) +void +VID_LockBuffer ( void ) { - // need empty function, because the #define method was just silly + // Empty function, locking not necessary here. } -void VID_UnlockBuffer (void) +void +VID_UnlockBuffer ( void ) { - // need empty function, because the #define method was just silly + // Empty function, locking not necessary here. } diff --git a/common/quakefs.c b/common/quakefs.c index 64daf2e..8d7a160 100644 --- a/common/quakefs.c +++ b/common/quakefs.c @@ -191,20 +191,19 @@ void COM_Path_f (void) } /* -============ -COM_Maplist_f + COM_Maplist_f -============ + List map files in gamepaths. */ - -void COM_Maplist_f (void) +void +COM_Maplist_f ( void ) { searchpath_t *search; - DIR *dir_ptr; + DIR *dir_ptr; struct dirent *dirent; - char buf[MAX_OSPATH]; + char buf[MAX_OSPATH]; - for (search = com_searchpaths ; search ; search = search->next) { + for (search = com_searchpaths ; search != NULL ; search = search->next) { if (search->pack) { int i; pack_t *pak = search->pack; @@ -222,8 +221,8 @@ void COM_Maplist_f (void) if (!dir_ptr) continue; while ((dirent = readdir (dir_ptr))) - if (!fnmatch ("*.bsp", dirent->d_name, FNMATCH_FLAGS) - || !fnmatch ("*.bsp.gz", dirent->d_name, FNMATCH_FLAGS)) + if (!fnmatch ("*.bsp", dirent->d_name, 0) + || !fnmatch ("*.bsp.gz", dirent->d_name, 0)) Con_Printf ("%s\n", dirent->d_name); closedir (dir_ptr); } @@ -231,13 +230,12 @@ void COM_Maplist_f (void) } /* -============ -COM_WriteFile + COM_WriteFile -The filename will be prefixed by the current game directory -============ + The filename will be prefixed by the current game directory */ -void COM_WriteFile (char *filename, void *data, int len) +void +COM_WriteFile ( char *filename, void *data, int len ) { QFile *f; char name[MAX_OSPATH]; @@ -259,20 +257,17 @@ void COM_WriteFile (char *filename, void *data, int len) /* -============ -COM_CreatePath + COM_CreatePath -Only used for CopyFile and download -============ + Only used for CopyFile and download */ -void COM_CreatePath (char *path) +void +COM_CreatePath ( char *path ) { char *ofs; - for (ofs = path+1 ; *ofs ; ofs++) - { - if (*ofs == '/') - { // create the directory + for (ofs = path+1 ; *ofs ; ofs++) { + if (*ofs == '/') { // create the directory *ofs = 0; Sys_mkdir (path); *ofs = '/'; @@ -742,7 +737,7 @@ COM_LoadGameDirectory(char *dir) return; while ((dirent = readdir(dir_ptr))) { - if (!fnmatch("*.pak", dirent->d_name, FNMATCH_FLAGS)) { + if (!fnmatch("*.pak", dirent->d_name, 0)) { if (count >= bufsize) { bufsize += FBLOCK_SIZE; pakfiles = realloc(pakfiles, bufsize * sizeof(char *)); diff --git a/common/vid_win.c b/common/vid_win.c index 18c8e54..22d555d 100644 --- a/common/vid_win.c +++ b/common/vid_win.c @@ -3481,18 +3481,8 @@ void VID_ExtraOptionCmd(int option_cursor) } } -void VID_InitCvars() +void +VID_InitCvars( void ) { // It may not look like it, but this is important } - -void -VID_LockBuffer ( void ) -{ -} - -void -VID_UnlockBuffer ( void ) -{ -} -