more const correctness

This commit is contained in:
Bill Currie 2001-07-14 23:50:18 +00:00
parent d0d32b6a1a
commit f4976e8133
2 changed files with 18 additions and 17 deletions

View file

@ -52,21 +52,22 @@ extern char gamedirfile[MAX_OSPATH];
void COM_WriteFile (char *filename, void *data, int len); void COM_WriteFile (char *filename, void *data, int len);
void COM_WriteBuffers (const char *filename, int count, ...); void COM_WriteBuffers (const char *filename, int count, ...);
int _COM_FOpenFile (char *filename, VFile **gzfile, char *foundname, int zip); int _COM_FOpenFile (const char *filename, VFile **gzfile, char *foundname, int zip);
int COM_FOpenFile (char *filename, VFile **gzfile); int COM_FOpenFile (const char *filename, VFile **gzfile);
void COM_CloseFile (VFile *h); void COM_CloseFile (VFile *h);
int COM_filelength (VFile *f); int COM_filelength (VFile *f);
void COM_FileBase (char *in, char *out); void COM_FileBase (const char *in, char *out);
void COM_DefaultExtension (char *path, char *extension); void COM_DefaultExtension (char *path, char *extension);
char *COM_SkipPath (char *pathname); char *COM_SkipPath (char *pathname);
void COM_StripExtension (char *in, char *out); void COM_StripExtension (char *in, char *out);
int COM_NextFilename (char *filename, const char *prefix, const char *ext); int COM_NextFilename (char *filename, const char *prefix, const char *ext);
byte *COM_LoadStackFile (char *path, void *buffer, int bufsize); byte *COM_LoadFile (const char *path, int usehunk);
byte *COM_LoadTempFile (char *path); byte *COM_LoadStackFile (const char *path, void *buffer, int bufsize);
byte *COM_LoadHunkFile (char *path); byte *COM_LoadTempFile (const char *path);
void COM_LoadCacheFile (char *path, struct cache_user_s *cu); byte *COM_LoadHunkFile (const char *path);
void COM_LoadCacheFile (const char *path, struct cache_user_s *cu);
void COM_CreatePath (char *path); void COM_CreatePath (char *path);
void COM_Gamedir (char *dir); void COM_Gamedir (char *dir);
void COM_Filesystem_Init (void); void COM_Filesystem_Init (void);

View file

@ -165,10 +165,10 @@ searchpath_t *com_base_searchpaths; // without gamedirs
COM_FileBase COM_FileBase
*/ */
void void
COM_FileBase (char *in, char *out) COM_FileBase (const char *in, char *out)
{ {
char *slash, *dot; const char *slash, *dot;
char *s; const char *s;
slash = in; slash = in;
dot = NULL; dot = NULL;
@ -548,7 +548,7 @@ int file_from_pak; // global indicating file came from
Sets com_filesize and one of handle or file Sets com_filesize and one of handle or file
*/ */
int int
_COM_FOpenFile (char *filename, VFile **gzfile, char *foundname, int zip) _COM_FOpenFile (const char *filename, VFile **gzfile, char *foundname, int zip)
{ {
searchpath_t *search; searchpath_t *search;
char netpath[MAX_OSPATH]; char netpath[MAX_OSPATH];
@ -625,7 +625,7 @@ _COM_FOpenFile (char *filename, VFile **gzfile, char *foundname, int zip)
} }
int int
COM_FOpenFile (char *filename, VFile **gzfile) COM_FOpenFile (const char *filename, VFile **gzfile)
{ {
char foundname[MAX_OSPATH]; char foundname[MAX_OSPATH];
@ -643,7 +643,7 @@ int loadsize;
Allways appends a 0 byte to the loaded data. Allways appends a 0 byte to the loaded data.
*/ */
byte * byte *
COM_LoadFile (char *path, int usehunk) COM_LoadFile (const char *path, int usehunk)
{ {
VFile *h; VFile *h;
byte *buf = NULL; byte *buf = NULL;
@ -685,19 +685,19 @@ COM_LoadFile (char *path, int usehunk)
} }
byte * byte *
COM_LoadHunkFile (char *path) COM_LoadHunkFile (const char *path)
{ {
return COM_LoadFile (path, 1); return COM_LoadFile (path, 1);
} }
byte * byte *
COM_LoadTempFile (char *path) COM_LoadTempFile (const char *path)
{ {
return COM_LoadFile (path, 2); return COM_LoadFile (path, 2);
} }
void void
COM_LoadCacheFile (char *path, struct cache_user_s *cu) COM_LoadCacheFile (const char *path, struct cache_user_s *cu)
{ {
loadcache = cu; loadcache = cu;
COM_LoadFile (path, 3); COM_LoadFile (path, 3);
@ -705,7 +705,7 @@ COM_LoadCacheFile (char *path, struct cache_user_s *cu)
// uses temp hunk if larger than bufsize // uses temp hunk if larger than bufsize
byte * byte *
COM_LoadStackFile (char *path, void *buffer, int bufsize) COM_LoadStackFile (const char *path, void *buffer, int bufsize)
{ {
byte *buf; byte *buf;