fix some warnings and a possible off-by-one error with reading scintilla text.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5257 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2018-05-28 21:09:15 +00:00
parent 1d655322d0
commit b1b5fcf4fb
6 changed files with 15 additions and 15 deletions

View File

@ -7,7 +7,7 @@
#define Hash_BytesForBuckets(b) (sizeof(bucket_t*)*(b))
#define STRCMP(s1,s2) (((*s1)!=(*s2)) || (strcmp(s1,s2))) //saves about 2-6 out of 120 - expansion of idea from fastqcc
#define STRCMP(s1,s2) (((*s1)!=(*s2)) || strcmp(s1,s2)) //saves about 2-6 out of 120 - expansion of idea from fastqcc
typedef struct bucket_s {
void *data;
union {

View File

@ -1173,4 +1173,4 @@ vfile_t *QCC_AddVFile(const char *name, void *data, size_t size);
void QCC_CatVFile(vfile_t *, const char *fmt, ...);
void QCC_InsertVFile(vfile_t *, size_t pos, const char *fmt, ...);
void *QCC_ReadFile(const char *fname, unsigned char *(*buf_get)(void *ctx, size_t len), void *buf_ctx, size_t *out_size, pbool issourcefile);
//void *QCC_ReadFile(const char *fname, unsigned char *(*buf_get)(void *ctx, size_t len), void *buf_ctx, size_t *out_size, pbool issourcefile);

View File

@ -21,8 +21,8 @@ void QCC_PR_ParseAsm(void);
#define MEMBERFIELDNAME "__m%s"
#define STRCMP(s1,s2) (((*s1)!=(*s2)) || strcmp(s1+1,s2+1)) //saves about 2-6 out of 120 - expansion of idea from fastqcc
#define STRNCMP(s1,s2,l) (((*s1)!=(*s2)) || strncmp(s1+1,s2+1,l)) //pathetic saving here.
#define STRCMP(s1,s2) (((*s1)!=(*s2)) || strcmp(s1,s2)) //saves about 2-6 out of 120 - expansion of idea from fastqcc
#define STRNCMP(s1,s2,l) (((*s1)!=(*s2)) || strncmp(s1,s2,l)) //pathetic saving here.
extern char *compilingfile;

View File

@ -8,7 +8,7 @@
#define MEMBERFIELDNAME "__m%s"
#define STRCMP(s1,s2) (((*s1)!=(*s2)) || strcmp(s1+1,s2+1)) //saves about 2-6 out of 120 - expansion of idea from fastqcc
#define STRCMP(s1,s2) (((*s1)!=(*s2)) || strcmp(s1,s2)) //saves about 2-6 out of 120 - expansion of idea from fastqcc
void QCC_PR_PreProcessor_Define(pbool append);
pbool QCC_PR_UndefineName(char *name);
@ -2291,7 +2291,7 @@ void QCC_PR_LexName (void)
}
c = *pr_file_p;
} while ( (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_'
|| (c >= '0' && c <= '9') || c & 0x80);
|| (c >= '0' && c <= '9') || (c & 0x80));
pr_token[len] = 0;
pr_token_type = tt_name;

View File

@ -450,7 +450,7 @@ void QCC_EnumerateFilesResult(const char *name, const void *compdata, size_t com
LoadFile
==============
*/
void *QCC_ReadFile(const char *fname, unsigned char *(*buf_get)(void *ctx, size_t len), void *buf_ctx, size_t *out_size)
static void *QCC_ReadFile(const char *fname, unsigned char *(*buf_get)(void *ctx, size_t len), void *buf_ctx, size_t *out_size)
//unsigned char *PDECL QCC_ReadFile (const char *fname, void *buffer, int len, size_t *sz)
{
size_t len;
@ -3374,8 +3374,8 @@ void *GUIReadFile(const char *fname, unsigned char *(*buf_get)(void *ctx, size_t
free(deflist);
blen = SendMessage(e->editpane, SCI_GETLENGTH, 0, 0);
buffer = buf_get(buf_ctx, blen);
blen = SendMessage(e->editpane, SCI_GETTEXT, blen, (LPARAM)buffer);
buffer = buf_get(buf_ctx, blen+1);
blen = SendMessage(e->editpane, SCI_GETTEXT, blen+1, (LPARAM)buffer);
}
else if (e->savefmt == UTF_ANSI)
{

View File

@ -8,7 +8,7 @@
LoadFile
==============
*/
void *QCC_ReadFile(const char *fname, unsigned char *(*buf_get)(void *ctx, size_t len), void *buf_ctx, size_t *out_size, pbool issourcefile)
static void *QCC_ReadFile(const char *fname, unsigned char *(*buf_get)(void *ctx, size_t len), void *buf_ctx, size_t *out_size, pbool issourcefile)
//unsigned char *PDECL QCC_ReadFile (const char *fname, void *buffer, int len, size_t *sz)
{
size_t len;
@ -43,7 +43,7 @@ void *QCC_ReadFile(const char *fname, unsigned char *(*buf_get)(void *ctx, size_
*out_size = len;
return buffer;
}
int PDECL QCC_FileSize (const char *fname)
static int PDECL QCC_FileSize (const char *fname)
{
long length;
FILE *f;
@ -57,7 +57,7 @@ int PDECL QCC_FileSize (const char *fname)
return length;
}
pbool PDECL QCC_WriteFile (const char *name, void *data, int len)
static pbool PDECL QCC_WriteFile (const char *name, void *data, int len)
{
long length;
FILE *f;
@ -76,7 +76,7 @@ pbool PDECL QCC_WriteFile (const char *name, void *data, int len)
#undef printf
#undef Sys_Error
void PDECL Sys_Error(const char *text, ...)
static void PDECL Sys_Error(const char *text, ...)
{
va_list argptr;
static char msg[2048];
@ -89,8 +89,8 @@ void PDECL Sys_Error(const char *text, ...)
}
FILE *logfile;
int logprintf(const char *format, ...)
static FILE *logfile;
static int logprintf(const char *format, ...)
{
va_list argptr;
static char string[1024];