cast to bool optimization

This commit is contained in:
Ianos Gnatiuc 2005-10-25 06:11:09 +00:00
parent f602e0d3e3
commit 97ffdeef9d
37 changed files with 71 additions and 70 deletions

View File

@ -224,10 +224,10 @@ void AreaList::ReadGoldLast() {
(*ap)->Msgn.count = entry.msgncount; (*ap)->Msgn.count = entry.msgncount;
(*ap)->unread = entry.unread; (*ap)->unread = entry.unread;
(*ap)->marks = entry.marks; (*ap)->marks = entry.marks;
(*ap)->isscanned = (entry.flags & 1) ? true : false; (*ap)->isscanned = make_bool(entry.flags & 1);
(*ap)->isvalidchg = (entry.flags & 2) ? true : false; (*ap)->isvalidchg = make_bool(entry.flags & 2);
(*ap)->UpdateAreadata(); (*ap)->UpdateAreadata();
(*ap)->isunreadchg = (entry.flags & 4) ? true : false; (*ap)->isunreadchg = make_bool(entry.flags & 4);
(*ap)->Mark.Load(fp); (*ap)->Mark.Load(fp);
(*ap)->PMrk.Load(fp); (*ap)->PMrk.Load(fp);

View File

@ -38,7 +38,7 @@ extern char* val;
void CfgHighlighturls() { void CfgHighlighturls() {
CFG->highlighturls = GetYesno(val) ? true : false; CFG->highlighturls = make_bool(GetYesno(val));
} }
// ------------------------------------------------------------------ // ------------------------------------------------------------------
@ -218,7 +218,7 @@ void CfgInternetrfcbody() {
void CfgInternetviagate() { void CfgInternetviagate() {
CFG->internetviagate = GetYesno(val) ? true : false; CFG->internetviagate = make_bool(GetYesno(val));
} }
// ------------------------------------------------------------------ // ------------------------------------------------------------------

View File

@ -170,8 +170,8 @@ extern "C" int AreaListCmp(const Area** __a, const Area** __b) {
case 'F': case 'F':
case 'f': case 'f':
if(*area_maybe) { if(*area_maybe) {
register bool amay = striinc(area_maybe, A->echoid()) ? true : false; bool amay = make_bool(striinc(area_maybe, A->echoid()));
register bool bmay = striinc(area_maybe, B->echoid()) ? true : false; bool bmay = make_bool(striinc(area_maybe, B->echoid()));
if((cmp = compare_two(bmay, amay)) != 0) if((cmp = compare_two(bmay, amay)) != 0)
return cmp; return cmp;

View File

@ -142,7 +142,7 @@ int DoCarboncopy(GMsg* msg, GMsg** carbon) {
HeaderView->Use(AA, msg); HeaderView->Use(AA, msg);
HeaderView->Paint(); HeaderView->Paint();
GMenuCarbon MenuCarbon; GMenuCarbon MenuCarbon;
ignorecc = MenuCarbon.Run(msg) ? false : true; ignorecc = make_bool_not(MenuCarbon.Run(msg));
if(ignorecc) // Do not process carbon copies if(ignorecc) // Do not process carbon copies
break; break;
if(newline) if(newline)
@ -362,7 +362,7 @@ void DoCrosspost(GMsg* msg, std::vector<int> &postareas) {
if(not ignorexc and (strnieql(ptr, "XC:", 3) or strnieql(ptr, "XP:", 3))) { if(not ignorexc and (strnieql(ptr, "XC:", 3) or strnieql(ptr, "XP:", 3))) {
if(ask) { if(ask) {
GMenuCross MenuCross; GMenuCross MenuCross;
ignorexc = (CFG->crosspost != ASK) or MenuCross.Run(msg) ? false : true; ignorexc = make_bool_not((CFG->crosspost != ASK) or MenuCross.Run(msg));
if(ignorexc) // Do not process crossposting if(ignorexc) // Do not process crossposting
break; break;
if(newline) if(newline)

View File

@ -249,7 +249,7 @@ void DoKludges(int mode, GMsg* msg, int kludges) {
if(line->kludge & kludges) { if(line->kludge & kludges) {
bool waswrapped; bool waswrapped;
do { do {
waswrapped = (line->type & GLINE_WRAP) ? true : false; waswrapped = make_bool(line->type & GLINE_WRAP);
line = DeleteLine(line); line = DeleteLine(line);
} while(line and waswrapped); } while(line and waswrapped);
} }

View File

@ -235,7 +235,7 @@ static void WriteMsgs(GMsg* msg) {
SaveLines(MODE_WRITE, "\001PRN", msg, prnmargin); SaveLines(MODE_WRITE, "\001PRN", msg, prnmargin);
} }
else { else {
SaveLines(overwrite ? MODE_WRITE : MODE_APPEND, AA->Outputfile(), msg, prnmargin, (target & WRITE_CLIPBRD) ? true : false); SaveLines(overwrite ? MODE_WRITE : MODE_APPEND, AA->Outputfile(), msg, prnmargin, make_bool(target & WRITE_CLIPBRD));
} }
} }
if(prnfp) if(prnfp)

View File

@ -1127,7 +1127,7 @@ void IEclass::DelChar() {
setlinetype(_thisline); setlinetype(_thisline);
// Rewrap this line // Rewrap this line
bool display = (row > maxrow / 2) ? false : true; bool display = make_bool_not(row > maxrow / 2);
wrapdel(&currline, &col, &row, display); wrapdel(&currline, &col, &row, display);
if(display) { if(display) {
refresh(currline, row); refresh(currline, row);
@ -1553,7 +1553,7 @@ void IEclass::DeleteEOL() {
GFTRK("EditDeleteEOL"); GFTRK("EditDeleteEOL");
bool _has_linefeed = (currline->txt.find('\n') != currline->txt.npos) ? true : false; bool _has_linefeed = (currline->txt.find('\n') != currline->txt.npos);
Undo->PushItem(EDIT_UNDO_DEL_TEXT, currline); Undo->PushItem(EDIT_UNDO_DEL_TEXT, currline);
@ -3014,7 +3014,7 @@ void UndoStack::PlayItem() {
currline = thisline; currline = thisline;
break; break;
case EDIT_UNDO_PUSH_LINE: case EDIT_UNDO_PUSH_LINE:
editor->UnDelete((last_item->action & LAST_LINE) ? false : true); editor->UnDelete(make_bool_not(last_item->action & LAST_LINE));
break; break;
case EDIT_UNDO_POP_LINE: case EDIT_UNDO_POP_LINE:
editor->DelLine(); editor->DelLine();

View File

@ -84,7 +84,7 @@ static void InitCmdline(char* val) {
std::cout << "Warning: configuration filename missed for -C option, ignored.\n"; std::cout << "Warning: configuration filename missed for -C option, ignored.\n";
break; break;
case 'D': case 'D':
cmdlineoldkeyw = (*val == '-') ? true : false; cmdlineoldkeyw = (*val == '-');
break; break;
case 'E': case 'E':
if(strieql(key, "EXPORTSOUP")) if(strieql(key, "EXPORTSOUP"))
@ -93,7 +93,7 @@ static void InitCmdline(char* val) {
strxcpy(stecho, val, sizeof(stecho)); strxcpy(stecho, val, sizeof(stecho));
break; break;
case 'F': case 'F':
cmdlineforce = (*val == '-') ? false : true; cmdlineforce = make_bool_not(*val == '-');
if(toupper(key[1]) == 'F') if(toupper(key[1]) == 'F')
cmdlineforce++; cmdlineforce++;
break; break;
@ -112,7 +112,7 @@ static void InitCmdline(char* val) {
cmdlineimportsoup = true; cmdlineimportsoup = true;
break; break;
case 'M': case 'M':
disablesound = (*val == '-') ? false : true; disablesound = make_bool_not(*val == '-');
break; break;
case 'N': case 'N':
if(strieql(key, "NOSCAN")) if(strieql(key, "NOSCAN"))
@ -121,7 +121,7 @@ static void InitCmdline(char* val) {
cmdlinesharemode = SH_COMPAT; cmdlinesharemode = SH_COMPAT;
break; break;
case 'P': case 'P':
cmdlinepriority = (*val == '-') ? false : true; cmdlinepriority = make_bool_not(*val == '-');
break; break;
case 'Q': case 'Q':
quiet = true; quiet = true;
@ -134,17 +134,17 @@ static void InitCmdline(char* val) {
break; break;
case 'V': case 'V':
quiet = false; quiet = false;
veryverbose = (toupper(key[1]) == 'V') ? true : false; veryverbose = (toupper(key[1]) == 'V');
break; break;
case 'W': case 'W':
cmdlinewriteareas = (*val == '-') ? false : true; cmdlinewriteareas = make_bool_not(*val == '-');
break; break;
case 'Y': case 'Y':
cmdlinedebughg = (*val == '-') ? false : true; cmdlinedebughg = make_bool_not(*val == '-');
break; break;
#if defined(GFTRK_ENABLE) #if defined(GFTRK_ENABLE)
case 'X': case 'X':
__gftrk_statusline = (*val == '-') ? false : true; __gftrk_statusline = make_bool_not(*val == '-');
break; break;
case 'Z': case 'Z':
gftrk_set_max = atoi(val); gftrk_set_max = atoi(val);

View File

@ -819,7 +819,7 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) {
// Set msg date and time // Set msg date and time
bool dochgdate = true; bool dochgdate = true;
if(mode == MODE_CHANGE) { if(mode == MODE_CHANGE) {
dochgdate = EDIT->ChangeDate() ? true : false; dochgdate = make_bool(EDIT->ChangeDate());
if((EDIT->ChangeDate() == YES) and not msg->attr.fmu()) if((EDIT->ChangeDate() == YES) and not msg->attr.fmu())
dochgdate = false; dochgdate = false;
} }

View File

@ -267,8 +267,8 @@ void ToggleStyles() {
w_info(NULL); w_info(NULL);
if(k != Key_Esc) { if(k != Key_Esc) {
AA->adat->usestylies = (setting & 1) ? true : false; AA->adat->usestylies = make_bool(setting & 1);
AA->adat->hidestylies = (setting & 2) ? true : false; AA->adat->hidestylies = make_bool(setting & 2);
} }
} }

View File

@ -61,7 +61,7 @@ char* CvtMessageIDtoMSGID(const char* mptr, char* msgidbuf, const char* echoid,
} }
else { else {
bool spaces = strchr(mptr, ' ') ? true : false; bool spaces = make_bool(strchr(mptr, ' '));
dword crc32 = CRC32_MASK_CCITT; dword crc32 = CRC32_MASK_CCITT;
crc32 = strCrc32(mptr, NO, crc32); crc32 = strCrc32(mptr, NO, crc32);

View File

@ -337,7 +337,7 @@ bool golded_search_manager::search(GMsg* msg, bool quick, bool shortcircuit) {
// Perform short-circuit logic analysis // Perform short-circuit logic analysis
if(shortcircuit) { if(shortcircuit) {
exit = found ? true : false; exit = make_bool(found);
if(item == items.end()-1) if(item == items.end()-1)
return exit; return exit;
} }

View File

@ -59,7 +59,7 @@ int edit_string(char* buf, int buf_size, char* title, int helpcat) {
while(len and ('!' > buf2[--len])) while(len and ('!' > buf2[--len]))
buf2.erase(len, 1); buf2.erase(len, 1);
strcpy(buf, buf2.c_str()); strcpy(buf, buf2.c_str());
return *buf ? true : false; return make_bool(*buf);
} }

View File

@ -418,9 +418,9 @@ public:
bool pmscan() { return area->pmscan(); } bool pmscan() { return area->pmscan(); }
bool pmscanexcl() { return area->pmscanexcl(); } bool pmscanexcl() { return area->pmscanexcl(); }
bool pmscanincl() { return area->pmscanincl(); } bool pmscanincl() { return area->pmscanincl(); }
bool ismarked() const { return (marks & (1<<AL.mask)) ? true : false; } bool ismarked() const { return make_bool(marks & (1<<AL.mask)); }
bool isnewmail() const { return (isvalidchg and isunreadchg) ? true : false; } bool isnewmail() const { return (isvalidchg and isunreadchg); }
const char* echoid() const { return area->echoid(); } const char* echoid() const { return area->echoid(); }
const char* desc() const { return area->desc(); } const char* desc() const { return area->desc(); }

View File

@ -162,7 +162,8 @@ 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 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 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 int zero_or_one(T e) { return e ? 1 : 0; }
template <class T> inline bool make_bool(T a) { return a != 0; } template <class T> inline bool make_bool(T a) { return !!a; }
template <class T> inline bool make_bool_not(T a) { return !a; }
// ------------------------------------------------------------------ // ------------------------------------------------------------------

View File

@ -96,7 +96,7 @@ int gfile::okay() {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
int gfile::isopen() { bool gfile::isopen() {
if((fh != -1) or (fp != NULL)) if((fh != -1) or (fp != NULL))
return true; return true;

View File

@ -64,7 +64,7 @@ public:
// Handy utility functions // Handy utility functions
int okay(); // Returns non-zero if no errors were detected int okay(); // Returns non-zero if no errors were detected
int isopen(); // true if the file is open bool isopen(); // true if the file is open
// -------------------------------------------------------------- // --------------------------------------------------------------
@ -78,7 +78,7 @@ public:
~gfile(); // Destructor (closes file) ~gfile(); // Destructor (closes file)
operator bool() { return isopen() ? true : false; } operator bool() { return isopen(); }
// -------------------------------------------------------------- // --------------------------------------------------------------

View File

@ -178,7 +178,7 @@ int is_dir(const char* path) {
struct stat st; struct stat st;
if(stat(tmp, &st) == 0) if(stat(tmp, &st) == 0)
return (st.st_mode & S_IFDIR) ? true : false; return make_bool(st.st_mode & S_IFDIR);
return false; return false;
} }

View File

@ -182,7 +182,7 @@ bool gfuzzy::findnext() {
} }
} }
return start ? true : false; return make_bool(start);
} }

View File

@ -134,7 +134,7 @@ void GKbd::Init() {
OSVERSIONINFO osversion; OSVERSIONINFO osversion;
osversion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); osversion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osversion); GetVersionEx(&osversion);
gkbd_nt = (osversion.dwPlatformId & VER_PLATFORM_WIN32_NT) ? true : false; gkbd_nt = make_bool(osversion.dwPlatformId & VER_PLATFORM_WIN32_NT);
gkbd_hin = CreateFile("CONIN$", GENERIC_READ | GENERIC_WRITE, gkbd_hin = CreateFile("CONIN$", GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
OPEN_EXISTING, 0, NULL); OPEN_EXISTING, 0, NULL);
@ -1283,9 +1283,9 @@ gkey kbxget_raw(int mode) {
} }
if((inp.EventType == KEY_EVENT) and inp.Event.KeyEvent.bKeyDown) { if((inp.EventType == KEY_EVENT) and inp.Event.KeyEvent.bKeyDown) {
bool alt_pressed = (CKS & (LEFT_ALT_PRESSED|RIGHT_ALT_PRESSED)) ? true : false; bool alt_pressed = make_bool(CKS & (LEFT_ALT_PRESSED|RIGHT_ALT_PRESSED));
bool ctrl_pressed = (CKS & (LEFT_CTRL_PRESSED|RIGHT_CTRL_PRESSED)) ? true : false; bool ctrl_pressed = make_bool(CKS & (LEFT_CTRL_PRESSED|RIGHT_CTRL_PRESSED));
bool shift_pressed = (CKS & SHIFT_PRESSED) ? true : false; bool shift_pressed = make_bool(CKS & SHIFT_PRESSED);
bool special_key = false; bool special_key = false;
k = 0; k = 0;

View File

@ -135,7 +135,7 @@ public:
void HideCursor(); void HideCursor();
void ShowCursor(); void ShowCursor();
int Hidden() { return hidden ? true : false; } int Hidden() { return make_bool(hidden); }
int Enabled() { return level > GMOU_LEVEL_NONE; } int Enabled() { return level > GMOU_LEVEL_NONE; }

View File

@ -71,7 +71,7 @@ bool gregex::compile(const char* pattern, int cflags) {
throw_new(preg); throw_new(preg);
} }
return regcomp(preg, pattern, cflgs) ? true : false; return make_bool(regcomp(preg, pattern, cflgs));
} }

View File

@ -474,7 +474,7 @@ int gsnd::is_playing() {
#if defined(__MSDOS__) #if defined(__MSDOS__)
if(file_open) if(file_open)
return data->status == 0 ? false : true; return make_bool_not(data->status == 0);
return false; return false;
#elif defined(GUTLOS_FUNCS) #elif defined(GUTLOS_FUNCS)

View File

@ -57,19 +57,19 @@ extern mail_ctype mail_ctype_global;
// ------------------------------------------------------------------ // ------------------------------------------------------------------
inline bool is_mail_char(uint c) { return (mail_ctype_global.table[c] & mail_ctype::mail_char) ? true : false; } inline bool is_mail_char(uint c) { return make_bool(mail_ctype_global.table[c] & mail_ctype::mail_char); }
inline bool is_mail_alpha(uint c) { return (mail_ctype_global.table[c] & mail_ctype::mail_alpha) ? true : false; } inline bool is_mail_alpha(uint c) { return make_bool(mail_ctype_global.table[c] & mail_ctype::mail_alpha); }
inline bool is_mail_ctl(uint c) { return (mail_ctype_global.table[c] & mail_ctype::mail_ctl) ? true : false; } inline bool is_mail_ctl(uint c) { return make_bool(mail_ctype_global.table[c] & mail_ctype::mail_ctl); }
inline bool is_mail_cr(uint c) { return c == CR; } inline bool is_mail_cr(uint c) { return c == CR; }
inline bool is_mail_lf(uint c) { return c == LF; } inline bool is_mail_lf(uint c) { return c == LF; }
inline bool is_mail_space(uint c) { return c == ' '; } inline bool is_mail_space(uint c) { return c == ' '; }
inline bool is_mail_htab(uint c) { return c == HT; } inline bool is_mail_htab(uint c) { return c == HT; }
inline bool is_mail_crlf(uint c) { return is_mail_cr(c) or is_mail_lf(c); } inline bool is_mail_crlf(uint c) { return is_mail_cr(c) or is_mail_lf(c); }
inline bool is_mail_lwsp(uint c) { return (mail_ctype_global.table[c] & mail_ctype::mail_lwsp) ? true : false; } inline bool is_mail_lwsp(uint c) { return make_bool(mail_ctype_global.table[c] & mail_ctype::mail_lwsp); }
inline bool is_mail_special(uint c) { return (mail_ctype_global.table[c] & mail_ctype::mail_special) ? true : false; } inline bool is_mail_special(uint c) { return make_bool(mail_ctype_global.table[c] & mail_ctype::mail_special); }
inline bool is_mail_delimiters(uint c) { return (mail_ctype_global.table[c] & mail_ctype::mail_delimiters) ? true : false; } inline bool is_mail_delimiters(uint c) { return make_bool(mail_ctype_global.table[c] & mail_ctype::mail_delimiters); }
inline bool is_mime_tspecial(uint c) { return (mail_ctype_global.table[c] & mail_ctype::mime_tspecial) ? true : false; } inline bool is_mime_tspecial(uint c) { return make_bool(mail_ctype_global.table[c] & mail_ctype::mime_tspecial); }
inline bool is_mime_especial(uint c) { return (mail_ctype_global.table[c] & mail_ctype::mime_especial) ? true : false; } inline bool is_mime_especial(uint c) { return make_bool(mail_ctype_global.table[c] & mail_ctype::mime_especial); }
inline bool is_mail_atom_delimiters(uint c) { return is_mail_delimiters(c) or is_mail_ctl(c); } inline bool is_mail_atom_delimiters(uint c) { return is_mail_delimiters(c) or is_mail_ctl(c); }
inline bool is_mime_ct_token_valid(uint c) { return not (is_mail_lwsp(c) or is_mail_ctl(c) or is_mime_tspecial(c)); } inline bool is_mime_ct_token_valid(uint c) { return not (is_mail_lwsp(c) or is_mail_ctl(c) or is_mime_tspecial(c)); }

View File

@ -102,11 +102,11 @@ bool gclipbrd::writeclipbrd(const char* buf) {
if(fake_clipboard) if(fake_clipboard)
throw_free(fake_clipboard); throw_free(fake_clipboard);
fake_clipboard = throw_strdup(buf); fake_clipboard = throw_strdup(buf);
return (fake_clipboard != NULL) ? true : false; return (fake_clipboard != NULL);
} }
#if defined(GUTLOS_FUNCS) #if defined(GUTLOS_FUNCS)
return (g_put_clip_text(buf) == 0) ? true : false; return (g_put_clip_text(buf) == 0);
#else #else
return false; return false;
#endif #endif

View File

@ -191,7 +191,7 @@ void g_set_osicon(void) {
bool g_is_clip_available(void) { bool g_is_clip_available(void) {
return (winapi == NOAPI) ? false : true; return make_bool_not(winapi == NOAPI);
} }

View File

@ -254,7 +254,7 @@ void g_set_osicon(void) {
bool g_is_clip_available(void) { bool g_is_clip_available(void) {
return (ge_os2_hab) ? true : false; return make_bool(ge_os2_hab);
} }

View File

@ -1832,7 +1832,7 @@ void vcurset(int sline, int eline) {
vposset(gvid->numrows-1, gvid->numcols-1); vposset(gvid->numrows-1, gvid->numcols-1);
cci.dwSize = (eline and sline) ? sline : 100; cci.dwSize = (eline and sline) ? sline : 100;
cci.bVisible = eline ? true : false; cci.bVisible = make_bool(eline);
SetConsoleCursorInfo(gvid_hout, &cci); SetConsoleCursorInfo(gvid_hout, &cci);

View File

@ -99,7 +99,7 @@ int gwildmatch::match_internal(const char* text, const char* pattern, bool ignor
} }
return -1; return -1;
case '[': case '[':
reverse = p[1] == '^' ? true : false; reverse = (p[1] == '^');
if(reverse) // Inverted character class if(reverse) // Inverted character class
p++; p++;
matched = false; matched = false;

View File

@ -48,17 +48,17 @@
static GOLD_INLINE int _wchkrow(int wrow) { static GOLD_INLINE int _wchkrow(int wrow) {
return ((wrow<0) or (wrow>((gwin.active->erow-gwin.active->border)-(gwin.active->srow+gwin.active->border)))) ? true : false; return ((wrow<0) or (wrow>((gwin.active->erow-gwin.active->border)-(gwin.active->srow+gwin.active->border))));
} }
static GOLD_INLINE int _wchkcol(int wcol) { static GOLD_INLINE int _wchkcol(int wcol) {
return ((wcol<0) or (wcol>((gwin.active->ecol-gwin.active->border)-(gwin.active->scol+gwin.active->border)))) ? true : false; return ((wcol<0) or (wcol>((gwin.active->ecol-gwin.active->border)-(gwin.active->scol+gwin.active->border))));
} }
static GOLD_INLINE int _wchkcoord(int wrow, int wcol) { static GOLD_INLINE int _wchkcoord(int wrow, int wcol) {
return (_wchkrow(wrow) or _wchkcol(wcol)) ? true : false; return (_wchkrow(wrow) or _wchkcol(wcol));
} }
@ -94,7 +94,7 @@ int wchkcoord(int wrow, int wcol) {
int wchkbox(int wsrow, int wscol, int werow, int wecol) { int wchkbox(int wsrow, int wscol, int werow, int wecol) {
return (_wchkcoord(wsrow,wscol) or _wchkcoord(werow,wecol) or (wsrow>werow) or (wscol>wecol)) ? true : false; return (_wchkcoord(wsrow,wscol) or _wchkcoord(werow,wecol) or (wsrow>werow) or (wscol>wecol));
} }

View File

@ -165,7 +165,7 @@ void GMnu::SetTag(int tag) {
void GMnu::Begin(int type) { void GMnu::Begin(int type) {
int was_horz = (stack[depth].type&M_HORZ) ? true : false; bool was_horz = make_bool(stack[depth].type & M_HORZ);
depth++; depth++;
stack[depth].tag = -1; stack[depth].tag = -1;
stack[depth].type = type | M_SAVE; stack[depth].type = type | M_SAVE;

View File

@ -1009,12 +1009,12 @@ bool gwinput::field::delete_word(bool left) {
if(entry != gwinput::entry_noedit) { if(entry != gwinput::entry_noedit) {
bool state = isspace(buf[buf_pos-((int) left)]) ? true : false; bool state = make_bool(isspace(buf[buf_pos-((int) left)]));
while(left ? buf_pos > 0 : buf_pos < buf_end_pos) { while(left ? buf_pos > 0 : buf_pos < buf_end_pos) {
left ? delete_left() : delete_char(); left ? delete_left() : delete_char();
if((isspace(buf[buf_pos-((int) left)]) ? true : false) != state) if(make_bool(isspace(buf[buf_pos-((int) left)])) != state)
break; break;
} }
return true; return true;

View File

@ -205,7 +205,7 @@ void gareafile::ReadSpaceNtm(const char* file) {
ParseSpaceArea(val, aa); ParseSpaceArea(val, aa);
break; break;
case CRC_AUTOEXPORT: case CRC_AUTOEXPORT:
exportarea = GetYesno(val) ? true : false; exportarea = make_bool(GetYesno(val));
break; break;
case CRC_ENDNETMAIL: case CRC_ENDNETMAIL:
if(exportarea and (aa.basetype[0] != '\0')) if(exportarea and (aa.basetype[0] != '\0'))

View File

@ -156,7 +156,7 @@ public:
FidoArea() { wide = NULL; data = NULL; } FidoArea() { wide = NULL; data = NULL; }
virtual ~FidoArea() {} virtual ~FidoArea() {}
virtual bool havearrivedstamp() const { return isopus() ? true : false; } virtual bool havearrivedstamp() const { return isopus(); }
virtual bool havereceivedstamp() const { return false; } virtual bool havereceivedstamp() const { return false; }
// ---------------------------------------------------------------- // ----------------------------------------------------------------

View File

@ -228,7 +228,7 @@ void FidoArea::scan_area() {
GFTRK("FidoArea::scan_area"); GFTRK("FidoArea::scan_area");
bool was_open = data ? true : false; bool was_open = make_bool(data);
if(not was_open) if(not was_open)
data_open(); data_open();
raw_scan(false); raw_scan(false);
@ -245,7 +245,7 @@ void FidoArea::scan_area_pm() {
GFTRK("FidoArea::scan_area_pm"); GFTRK("FidoArea::scan_area_pm");
bool was_open = data ? true : false; bool was_open = make_bool(data);
if(not was_open) if(not was_open)
data_open(); data_open();
raw_scan(true); raw_scan(true);

View File

@ -300,7 +300,7 @@ void JamArea::save_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
lseekset(data->fhjhr, _idx.hdroffset); lseekset(data->fhjhr, _idx.hdroffset);
JamHdr oldhdr; JamHdr oldhdr;
read(data->fhjhr, &oldhdr, sizeof(JamHdr)); read(data->fhjhr, &oldhdr, sizeof(JamHdr));
was_deleted = oldhdr.attribute & JAMATTR_DELETED ? true : false; was_deleted = make_bool(oldhdr.attribute & JAMATTR_DELETED);
if(oldhdr.subfieldlen != __hdr.subfieldlen) { if(oldhdr.subfieldlen != __hdr.subfieldlen) {
oldhdr.attribute |= JAMATTR_DELETED; oldhdr.attribute |= JAMATTR_DELETED;
oldhdr.txtlen = 0; oldhdr.txtlen = 0;

View File

@ -1435,7 +1435,7 @@ static bool read_config(const char *cfg, const char *argv_0) {
Addr zoneaddr; Addr zoneaddr;
Path buf; Path buf;
bool found = (*cfg != NUL) ? true : false; bool found = (*cfg != NUL);
if(not found) { if(not found) {
// Look for configfilename in the environment // Look for configfilename in the environment
const char *ptr = getenv("GOLDNODE"); const char *ptr = getenv("GOLDNODE");