From e5d6d9694fcecd56dc9f251bc0c0de0bc5618408 Mon Sep 17 00:00:00 2001 From: terminx Date: Wed, 29 Jul 2009 21:56:56 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@1479 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/cache1d.c | 4 +- polymer/eduke32/build/src/kplib.c | 40 +++++-------------- .../eduke32/source/jaudiolib/Makefile.msvc | 2 +- 3 files changed, 12 insertions(+), 34 deletions(-) diff --git a/polymer/eduke32/build/src/cache1d.c b/polymer/eduke32/build/src/cache1d.c index 66f058161..2a1650614 100644 --- a/polymer/eduke32/build/src/cache1d.c +++ b/polymer/eduke32/build/src/cache1d.c @@ -20,7 +20,7 @@ static intptr_t kzipopen(char *filnam) { uint32_t i; - char newst[BMAX_PATH]; + char newst[BMAX_PATH+8]; newst[0] = '|'; for (i=0; filnam[i] && (i < sizeof(newst)-2); i++) newst[i+1] = filnam[i]; @@ -979,7 +979,7 @@ CACHE1D_FIND_REC *klistpath(const char *_path, const char *mask, int32_t type) if (!pathsearchmode) // next, zip files { - char buf[BMAX_PATH]; + char buf[BMAX_PATH+4]; int32_t i, j, ftype; strcpy(buf,path); if (*path) strcat(buf,"/"); diff --git a/polymer/eduke32/build/src/kplib.c b/polymer/eduke32/build/src/kplib.c index dd709fcc2..f65b6bef6 100644 --- a/polymer/eduke32/build/src/kplib.c +++ b/polymer/eduke32/build/src/kplib.c @@ -54,7 +54,7 @@ static uint32_t LSWAPIL(uint32_t a) { return(((a>>8)&0xff00)+((a&0xff00)<<8)+(a< static uint16_t SSWAPIL(uint16_t a) { return((a>>8)+(a<<8)); } #endif -#if !defined(_WIN32) && !defined(__DOS__) +#if !defined(_WIN32) #include #include typedef long long __int64; @@ -71,9 +71,7 @@ static __inline int32_t filelength(int h) #include #endif -#if defined(__DOS__) -#include -#elif defined(_WIN32) +#if defined(_WIN32) #define WIN32_LEAN_AND_MEAN #include #endif @@ -2836,7 +2834,7 @@ intptr_t kzopen(const char *filnam) j = strlen(tempbuf); if (strlen(filnam)+1+j >= sizeof(tempbuf)) continue; //don't allow int32_t filenames to buffer overrun if ((j) && (tempbuf[j-1] != '/') && (tempbuf[j-1] != '\\') && (filnam[0] != '/') && (filnam[0] != '\\')) -#if (defined(__DOS__) || defined(_WIN32)) +#if defined(_WIN32) strcat(tempbuf,"\\"); #else strcat(tempbuf,"/"); @@ -2859,10 +2857,7 @@ intptr_t kzopen(const char *filnam) // -------------------------------------------------------------------------- -#if defined(__DOS__) -#define MAX_PATH 260 -static struct find_t findata; -#elif defined(_WIN32) +#if defined(_WIN32) static HANDLE hfind = INVALID_HANDLE_VALUE; static WIN32_FIND_DATA findata; #else @@ -2883,8 +2878,7 @@ static char wildst[MAX_PATH] = "", newildst[MAX_PATH] = ""; void kzfindfilestart(const char *st) { -#if defined(__DOS__) -#elif defined(_WIN32) +#if defined(_WIN32) if (hfind != INVALID_HANDLE_VALUE) { FindClose(hfind); hfind = INVALID_HANDLE_VALUE; } #else @@ -2915,15 +2909,7 @@ kzfindfile_beg:; Bmemcpy(filnam,newildst,wildstpathleng); -#if defined(__DOS__) - if (_dos_findfirst(newildst,_A_SUBDIR,&findata)) - { if (!kzhashbuf) return(0); srchstat = 2; continue; } - i = wildstpathleng; - if (findata.attrib&16) - if ((findata.name[0] == '.') && (!findata.name[1])) continue; - strcpy(&filnam[i],findata.name); - if (findata.attrib&16) strcat(&filnam[i],"\\"); -#elif defined(_WIN32) +#if defined(_WIN32) hfind = FindFirstFile(newildst,&findata); if (hfind == INVALID_HANDLE_VALUE) { if (!kzhashbuf) return(0); srchstat = 2; continue; } @@ -2956,17 +2942,9 @@ kzfindfile_beg:; while (1) { Bmemcpy(filnam,newildst,wildstpathleng); -#if defined(__DOS__) - if (_dos_findnext(&findata)) - { if (!kzhashbuf) return(0); srchstat = 2; break; } - i = wildstpathleng; - if (findata.attrib&16) - if ((findata.name[0] == '.') && (!findata.name[1])) continue; - strcpy(&filnam[i],findata.name); - if (findata.attrib&16) strcat(&filnam[i],"\\"); -#elif defined(_WIN32) +#if defined(_WIN32) if (!FindNextFile(hfind,&findata)) - { FindClose(hfind); if (!kzhashbuf) return(0); srchstat = 2; break; } + { FindClose(hfind); hfind = INVALID_HANDLE_VALUE; if (!kzhashbuf) return(0); srchstat = 2; break; } if (findata.dwFileAttributes&FILE_ATTRIBUTE_HIDDEN) continue; i = wildstpathleng; if (findata.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) @@ -3007,7 +2985,7 @@ kzfindfile_beg:; strcpy(newildst,&kzhashbuf[srchdoff+4]); i = strlen(newildst); if ((i) && (newildst[i-1] != '/') && (newildst[i-1] != '\\') && (filnam[0] != '/') && (filnam[0] != '\\')) -#if (defined(__DOS__) || defined(_WIN32)) +#if defined(_WIN32) strcat(newildst,"\\"); #else strcat(newildst,"/"); diff --git a/polymer/eduke32/source/jaudiolib/Makefile.msvc b/polymer/eduke32/source/jaudiolib/Makefile.msvc index 3903dd850..0badb9ece 100644 --- a/polymer/eduke32/source/jaudiolib/Makefile.msvc +++ b/polymer/eduke32/source/jaudiolib/Makefile.msvc @@ -46,5 +46,5 @@ $(JFAUDIOLIB): $(OBJECTS) lib $(flags_lib) /out:$@ /nologo $** clean: - -del /Q $(OBJECTS) $(JFAUDIOLIB) + -del /Q $(OBJ)\* $(JFAUDIOLIB)