From fb668729c21bb0479f3180f3e56d4aec16bf381a Mon Sep 17 00:00:00 2001 From: Ianos Gnatiuc Date: Sat, 22 Oct 2005 02:45:18 +0000 Subject: [PATCH] Solved compiler warnings --- golded3/gccfgg0.cpp | 2 +- golded3/gccfgg1.cpp | 12 ++++++------ golded3/gccfgg2.cpp | 4 ++-- golded3/gccfgg3.cpp | 24 ++++++++++++------------ golded3/gccfgg4.cpp | 4 ++-- golded3/gccfgg5.cpp | 8 ++++---- golded3/gccfgg6.cpp | 6 +++--- golded3/gccfgg7.cpp | 10 +++++----- golded3/gccfgg8.cpp | 28 ++++++++++++++-------------- golded3/gectrl.cpp | 2 +- golded3/geedit.cpp | 4 ++-- golded3/geedit2.cpp | 2 +- golded3/geinit.cpp | 4 ++-- golded3/gemlst.cpp | 4 ++-- golded3/gemnus.cpp | 2 +- golded3/gemsgs.cpp | 7 +++---- golded3/genode.cpp | 2 +- golded3/gepost.cpp | 12 ++++++------ golded3/geread2.cpp | 2 +- golded3/gescan.cpp | 4 ++-- golded3/gesrch.cpp | 2 +- golded3/getpls.cpp | 18 +++++++++--------- golded3/gmarea.h | 12 ++++++------ goldlib/gall/gdefs.h | 7 ++----- goldlib/gall/gfilutil.h | 4 ++-- goldlib/gcfg/gs_im175.h | 4 ---- goldlib/gcfg/gs_ts.h | 5 ----- goldlib/gmb3/gmoarea.h | 2 +- 28 files changed, 92 insertions(+), 105 deletions(-) diff --git a/golded3/gccfgg0.cpp b/golded3/gccfgg0.cpp index 080fecd..6cb35a0 100644 --- a/golded3/gccfgg0.cpp +++ b/golded3/gccfgg0.cpp @@ -130,7 +130,7 @@ bool gswitches::handle(word crc, const char* value) { left = middle + 1; } else { - cfg[middle] = GetYesno(value); + cfg[middle] = make_bool(GetYesno(value)); return true; } } while(left <= right); diff --git a/golded3/gccfgg1.cpp b/golded3/gccfgg1.cpp index 136ead8..e203e28 100644 --- a/golded3/gccfgg1.cpp +++ b/golded3/gccfgg1.cpp @@ -184,7 +184,7 @@ void CfgAkamatchfromto() { void CfgAkamatching() { if(cfgingroup) { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); CFG->grp.AddItm(GRP_AKAMATCHING, flag); } } @@ -193,7 +193,7 @@ void CfgAkamatching() { void CfgAkamatchmanually() { - CFG->akamatchmanually = (0 != GetYesno(val)); + CFG->akamatchmanually = make_bool(GetYesno(val)); } // ------------------------------------------------------------------ @@ -226,7 +226,7 @@ void CfgAreacfmreplyto() { void CfgAreacopydirect() { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); if(cfgingroup) CFG->grp.AddItm(GRP_AREACOPYDIRECT, flag); else @@ -249,7 +249,7 @@ void CfgAreacopyto() { void CfgAreacopyaddid() { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); if(cfgingroup) CFG->grp.AddItm(GRP_AREACOPYADDID, flag); else @@ -282,7 +282,7 @@ void CfgAreaexcl() { void CfgAreaforwarddirect() { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); if(cfgingroup) CFG->grp.AddItm(GRP_AREAFORWARDDIRECT, flag); else @@ -293,7 +293,7 @@ void CfgAreaforwarddirect() { void CfgAreafreqdirect() { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); if(cfgingroup) CFG->grp.AddItm(GRP_AREAFREQDIRECT, flag); else diff --git a/golded3/gccfgg2.cpp b/golded3/gccfgg2.cpp index 6d7a829..61c3d49 100644 --- a/golded3/gccfgg2.cpp +++ b/golded3/gccfgg2.cpp @@ -37,7 +37,7 @@ extern char* val; void CfgAreareplydirect() { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); if(cfgingroup) CFG->grp.AddItm(GRP_AREAREPLYDIRECT, flag); else @@ -451,7 +451,7 @@ void CfgDisphdrdateset() { void CfgDisphdrlocation() { - CFG->disphdrlocation = (0 != GetYesno(val)); + CFG->disphdrlocation = make_bool(GetYesno(val)); } // ------------------------------------------------------------------ diff --git a/golded3/gccfgg3.cpp b/golded3/gccfgg3.cpp index bbe3058..dfb1c9c 100644 --- a/golded3/gccfgg3.cpp +++ b/golded3/gccfgg3.cpp @@ -64,7 +64,7 @@ void CfgDispareano() { void CfgDisppmfirst() { - CFG->disppmfirst = GetYesno(val); + CFG->disppmfirst = make_bool(GetYesno(val)); } // ------------------------------------------------------------------ @@ -78,7 +78,7 @@ void CfgDisptabsize() { void CfgEditautoattach() { - EDIT->AutoAttach(GetYesno(val)); + EDIT->AutoAttach(make_bool(GetYesno(val))); } // ------------------------------------------------------------------ @@ -139,14 +139,14 @@ void CfgEditcompletion() { void CfgEditcrlfterm() { - EDIT->CrLfTerm(GetYesno(val)); + EDIT->CrLfTerm(make_bool(GetYesno(val))); } // ------------------------------------------------------------------ void CfgEditfieldclear() { - EDIT->FieldClear(GetYesno(val)); + EDIT->FieldClear(make_bool(GetYesno(val))); } // ------------------------------------------------------------------ @@ -160,14 +160,14 @@ void CfgEdithardline() { void CfgEdithardlines() { - EDIT->HardLines(GetYesno(val)); + EDIT->HardLines(make_bool(GetYesno(val))); } // ------------------------------------------------------------------ void CfgEdithardterm() { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); if(cfgingroup) CFG->grp.AddItm(GRP_EDITHARDTERM, flag); else @@ -198,7 +198,7 @@ void CfgEdithdrnodeset() { void CfgEditheaderattrs() { - EDIT->HeaderAttrs(GetYesno(val)); + EDIT->HeaderAttrs(make_bool(GetYesno(val))); } // ------------------------------------------------------------------ @@ -228,21 +228,21 @@ void CfgEditheaderfirst() { void CfgEditinternal() { - EDIT->Internal(GetYesno(val)); + EDIT->Internal(make_bool(GetYesno(val))); } // ------------------------------------------------------------------ void CfgEditmenu() { - EDIT->Menu(GetYesno(val)); + EDIT->Menu(make_bool(GetYesno(val))); } // ------------------------------------------------------------------ void CfgEditmixcase() { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); if(cfgingroup) CFG->grp.AddItm(GRP_EDITMIXCASE, flag); else @@ -290,7 +290,7 @@ void CfgEditreplyre() { void CfgEditsavemenu() { - EDIT->SaveMenu(GetYesno(val)); + EDIT->SaveMenu(make_bool(GetYesno(val))); } // ------------------------------------------------------------------ @@ -328,7 +328,7 @@ void CfgEditundelete() { void CfgEncodeemailheaders() { - CFG->encodeemailheaders = GetYesno(val); + CFG->encodeemailheaders = make_bool(GetYesno(val)); } // ------------------------------------------------------------------ diff --git a/golded3/gccfgg4.cpp b/golded3/gccfgg4.cpp index d9ddb6f..5bed1de 100644 --- a/golded3/gccfgg4.cpp +++ b/golded3/gccfgg4.cpp @@ -234,7 +234,7 @@ void CfgFilealias() { void CfgForcetemplate() { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); if(cfgingroup) CFG->grp.AddItm(GRP_FORCETEMPLATE, flag); else @@ -291,7 +291,7 @@ void CfgFrqoptions() { void CfgGedhandshake() { - CFG->gedhandshake = GetYesno(val); + CFG->gedhandshake = make_bool(GetYesno(val)); } // ------------------------------------------------------------------ diff --git a/golded3/gccfgg5.cpp b/golded3/gccfgg5.cpp index 97fbc66..c87083a 100644 --- a/golded3/gccfgg5.cpp +++ b/golded3/gccfgg5.cpp @@ -79,7 +79,7 @@ void CfgHudsonuserno() { void CfgIgnorecharset() { - CFG->ignorecharset = GetYesno(val); + CFG->ignorecharset = make_bool(GetYesno(val)); } // ------------------------------------------------------------------ @@ -126,7 +126,7 @@ void CfgInputfile() { void CfgIntensecolors() { - CFG->intensecolors = GetYesno(val); + CFG->intensecolors = make_bool(GetYesno(val)); if(CFG->intensecolors) memcpy(CFG->color, gold_color2, sizeof(CFG->color)); } @@ -194,7 +194,7 @@ void CfgInternetgateexp() { void CfgInternetmsgid() { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); if(cfgingroup) CFG->grp.AddItm(GRP_INTERNETMSGID, flag); else @@ -465,7 +465,7 @@ void CfgMsglistdate() { void CfgMsglistfast() { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); if(cfgingroup) CFG->grp.AddItm(GRP_MSGLISTFAST, flag); else diff --git a/golded3/gccfgg6.cpp b/golded3/gccfgg6.cpp index 52849dd..43741b9 100644 --- a/golded3/gccfgg6.cpp +++ b/golded3/gccfgg6.cpp @@ -37,7 +37,7 @@ extern char* val; void CfgMsglistfirst() { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); if(cfgingroup) CFG->grp.AddItm(GRP_MSGLISTFIRST, flag); else @@ -48,7 +48,7 @@ void CfgMsglistfirst() { void CfgMsglistheader() { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); if(cfgingroup) CFG->grp.AddItm(GRP_MSGLISTHEADER, flag); else @@ -59,7 +59,7 @@ void CfgMsglistheader() { void CfgMsglistwidesubj() { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); if(cfgingroup) CFG->grp.AddItm(GRP_MSGLISTWIDESUBJ, flag); else diff --git a/golded3/gccfgg7.cpp b/golded3/gccfgg7.cpp index a6d55c8..ae31b00 100644 --- a/golded3/gccfgg7.cpp +++ b/golded3/gccfgg7.cpp @@ -73,7 +73,7 @@ void CfgQuotestops() { void CfgQuotewraphard() { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); if(cfgingroup) CFG->grp.AddItm(GRP_QUOTEWRAPHARD, flag); else @@ -84,7 +84,7 @@ void CfgQuotewraphard() { void CfgQuoteusenewai() { - CFG->quoteusenewai = 0 != GetYesno(val); + CFG->quoteusenewai = make_bool(GetYesno(val)); } // ------------------------------------------------------------------ @@ -187,7 +187,7 @@ void CfgReplylink() { void CfgReplylinkfloat() { - CFG->replylinkfloat = (0 != GetYesno(val)); + CFG->replylinkfloat = make_bool(GetYesno(val)); } // ------------------------------------------------------------------ @@ -204,7 +204,7 @@ void CfgReplylinklist() { void CfgReplylinkshowalways() { - CFG->replylinkshowalways = (0 != GetYesno(val)); + CFG->replylinkshowalways = make_bool(GetYesno(val)); } // ------------------------------------------------------------------ @@ -444,7 +444,7 @@ void CfgSharemode() { void CfgShowdeleted() { - CFG->showdeleted = GetYesno(val); + CFG->showdeleted = make_bool(GetYesno(val)); } // ------------------------------------------------------------------ diff --git a/golded3/gccfgg8.cpp b/golded3/gccfgg8.cpp index 755e82d..7fc7623 100644 --- a/golded3/gccfgg8.cpp +++ b/golded3/gccfgg8.cpp @@ -68,7 +68,7 @@ void CfgStatuslinehelp() { void CfgStripHTML() { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); if(cfgingroup) CFG->grp.AddItm(GRP_STRIPHTML, flag); else @@ -93,7 +93,7 @@ void CfgStylecodes() { if (strieql(val, "HIDE")) flag1 = flag2 = true; else - flag2 = GetYesno(val); + flag2 = make_bool(GetYesno(val)); if (cfgingroup) { @@ -143,7 +143,7 @@ void CfgTaglinechar() { void CfgTaglinesupport() { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); if(cfgingroup) CFG->grp.AddItm(GRP_TAGLINESUPPORT, flag); else @@ -204,7 +204,7 @@ void CfgTemplate() { void CfgTemplatematch() { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); if(cfgingroup) CFG->grp.AddItm(GRP_TEMPLATEMATCH, flag); else @@ -237,7 +237,7 @@ void CfgTimeout() { void CfgTitlestatus(){ - CFG->titlestatus = GetYesno(val); + CFG->titlestatus = make_bool(GetYesno(val)); } // ------------------------------------------------------------------ @@ -341,7 +341,7 @@ void CfgUrlhandler() { void CfgUsearea() { - int flag = GetYesno(val) ? true : false; + bool flag = make_bool(GetYesno(val)); if(cfgingroup) CFG->grp.AddItm(GRP_USEAREA, flag); else @@ -352,7 +352,7 @@ void CfgUsearea() { void CfgUsecharset() { - CFG->usecharset = GetYesno(val); + CFG->usecharset = make_bool(GetYesno(val)); } // ------------------------------------------------------------------ @@ -370,14 +370,14 @@ void CfgUsefwd() { void CfgUseintl() { - CFG->useintl = GetYesno(val); + CFG->useintl = make_bool(GetYesno(val)); } // ------------------------------------------------------------------ void CfgUsepid() { - CFG->usepid = GetYesno(val); + CFG->usepid = make_bool(GetYesno(val)); } // ------------------------------------------------------------------ @@ -453,7 +453,7 @@ void CfgUsername() { void CfgUsesoftcrxlat() { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); if (cfgingroup) CFG->grp.AddItm(GRP_USESOFTCRXLAT, flag); else @@ -464,7 +464,7 @@ void CfgUsesoftcrxlat() void CfgUsetzutc() { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); if(cfgingroup) CFG->grp.AddItm(GRP_USETZUTC, flag); else @@ -482,7 +482,7 @@ void CfgUudecodepath() { void CfgViewhidden() { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); if(cfgingroup) CFG->grp.AddItm(GRP_VIEWHIDDEN, flag); else @@ -493,7 +493,7 @@ void CfgViewhidden() { void CfgViewkludge() { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); if(cfgingroup) CFG->grp.AddItm(GRP_VIEWKLUDGE, flag); else @@ -504,7 +504,7 @@ void CfgViewkludge() { void CfgViewquote() { - bool flag = GetYesno(val); + bool flag = make_bool(GetYesno(val)); if(cfgingroup) CFG->grp.AddItm(GRP_VIEWQUOTE, flag); else diff --git a/golded3/gectrl.cpp b/golded3/gectrl.cpp index 1f20366..ce12843 100644 --- a/golded3/gectrl.cpp +++ b/golded3/gectrl.cpp @@ -615,7 +615,7 @@ void DoKludges(int mode, GMsg* msg, int kludges) { line = AddKludge(line, buf); line->kludge = GKLUD_RFC; char encoding[100]; - bool isusascii = striinc("ASCII", msg->charset); + bool isusascii = make_bool(striinc("ASCII", msg->charset)); bool isqp = not isusascii and IsQuotedPrintable(msg->charset); if(strnieql(msg->charset, "latin", 5)) Latin2ISO(encoding, msg->charset); diff --git a/golded3/geedit.cpp b/golded3/geedit.cpp index a5aaae0..2480cd7 100644 --- a/golded3/geedit.cpp +++ b/golded3/geedit.cpp @@ -839,7 +839,7 @@ Line* IEclass::wrapit(Line** __currline, uint* __curr_col, uint* __curr_row, boo } // Was this line truncated at space? - bool truncated_at_space = isspace(_thisline->txt[_wrappos]); + bool truncated_at_space = make_bool(isspace(_thisline->txt[_wrappos])); // Truncate at the wrapping location _thisline->txt.erase(_wrappos); @@ -2930,7 +2930,7 @@ void UndoStack::PlayItem() { uint undo_type = last_item->action & EDIT_UNDO_TYPE; uint undo_action = last_item->action & EDIT_UNDO_ACTION; - in_batch = last_item->action & BATCH_MODE; + in_batch = make_bool(last_item->action & BATCH_MODE); currline = last_item->line; if(last_item->action & PREV_LINE) { diff --git a/golded3/geedit2.cpp b/golded3/geedit2.cpp index 0dd01dd..8cb8fbd 100644 --- a/golded3/geedit2.cpp +++ b/golded3/geedit2.cpp @@ -1428,7 +1428,7 @@ void IEclass::AskExit() { cursoroff(); GMenuQuit MenuQuit; - gkbd.quitall = MenuQuit.Run(); + gkbd.quitall = make_bool(MenuQuit.Run()); if(gkbd.quitall) { GMenuDropmsg MenuDropmsg; if(MenuDropmsg.Run()) diff --git a/golded3/geinit.cpp b/golded3/geinit.cpp index 9eb956b..3037b2c 100644 --- a/golded3/geinit.cpp +++ b/golded3/geinit.cpp @@ -702,8 +702,8 @@ void Initialize(int argc, char* argv[]) { // Read/compile various configs compiled |= ReadLangCfg(cmdlineforce); - compiled |= bool(ReadKeysCfg(cmdlineforce)); - compiled |= bool(ReadHelpCfg(cmdlineforce)); + compiled |= make_bool(ReadKeysCfg(cmdlineforce)); + compiled |= make_bool(ReadHelpCfg(cmdlineforce)); // Initialize sound system InitSound(); diff --git a/golded3/gemlst.cpp b/golded3/gemlst.cpp index fc132e6..87ca1b5 100644 --- a/golded3/gemlst.cpp +++ b/golded3/gemlst.cpp @@ -396,7 +396,7 @@ bool GMsgList::handle_key() { case KK_ListAskExit: { GMenuQuit MenuQuit; - aborted = gkbd.quitall = (MenuQuit.Run()); + aborted = gkbd.quitall = make_bool(MenuQuit.Run()); if(gkbd.quitall) { AA->bookmark = AA->Msgn.CvtReln(msgmark2); return false; @@ -1117,7 +1117,7 @@ bool GThreadlist::handle_key() { case KK_ListAskExit: { GMenuQuit MenuQuit; - aborted = gkbd.quitall = (MenuQuit.Run()); + aborted = gkbd.quitall = make_bool(MenuQuit.Run()); if(gkbd.quitall) return false; } diff --git a/golded3/gemnus.cpp b/golded3/gemnus.cpp index 0e47c41..75f0058 100644 --- a/golded3/gemnus.cpp +++ b/golded3/gemnus.cpp @@ -868,7 +868,7 @@ int GMenuEditHeader::Run(int mode, GMsg* msg) { update_statusline(LNG->EditHeader); - _tag = EditHeaderinfo(mode, *HeaderView, doedithdr); + _tag = EditHeaderinfo(mode, *HeaderView, make_bool(doedithdr)); if((_tag == W_ESCPRESS) or gkbd.quitall) break; diff --git a/golded3/gemsgs.cpp b/golded3/gemsgs.cpp index a2413d8..3dc87e6 100644 --- a/golded3/gemsgs.cpp +++ b/golded3/gemsgs.cpp @@ -39,7 +39,6 @@ static bool tokenxchg(char*& dst, char* tok, const char* src, int len = 0, int c uint toklen = strlen(tok); char buf[100]; - bool use; if(*dst != *tok) return false; @@ -59,7 +58,7 @@ static bool tokenxchg(char*& dst, char* tok, const char* src, int len = 0, int c va_list a; va_start(a, cnt); for(int i = 0; i < cnt; i ++) { - use = va_arg(a, int); + bool use = make_bool(va_arg(a, int)); if(dst[toklen] == '{') { char *p = strchr(dst+toklen, '}'); if(p) { @@ -123,8 +122,8 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea) strftimei(odtime, 80, LNG->DateTimeFmt, written_tm); const char* origareaid = AL.AreaIdToPtr(__origarea)->echoid(); - bool origareaisinet = AL.AreaIdToPtr(__origarea)->isinternet(); - bool currareaisinet = AA->isinternet(); + bool origareaisinet = make_bool(AL.AreaIdToPtr(__origarea)->isinternet()); + bool currareaisinet = make_bool(AA->isinternet()); char* modereptr = oldmsg->re; char msgno[16]; diff --git a/golded3/genode.cpp b/golded3/genode.cpp index 8be3671..1165f49 100644 --- a/golded3/genode.cpp +++ b/golded3/genode.cpp @@ -1038,7 +1038,7 @@ void Lookup(GMsg* msg, Addr* addr, char* name, int topline, char* status) { if(not found or (topline < 0)) { strcpy(buf, information); update_statusline(status); - found = browse_nodelist(msg, tmpname, abs(topline)); + found = make_bool(browse_nodelist(msg, tmpname, abs(topline))); update_statusline(buf); } } diff --git a/golded3/gepost.cpp b/golded3/gepost.cpp index 2e734a9..1d61f56 100644 --- a/golded3/gepost.cpp +++ b/golded3/gepost.cpp @@ -617,9 +617,9 @@ static void MakeMsg2(int& mode, int& status, int& forwstat, int& topline, GMsg* LoadText(msg, AddPath(CFG->goldpath, EDIT->File())); if(mode == MODE_FORWARD) msg->attr.pos1(); - int adat_viewhidden = AA->Viewhidden(); - int adat_viewkludge = AA->Viewkludge(); - int adat_viewquote = AA->Viewquote(); + bool adat_viewhidden = AA->Viewhidden(); + bool adat_viewkludge = AA->Viewkludge(); + bool adat_viewquote = AA->Viewquote(); bool adat_striphtml = AA->StripHTML(); AA->adat->viewhidden = true; AA->adat->viewkludge = true; @@ -752,9 +752,9 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) { post_xparea.pop_back(); } - int status = MODE_SAVE; - int hardlines = EDIT->HardLines(); - int topline = 0; + int status = MODE_SAVE; + bool hardlines = EDIT->HardLines(); + int topline = 0; fspecs = specfiles = 0; fspec = (FileSpec*)throw_realloc(fspec, sizeof(FileSpec)); memset(fspec, 0, sizeof(FileSpec)); diff --git a/golded3/geread2.cpp b/golded3/geread2.cpp index 154d9aa..ffb586c 100644 --- a/golded3/geread2.cpp +++ b/golded3/geread2.cpp @@ -587,7 +587,7 @@ int ExternUtil(GMsg *msg, ExtUtil *extutil) { } } - int hardlines = EDIT->HardLines(); + bool hardlines = EDIT->HardLines(); EDIT->HardLines(false); LoadText(msg, editorfile); EDIT->HardLines(hardlines); diff --git a/golded3/gescan.cpp b/golded3/gescan.cpp index d26d94e..8b128c9 100644 --- a/golded3/gescan.cpp +++ b/golded3/gescan.cpp @@ -44,11 +44,11 @@ void Area::UpdateAreadata() { unread = _unread; isvalidchg = true; } - isunreadchg = (bool)(unread != _unread); + isunreadchg = (unread != _unread); unread = _unread; word oldmask = AL.mask; AL.mask = 0; - set_marked(_unread); + set_marked(make_bool(_unread)); AL.mask = oldmask; } } diff --git a/golded3/gesrch.cpp b/golded3/gesrch.cpp index 37f4ce6..b54a9f1 100644 --- a/golded3/gesrch.cpp +++ b/golded3/gesrch.cpp @@ -359,7 +359,7 @@ bool golded_search_manager::search(GMsg* msg, bool quick, bool shortcircuit) { logic.push_operator(geval::logic_or); } } - return (bool)logic.evaluate(); + return make_bool(logic.evaluate()); } } diff --git a/golded3/getpls.cpp b/golded3/getpls.cpp index 4e57334..68c299d 100644 --- a/golded3/getpls.cpp +++ b/golded3/getpls.cpp @@ -1062,9 +1062,9 @@ void OtherAreaReplyMsg() { destarea = AreaPick(LNG->ReplyArea, 6, &destarea); } if(destarea != -1) { - int adat_viewhidden = AA->Viewhidden(); - int adat_viewkludge = AA->Viewkludge(); - int adat_viewquote = AA->Viewquote(); + bool adat_viewhidden = AA->Viewhidden(); + bool adat_viewkludge = AA->Viewkludge(); + bool adat_viewquote = AA->Viewquote(); AL.SetActiveAreaId(destarea); if(CurrArea != OrigArea) { AA->Open(); @@ -1218,9 +1218,9 @@ void OtherAreaQuoteMsg(bool ignore_replyto) { destarea = AreaPick(LNG->ReplyArea, 6, &destarea); } if(destarea != -1) { - int adat_viewhidden = AA->Viewhidden(); - int adat_viewkludge = AA->Viewkludge(); - int adat_viewquote = AA->Viewquote(); + bool adat_viewhidden = AA->Viewhidden(); + bool adat_viewkludge = AA->Viewkludge(); + bool adat_viewquote = AA->Viewquote(); AL.SetActiveAreaId(destarea); if(CurrArea != OrigArea) { AA->Open(); @@ -1268,9 +1268,9 @@ void OtherAreaCommentMsg() { destarea = AreaPick(LNG->ReplyArea, 6, &destarea); } if(destarea != -1) { - int adat_viewhidden = AA->Viewhidden(); - int adat_viewkludge = AA->Viewkludge(); - int adat_viewquote = AA->Viewquote(); + bool adat_viewhidden = AA->Viewhidden(); + bool adat_viewkludge = AA->Viewkludge(); + bool adat_viewquote = AA->Viewquote(); AL.SetActiveAreaId(destarea); if(CurrArea != OrigArea) { AA->Open(); diff --git a/golded3/gmarea.h b/golded3/gmarea.h index 67f8049..59205a7 100644 --- a/golded3/gmarea.h +++ b/golded3/gmarea.h @@ -97,11 +97,11 @@ public: char* By() { return *realby ? realby : by; } char* To() { return *realto ? realto : to; } - bool to_me() { return (you_and_I & TO_ME); } - bool to_all() { return (you_and_I & TO_ALL); } - bool by_me() { return (you_and_I & BY_ME); } - bool to_you() { return (you_and_I & TO_YOU); } - bool by_you() { return (you_and_I & BY_YOU); } + bool to_me() { return make_bool(you_and_I & TO_ME ); } + bool to_all() { return make_bool(you_and_I & TO_ALL); } + bool by_me() { return make_bool(you_and_I & BY_ME ); } + bool to_you() { return make_bool(you_and_I & TO_YOU); } + bool by_you() { return make_bool(you_and_I & BY_YOU); } void TextToLines(int __line_width, bool getvalue = true, bool header_recode = true); void LinesToText(); @@ -389,7 +389,7 @@ public: bool get_findfirst() { return findfirst; } uint get_findtype() { return findtype; } - bool isopen() { return area->isopen; } + bool isopen() { return make_bool(area->isopen); } bool isunreadchg : 1; // TRUE if unread was changed since last scan bool isreadmark : 1; // TRUE if in read marked mode diff --git a/goldlib/gall/gdefs.h b/goldlib/gall/gdefs.h index 29dc65c..127226b 100644 --- a/goldlib/gall/gdefs.h +++ b/goldlib/gall/gdefs.h @@ -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 inline int compare_two(T a, T b) { return a < b ? -1 : a template inline T minimum_of_two(T a, T b) { return (a < b) ? a : b; } template inline T maximum_of_two(T a, T b) { return (a > b) ? a : b; } template inline int zero_or_one(T e) { return e ? 1 : 0; } -template inline bool make_bool(T a) { return a ? true : false; } +template inline bool make_bool(T a) { return a != 0; } // ------------------------------------------------------------------ diff --git a/goldlib/gall/gfilutil.h b/goldlib/gall/gfilutil.h index 7ccfcce..ca9cc98 100644 --- a/goldlib/gall/gfilutil.h +++ b/goldlib/gall/gfilutil.h @@ -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 diff --git a/goldlib/gcfg/gs_im175.h b/goldlib/gcfg/gs_im175.h index df8263c..86571bd 100644 --- a/goldlib/gcfg/gs_im175.h +++ b/goldlib/gcfg/gs_im175.h @@ -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 */ diff --git a/goldlib/gcfg/gs_ts.h b/goldlib/gcfg/gs_ts.h index 209ba9d..80fbaee 100644 --- a/goldlib/gcfg/gs_ts.h +++ b/goldlib/gcfg/gs_ts.h @@ -48,11 +48,6 @@ // ------------------------------------------------------------------ -// ------------------------------------------------------------------ - -typedef byte bit; - - // ------------------------------------------------------------------ // Structure of the records diff --git a/goldlib/gmb3/gmoarea.h b/goldlib/gmb3/gmoarea.h index 233dbf4..c0594eb 100644 --- a/goldlib/gmb3/gmoarea.h +++ b/goldlib/gmb3/gmoarea.h @@ -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; }