From c5f8c44ce8d758a452fa8bdf7c6502172bb87d0a Mon Sep 17 00:00:00 2001 From: sezero Date: Thu, 15 Jul 2010 09:15:42 +0000 Subject: [PATCH] * Windows/dirent.c: For 64 bit compatibility, changed the handle member of struct DIR from long to intptr_t, which is what _findfirst() returns and _findnext() and _findclose() accepts, and removed the brain-dead long casts in the code. This file is probably only used with M$VC, therefore this doesn't affect gcc/mingw compilations and previous binaries. git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@236 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Windows/dirent.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Windows/dirent.c b/Windows/dirent.c index 08ea8007..bf6e7fff 100644 --- a/Windows/dirent.c +++ b/Windows/dirent.c @@ -21,7 +21,7 @@ extern "C" struct DIR { - long handle; /* -1 for failed rewind */ + intptr_t handle; /* -1 for failed rewind */ struct _finddata_t info; struct dirent result; /* d_name null iff first time */ char *name; /* null-terminated char string */ @@ -42,7 +42,7 @@ DIR *opendir(const char *name) { strcat(strcpy(dir->name, name), all); - if((dir->handle = (long) _findfirst(dir->name, &dir->info)) != -1) + if((dir->handle = _findfirst(dir->name, &dir->info)) != -1) { dir->result.d_name = 0; } @@ -116,7 +116,7 @@ void rewinddir(DIR *dir) if(dir && dir->handle != -1) { _findclose(dir->handle); - dir->handle = (long) _findfirst(dir->name, &dir->info); + dir->handle = _findfirst(dir->name, &dir->info); dir->result.d_name = 0; } else