diff options
author | Simon Howard | 2005-09-07 21:30:42 +0000 |
---|---|---|
committer | Simon Howard | 2005-09-07 21:30:42 +0000 |
commit | 34a3dfd2803163e92216988a8194c596c61a711f (patch) | |
tree | 4297dc6694c2b1de5bf454fa31b162ec4eaadfcc | |
parent | a602d1dba6523e45a76d472f8fce31e92d820dab (diff) | |
download | chocolate-doom-34a3dfd2803163e92216988a8194c596c61a711f.tar.gz chocolate-doom-34a3dfd2803163e92216988a8194c596c61a711f.tar.bz2 chocolate-doom-34a3dfd2803163e92216988a8194c596c61a711f.zip |
Remove non-ANSI C headers. Use standard C file I/O functions.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 84
-rw-r--r-- | src/m_menu.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/m_menu.c b/src/m_menu.c index 2ec1f398..46f6e27a 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: m_menu.c 66 2005-09-04 14:51:19Z fraggle $ +// $Id: m_menu.c 84 2005-09-07 21:30:42Z fraggle $ // // Copyright(C) 1993-1996 Id Software, Inc. // Copyright(C) 2005 Simon Howard @@ -22,6 +22,9 @@ // 02111-1307, USA. // // $Log$ +// Revision 1.6 2005/09/07 21:30:42 fraggle +// Remove non-ANSI C headers. Use standard C file I/O functions. +// // Revision 1.5 2005/09/04 14:51:19 fraggle // Display the correct quit messages according to which game is being played. // Remove "language" variable (do this through gettext, if ever) @@ -46,12 +49,8 @@ //----------------------------------------------------------------------------- static const char -rcsid[] = "$Id: m_menu.c 66 2005-09-04 14:51:19Z fraggle $"; +rcsid[] = "$Id: m_menu.c 84 2005-09-07 21:30:42Z fraggle $"; -#include <unistd.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> #include <stdlib.h> #include <ctype.h> @@ -87,6 +86,7 @@ rcsid[] = "$Id: m_menu.c 66 2005-09-04 14:51:19Z fraggle $"; #include "m_menu.h" +extern void M_QuitDOOM(int); extern patch_t* hu_font[HU_FONTSIZE]; extern boolean message_dontfuckwithme; @@ -533,9 +533,9 @@ menu_t SaveDef = // void M_ReadSaveStrings(void) { - int handle; - int count; - int i; + FILE *handle; + int count; + int i; char name[256]; for (i = 0;i < load_end;i++) @@ -545,15 +545,15 @@ void M_ReadSaveStrings(void) else sprintf(name,SAVEGAMENAME"%d.dsg",i); - handle = open (name, O_RDONLY | 0, 0666); - if (handle == -1) + handle = fopen(name, "rb"); + if (handle == NULL) { - strcpy(&savegamestrings[i][0],EMPTYSTRING); + strcpy(&savegamestrings[i][0], EMPTYSTRING); LoadMenu[i].status = 0; continue; } - count = read (handle, &savegamestrings[i], SAVESTRINGSIZE); - close (handle); + count = fread(&savegamestrings[i], 1, SAVESTRINGSIZE, handle); + fclose(handle); LoadMenu[i].status = 1; } } |