Solved compiler warnings

This commit is contained in:
Ianos Gnatiuc
2005-10-22 02:45:18 +00:00
parent f559b54f6e
commit fb668729c2
28 changed files with 92 additions and 105 deletions

View File

@@ -47,14 +47,11 @@
// C4786: 'identifier' : identifier was truncated to 'number'
// characters in the debug information
//
// C4800: 'type' : forcing value to bool 'true' or 'false'
// (performance warning)
//
// C4065: switch statement contains 'default' but no 'case' labels
//
// C4200: nonstandard extension used : zero-sized array in struct/union
//
#pragma warning(disable: 4200 4786 4800 4065)
#pragma warning(disable: 4200 4786 4065)
#endif
// ------------------------------------------------------------------
@@ -165,7 +162,7 @@ template <class T> inline int compare_two(T a, T b) { return a < b ? -1 : a
template <class T> inline T minimum_of_two(T a, T b) { return (a < b) ? a : b; }
template <class T> inline T maximum_of_two(T a, T b) { return (a > b) ? a : b; }
template <class T> inline int zero_or_one(T e) { return e ? 1 : 0; }
template <class T> inline bool make_bool(T a) { return a ? true : false; }
template <class T> inline bool make_bool(T a) { return a != 0; }
// ------------------------------------------------------------------

View File

@@ -72,11 +72,11 @@
#endif
#ifndef S_ISDIR
#define S_ISDIR(st_mode) ((st_mode)&_S_IFDIR)
#define S_ISDIR(st_mode) (make_bool((st_mode)&_S_IFDIR))
#endif
#ifndef S_ISREG
#define S_ISREG(st_mode) ((st_mode)&_S_IFREG)
#define S_ISREG(st_mode) (make_bool((st_mode)&_S_IFREG))
#endif
#ifndef R_OK

View File

@@ -52,10 +52,6 @@
#define IM_PRD_CODE 0x4B
#define BETA
// Data type definitions
typedef unsigned char bit;
// Internal limits
#define MAXAKAS 50 /* Max # of addresses */

View File

@@ -48,11 +48,6 @@
// ------------------------------------------------------------------
// ------------------------------------------------------------------
typedef byte bit;
// ------------------------------------------------------------------
// Structure of the records

View File

@@ -86,7 +86,7 @@ public:
const ftn_addr& aka() const { return cfg.aka; }
int originno() const { return cfg.originno; }
Attr& attr() { return cfg.attr; }
bool ispacked() const { return cfg.attr.pkd(); }
bool ispacked() const { return make_bool(cfg.attr.pkd()); }
void packed(bool a) { cfg.attr.pkd(a); }
bool ascan() { return (bool)cfg.scan; }