Remove Sys_Mkdir/Sys_DebugLog

This commit is contained in:
libretroadmin 2024-05-24 21:03:57 +02:00
parent 3411022950
commit 2d1dee65c8
6 changed files with 5 additions and 56 deletions

View File

@ -976,7 +976,7 @@ CL_Download_f(void)
for (;;) {
if ((q = strchr(p, '/')) != NULL) {
*q = 0;
Sys_mkdir(cls.downloadname);
path_mkdir(cls.downloadname);
*q = '/';
p = q + 1;
} else
@ -1362,7 +1362,7 @@ Host_Init(quakeparms_t *parms)
COM_AddParm("-game");
COM_AddParm("qw");
Sys_mkdir("qw");
path_mkdir("qw");
minimum_memory = MINIMUM_MEMORY;
if (COM_CheckParm("-minmemory"))

View File

@ -45,22 +45,6 @@ static qboolean stdin_ready;
===============================================================================
*/
/*
============
Sys_mkdir
============
*/
void
Sys_mkdir(const char *path)
{
if (mkdir(path, 0777) != -1)
return;
if (errno != EEXIST)
Sys_Error("mkdir %s: %s", path, strerror(errno));
}
/*
================
Sys_DoubleTime

View File

@ -1237,7 +1237,7 @@ void COM_WriteFile(const char *filename, const void *data, int len)
f = rfopen(name, "wb");
if (!f)
{
Sys_mkdir(com_gamedir);
path_mkdir(com_gamedir);
f = rfopen(name, "wb");
if (!f)
Sys_Error("Error opening %s", filename);
@ -1268,7 +1268,7 @@ void COM_CreatePath(const char *path)
if (*ofs == '/')
{ // create the directory
*ofs = 0;
Sys_mkdir(part);
path_mkdir(part);
*ofs = '/';
}
}

View File

@ -62,8 +62,6 @@ static cvar_t con_notifytime = { "con_notifytime", "3" }; //seconds
static float con_times[NUM_CON_TIMES]; // realtime time the line was generated
// for transparent notify lines
static qboolean debuglog;
qboolean con_initialized;
/*
@ -320,10 +318,6 @@ void Con_Printf(const char *fmt, ...)
/* also echo to debugging console */
Sys_Printf("%s", msg); // also echo to debugging console
/* log all messages to file */
if (debuglog)
Sys_DebugLog(va("%s/qconsole.log", com_savedir), "%s", msg);
if (!con_initialized)
return;
@ -375,16 +369,8 @@ Con_DPrintf(const char *fmt, ...)
va_list argptr;
char msg[MAX_PRINTMSG];
if (!developer.value) {
if (debuglog) {
strcpy(msg, "DEBUG: ");
va_start(argptr, fmt);
vsnprintf(msg + 7, sizeof(msg) - 7, fmt, argptr);
va_end(argptr);
Sys_DebugLog(va("%s/qconsole.log", com_savedir), "%s", msg);
}
if (!developer.value)
return;
}
va_start(argptr, fmt);
vsnprintf(msg, sizeof(msg), fmt, argptr);
@ -787,8 +773,6 @@ Con_Init
void
Con_Init(void)
{
debuglog = COM_CheckParm("-condebug");
con_main.text = (char*)Hunk_Alloc(CON_TEXTSIZE);
con = &con_main;

View File

@ -341,15 +341,6 @@ bool Sys_Error(const char *error, ...)
return false;
}
void Sys_mkdir(const char *path)
{
path_mkdir(path);
}
void Sys_DebugLog(const char *file, const char *fmt, ...)
{
}
double Sys_DoubleTime(void)
{
static int first = true;

View File

@ -26,24 +26,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// FIXME - QW/server doesn't want this much stuff...
// sys.h -- non-portable functions
// file IO
void Sys_mkdir(const char *path);
//
// memory protection
//
void Sys_MakeCodeWriteable(unsigned long startaddr, unsigned long length);
//
// system IO
//
#define MAX_PRINTMSG 4096
void Sys_Printf(const char *fmt, ...);
void Sys_DebugLog(const char *file, const char *fmt, ...);
bool Sys_Error(const char *error, ...);
// send text to the console