mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-09 01:01:07 +00:00
Remove MAX_HANDLES limit.
This commit is contained in:
parent
425f0fb831
commit
666825037a
2 changed files with 22 additions and 16 deletions
|
@ -52,21 +52,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
qboolean isDedicated;
|
||||
cvar_t sys_throttle = {"sys_throttle", "0.02", CVAR_ARCHIVE};
|
||||
|
||||
#define MAX_HANDLES 32 /* johnfitz -- was 10 */
|
||||
static FILE *sys_handles[MAX_HANDLES];
|
||||
|
||||
|
||||
static size_t sys_handles_max; /* spike -- removed limit, was 32 (johnfitz -- was 10) */
|
||||
static FILE **sys_handles;
|
||||
static int findhandle (void)
|
||||
{
|
||||
int i;
|
||||
size_t i, n;
|
||||
|
||||
for (i = 1; i < MAX_HANDLES; i++)
|
||||
for (i = 1; i < sys_handles_max; i++)
|
||||
{
|
||||
if (!sys_handles[i])
|
||||
return i;
|
||||
}
|
||||
n = sys_handles_max+10;
|
||||
sys_handles = realloc(sys_handles, sizeof(*sys_handles)*n);
|
||||
if (!sys_handles)
|
||||
Sys_Error ("out of handles");
|
||||
return -1;
|
||||
while (sys_handles_max < n)
|
||||
sys_handles[sys_handles_max++] = NULL;
|
||||
return i;
|
||||
}
|
||||
|
||||
long Sys_filelength (FILE *f)
|
||||
|
|
|
@ -51,21 +51,24 @@ cvar_t sys_throttle = {"sys_throttle", "0.02", CVAR_ARCHIVE};
|
|||
|
||||
static HANDLE hinput, houtput;
|
||||
|
||||
#define MAX_HANDLES 32 /* johnfitz -- was 10 */
|
||||
static FILE *sys_handles[MAX_HANDLES];
|
||||
|
||||
|
||||
static size_t sys_handles_max; /* spike -- removed limit, was 32 (johnfitz -- was 10) */
|
||||
static FILE **sys_handles;
|
||||
static int findhandle (void)
|
||||
{
|
||||
int i;
|
||||
size_t i, n;
|
||||
|
||||
for (i = 1; i < MAX_HANDLES; i++)
|
||||
for (i = 1; i < sys_handles_max; i++)
|
||||
{
|
||||
if (!sys_handles[i])
|
||||
return i;
|
||||
}
|
||||
n = sys_handles_max+10;
|
||||
sys_handles = realloc(sys_handles, sizeof(*sys_handles)*n);
|
||||
if (!sys_handles)
|
||||
Sys_Error ("out of handles");
|
||||
return -1;
|
||||
while (sys_handles_max < n)
|
||||
sys_handles[sys_handles_max++] = NULL;
|
||||
return i;
|
||||
}
|
||||
|
||||
long Sys_filelength (FILE *f)
|
||||
|
|
Loading…
Reference in a new issue