Fix build on GCC.
This commit is contained in:
parent
62ed3973b5
commit
0100ebadb9
@ -24,6 +24,7 @@ IPluginRuntime *SourcePawnEngine2::LoadPlugin(ICompilation *co, const char *file
|
|||||||
uint8_t *base;
|
uint8_t *base;
|
||||||
int z_result;
|
int z_result;
|
||||||
int error;
|
int error;
|
||||||
|
size_t ignore;
|
||||||
BaseRuntime *pRuntime;
|
BaseRuntime *pRuntime;
|
||||||
|
|
||||||
FILE *fp = fopen(file, "rb");
|
FILE *fp = fopen(file, "rb");
|
||||||
@ -35,7 +36,7 @@ IPluginRuntime *SourcePawnEngine2::LoadPlugin(ICompilation *co, const char *file
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Rewind for safety */
|
/* Rewind for safety */
|
||||||
fread(&hdr, sizeof(sp_file_hdr_t), 1, fp);
|
ignore = fread(&hdr, sizeof(sp_file_hdr_t), 1, fp);
|
||||||
|
|
||||||
if (hdr.magic != SmxConsts::FILE_MAGIC)
|
if (hdr.magic != SmxConsts::FILE_MAGIC)
|
||||||
{
|
{
|
||||||
@ -56,8 +57,8 @@ IPluginRuntime *SourcePawnEngine2::LoadPlugin(ICompilation *co, const char *file
|
|||||||
void *uncompdata = malloc(uncompsize);
|
void *uncompdata = malloc(uncompsize);
|
||||||
void *sectheader = malloc(sectsize);
|
void *sectheader = malloc(sectsize);
|
||||||
|
|
||||||
fread(sectheader, sectsize, 1, fp);
|
ignore = fread(sectheader, sectsize, 1, fp);
|
||||||
fread(tempbuf, compsize, 1, fp);
|
ignore = fread(tempbuf, compsize, 1, fp);
|
||||||
|
|
||||||
z_result = uncompress((Bytef *)uncompdata, &destlen, (Bytef *)tempbuf, compsize);
|
z_result = uncompress((Bytef *)uncompdata, &destlen, (Bytef *)tempbuf, compsize);
|
||||||
free(tempbuf);
|
free(tempbuf);
|
||||||
@ -81,7 +82,7 @@ IPluginRuntime *SourcePawnEngine2::LoadPlugin(ICompilation *co, const char *file
|
|||||||
{
|
{
|
||||||
base = (uint8_t *)malloc(hdr.imagesize);
|
base = (uint8_t *)malloc(hdr.imagesize);
|
||||||
rewind(fp);
|
rewind(fp);
|
||||||
fread(base, hdr.imagesize, 1, fp);
|
ignore = fread(base, hdr.imagesize, 1, fp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@ -114,6 +115,8 @@ IPluginRuntime *SourcePawnEngine2::LoadPlugin(ICompilation *co, const char *file
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(void)ignore;
|
||||||
|
|
||||||
if (!pRuntime->plugin()->name)
|
if (!pRuntime->plugin()->name)
|
||||||
{
|
{
|
||||||
pRuntime->SetName(file);
|
pRuntime->SetName(file);
|
||||||
|
Loading…
Reference in New Issue
Block a user