Skip to content

Commit

Permalink
Cosmetic changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-x-d committed Apr 27, 2019
1 parent 2b0bfff commit 559a1f6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
12 changes: 8 additions & 4 deletions game/q_shared.c
Expand Up @@ -620,6 +620,7 @@ qboolean AxisCompare(const vec3_t axis1[3], const vec3_t axis2[3])

//====================================================================================

// Returns filename ("c:/dir/file.txt" -> "file.txt") //mxd. Never used
char *COM_SkipPath(char *pathname)
{
char *last = pathname;
Expand All @@ -634,6 +635,7 @@ char *COM_SkipPath(char *pathname)
return last;
}

// Returns filename without extension ("c:/dir/file.txt" -> "c:/dir/file")
void COM_StripExtension(char *in, char *out)
{
//mxd. Let's find the last dot instead of first...
Expand All @@ -643,23 +645,25 @@ void COM_StripExtension(char *in, char *out)
*ext = 0;
}

// Returns file extension ("c:/dir/file.txt" -> "txt")
const char *COM_FileExtension(const char *in)
{
//mxd. YQ2 implementation
const char *ext = strrchr(in, '.');
return ((!ext || ext == in) ? "" : ext + 1);
}

// Returns filename without extension ("c:/dir/file.txt" -> "file") //mxd. Never used
void COM_FileBase(char *in, char *out)
{
char *s2;
char *s = in + strlen(in) - 1;

while (s != in && *s != '.')
s--;

for (s2 = s; s2 != in && *s2 != '/'; s2--)
;
char *s2 = s;
while (s2 != in && *s2 != '/')
s2--;

if (s - s2 < 2)
{
Expand All @@ -673,7 +677,7 @@ void COM_FileBase(char *in, char *out)
}
}

// Returns the path up to, but not including the last /
// Returns the path up to, but not including the last '/' ("c:/dir/file.txt" -> "c:/dir")
void COM_FilePath(char *in, char *out)
{
char *s = in + strlen(in) - 1;
Expand Down
15 changes: 8 additions & 7 deletions win32/q_shwin.c
Expand Up @@ -24,7 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <io.h>


int curtime;
int curtime;

int Sys_Milliseconds(void)
{
static int base;
Expand Down Expand Up @@ -65,9 +66,9 @@ char *Sys_GetCurrentDirectory(void)

//============================================

char findbase[MAX_OSPATH];
char findpath[MAX_OSPATH];
int findhandle;
static char findbase[MAX_OSPATH];
static char findpath[MAX_OSPATH];
static int findhandle;

static qboolean CompareAttributes(unsigned found, unsigned musthave, unsigned canthave)
{
Expand Down Expand Up @@ -96,7 +97,7 @@ static qboolean CompareAttributes(unsigned found, unsigned musthave, unsigned ca
return true;
}

char *Sys_FindFirst(char *path, unsigned musthave, unsigned canthave )
char *Sys_FindFirst(char *path, unsigned musthave, unsigned canthave)
{
struct _finddata_t findinfo;

Expand Down Expand Up @@ -161,8 +162,8 @@ mxd. High-precision timers
*/
#define NUM_TIMERS 16

double PCFreq[NUM_TIMERS];
__int64 CounterStart[NUM_TIMERS];
static double PCFreq[NUM_TIMERS];
static __int64 CounterStart[NUM_TIMERS];

void Sys_TimerStart(int timerindex)
{
Expand Down

0 comments on commit 559a1f6

Please sign in to comment.