Fix several VC++ warnings
git-svn-id: svn://svn.cc65.org/cc65/trunk@40 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -35,7 +35,13 @@
|
|||||||
int oursp = 0;
|
int oursp = 0;
|
||||||
|
|
||||||
/* Current segment */
|
/* Current segment */
|
||||||
static enum { SEG_CODE, SEG_RODATA, SEG_DATA, SEG_BSS } CurSeg = SEG_CODE;
|
static enum {
|
||||||
|
SEG_INV = -1, /* Invalid segment */
|
||||||
|
SEG_CODE,
|
||||||
|
SEG_RODATA,
|
||||||
|
SEG_DATA,
|
||||||
|
SEG_BSS
|
||||||
|
} CurSeg = SEG_CODE;
|
||||||
|
|
||||||
/* Segment names */
|
/* Segment names */
|
||||||
static char* SegmentNames [4];
|
static char* SegmentNames [4];
|
||||||
@@ -173,7 +179,7 @@ void g_postamble (void)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void UseSeg (unsigned NewSeg)
|
static void UseSeg (int NewSeg)
|
||||||
/* Switch to a specific segment */
|
/* Switch to a specific segment */
|
||||||
{
|
{
|
||||||
if (CurSeg != NewSeg) {
|
if (CurSeg != NewSeg) {
|
||||||
@@ -217,7 +223,7 @@ void g_usebss (void)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void SegName (unsigned Seg, const char* Name)
|
static void SegName (int Seg, const char* Name)
|
||||||
/* Set the name of a segment */
|
/* Set the name of a segment */
|
||||||
{
|
{
|
||||||
/* Free the old name and set a new one */
|
/* Free the old name and set a new one */
|
||||||
@@ -228,7 +234,7 @@ void SegName (unsigned Seg, const char* Name)
|
|||||||
* with the new name.
|
* with the new name.
|
||||||
*/
|
*/
|
||||||
if (Seg == CurSeg) {
|
if (Seg == CurSeg) {
|
||||||
CurSeg = -1; /* Invalidate */
|
CurSeg = SEG_INV; /* Invalidate */
|
||||||
UseSeg (Seg);
|
UseSeg (Seg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2219,9 +2225,9 @@ void g_push (unsigned flags, unsigned long val)
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
/* Handle as 16 bit value */
|
/* Handle as 16 bit value */
|
||||||
hi = val >> 8;
|
hi = (unsigned char) (val >> 8);
|
||||||
if (val <= 7) {
|
if (val <= 7) {
|
||||||
AddCodeLine ("\tjsr\tpush%u", val);
|
AddCodeLine ("\tjsr\tpush%u", (unsigned) val);
|
||||||
} else if (hi == 0 || hi == 0xFF) {
|
} else if (hi == 0 || hi == 0xFF) {
|
||||||
/* Use special function */
|
/* Use special function */
|
||||||
ldaconst (val);
|
ldaconst (val);
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ static char* Find (const char* Path, const char* File)
|
|||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
const char* P;
|
const char* P;
|
||||||
unsigned Count;
|
|
||||||
int Max;
|
int Max;
|
||||||
char PathName [FILENAME_MAX];
|
char PathName [FILENAME_MAX];
|
||||||
|
|
||||||
@@ -92,7 +91,7 @@ static char* Find (const char* Path, const char* File)
|
|||||||
/* Start the search */
|
/* Start the search */
|
||||||
while (*P) {
|
while (*P) {
|
||||||
/* Copy the next path element into the buffer */
|
/* Copy the next path element into the buffer */
|
||||||
Count = 0;
|
int Count = 0;
|
||||||
while (*P != '\0' && *P != ';' && Count < Max) {
|
while (*P != '\0' && *P != ';' && Count < Max) {
|
||||||
PathName [Count++] = *P++;
|
PathName [Count++] = *P++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
|
|
||||||
/* Register variable management */
|
/* Register variable management */
|
||||||
unsigned MaxRegSpace = 6; /* Maximum space available */
|
unsigned MaxRegSpace = 6; /* Maximum space available */
|
||||||
static int RegOffs = 0; /* Offset into register space */
|
static unsigned RegOffs = 0; /* Offset into register space */
|
||||||
static const SymEntry** RegSyms = 0; /* The register variables */
|
static const SymEntry** RegSyms = 0; /* The register variables */
|
||||||
static unsigned RegSymCount = 0; /* Number of register variables */
|
static unsigned RegSymCount = 0; /* Number of register variables */
|
||||||
|
|
||||||
@@ -407,7 +407,8 @@ void RestoreRegVars (int HaveResult)
|
|||||||
* the accumulator must be saved across the restore.
|
* the accumulator must be saved across the restore.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
int I, J, Bytes, Offs;
|
unsigned I, J;
|
||||||
|
int Bytes, Offs;
|
||||||
|
|
||||||
/* If we don't have register variables in this function, bail out early */
|
/* If we don't have register variables in this function, bail out early */
|
||||||
if (RegSymCount == 0) {
|
if (RegSymCount == 0) {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#ifdef __WATCOMC__
|
#if defined(__WATCOMC__) || defined(_MSC_VER)
|
||||||
# include <malloc.h>
|
# include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ static void FlagPragma (unsigned char* Flag)
|
|||||||
constexpr (&val);
|
constexpr (&val);
|
||||||
|
|
||||||
/* Store the value into the flag parameter */
|
/* Store the value into the flag parameter */
|
||||||
*Flag = val.e_const;
|
*Flag = (val.e_const != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user