diff --git a/docs/notework.txt b/docs/notework.txt index f166503..b5d7384 100644 --- a/docs/notework.txt +++ b/docs/notework.txt @@ -12,6 +12,8 @@ ______________________________________________________________________ Notes for GoldED+ 1.1.5, April xx 2001 ______________________________________________________________________ +- Fixed Y2K bug in WildCat! and PCBoard bases. + - Fixed cursor position in XlatImport menu when Auto encoding selected. @@ -171,6 +173,7 @@ ______________________________________________________________________ @cdtime current time in MS_DateTimeFmt format @fpgp either e-mail or name from "From" field @dpgp either e-mail or name from "To" field + @osver operation system version - Fixed bug in expanding fixed lenght macroses. diff --git a/docs/todowork.txt b/docs/todowork.txt index 71ab897..9334e73 100644 --- a/docs/todowork.txt +++ b/docs/todowork.txt @@ -21,7 +21,7 @@ To do: * Try to save position in message after printing, changing xlat table, etc. * Major xlat/recode engine update (in progress). -* CUI in /lnx and input prompts. +* CUI in input prompts. * Activating built-in MIME-QP convertor by key (on whole message). * Postpone. * Highlight up to 3 groups of users by different color. @@ -43,8 +43,6 @@ ______________________________________________________________________ To fix: * UUdecoder not 100% reliable: any volunteers for uulib maintaining? -* Adding e-mail's to addressbook from UUCP gated messages. -* QUOTEHARDTERM is always NO. * Need some workarounds on -install feature under Linux (UNIX). * Win32 (only when runned under Win9x) version does not support case insensitive search of regexp's for high part of ASCII table. That's @@ -55,7 +53,6 @@ ______________________________________________________________________ Known wishes that not currently planned (any volunteers?): -* FREQ catcher (not 100% reliable detects files) * Interactive Twit-list edition. * Pass areaname, message number, etc. to external utility. * Hide empty areas / areas without new messages from arealist. diff --git a/golded3/gcalst.cpp b/golded3/gcalst.cpp index 8c5d286..ade2bbd 100644 --- a/golded3/gcalst.cpp +++ b/golded3/gcalst.cpp @@ -34,7 +34,7 @@ #ifndef GMB_NOEZY #include #endif -#if not defined(GMB_NOHUDS) and not defined(GMB_NOGOLD) +#if !defined(GMB_NOHUDS) && !defined(GMB_NOGOLD) #include #endif #ifndef GMB_NOJAM diff --git a/golded3/gcarea.cpp b/golded3/gcarea.cpp index e704c57..dd83968 100644 --- a/golded3/gcarea.cpp +++ b/golded3/gcarea.cpp @@ -207,7 +207,7 @@ void AreaList::AddNewArea(AreaCfg* aa) { #endif #ifndef GMB_NOXBBS case MT_ADEPTXBBS: - #if not defined(__OS2__) + #if !defined(__OS2__) return; #else if(*aa->path == NUL) @@ -224,7 +224,7 @@ void AreaList::AddNewArea(AreaCfg* aa) { #ifndef GMB_NOJAM case MT_JAM: #endif - #if not defined(GMB_NOJAM) or not defined(GMB_NOSQSH) + #if !defined(GMB_NOJAM) || !defined(GMB_NOSQSH) if(*aa->path == NUL) return; MapPath(aa->path); diff --git a/golded3/gckeys.cpp b/golded3/gckeys.cpp index 41ade68..d74a62a 100644 --- a/golded3/gckeys.cpp +++ b/golded3/gckeys.cpp @@ -127,7 +127,7 @@ CmdKey DefaultKeyset[] = { { Key_C_U , KK_EditUnDelete , KT_E }, { Key_A_BS , KK_EditUndo , KT_E }, { Key_A_Z , KK_EditZapQuoteBelow , KT_E }, -#if not defined(__UNIX__) or defined(__USE_NCURSES__) +#if !defined(__UNIX__) || defined(__USE_NCURSES__) { Key_C_Ins , KK_EditCopy , KT_E }, { Key_S_Del , KK_EditCut , KT_E }, { Key_C_Del , KK_EditDelete , KT_E }, @@ -366,7 +366,7 @@ tglobalkey globalkeys[] = { { CRC_HEADERTOGGLESCANNED , KK_HeaderToggleScanned , KT_H }, // 0x0459 { CRC_READTOGGLEHIDDEN , KK_ReadToggleHidden , KT_R }, // 0x04CE { CRC_EDITIMPORTTEXT , KK_EditImportText , KT_E }, // 0x0586 -#if not defined(__UNIX__) or defined(__USE_NCURSES__) +#if !defined(__UNIX__) || defined(__USE_NCURSES__) { CRC_K_SEND , Key_S_End , 0 }, // 0x0590 #endif { CRC_READGOTOPREVMSG , KK_ReadGotoPrevMsg , KT_R }, // 0x06D9 @@ -413,7 +413,7 @@ tglobalkey globalkeys[] = { { CRC_AREAABORT , KK_AreaAbort , KT_A }, // 0x1E02 { CRC_READTOGGLEMARK , KK_ReadToggleMark , KT_R }, // 0x1E64 { CRC_READFIDORENUMBER , KK_ReadFidoRenumber , KT_R }, // 0x1E7C -#if not defined(__UNIX__) or defined(__USE_NCURSES__) +#if !defined(__UNIX__) || defined(__USE_NCURSES__) { CRC_K_SDEL , Key_S_Del , 0 }, // 0x1EB9 #endif { CRC_EDITCOPY , KK_EditCopy , KT_E }, // 0x1F77 @@ -491,7 +491,7 @@ tglobalkey globalkeys[] = { { CRC_K_AZ , Key_A_Z , 0 }, // 0x405A { CRC_K_ADEL , Key_A_Del , 0 }, // 0x40C0 { CRC_NODEMACRO , KK_NodeMacro , KT_N }, // 0x4129 -#if not defined(__UNIX__) or defined(__USE_NCURSES__) +#if !defined(__UNIX__) || defined(__USE_NCURSES__) { CRC_K_SUP , Key_S_Up , 0 }, // 0x4151 #endif { CRC_AREAGOTOFIRST , KK_AreaGotoFirst , KT_A }, // 0x41CB @@ -552,7 +552,7 @@ tglobalkey globalkeys[] = { { CRC_EDITEXPORTTEXT , KK_EditExportText , KT_E }, // 0x5AED { CRC_EDITLOOKUPORIG , KK_EditLookupOrig , KT_E }, // 0x5AFB { CRC_AREAHEAT , KK_AreaHeat , KT_A }, // 0x5B15 -#if not defined(__UNIX__) or defined(__USE_NCURSES__) +#if !defined(__UNIX__) || defined(__USE_NCURSES__) { CRC_K_SRIGHT , Key_S_Rgt , 0 }, // 0x5B1F #endif { CRC_READGOTONEXTAREA , KK_ReadGotoNextArea , KT_R }, // 0x5B23 @@ -709,12 +709,12 @@ tglobalkey globalkeys[] = { { CRC_READQUITNOW , KK_ReadQuitNow , KT_R }, // 0xAC15 { CRC_HEADERTOGGLEUPDREQ , KK_HeaderToggleUpdreq , KT_H }, // 0xAC35 { CRC_EDITDELLINE , KK_EditDelLine , KT_E }, // 0xACCF -#if not defined(__UNIX__) or defined(__USE_NCURSES__) +#if !defined(__UNIX__) || defined(__USE_NCURSES__) { CRC_K_SPGDN , Key_S_PgDn , 0 }, // 0xAD44 #endif { CRC_READSOUNDKILL , KK_ReadSoundkill , KT_R }, // 0xAE29 { CRC_LISTUNDEFINE , KK_ListUndefine , KT_M }, // 0xAF86 -#if not defined(__UNIX__) or defined(__USE_NCURSES__) +#if !defined(__UNIX__) || defined(__USE_NCURSES__) { CRC_K_SHOME , Key_S_Home , 0 }, // 0xAF9D #endif { CRC_READTOGGLEQUOTE , KK_ReadToggleQuote , KT_R }, // 0xB293 @@ -728,7 +728,7 @@ tglobalkey globalkeys[] = { { CRC_K_CINS , Key_C_Ins , 0 }, // 0xBA0E { CRC_READGOTONEXTUNREAD , KK_ReadGotoNextUnread , KT_R }, // 0xBA34 { CRC_READADDRESSBOOK , KK_ReadAddressbook , KT_R }, // 0xBAC1 -#if not defined(__UNIX__) or defined(__USE_NCURSES__) +#if !defined(__UNIX__) || defined(__USE_NCURSES__) { CRC_K_SPGUP , Key_S_PgUp , 0 }, // 0xBC5A #endif { CRC_FILEABORT , KK_FileAbort , KT_F }, // 0xBCED @@ -742,13 +742,13 @@ tglobalkey globalkeys[] = { { CRC_READTOGGLEROT13 , KK_ReadToggleROT13 , KT_R }, // 0xC157 { CRC_EDITTOGGLECASE , KK_EditToggleCase , KT_E }, // 0xC282 { CRC_FILEGOTOLAST , KK_FileGotoLast , KT_F }, // 0xC40A -#if not defined(__UNIX__) or defined(__USE_NCURSES__) +#if !defined(__UNIX__) || defined(__USE_NCURSES__) { CRC_K_SINS , Key_S_Ins , 0 }, // 0xC40B #endif { CRC_AREASCANPM , KK_AreaScanPM , KT_A }, // 0xC4FF { CRC_READMSGEND , KK_ReadMsgEnd , KT_R }, // 0xC5AD { CRC_AREATOGGLE , KK_AreaToggle , KT_A }, // 0xC734 -#if not defined(__UNIX__) or defined(__USE_NCURSES__) +#if !defined(__UNIX__) || defined(__USE_NCURSES__) { CRC_K_SLEFT , Key_S_Lft , 0 }, // 0xC902 #endif { CRC_HEADERTOGGLEORPHAN , KK_HeaderToggleOrphan , KT_H }, // 0xC98A @@ -805,7 +805,7 @@ tglobalkey globalkeys[] = { { CRC_READGOTOPREVAREA , KK_ReadGotoPrevArea , KT_R }, // 0xEECB { CRC_READFINDALL , KK_ReadFindAll , KT_R }, // 0xEF19 { CRC_NODEDOSSHELL , KK_NodeDosShell , KT_N }, // 0xF084 -#if not defined(__UNIX__) or defined(__USE_NCURSES__) +#if !defined(__UNIX__) || defined(__USE_NCURSES__) { CRC_K_SDOWN , Key_S_Dwn , 0 }, // 0xF0FB #endif { CRC_READCHANGEXLATIMPORT , KK_ReadChangeXlatImport , KT_R }, // 0xF169 diff --git a/golded3/gckeys.h b/golded3/gckeys.h index 2d179ca..ea64b74 100644 --- a/golded3/gckeys.h +++ b/golded3/gckeys.h @@ -510,7 +510,7 @@ const word CRC_K_SPACE = 0x1281; const word CRC_KK_MACRO = 0x4BE9; const word CRC_KK_AUTO = 0x60E2; -#if not defined(__UNIX__) or defined(__USE_NCURSES__) +#if !defined(__UNIX__) || defined(__USE_NCURSES__) const word CRC_K_SINS = 0xC40B; const word CRC_K_SDEL = 0x1EB9; const word CRC_K_SHOME = 0xAF9D; diff --git a/golded3/gcmisc.cpp b/golded3/gcmisc.cpp index 493e90f..6f030db 100644 --- a/golded3/gcmisc.cpp +++ b/golded3/gcmisc.cpp @@ -317,7 +317,7 @@ int MakeColor(char* colors) { char* ink_; char* paper_; - #if defined(__UNIX__) or defined(__USE_NCURSES__) + #if defined(__UNIX__) || defined(__USE_NCURSES__) blink = 0; #else blink = (stridela("blinking", colors) ? 128 : 0); diff --git a/golded3/geall.h b/golded3/geall.h index fa23be6..366f1c2 100644 --- a/golded3/geall.h +++ b/golded3/geall.h @@ -551,7 +551,6 @@ struct MLst { time_t arrived; time_t received; char goldmark; - bool initialized; }; diff --git a/golded3/gecmfd.cpp b/golded3/gecmfd.cpp index 5d87b3e..65ccd2e 100644 --- a/golded3/gecmfd.cpp +++ b/golded3/gecmfd.cpp @@ -120,7 +120,7 @@ void Area::DeleteMsg(GMsg* msg, int direction) { if(isnet() and isfido()) TouchNetscan(false); - if(not issmb() and not (isjam() and not CFG->switches.get(jamharddelete))) { + if(not issmb() and not iswildcat() and not (isjam() and not CFG->switches.get(jamharddelete))) { // Remove message from internal table Msgn.Del(msg->msgno); } diff --git a/golded3/gedoss.cpp b/golded3/gedoss.cpp index d8345f7..291fcde 100644 --- a/golded3/gedoss.cpp +++ b/golded3/gedoss.cpp @@ -143,7 +143,7 @@ void Cleanup(void) { freonkey(); // Free all onkeys (macros) FreePastebuf(); // Free the internal editor cut'n'paste buffer - #if not defined(__UNIX__) and not defined(__USE_NCURSES__) + #if !defined(__UNIX__) && !defined(__USE_NCURSES__) if(CFG->screenpalette[16]) gvid->setpalette(gvid->orig.color.palette); @@ -286,13 +286,11 @@ int ShellToDos(char* command, char* message, int cls, int cursor, int pause) { if(CFG->screenpalette[16]) gvid->setpalette(gvid->orig.color.palette); - #if defined(__UNIX__) and not defined(__USE_NCURSES__) - gkbd_tty_reset(); - #endif - - #ifdef __USE_NCURSES__ + #if defined(__USE_NCURSES__) def_prog_mode(); reset_shell_mode(); + #elif defined(__UNIX__) + gkbd_tty_reset(); #endif // Write message on screen diff --git a/golded3/gefile.cpp b/golded3/gefile.cpp index b72792e..58e8972 100644 --- a/golded3/gefile.cpp +++ b/golded3/gefile.cpp @@ -528,7 +528,7 @@ void CreateFileMsgs(int mode, GMsg* msg) { ); } sprintf(subj, "%s%s%s%s%s ", fspec[x].delsent ? "^" : "", fspec[x].path, fspec[x].fblk ? (fspec[x].fblk[m].name ? fspec[x].fblk[m].name : "") : "", *fspec[x].password ? " " : "", fspec[x].password); -#if not defined(__UNIX__) +#if !defined(__UNIX__) strupr(subj); #endif diff --git a/golded3/gehdre.cpp b/golded3/gehdre.cpp index bea7fbb..fa81ebe 100644 --- a/golded3/gehdre.cpp +++ b/golded3/gehdre.cpp @@ -429,7 +429,7 @@ int EditHeaderinfo(int mode, GMsgHeaderView &view) { vcurshow(); if(not (hedit.lookup or AA->isnet())) { - char date2[25] = {""}; + char date2[25] = ""; strsetsz(date2, view.width - CFG->disphdrdateset.pos); view.window.prints(3, CFG->disphdrdateset.pos, view.to_color, date2); } diff --git a/golded3/geinit.cpp b/golded3/geinit.cpp index 8e7ac68..a6e150c 100644 --- a/golded3/geinit.cpp +++ b/golded3/geinit.cpp @@ -565,7 +565,7 @@ void Initialize(int argc, char* argv[]) { "-M Mute sounds. Disables all noises in GoldED+." << endl << "-N Disable share-compatible file opens during startup." << endl << "-NOSCAN Temporarily disable area scan during startup." << endl << - #if defined(GUTLOS_FUNCS) and not defined(__MSDOS__) + #if defined(GUTLOS_FUNCS) && !defined(__MSDOS__) "-P Increase program priority to run faster." << endl << #endif "-S Sorts all mail areas according to the sort specs." << endl << diff --git a/golded3/gemlst.cpp b/golded3/gemlst.cpp index 588936c..53fa3fd 100644 --- a/golded3/gemlst.cpp +++ b/golded3/gemlst.cpp @@ -71,7 +71,7 @@ class GMsgList : public gwinpick { gwindow window; GMsg msg; - vector mlst; + MLst **mlst; uint msgmark2; void open(); // Called after window is opened @@ -86,8 +86,19 @@ public: void Run(); - GMsgList() { memset(&msg, 0, sizeof(GMsg)); }; - ~GMsgList() { ResetMsg(&msg); }; + GMsgList() { + memset(&msg, 0, sizeof(GMsg)); + mlst = NULL; + maximum_index = AA->Msgn.Count()-1; + }; + ~GMsgList() { + ResetMsg(&msg); + if(mlst) { + for(uint i=0; i<= maximum_index; i++) + throw_xdelete(mlst[i]); + throw_free(mlst); + } + }; }; @@ -113,11 +124,14 @@ void GMsgList::close() { void GMsgList::ReadMlst(int n) { - MLst* ml = &mlst[n]; + MLst* ml = mlst[n]; - if(ml->initialized) + if(ml != NULL) return; + ml = mlst[n] = new MLst; + throw_new(ml); + ml->high = 0; strcpy(ml->marks, " "); @@ -164,11 +178,11 @@ void GMsgList::ReadMlst(int n) { ml->high |= MLST_HIGH_FROM; // Highlight if unread - if(msg.timesread == 0 and CFG->switches.get(highlightunread)) + if((msg.timesread == 0) and CFG->switches.get(highlightunread)) ml->high |= MLST_HIGH_UNREAD; // Highlight if unsent - if(msg.attr.uns()and not msg.attr.rcv() and not msg.attr.del()) + if(msg.attr.uns() and not msg.attr.rcv() and not msg.attr.del()) ml->high |= MLST_HIGH_UNSENT; ml->written = msg.written; @@ -187,8 +201,8 @@ void GMsgList::do_delayed() { // Update header and statusline if(AA->Msglistheader()) { ReadMlst(index); - AA->LoadMsg(&msg, mlst[index].msgno, CFG->dispmargin-(int)CFG->switches.get(disppagebar)); - mlst[index].goldmark = goldmark; + AA->LoadMsg(&msg, mlst[index]->msgno, CFG->dispmargin-(int)CFG->switches.get(disppagebar)); + mlst[index]->goldmark = goldmark; int mlstwh = whandle(); HeaderView->Use(AA, &msg); HeaderView->Paint(); @@ -197,7 +211,7 @@ void GMsgList::do_delayed() { if(CFG->switches.get(msglistviewsubj)) { ReadMlst(index); - wtitle(mlst[index].re, TCENTER|TBOTTOM, tattr); + wtitle(mlst[index]->re, TCENTER|TBOTTOM, tattr); } if(CFG->switches.get(msglistpagebar)) @@ -243,7 +257,7 @@ void GMsgList::print_line(uint idx, uint pos, bool isbar) { int resiz = mlst_resiz + fldadd2; ReadMlst(idx); - MLst* ml = &mlst[idx]; + MLst* ml = mlst[idx]; int wattr_, hattr_, mattr_; if(isbar) { @@ -379,12 +393,12 @@ bool GMsgList::handle_key() { case KK_ListToggleMark: { - ulong temp = AA->Mark.Find(mlst[index].msgno); + ulong temp = AA->Mark.Find(mlst[index]->msgno); if(temp) { AA->Mark.DelReln(temp); } else { - AA->Mark.Add(mlst[index].msgno); + AA->Mark.Add(mlst[index]->msgno); } } if(index < maximum_index) @@ -394,24 +408,24 @@ bool GMsgList::handle_key() { break; case KK_ListToggleBookMark: - if(AA->bookmark == mlst[index].msgno) { - mlst[index].marks[0] = ' '; + if(AA->bookmark == mlst[index]->msgno) { + mlst[index]->marks[0] = ' '; AA->bookmark = 0; - mlst[index].high &= ~MLST_HIGH_BOOK; + mlst[index]->high &= ~MLST_HIGH_BOOK; display_bar(); } else { long prevbm = AA->Msgn.ToReln(AA->bookmark-1); long newbm = index; - AA->bookmark = mlst[index].msgno; - mlst[index].marks[0] = MMRK_BOOK; - mlst[index].high |= MLST_HIGH_BOOK; + AA->bookmark = mlst[index]->msgno; + mlst[index]->marks[0] = MMRK_BOOK; + mlst[index]->high |= MLST_HIGH_BOOK; display_bar(); if(prevbm) { if(in_range((long)position + prevbm - newbm, 0l, (long)maximum_position)) { ReadMlst(prevbm); - mlst[prevbm].marks[0] = ' '; - mlst[prevbm].high &= ~MLST_HIGH_BOOK; + mlst[prevbm]->marks[0] = ' '; + mlst[prevbm]->high &= ~MLST_HIGH_BOOK; index = prevbm; position += prevbm - newbm; display_line(); @@ -427,16 +441,16 @@ bool GMsgList::handle_key() { long prevbm = AA->Msgn.ToReln(AA->bookmark-1); long newbm = index; index = prevbm; - AA->bookmark = mlst[newbm].msgno; + AA->bookmark = mlst[newbm]->msgno; if(in_range((long)position + prevbm - newbm, 0l, (long)maximum_position)) { - mlst[newbm].marks[0] = MMRK_BOOK; - mlst[newbm].high |= MLST_HIGH_BOOK; + mlst[newbm]->marks[0] = MMRK_BOOK; + mlst[newbm]->high |= MLST_HIGH_BOOK; index = newbm; display_line(); index = prevbm; ReadMlst(index); - mlst[index].marks[0] = ' '; - mlst[index].high &= ~MLST_HIGH_BOOK; + mlst[index]->marks[0] = ' '; + mlst[index]->high &= ~MLST_HIGH_BOOK; position += prevbm - newbm; display_bar(); } @@ -506,6 +520,15 @@ bool GMsgList::handle_key() { void GMsgList::Run() { + if(maximum_index == 0) { + aborted = true; + return; + } + + index = AA->Msgn.ToReln(reader_msg->msgno)-1; + minimum_index = 0; + msgmark2 = AA->Msgn.ToReln(AA->bookmark); + ypos = AA->Msglistheader() ? 6 : 1; // Window Starting Row xpos = 0; // Window Starting Column ylen = MAXROW-3-ypos; // Window Height @@ -521,11 +544,6 @@ void GMsgList::Run() { helpcat = H_MessageBrowser; // Window Help Category listwrap = CFG->switches.get(displistwrap); - index = AA->Msgn.ToReln(reader_msg->msgno)-1; - minimum_index = 0; - maximum_index = AA->Msgn.Count()-1; - msgmark2 = AA->Msgn.ToReln(AA->bookmark); - if(AA->Msglistdate() != MSGLISTDATE_NONE) { if(AA->Msglistdate() != MSGLISTDATE_WRITTEN) { if(AA->ishudson() or AA->isgoldbase() or AA->ispcboard()) @@ -540,23 +558,18 @@ void GMsgList::Run() { fldadd1 = (MAXCOL-80)/3; fldadd2 = (MAXCOL-80) - (fldadd1*2); - mlst.clear(); + mlst = (MLst **)throw_malloc(sizeof(MLst *) * (maximum_index + 1)); - MLst dummy_mlst; - dummy_mlst.initialized = false; for(uint i=0; i<= maximum_index; i++) - mlst.push_back(dummy_mlst); + mlst[i] = NULL; maximum_position = MinV((uint)maximum_index, (uint)ylen - 1); - if(mlst.size() != 0) - run_picker(); - else - aborted = true; + run_picker(); if(not aborted) { ReadMlst(index); - AA->set_lastread(AA->Msgn.ToReln(mlst[index].msgno)); + AA->set_lastread(AA->Msgn.ToReln(mlst[index]->msgno)); } } @@ -766,7 +779,7 @@ void GThreadlist::print_line(uint idx, uint pos, bool isbar) { GenTree(buf2, idx); - #if defined(__UNIX__) and not defined(__USE_NCURSES__) + #if defined(__UNIX__) && !defined(__USE_NCURSES__) gvid_boxcvt(buf2); #endif diff --git a/golded3/gemsgs.cpp b/golded3/gemsgs.cpp index 801717c..ed86dd7 100644 --- a/golded3/gemsgs.cpp +++ b/golded3/gemsgs.cpp @@ -100,6 +100,7 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea) MakeAttrStr(attr, sizeof(attr), &msg->attr); const char *xmailer = get_informative_string(); + const char *osver = ggetosstring(); time_t t = time(NULL); struct tm* written_tm = localtime(&t); @@ -364,6 +365,8 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea) continue; if(tokenxchg(dst, "@widepid", xmailer)) continue; + if(tokenxchg(dst, "@osver", osver)) + continue; if(tokenxchg(dst, "@osslash", __gver_platform__)) continue; if(tokenxchg(dst, "@subject", modereptr)) diff --git a/golded3/golded3.cpp b/golded3/golded3.cpp index af6b004..2094150 100644 --- a/golded3/golded3.cpp +++ b/golded3/golded3.cpp @@ -106,7 +106,7 @@ const char* __gver_shortver__ = __GVER_SVER__(__GVER_MAJOR__,__GVER_MINOR__,__GV #define __GVER_SHORTPLATFORM__ "LNX" #define __GVER_SHORTLOGNAME__ "L" #define __GVER_CFGEXT__ ".gel" -#elif defined(__FreeBSD__) or defined(__OpenBSD__) +#elif defined(__FreeBSD__) || defined(__OpenBSD__) #define __GVER_PLATFORM__ "/BSD" #define __GVER_SHORTPLATFORM__ "BSD" #define __GVER_SHORTLOGNAME__ "B" diff --git a/goldlib/gall/gdefs.h b/goldlib/gall/gdefs.h index ddbcdd6..c004de6 100644 --- a/goldlib/gall/gdefs.h +++ b/goldlib/gall/gdefs.h @@ -154,12 +154,6 @@ template inline bool make_bool(T a) { return a ? true : fal // ------------------------------------------------------------------ // Legacy defines -#ifndef AND -#define NOT ! -#define AND && -#define OR || -#endif - #define RngV in_range #define AbsV absolute #define CmpV compare_two diff --git a/goldlib/gall/gfilport.cpp b/goldlib/gall/gfilport.cpp index 8bc5aad..721c805 100644 --- a/goldlib/gall/gfilport.cpp +++ b/goldlib/gall/gfilport.cpp @@ -55,7 +55,7 @@ extern "C" { // ------------------------------------------------------------------ -#if (defined(__BORLANDC__) and defined(__OS2__)) or defined(__UNIX__) or defined(__EMX__) +#if (defined(__BORLANDC__) && defined(__OS2__)) || defined(__UNIX__) || defined(__EMX__) long filelength(int handle) { @@ -133,7 +133,7 @@ int unlock(int handle, long ofs, long length) // ------------------------------------------------------------------ -#if defined(__UNIX__) or defined(__CYGWIN__) +#if defined(__UNIX__) || defined(__CYGWIN__) int lock(int handle, long offset, long length) { @@ -151,7 +151,7 @@ int lock(int handle, long offset, long length) { // ------------------------------------------------------------------ -#if defined(__UNIX__) or defined(__CYGWIN__) +#if defined(__UNIX__) || defined(__CYGWIN__) int unlock(int handle, long offset, long length) { @@ -169,7 +169,7 @@ int unlock(int handle, long offset, long length) { // ------------------------------------------------------------------ -#if defined(__MINGW32__) or defined(_MSC_VER) +#if defined(__MINGW32__) || defined(_MSC_VER) int lock(int fh, long offs, long len) { @@ -182,7 +182,7 @@ int lock(int fh, long offs, long len) { // ------------------------------------------------------------------ -#if defined(__MINGW32__) or defined(_MSC_VER) +#if defined(__MINGW32__) || defined(_MSC_VER) int unlock(int fh, long offs, long len) { diff --git a/goldlib/gall/gfilutil.h b/goldlib/gall/gfilutil.h index 830efe2..2bc2103 100644 --- a/goldlib/gall/gfilutil.h +++ b/goldlib/gall/gfilutil.h @@ -39,7 +39,7 @@ #include #include #include -#if not defined(__UNIX__) +#if !defined(__UNIX__) #include #endif @@ -83,7 +83,7 @@ // ------------------------------------------------------------------ // Misc. defines -#if defined(__MSDOS__) or defined(__OS2__) or defined(__WIN32__) +#if defined(__MSDOS__) || defined(__OS2__) || defined(__WIN32__) #define GOLD_SLASH_CHR '\\' // Backslash #define GOLD_SLASH_STR "\\" #define GOLD_WRONG_SLASH_CHR '/' // Fwrdslash @@ -119,11 +119,11 @@ struct Stamp { // ------------------------------------------------------------------ // Prototypes -#if not defined(__GNUC__) or defined(__MINGW32__) +#if !defined(__GNUC__) || defined(__MINGW32__) #define mkdir(path,unused) mkdir(path) #endif -#ifdef __EMX__ // untested !!! +#ifdef __EMX__ #define getcwd _getcwd2 #define chdir _chdir2 #endif @@ -190,7 +190,7 @@ extern "C" { // ------------------------------------------------------------------ -#if (defined(__BORLANDC__) and defined(__OS2__)) or defined(__UNIX__) or defined(__EMX__) +#if (defined(__BORLANDC__) && defined(__OS2__)) || defined(__UNIX__) || defined(__EMX__) long filelength(int fh); #endif @@ -215,13 +215,13 @@ int unlock(int handle, long offset, long length); #undef sopen #endif -#if not defined(__DJGPP__) and defined(__GNUC__) +#if !defined(__DJGPP__) && defined(__GNUC__) int lock(int handle, long offset, long length); int unlock(int handle, long offset, long length); inline long tell(int fh) { return lseek(fh, 0, SEEK_CUR); } #endif -#if not defined(__MINGW32__) and not defined(__EMX__) and defined(__GNUC__) +#if !defined(__MINGW32__) && !defined(__EMX__) && defined(__GNUC__) inline int eof(int h) { return tell(h) > filelength(h); @@ -236,7 +236,7 @@ inline int sopen(const char* path, int access, int shflag, int mode) { #endif -#if defined(__UNIX__) or defined(__CYGWIN__) +#if defined(__UNIX__) || defined(__CYGWIN__) inline int chsize(int handle, long size) { return ftruncate(handle, size); } #endif diff --git a/goldlib/gall/gfilutl1.cpp b/goldlib/gall/gfilutl1.cpp index d33a3ab..1b94189 100644 --- a/goldlib/gall/gfilutl1.cpp +++ b/goldlib/gall/gfilutl1.cpp @@ -94,7 +94,7 @@ long GetFilesize(const char* file) { dword gfixstattime(time_t st_time) { - #if defined(__MINGW32__) or defined(__CYGWIN__) + #if defined(__MINGW32__) || defined(__CYGWIN__) struct tm &f = *gmtime(&st_time); #else struct tm &f = *localtime(&st_time); @@ -106,7 +106,7 @@ dword gfixstattime(time_t st_time) { t.ft_hour = f.tm_hour; t.ft_min = f.tm_min; t.ft_tsec = f.tm_sec / 2; - #if defined(__MINGW32__) or defined(__CYGWIN__) + #if defined(__MINGW32__) || defined(__CYGWIN__) union { DWORD t; struct { diff --git a/goldlib/gall/gkbdbase.cpp b/goldlib/gall/gkbdbase.cpp index e72dc04..6cd8b05 100644 --- a/goldlib/gall/gkbdbase.cpp +++ b/goldlib/gall/gkbdbase.cpp @@ -43,7 +43,7 @@ #include #endif -#if defined(__UNIX__) and not defined(__USE_NCURSES__) +#if defined(__UNIX__) && !defined(__USE_NCURSES__) #include #endif @@ -78,7 +78,7 @@ int curses_initialized = 0; // ------------------------------------------------------------------ // Global keyboard data -#if defined(__WIN32__) and not defined(__USE_NCURSES__) +#if defined(__WIN32__) && !defined(__USE_NCURSES__) HANDLE gkbd_hin; DWORD gkbd_kbdmode; int gkbd_nt; @@ -171,13 +171,13 @@ GKbd::GKbd() { extkbd = _farpeekb (_dos_ds, 0x0496) & (1 << 4); #elif defined(__MSDOS__) extkbd = *((byte*)0x0496) & (1 << 4); - #elif defined(__OS2__) or defined(__WIN32__) + #elif defined(__OS2__) || defined(__WIN32__) extkbd = true; #endif Init(); - #if defined(__UNIX__) and not defined(__USE_NCURSES__) + #if defined(__UNIX__) && !defined(__USE_NCURSES__) gkbd_keymap_init(); @@ -908,7 +908,7 @@ bool is_numpad_key(const INPUT_RECORD& inp) { // ------------------------------------------------------------------ // Numpad translation table -#elif defined(__MSDOS__) or defined(__OS2__) +#elif defined(__MSDOS__) || defined(__OS2__) const word numpad_keys[] = { 0x4737, 0x4838, 0x4939, 0x0000, diff --git a/goldlib/gall/gkbdcode.h b/goldlib/gall/gkbdcode.h index 3bd24b6..545eb1e 100644 --- a/goldlib/gall/gkbdcode.h +++ b/goldlib/gall/gkbdcode.h @@ -221,7 +221,7 @@ #define Key_S_F11 0x8700 // S - - E - #define Key_S_F12 0x8800 // S - - E - #define Key_S_Tab 0x0F00 // S - - - - -#if not defined(__UNIX__) or defined(__USE_NCURSES__) +#if !defined(__UNIX__) || defined(__USE_NCURSES__) #define Key_S_Ins 0xD200 // S Grey - G E T #define Key_S_Lft 0xCB00 // S Grey - G E T #define Key_S_PgDn 0xD100 // S Grey - G E T diff --git a/goldlib/gall/gmemi86.h b/goldlib/gall/gmemi86.h index 060253c..4f8518d 100644 --- a/goldlib/gall/gmemi86.h +++ b/goldlib/gall/gmemi86.h @@ -172,7 +172,7 @@ inline void i86::genint(int intno) { } -#if defined(__WATCOMC__) and defined(__386__) +#if defined(__WATCOMC__) && defined(__386__) inline int __dpmi_allocate_dos_memory(long len, int &buf) { i86 cpu; @@ -203,7 +203,7 @@ inline void __dpmi_free_dos_memory(int buffer) { // ------------------------------------------------------------------ // A more portable version of MK_FP() -#if defined(__WATCOMC__) and defined(__386__) +#if defined(__WATCOMC__) && defined(__386__) #define gmkfp(s,o) ((s << 4) + o) diff --git a/goldlib/gall/gshare.h b/goldlib/gall/gshare.h index 268270e..9c96b3f 100644 --- a/goldlib/gall/gshare.h +++ b/goldlib/gall/gshare.h @@ -34,7 +34,7 @@ // ------------------------------------------------------------------ -#if not defined(__GNUC__) or defined(__DJGPP__) or defined(__EMX__) or defined(__MINGW32__) +#if !defined(__GNUC__) || defined(__DJGPP__) || defined(__EMX__) || defined(__MINGW32__) #include #if defined(__MINGW32__) // SH_COMPAT doesn't work in Mingw32 #undef SH_COMPAT diff --git a/goldlib/gall/gsnd.cpp b/goldlib/gall/gsnd.cpp index d3d0681..fca6714 100644 --- a/goldlib/gall/gsnd.cpp +++ b/goldlib/gall/gsnd.cpp @@ -51,7 +51,7 @@ gsnd::gsnd() { #if defined(__MSDOS__) mpx = -1; - #if (defined(__WATCOMC__) and defined(__386__)) or defined(__DJGPP__) + #if (defined(__WATCOMC__) && defined(__386__)) || defined(__DJGPP__) buffer = -1; #else buffer = NULL; @@ -98,7 +98,7 @@ int gsnd::call_api(uint al, uint bx) { void gsnd::free_buffer() { #if defined(__MSDOS__) - #if defined(__DJGPP__) or (defined(__WATCOMC__) and defined(__386__)) + #if defined(__DJGPP__) || (defined(__WATCOMC__) && defined(__386__)) if(buffer != -1) { __dpmi_free_dos_memory(buffer); buffer = -1; @@ -226,7 +226,7 @@ int gsnd::open(const char* file) { goto try_again; case 0x02: free_buffer(); - #if defined(__DJGPP__) or (defined(__WATCOMC__) and defined(__386__)) + #if defined(__DJGPP__) || (defined(__WATCOMC__) && defined(__386__)) int seg = __dpmi_allocate_dos_memory((data->buffer_length >> 4) + 1, &buffer); if(seg == -1) return -1; diff --git a/goldlib/gall/gsndall.h b/goldlib/gall/gsndall.h index c0c0da9..029a009 100644 --- a/goldlib/gall/gsndall.h +++ b/goldlib/gall/gsndall.h @@ -55,7 +55,7 @@ protected: #if defined(__MSDOS__) int mpx; - #if defined(__DJGPP__) or (defined(__WATCOMC__) and defined(__386__)) + #if defined(__DJGPP__) || (defined(__WATCOMC__) && defined(__386__)) int buffer; #else char* buffer; diff --git a/goldlib/gall/gstrall.h b/goldlib/gall/gstrall.h index 95ef65a..cf6867d 100644 --- a/goldlib/gall/gstrall.h +++ b/goldlib/gall/gstrall.h @@ -121,7 +121,7 @@ inline char* strskip_wht(char* p) { while(*p and isspace(*p)) p++; return p; } inline const char* strskip_digits(const char* p) { return p+strspn(p, "0123456789"); } inline char* strskip_digits(char* p) { return p+strspn(p, "0123456789"); } -#if defined(_MSC_VER) or (defined(__GNUC__) and not defined(__DJGPP__)) or defined(__WATCOMC__) +#if defined(_MSC_VER) || (defined(__GNUC__) && !defined(__DJGPP__)) || defined(__WATCOMC__) inline char * stpcpy(char* dest, const char* src) { while ((*dest++ = *src++) != NUL) {} return --dest; diff --git a/goldlib/gall/gstrutil.cpp b/goldlib/gall/gstrutil.cpp index 598c83d..2799306 100644 --- a/goldlib/gall/gstrutil.cpp +++ b/goldlib/gall/gstrutil.cpp @@ -594,7 +594,7 @@ GTok::GTok(char* sep) { // ------------------------------------------------------------------ -#if defined(__GNUC__) and not defined(__EMX__) +#if defined(__GNUC__) && !defined(__EMX__) char* strupr(char* s) { diff --git a/goldlib/gall/gutlclip.h b/goldlib/gall/gutlclip.h index 2636dcd..1c6341e 100644 --- a/goldlib/gall/gutlclip.h +++ b/goldlib/gall/gutlclip.h @@ -38,7 +38,7 @@ #if defined(__OS2__) #define CLIP_NAME "OS/2 Clipboard" -#elif defined(__WIN32__) or defined(__MSDOS__) +#elif defined(__WIN32__) || defined(__MSDOS__) #define CLIP_NAME "Windows Clipboard" #else #define CLIP_NAME "Fake Clipboard" diff --git a/goldlib/gall/gutlmtsk.cpp b/goldlib/gall/gutlmtsk.cpp index 4667371..259712d 100644 --- a/goldlib/gall/gutlmtsk.cpp +++ b/goldlib/gall/gutlmtsk.cpp @@ -82,7 +82,7 @@ int GMTsk::os2() { #if defined(__OS2__) detected = GMTSK_OS2; name = "OS/2"; - #elif not defined(__GNUC__) + #elif !defined(__GNUC__) if(_osmajor >= 10) { detected = GMTSK_OS2; name = "OS/2"; @@ -115,7 +115,7 @@ int GMTsk::win32() { int GMTsk::windows() { - #if defined(__MSDOS__) and not defined(__DJGPP__) + #if defined(__MSDOS__) && !defined(__DJGPP__) i86 cpu; cpu.ax(0x352F); cpu.genint(0x21); @@ -136,7 +136,7 @@ int GMTsk::windows() { int GMTsk::desqview() { - #if defined(__MSDOS__) and not defined(__DJGPP__) + #if defined(__MSDOS__) && !defined(__DJGPP__) i86 cpu; cpu.cx(0x4445); cpu.dx(0x5351); @@ -157,7 +157,7 @@ int GMTsk::desqview() { int GMTsk::dosint28() { - #if defined(__MSDOS__) and not defined(__DJGPP__) + #if defined(__MSDOS__) && !defined(__DJGPP__) detected = GMTSK_DOS; name = "DOS"; #endif @@ -191,7 +191,7 @@ void GMTsk::timeslice() { Sleep(5); break; #endif - #if defined(__MSDOS__) or defined(__OS2__) + #if defined(__MSDOS__) || defined(__OS2__) case GMTSK_OS2: #if defined(__OS2__) DosSleep(5); diff --git a/goldlib/gall/gutlos.h b/goldlib/gall/gutlos.h index 481a6b4..20454c4 100644 --- a/goldlib/gall/gutlos.h +++ b/goldlib/gall/gutlos.h @@ -35,7 +35,7 @@ // ------------------------------------------------------------------ -#if defined(__WIN32__) or defined(__OS2__) or defined(__DJGPP__) +#if defined(__WIN32__) || defined(__OS2__) || defined(__DJGPP__) // ------------------------------------------------------------------ diff --git a/goldlib/gall/gutltag.cpp b/goldlib/gall/gutltag.cpp index 8b85ab6..74c4256 100644 --- a/goldlib/gall/gutltag.cpp +++ b/goldlib/gall/gutltag.cpp @@ -131,7 +131,7 @@ ulong* GTag::Add(ulong __tagn) { uint _reln = ToReln(__tagn, TAGN_CLOSEST); // Do we have it already? - if((_reln == RELN_INVALID) OR (tag[_reln-1] != __tagn)) { + if((_reln == RELN_INVALID) or (tag[_reln-1] != __tagn)) { // Resize tag array to make room for the new number Resize(tags+1); @@ -143,7 +143,7 @@ ulong* GTag::Add(ulong __tagn) { // - no tags in array (if _reln == RELN_INVALID) // - tag[_reln-1] is larger than __tagn - if(_reln AND (tag[_reln-1] > __tagn)) + if(_reln and (tag[_reln-1] > __tagn)) _reln--; // Move data to make room for the new tag number diff --git a/goldlib/gall/gutltag.h b/goldlib/gall/gutltag.h index 42d4966..4c00706 100644 --- a/goldlib/gall/gutltag.h +++ b/goldlib/gall/gutltag.h @@ -96,7 +96,7 @@ public: uint SetCount(uint n) { tags = count = n; return count; } void Set(uint n, ulong t) { tag[n] = t; } - ulong Get(uint n) { return (tags AND (n>4)&0x07)|((attr<<4)&0x70)|(attr&0x80)|(attr&0x08)); } -#if not defined(__USE_NCURSES__) +#if !defined(__USE_NCURSES__) // ------------------------------------------------------------------ @@ -569,7 +569,7 @@ chtype gvid_tcpr(vchar chr) { // ------------------------------------------------------------------ // Print character and attribute at specfied location -#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__) +#if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__) inline void _vputw(int row, int col, word chat) { _farpokew(_dos_ds, gdmaptr(col, row), chat); @@ -738,7 +738,7 @@ void vputc(int row, int col, int atr, vchar chr) { cpu.genint(0x10); } - #elif defined(__OS2__) or defined(__WIN32__) + #elif defined(__OS2__) || defined(__WIN32__) vputw(row, col, vcatch(chr, atr)); @@ -854,7 +854,7 @@ void vputs(int row, int col, int atr, const char* str) { // ------------------------------------------------------------------ // Print string with attribute at specfied location -#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__) +#if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__) static void _vputns(int row, int col, int atr, const char* str, uint width) { char fillchar = ' '; @@ -967,7 +967,7 @@ void vputns(int row, int col, int atr, const char* str, uint width) { // ------------------------------------------------------------------ // Print horizontal line of character and attribute -#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__) +#if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__) void _vputx(int row, int col, int atr, char chr, uint len) { gdma p = gdmaptr(col, row); @@ -1040,7 +1040,7 @@ void vputx(int row, int col, int atr, vchar chr, uint len) { // ------------------------------------------------------------------ // Print vertical line of character and attribute -#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__) +#if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__) inline void _vputy(int row, int col, int atr, char chr, uint len) { gdma p = gdmaptr(col, row); @@ -1130,7 +1130,7 @@ void vputy(int row, int col, int atr, vchar chr, uint len) { // ------------------------------------------------------------------ // Get character and attribute at cursor position -#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__) +#if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__) inline word _vgetw(int row, int col) { return _farpeekw(_dos_ds, gdmaptr(col, row)); @@ -1203,7 +1203,7 @@ vatch vgetw(int row, int col) { void vgetc(int row, int col, int* atr, vchar* chr) { - if((row < 0) || (row > gvid->numrows-1) || (col < 0) || (col > gvid->numcols-1)) { + if((row < 0) or (row > gvid->numrows-1) or (col < 0) or (col > gvid->numcols-1)) { *chr = ' '; *atr = 0; } @@ -1219,7 +1219,7 @@ void vgetc(int row, int col, int* atr, vchar* chr) { // ------------------------------------------------------------------ // Scroll screen area -#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__) +#if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__) static void _vscroll(int srow, int scol, int erow, int ecol, int atr, int lines) { word empty = (atr << 8) | ' '; @@ -1461,7 +1461,7 @@ void vclrscr() { // ------------------------------------------------------------------ // Clears the screen using given attribute and homes the cursor -#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__) +#if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__) static void _vclrscr(int atr) { int len = gvid->numrows * gvid->numcols; @@ -1529,7 +1529,7 @@ void vclrscr(int atr) { // ------------------------------------------------------------------ // Saves the current screen and returns pointer to buffer -#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__) +#if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__) static void _vsave(word* buf, int len1, int srow, int scol, int erow) { const int len2 = len1*sizeof(word); @@ -1645,7 +1645,7 @@ vsavebuf* vsave(int srow, int scol, int erow, int ecol) { // ------------------------------------------------------------------ // Redraws a previously saved screen -#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__) +#if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__) static void _vredraw(word* buf, int len1, int srow, int scol, int erow) { const int len2 = len1*sizeof(word); @@ -1972,7 +1972,7 @@ void vcursmall() { // 14 - solid block // ------------------------------------------------------------------ -#if not defined(__USE_NCURSES__) +#if !defined(__USE_NCURSES__) char* __box_table[] = { @@ -2069,7 +2069,7 @@ chtype _box_table(int type, int c) { // ------------------------------------------------------------------ -#if defined(__UNIX__) and not defined(__USE_NCURSES__) +#if defined(__UNIX__) && !defined(__USE_NCURSES__) void gvid_boxcvt(char* s) { while(*s) { diff --git a/goldlib/gall/gvidinit.cpp b/goldlib/gall/gvidinit.cpp index d8273bf..4b134c6 100644 --- a/goldlib/gall/gvidinit.cpp +++ b/goldlib/gall/gvidinit.cpp @@ -32,7 +32,7 @@ #include #include #include -#if defined(__WATCOMC__) or defined(__DJGPP__) +#if defined(__WATCOMC__) || defined(__DJGPP__) #include #endif #include @@ -46,7 +46,7 @@ #include #endif -#if not defined(__USE_NCURSES__) and defined(__UNIX__) +#if !defined(__USE_NCURSES__) && defined(__UNIX__) #include #include #include @@ -62,7 +62,7 @@ // ------------------------------------------------------------------ // Check if Borland C++ for OS/2 1.0 header has been fixed -#if defined(__OS2__) and defined(__BORLANDC__) +#if defined(__OS2__) && defined(__BORLANDC__) #if __BORLANDC__ <= 0x400 #ifndef BCOS2_BSESUB_FIXED #error There is a bug in the BSESUB.H header. Please fix it. @@ -189,11 +189,11 @@ void GVid::init() { #if defined(__USE_NCURSES__) dmaptr = dmadir = NULL; - #elif defined(__WATCOMC__) and defined(__386__) + #elif defined(__WATCOMC__) && defined(__386__) dmaptr = dmadir = (gdma)(videoseg << 4); #elif defined(__DJGPP__) dmaptr = dmadir = ScreenPrimary; - #elif defined(__OS2__) or defined(__WIN32__) + #elif defined(__OS2__) || defined(__WIN32__) dmaptr = dmadir = NULL; #elif defined(__UNIX__) dmaptr = (gdma)throw_xcalloc((orig.screen.rows+1)*orig.screen.columns, sizeof(word)); @@ -319,7 +319,7 @@ int GVid::detectadapter() { #ifndef __DJGPP__ // Set video segment - #if defined(__BORLANDC__) and defined(__DPMI32__) + #if defined(__BORLANDC__) && defined(__DPMI32__) videoseg = (word)((adapter & V_MONO) ? __SegB000 : __SegB800); #else videoseg = (word)((adapter & V_MONO) ? 0xB000 : 0xB800); @@ -340,7 +340,7 @@ int GVid::detectadapter() { __gdvdetected = true; - #if defined(__WATCOMC__) and defined(__386__) + #if defined(__WATCOMC__) && defined(__386__) memset(&RMI, 0, sizeof(RMI)); RMI.EAX = 0x0000FE00; RMI.ES = videoseg; @@ -396,7 +396,6 @@ int GVid::detectadapter() { FILE_SHARE_WRITE | FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_NO_BUFFERING|FILE_FLAG_WRITE_THROUGH, NULL); - // gvid_hout = GetStdHandle(STD_OUTPUT_HANDLE); adapter = V_VGA; @@ -762,7 +761,7 @@ void GVid::setrows(int _rows) { } if(adapter >= V_EGA) { - if(_rows == 28 and adapter >= V_VGA) { // vga-only + if((_rows == 28) and (adapter >= V_VGA)) { // vga-only cpu.ax(0x1202); cpu.bl(0x30); cpu.genint(0x10); @@ -811,7 +810,7 @@ void GVid::setrows(int _rows) { viomodeinfo.row = (USHORT)_rows; VioSetMode(&viomodeinfo, 0); - #elif defined(__WIN32__) or defined(__UNIX__) + #elif defined(__WIN32__) || defined(__UNIX__) NW(_rows); @@ -852,7 +851,7 @@ void GVid::setoverscan(int _overscan) { viooverscan.color = (BYTE)_overscan; VioSetState(&viooverscan, 0); - #elif defined(__WIN32__) or defined(__UNIX__) + #elif defined(__WIN32__) || defined(__UNIX__) NW(_overscan); @@ -910,7 +909,7 @@ void GVid::setintensity(int _intensity) { viointensity.type = 0x0002; VioSetState(&viointensity, 0); - #elif defined(__WIN32__) or defined(__UNIX__) + #elif defined(__WIN32__) || defined(__UNIX__) NW(_intensity); @@ -959,7 +958,7 @@ void GVid::getpalette(int* _palette) { for(byte n=0; n<16; n++) _palette[n] = pviopalstate->acolor[n]; - #elif defined(__WIN32__) or defined(__UNIX__) + #elif defined(__WIN32__) || defined(__UNIX__) NW(_palette); @@ -1004,7 +1003,7 @@ void GVid::setpalette(int* _palette) { pviopalstate->acolor[n] = (USHORT)_palette[n]; VioSetState(pviopalstate, 0); - #elif defined(__WIN32__) or defined(__UNIX__) + #elif defined(__WIN32__) || defined(__UNIX__) NW(_palette); @@ -1033,7 +1032,7 @@ void GVid::resize_screen(int columns, int rows) { bufwrd = (vatch*)throw_xrealloc(bufwrd, (numcols+1)*sizeof(vatch)); bufansi = (vchar*)throw_xrealloc(bufansi, 1+(11*numcols)); - #if defined(__UNIX__) and not defined(__USE_NCURSES__) + #if defined(__UNIX__) && !defined(__USE_NCURSES__) dmaptr = (gdma)throw_xrealloc(dmaptr, (rows+1)*columns*sizeof(word)); #endif } diff --git a/goldlib/gcfg/gedacfg.cpp b/goldlib/gcfg/gedacfg.cpp index 307571e..d5224de 100644 --- a/goldlib/gcfg/gedacfg.cpp +++ b/goldlib/gcfg/gedacfg.cpp @@ -439,7 +439,7 @@ bool gareafile::ReadAreafile(word crc, char* parameters) { #ifndef GCFG_NORA case CRC_REMOTEACCESS: ReadRemoteAccess(parameters); break; #endif -#if not defined(GCFG_NOSQSH) or not defined(GCFG_NOPARTOSS) +#if !defined(GCFG_NOSQSH) || !defined(GCFG_NOPARTOSS) case CRC_PARTOSS: case CRC_SQUISH: ReadSquish(parameters); break; #endif diff --git a/goldlib/gcfg/gedacfg.h b/goldlib/gcfg/gedacfg.h index 9e0fed4..868371a 100644 --- a/goldlib/gcfg/gedacfg.h +++ b/goldlib/gcfg/gedacfg.h @@ -283,7 +283,7 @@ protected: #ifndef GCFG_NOQECHO void ReadQEchoFile(char* file, char* options, char* origin); #endif -#if not defined(GCFG_NOSQSH) or not defined(GCFG_NOPARTOSS) +#if !defined(GCFG_NOSQSH) || !defined(GCFG_NOPARTOSS) void ReadSquishFile(char* path, char* file, char* options, char* origin, int group); #endif #ifndef GCFG_NOTIMED @@ -412,7 +412,7 @@ public: #ifndef GCFG_NORA void ReadRemoteAccess(char* tag); #endif -#if not defined(GCFG_NOSQSH) or not defined(GCFG_NOPARTOSS) +#if !defined(GCFG_NOSQSH) || !defined(GCFG_NOPARTOSS) void ReadSquish(char* tag); #endif #ifndef GCFG_NOSBBS diff --git a/goldlib/gcfg/gxcrash.cpp b/goldlib/gcfg/gxcrash.cpp index ad2e9d5..8176c18 100644 --- a/goldlib/gcfg/gxcrash.cpp +++ b/goldlib/gcfg/gxcrash.cpp @@ -71,7 +71,7 @@ bool gareafile::jbstrcpy(char *dest, char *src, size_t maxlen, size_t *jbc) { // ------------------------------------------------------------------ -// Read areas from HPT (echomail processor) +// Read areas from Crashmail (echomail processor) void gareafile::ReadCrashmail(char* tag) { diff --git a/goldlib/gmb3/gmoezyc1.cpp b/goldlib/gmb3/gmoezyc1.cpp index 79d9629..3cd19d4 100644 --- a/goldlib/gmb3/gmoezyc1.cpp +++ b/goldlib/gmb3/gmoezyc1.cpp @@ -164,7 +164,7 @@ int EzycomArea::raw_open() { int _sopen_access = data->omode | O_BINARY; int _sopen_permit = 0; - if(NOT fexist(ret_mess_xxx(data->ezyfile,1))) { + if(not fexist(ret_mess_xxx(data->ezyfile,1))) { _sopen_access |= O_CREAT; _sopen_permit = S_STDRW; } @@ -193,7 +193,7 @@ int EzycomArea::raw_open() { break; } Path _path; - if(NOT is_dir(ret_mess_area(_path))) { + if(not is_dir(ret_mess_area(_path))) { mkdir(ret_mess_area(_path), S_IWUSR); _tryagain++; } @@ -218,10 +218,10 @@ void EzycomArea::test_raw_open(int __fileline) { _isopen = raw_open(); - if(NOT _isopen) { + if(not _isopen) { // Tell the world - if((errno != EACCES) OR PopupLocked(++_tries, false, data->ezyfile) == false) { + if((errno != EACCES) or PopupLocked(++_tries, false, data->ezyfile) == false) { // User requested to exit WideLog->erropen(__FILE__, __fileline); @@ -231,7 +231,7 @@ void EzycomArea::test_raw_open(int __fileline) { OpenErrorExit(); } } - } while(NOT _isopen); + } while(not _isopen); // Remove the popup window if(_tries) @@ -266,7 +266,7 @@ void EzycomInit(const char* msgbasepath, const char* userbasepath, int userno) { Path _path; *_path = NUL; char* _ptr = getenv("EZY"); - if(_ptr AND *_ptr) { + if(_ptr and *_ptr) { _ptr = strcpy(_path, _ptr); char* _ptr2 = strchr(_ptr, ' '); if(_ptr2) @@ -275,12 +275,12 @@ void EzycomInit(const char* msgbasepath, const char* userbasepath, int userno) { } const char* _file = ""; _ptr = getenv("TASK"); - if(_ptr AND *_ptr) { + if(_ptr and *_ptr) { char _tmp[20]; sprintf(_tmp, "CONFIG.%u", atoi(_ptr)); _file = AddPath(_path, _tmp); } - if(NOT fexist(_file)) + if(not fexist(_file)) _file = AddPath(_path, "CONFIG.EZY"); ezycomwide->ver = 102; @@ -308,7 +308,7 @@ void EzycomInit(const char* msgbasepath, const char* userbasepath, int userno) { ezycomwide->user->extfh = ::sopen(AddPath(ezycomwide->userbasepath, "USERSEXT.BBS"), O_RDWR|O_CREAT|O_BINARY, WideSharemode, S_STDRW); if(ezycomwide->user->extfh != -1) { ezycomwide->user->find(_username); - if(NOT ezycomwide->user->found) { + if(not ezycomwide->user->found) { WideLog->printf("* User \"%s\" not found in %sUSERS.BBS.", _username, ezycomwide->userbasepath); ezycomwide->user->add(_username); WideLog->printf("* Now added with user number %u.", ezycomwide->user->index); @@ -424,7 +424,7 @@ void EzycomArea::suspend() { void EzycomArea::resume() { GFTRK("EzycomResume"); - if(NOT raw_open()) { + if(not raw_open()) { Path _path; WideLog->ErrOpen(); WideLog->printf("! A Ezycom msgbase file could not be opened."); diff --git a/goldlib/gmb3/gmoezyc2.cpp b/goldlib/gmb3/gmoezyc2.cpp index 154eda5..e79b4a8 100644 --- a/goldlib/gmb3/gmoezyc2.cpp +++ b/goldlib/gmb3/gmoezyc2.cpp @@ -35,7 +35,7 @@ void EzycomArea::raw_scan(int __keep_index) { GFTRK("EzycomRawScan"); int _wasopen = isopen; - if(NOT _wasopen) { + if(not _wasopen) { isopen++; data_open(); test_raw_open(__LINE__); @@ -73,7 +73,7 @@ void EzycomArea::raw_scan(int __keep_index) { while(1) { // Set lastread pointer - if((*_msgnoptr >= _lastread) AND (_lastread_reln == 0)) { + if((*_msgnoptr >= _lastread) and (_lastread_reln == 0)) { _lastreadfound = *_msgnoptr; _lastread_reln = _count - (*_msgnoptr != _lastread ? 1 : 0); break; @@ -85,7 +85,7 @@ void EzycomArea::raw_scan(int __keep_index) { } // If the exact lastread was not found - if(_active AND (_lastreadfound != _lastread)) { + if(_active and (_lastreadfound != _lastread)) { // Higher than highest or lower than lowest? if(_lastread > _lastmsgno) @@ -101,10 +101,10 @@ void EzycomArea::raw_scan(int __keep_index) { ::close(_fh); } - if(NOT __keep_index) + if(not __keep_index) Msgn->Reset(); - if(NOT _wasopen) { + if(not _wasopen) { raw_close(); data_close(); isopen--; diff --git a/goldlib/gmb3/gmoezyc3.cpp b/goldlib/gmb3/gmoezyc3.cpp index 93217b0..be35735 100644 --- a/goldlib/gmb3/gmoezyc3.cpp +++ b/goldlib/gmb3/gmoezyc3.cpp @@ -88,7 +88,7 @@ int EzycomArea::load_message(int __mode, gmsg* __msg, EzycHdr& __hdr) { __msg->attr.rrq(__hdr.netattr & EZYC_NETATTR_RREQ); __msg->attr.arq(__hdr.netattr & EZYC_NETATTR_AREQ); __msg->attr.rrc(__hdr.netattr & EZYC_NETATTR_RREC); - __msg->attr.uns(((__hdr.msgattr & EZYC_MSGATTR_NETPEND) OR (__hdr.msgattr & EZYC_MSGATTR_ECHOPEND)) ? 1 : 0); + __msg->attr.uns(((__hdr.msgattr & EZYC_MSGATTR_NETPEND) or (__hdr.msgattr & EZYC_MSGATTR_ECHOPEND)) ? 1 : 0); __msg->ezycom.extattr = __hdr.extattr; __msg->timesread = (__hdr.extattr & EZYC_EXTATTR_SEEN) ? 1 : 0; diff --git a/goldlib/gmb3/gmoezyc4.cpp b/goldlib/gmb3/gmoezyc4.cpp index 3c8c0f4..8565c52 100644 --- a/goldlib/gmb3/gmoezyc4.cpp +++ b/goldlib/gmb3/gmoezyc4.cpp @@ -69,7 +69,7 @@ void EzycomArea::unlock() { void EzycomArea::save_message(int __mode, gmsg* __msg, EzycHdr& __hdr) { int _was_locked = data->islocked; - if(NOT _was_locked) + if(not _was_locked) lock(); if(__mode & GMSG_NEW) @@ -140,7 +140,7 @@ void EzycomArea::save_message(int __mode, gmsg* __msg, EzycHdr& __hdr) { // Write the message text uint _size = strlen(__msg->txt) + 1; - if((__mode & GMSG_NEW) OR (_size > __hdr.messagelength)) + if((__mode & GMSG_NEW) or (_size > __hdr.messagelength)) __hdr.startposition = filelength(data->fhtxt); lseekset(data->fhtxt, __hdr.startposition); write(data->fhtxt, __msg->txt, _size); @@ -238,7 +238,7 @@ void EzycomArea::save_message(int __mode, gmsg* __msg, EzycHdr& __hdr) { Msgn->Append(__msg->msgno); } - if(NOT _was_locked) + if(not _was_locked) unlock(); GFTRK(NULL); diff --git a/goldlib/gmb3/gmofido1.cpp b/goldlib/gmb3/gmofido1.cpp index 6383566..4f18f3b 100644 --- a/goldlib/gmb3/gmofido1.cpp +++ b/goldlib/gmb3/gmofido1.cpp @@ -80,10 +80,10 @@ int FidoArea::test_open(const char* __file, int __openmode, int __sharemode, int _fh = ::sopen(__file, __openmode, __sharemode, S_STDRW); if(_fh == -1) { - if((errno != EACCES) OR (PopupLocked(++_tries, false, __file) == false)) { + if((errno != EACCES) or (PopupLocked(++_tries, false, __file) == false)) { // Return instead of halting if requested - if(errno != EACCES AND NOT __fail) { + if((errno != EACCES) and not __fail) { GFTRK(NULL); return _fh; } @@ -142,7 +142,7 @@ void FidoInit(const char* fidolastread, int fidohwmarks, int fidonullfix, int fi fidowide->user->fh = ::sopen(userfile, O_RDWR|O_CREAT|O_BINARY, WideSharemode, S_STDRW); if(fidowide->user->fh != -1) { fidowide->user->find(_username); - if(NOT fidowide->user->found) { + if(not fidowide->user->found) { WideLog->printf("* User \"%s\" not found in %s.", _username, userfile); fidowide->user->add(_username); WideLog->printf("* Now added with user number %u.", fidowide->user->index); diff --git a/goldlib/gmb3/gmofido2.cpp b/goldlib/gmb3/gmofido2.cpp index 5c1ea20..d66ebcb 100644 --- a/goldlib/gmb3/gmofido2.cpp +++ b/goldlib/gmb3/gmofido2.cpp @@ -89,7 +89,7 @@ void FidoArea::raw_scan(bool __scanpm) { while(1) { // Set lastread pointer - if((*_msgnoptr >= _lastread) AND (_lastread_reln == 0)) { + if((*_msgnoptr >= _lastread) and (_lastread_reln == 0)) { _lastreadfound = *_msgnoptr; _lastread_reln = _count - (*_msgnoptr != _lastread ? 1 : 0); break; @@ -101,7 +101,7 @@ void FidoArea::raw_scan(bool __scanpm) { } // If the exact lastread was not found - if(_active AND (_lastreadfound != _lastread)) { + if(_active and (_lastreadfound != _lastread)) { // Higher than highest or lower than lowest? if(_lastread > _lastmsgno) @@ -112,7 +112,7 @@ void FidoArea::raw_scan(bool __scanpm) { // Read highwater mark data->highwatermark = 0; - if(isecho() AND wide->fidohwmarks) { + if(isecho() and wide->fidohwmarks) { _fh = test_open(AddPath(path(), "1.msg"), O_RDONLY|O_BINARY, WideSharemode); if(_fh != -1) { read(_fh, &_hdr, sizeof(FidoHdr)); diff --git a/goldlib/gmb3/gmofido3.cpp b/goldlib/gmb3/gmofido3.cpp index bee36b8..893cd92 100644 --- a/goldlib/gmb3/gmofido3.cpp +++ b/goldlib/gmb3/gmofido3.cpp @@ -117,9 +117,9 @@ int FidoArea::load_message(int __mode, gmsg* __msg, FidoHdr& __hdr) { __msg->attr.lok(not (st.st_mode & S_IWUSR)); // Set the unsent attribute - if(isnet() OR (isecho() AND NOT wide->fidohwmarks)) - __msg->attr.uns((__hdr.attr & FIDO_LOCAL) AND NOT (__hdr.attr & FIDO_SENT)); - else if(isecho() AND wide->fidohwmarks) { + if(isnet() or (isecho() and not wide->fidohwmarks)) + __msg->attr.uns((__hdr.attr & FIDO_LOCAL) and not (__hdr.attr & FIDO_SENT)); + else if(isecho() and wide->fidohwmarks) { __msg->attr.uns(data->highwatermark < __msg->msgno); __msg->attr.snt(data->highwatermark >= __msg->msgno); } diff --git a/goldlib/gmb3/gmofido4.cpp b/goldlib/gmb3/gmofido4.cpp index b1aafaa..82e761a 100644 --- a/goldlib/gmb3/gmofido4.cpp +++ b/goldlib/gmb3/gmofido4.cpp @@ -72,7 +72,7 @@ void FidoArea::save_message(int __mode, gmsg* __msg, FidoHdr& __hdr) { // Never create a new 1.MSG in echo or local areas. if(__msg->msgno == 1) { - if(NOT isnet()) { + if(not isnet()) { __msg->msgno = 2; build_msgname(_msgfile, __msg->msgno); } @@ -120,9 +120,8 @@ void FidoArea::save_message(int __mode, gmsg* __msg, FidoHdr& __hdr) { int _fh = test_open(_msgfile, _omode, WideSharemode, YES); // Get date/time of message file - if(NOT(__mode & GMSG_NEW)) { - if(NOT __msg->attr.upd()) - fstat(_fh, &st); + if(not (__mode & GMSG_NEW) and not __msg->attr.upd()) { + fstat(_fh, &st); } memset(&__hdr, 0, sizeof(FidoHdr)); @@ -189,13 +188,11 @@ void FidoArea::save_message(int __mode, gmsg* __msg, FidoHdr& __hdr) { ::close(_fh); // Reset date/time of message file - if(NOT(__mode & GMSG_NEW)) { - if(NOT __msg->attr.upd()) { - struct utimbuf t; - t.actime = st.st_atime; - t.modtime = st.st_mtime; - utime(_msgfile, &t); - } + if(not (__mode & GMSG_NEW) and not __msg->attr.upd()) { + struct utimbuf t; + t.actime = st.st_atime; + t.modtime = st.st_mtime; + utime(_msgfile, &t); } // If the message has locked status, make it read-only diff --git a/goldlib/gmb3/gmofido5.cpp b/goldlib/gmb3/gmofido5.cpp index c4ad2ff..2626adc 100644 --- a/goldlib/gmb3/gmofido5.cpp +++ b/goldlib/gmb3/gmofido5.cpp @@ -63,7 +63,7 @@ int FidoArea::renumber() { // In echo or local, start with 2.MSG so we don't conflict // with highwater marks, unless there is already a 1.MSG ulong _msgno1st = 1; - if((NOT isnet()) AND (Msgn->at(0) != 1)) + if(not isnet() and (Msgn->at(0) != 1)) _msgno1st++; // Renumber *.MSG files @@ -105,7 +105,7 @@ int FidoArea::renumber() { read(_fh, &_hdr, sizeof(FidoHdr)); // Update the replylinks - if(_hdr.replyto OR _hdr.reply1st) { + if(_hdr.replyto or _hdr.reply1st) { _hdr.replyto = (word)Msgn->ToReln(_hdr.replyto); _hdr.reply1st = (word)Msgn->ToReln(_hdr.reply1st); lseekset(_fh, 0); diff --git a/goldlib/gmb3/gmohuds1.cpp b/goldlib/gmb3/gmohuds1.cpp index 57e8501..d23c836 100644 --- a/goldlib/gmb3/gmohuds1.cpp +++ b/goldlib/gmb3/gmohuds1.cpp @@ -81,7 +81,7 @@ void _HudsWide::init() { scn = NULL; // Open complete msgbase, create if none exists - if(NOT fexist(AddPath(path, __HUDSON ? "msghdr" HUDS_EXT : "msghdr" GOLD_EXT))) { + if(not fexist(AddPath(path, __HUDSON ? "msghdr" HUDS_EXT : "msghdr" GOLD_EXT))) { WideLog->printf("* Creating new msgbase at %s", path); raw_open(O_CREAT); if(filelength(fhinf) == 0) { @@ -108,7 +108,7 @@ void _HudsWide::init() { long _hdrsize = filelength(fhhdr)/(long)sizeof(HudsHdr); long _idxsize = filelength(fhidx)/(long)sizeof(HudsIdx); long _toisize = filelength(fhtoi)/(long)sizeof(HudsToIdx); - if((_hdrsize != _idxsize) OR (_hdrsize != _toisize)) { + if((_hdrsize != _idxsize) or (_hdrsize != _toisize)) { raw_close(); HGWarnRebuild(); WideLog->ErrIndex(); @@ -137,7 +137,7 @@ void _HudsWide::init() { ra2usersbbs = 2; // If it matches both of them - if(hudsmatch AND ra2match) { + if(hudsmatch and ra2match) { // Check version in CONFIG.RA to make sure Path rapath, file; @@ -158,7 +158,7 @@ void _HudsWide::init() { } // If it does not match either of them - if(NOT hudsmatch AND NOT ra2match) { + if(not hudsmatch and not ra2match) { WideLog->ErrIndex(); WideLog->printf("! The users.bbs file has an incorrect size."); WideLog->printf(": %susers.bbs, %lu bytes.", path, len); @@ -200,7 +200,7 @@ void _HudsWide::init() { if(userno == -1) { user->fh = fhusr; user->find(_username); - if(NOT user->found) { + if(not user->found) { WideLog->printf("* User \"%s\" not found in %susers%s.", _username, path, __HUDSON ? HUDS_EXT : GOLD_EXT); user->add(_username); WideLog->printf("* Now added with user number %u.", user->index); diff --git a/goldlib/gmb3/gmohuds2.cpp b/goldlib/gmb3/gmohuds2.cpp index 69d2c51..12e318f 100644 --- a/goldlib/gmb3/gmohuds2.cpp +++ b/goldlib/gmb3/gmohuds2.cpp @@ -206,7 +206,7 @@ void _HudsWide::lock() { GFTRK("HudsLock"); - if(NOT islocked AND WideCanLock) { + if(not islocked and WideCanLock) { long _tries = 0; @@ -251,7 +251,7 @@ void _HudsWide::unlock() { GFTRK("HudsUnlock"); - if(islocked AND WideCanLock) { + if(islocked and WideCanLock) { ::unlock(fhinf, sizeof(HudsInfo)+1, 1); islocked = false; } @@ -317,7 +317,7 @@ void _HudsWide::scan() { if(_msgidx_ptr->msgno != (__HUDSON ? HUDS_DELETEDMSGNO : GOLD_DELETEDMSGNO)) { register int _idxboard = _msgidx_ptr->board; - if(_idxboard AND (_idxboard <= (__HUDSON ? HUDS_MAXBOARD : GOLD_MAXBOARD))) { + if(_idxboard and (_idxboard <= (__HUDSON ? HUDS_MAXBOARD : GOLD_MAXBOARD))) { _scan = scn + (_idxboard - 1); @@ -326,11 +326,11 @@ void _HudsWide::scan() { _scan->count++; // Set first message number - if(NOT _scan->firstmsgno) + if(not _scan->firstmsgno) _scan->firstmsgno = _scan->lastmsgno; // Set lastread pointer - if((_scan->lastmsgno >= _scan->lastread) AND (_scan->lastreadreln == 0)) { + if((_scan->lastmsgno >= _scan->lastread) and (_scan->lastreadreln == 0)) { _scan->lastreadfound = _scan->lastmsgno; _scan->lastreadreln = _scan->count - (_scan->lastmsgno != _scan->lastread ? 1 : 0); } @@ -358,7 +358,7 @@ void _HudsWide::scan() { while(_board < (__HUDSON ? HUDS_MAXBOARD : GOLD_MAXBOARD)) { // Check/fix lastreads - if(_scan->count AND (_scan->lastreadfound != _scan->lastread)) { + if(_scan->count and (_scan->lastreadfound != _scan->lastread)) { if(_scan->lastread > _scan->lastmsgno) _scan->lastreadreln = _scan->count; else if(_scan->lastread < _scan->firstmsgno) @@ -403,7 +403,7 @@ void _HudsArea::raw_scan(int _ if(!wide) wide = (HudsWide*) (__HUDSON ? (void *)hudsonwide : (void *)goldbasewide); - if(wide->iswideopen AND NOT wide->iswidescanned) + if(wide->iswideopen and not wide->iswidescanned) wide->scan(); // Get wide scan data if any @@ -419,7 +419,7 @@ void _HudsArea::raw_scan(int _ // Open the msgbase if it wasn't already int _was_open = wide->isopen; - if(NOT _was_open) + if(not _was_open) wide->open(); // Get the number of active msgs in the area @@ -448,14 +448,14 @@ void _HudsArea::raw_scan(int _ while(_msgidx_count < _msgidx_total) { // Is it our board and is the msg not deleted? - if((_msgidx_ptr->board == _board) AND (_msgidx_ptr->msgno != (__HUDSON ? HUDS_DELETEDMSGNO : GOLD_DELETEDMSGNO))) { + if((_msgidx_ptr->board == _board) and (_msgidx_ptr->msgno != (__HUDSON ? HUDS_DELETEDMSGNO : GOLD_DELETEDMSGNO))) { // Get message number _lastmsgno = _msgidx_ptr->msgno; _msg_count++; // Set first message number - if(NOT _firstmsgno) + if(not _firstmsgno) _firstmsgno = _lastmsgno; // Transfer data to the index @@ -463,7 +463,7 @@ void _HudsArea::raw_scan(int _ *_msgno_ptr++ = _lastmsgno; // Set lastread pointer - if((_lastmsgno >= _lastread) AND (_lastread_reln == 0)) { + if((_lastmsgno >= _lastread) and (_lastread_reln == 0)) { _lastreadfound = _lastmsgno; _lastread_reln = _msg_count - (_lastmsgno != _lastread ? 1 : 0); } @@ -479,7 +479,7 @@ void _HudsArea::raw_scan(int _ } // If the exact lastread was not found - if(_msg_count AND (_lastreadfound != _lastread)) { + if(_msg_count and (_lastreadfound != _lastread)) { // Higher than highest or lower than lowest? if(_lastread > _lastmsgno) @@ -514,7 +514,7 @@ void _HudsArea::raw_scan(int _ } // Close the msgbase again if we opened it in here - if(NOT _was_open) + if(not _was_open) wide->close(); } @@ -572,7 +572,7 @@ void _HudsWide::scan_pm() { GFTRK("HudsWideScanPM"); - if(NOT iswidescanned) + if(not iswidescanned) scan(); ispmscanned = true; @@ -602,7 +602,7 @@ void _HudsWide::scan_pm() { // Skip msgs in invalid boards idxboard = idxptr->board; - if(NOT(idxboard AND (idxboard <= (__HUDSON ? HUDS_MAXBOARD : GOLD_MAXBOARD)))) { + if(not (idxboard and (idxboard <= (__HUDSON ? HUDS_MAXBOARD : GOLD_MAXBOARD)))) { invalidboards++; continue; } @@ -669,7 +669,7 @@ void _HudsArea::scan_area_pm() if(!wide) wide = (HudsWide*) (__HUDSON ? (void *)hudsonwide : (void *)goldbasewide); - if(wide->iswideopen AND NOT wide->ispmscanned) + if(wide->iswideopen and not wide->ispmscanned) wide->scan_pm(); // Get wide scan data if any diff --git a/goldlib/gmb3/gmohuds4.cpp b/goldlib/gmb3/gmohuds4.cpp index e875a3c..b912d78 100644 --- a/goldlib/gmb3/gmohuds4.cpp +++ b/goldlib/gmb3/gmohuds4.cpp @@ -103,7 +103,7 @@ void _HudsArea::save_message(i // Lock msgbase before doing anything int _was_locked = wide->islocked; - if(NOT _was_locked) + if(not _was_locked) lock(); // Find header index @@ -175,7 +175,7 @@ void _HudsArea::save_message(i // If the msg is new or the text is too large to fit uint _txtlen = strlen(__msg->txt)+1; - if((__mode & GMSG_NEW) OR (_txtlen > ((long)__msg->txtlength*255L))) + if((__mode & GMSG_NEW) or (_txtlen > ((long)__msg->txtlength*255L))) __hdr.startrec = (msgn_t)(filelength(wide->fhtxt)/256L); // Calculate the number of text records to write @@ -270,9 +270,9 @@ void _HudsArea::save_message(i write(wide->fhinf, &wide->msginfo, sizeof(HudsInfo)); // Update scanning files - if((__hdr.msgattr & HUDS_NETTRANS) OR (__mode & GMSG_DELETE)) + if((__hdr.msgattr & HUDS_NETTRANS) or (__mode & GMSG_DELETE)) wide->update_netecho(__HUDSON ? "netmail" HUDS_EXT : "netmail" GOLD_EXT, _hdridx, __hdr.msgattr & HUDS_DELETED); - if((__hdr.msgattr & HUDS_ECHOTRANS) OR (__mode & GMSG_DELETE)) + if((__hdr.msgattr & HUDS_ECHOTRANS) or (__mode & GMSG_DELETE)) wide->update_netecho(__HUDSON ? "echomail" HUDS_EXT : "echomail" GOLD_EXT, _hdridx, __hdr.msgattr & HUDS_DELETED); if(__mode & GMSG_NEW) { @@ -285,7 +285,7 @@ void _HudsArea::save_message(i } // Unlock msgbase after use - if(NOT _was_locked) + if(not _was_locked) unlock(); GFTRK(NULL); diff --git a/goldlib/gmb3/gmojamm2.cpp b/goldlib/gmb3/gmojamm2.cpp index 4007216..abcf98d 100644 --- a/goldlib/gmb3/gmojamm2.cpp +++ b/goldlib/gmb3/gmojamm2.cpp @@ -69,7 +69,7 @@ int JamArea::test_open(const char* file) { if(fh == -1) { // Tell the world - if((errno != EACCES) OR (PopupLocked(++tries, false, file) == false)) { + if((errno != EACCES) or (PopupLocked(++tries, false, file) == false)) { WideLog->ErrOpen(); raw_close(); WideLog->printf("! A JAM msgbase file could not be opened."); @@ -100,7 +100,7 @@ void JamArea::raw_open() { sprintf(file, "%s.jhr", path()); data->fhjhr = test_open(file); sprintf(file, "%s.jdx", path()); data->fhjdx = test_open(file); sprintf(file, "%s.jlr", path()); data->fhjlr = test_open(file); - if(NOT just_scanning) { + if(not just_scanning) { sprintf(file, "%s.jdt", path()); data->fhjdt = test_open(file); if(not jamwide->smapihw) { sprintf(file, "%s.cmhw", path()); data->fhjhw = ::sopen(file, O_RDWR|O_BINARY, WideSharemode, S_STDRW); @@ -182,7 +182,7 @@ void JamArea::open_area() { } // If user was not found, init the lastread with our values - if(NOT founduser) { + if(not founduser) { data->lastrec.usercrc = wide->usercrc; data->lastrec.userid = wide->userid; data->lastrec.lastread = 0; @@ -203,8 +203,8 @@ void JamArea::raw_scan(int __keep_index, int __scanpm) { // Open the msgbase if it wasn't already int _was_open = isopen; - if(NOT _was_open) { - if(NOT __keep_index OR __scanpm) + if(not _was_open) { + if(not __keep_index or __scanpm) just_scanning = true; isopen++; data_open(); @@ -241,14 +241,14 @@ void JamArea::raw_scan(int __keep_index, int __scanpm) { register JamIndex* _jdxptr = _jdxbuf; // Fill message index - while(_msgno<_total) { + while(_msgno < _total) { if(_jdxptr->hdroffset != 0xFFFFFFFFL) { _active++; - if(NOT _firstmsgno) + if(not _firstmsgno) _firstmsgno = _msgno; if(__keep_index) *_msgndxptr++ = _msgno; - if((_msgno >= _lastread) AND (_lastread_reln == 0)) { + if((_msgno >= _lastread) and (_lastread_reln == 0)) { _lastreadfound = _msgno; _lastread_reln = (uint)(_active - (_msgno != _lastread ? 1 : 0)); } @@ -259,7 +259,7 @@ void JamArea::raw_scan(int __keep_index, int __scanpm) { } // If the exact lastread was not found - if(_active AND (_lastreadfound != _lastread)) { + if(_active and (_lastreadfound != _lastread)) { // Higher than highest or lower than lowest? if(_lastread > _lastmsgno) @@ -298,8 +298,8 @@ void JamArea::raw_scan(int __keep_index, int __scanpm) { JamHdr hdr; lseekset(data->fhjhr, idx->hdroffset); read(data->fhjhr, &hdr, sizeof(JamHdr)); - if(NOT (hdr.attribute & JAMATTR_READ)) { - if(NOT (hdr.attribute & JAMATTR_DELETED)) { + if(not (hdr.attribute & JAMATTR_READ)) { + if(not (hdr.attribute & JAMATTR_DELETED)) { PMrk->Append(hdr.messagenumber); } } @@ -328,7 +328,7 @@ void JamArea::raw_scan(int __keep_index, int __scanpm) { throw_free(_jdxbuf); // Close the msgbase again if we opened it in here - if(NOT _was_open) { + if(not _was_open) { raw_close(); data_close(); isopen--; diff --git a/goldlib/gmb3/gmojamm3.cpp b/goldlib/gmb3/gmojamm3.cpp index d5ee815..591aa10 100644 --- a/goldlib/gmb3/gmojamm3.cpp +++ b/goldlib/gmb3/gmojamm3.cpp @@ -89,8 +89,8 @@ int JamArea::load_message(int __mode, gmsg* __msg, JamHdr& __hdr) { __msg->attr.lok(__hdr.attribute & JAMATTR_LOCKED); __msg->attr.del(__hdr.attribute & JAMATTR_DELETED); - if(isnet() OR isecho()) - __msg->attr.uns(__msg->attr.loc() AND NOT __msg->attr.snt()); + if(isnet() or isecho()) + __msg->attr.uns(__msg->attr.loc() and not __msg->attr.snt()); else __msg->attr.uns0(); @@ -140,7 +140,7 @@ int JamArea::load_message(int __mode, gmsg* __msg, JamHdr& __hdr) { switch(_subfieldptr->loid) { case JAMSUB_OADDRESS: - if(NOT _got_oaddr) { + if(not _got_oaddr) { _got_oaddr = true; __msg->oorig.set(_buf, __msg->odom); __msg->orig = __msg->oorig; @@ -161,7 +161,7 @@ int JamArea::load_message(int __mode, gmsg* __msg, JamHdr& __hdr) { break; case JAMSUB_DADDRESS: - if(NOT _got_daddr) { + if(not _got_daddr) { _got_daddr = true; __msg->odest.set(_buf, __msg->ddom); __msg->dest = __msg->odest; @@ -184,7 +184,7 @@ int JamArea::load_message(int __mode, gmsg* __msg, JamHdr& __hdr) { __msg->msgid.reset_fast(); if(atoi(__msg->msgids)) { __msg->msgid.set(__msg->msgids, __msg->odom); - if(__msg->msgid.net AND (__msg->orig.net == 0)) + if(__msg->msgid.net and (__msg->orig.net == 0)) __msg->orig = __msg->msgid; } break; @@ -304,10 +304,10 @@ int JamArea::load_message(int __mode, gmsg* __msg, JamHdr& __hdr) { throw_free(_subfield); // Get reply numbers in chain - if(wide->lookreplies AND __msg->link.first()) { + if(wide->lookreplies and __msg->link.first()) { int r = 0; ulong m = __msg->link.first(); - while(m AND (r<__msg->link.list_max())) { + while(m and (r < __msg->link.list_max())) { JamHdr _rhdr; memset(&_rhdr, 0, sizeof(JamHdr)); lseekset(data->fhjdx, m-data->hdrinfo.basemsgnum, sizeof(JamIndex)); diff --git a/goldlib/gmb3/gmojamm4.cpp b/goldlib/gmb3/gmojamm4.cpp index 4a9dc88..856aea8 100644 --- a/goldlib/gmb3/gmojamm4.cpp +++ b/goldlib/gmb3/gmojamm4.cpp @@ -40,7 +40,7 @@ void JamArea::lock() { GFTRK("JamArea::lock"); - if(NOT data->islocked AND WideCanLock) { + if(not data->islocked and WideCanLock) { long _tries = 0; @@ -121,7 +121,7 @@ void JamArea::add_subfield(JamHdr& __hdr, byte*& __subfield, word __loid, word _ void JamArea::save_message(int __mode, gmsg* __msg, JamHdr& __hdr) { int _was_locked = data->islocked; - if(NOT _was_locked) + if(not _was_locked) lock(); // Reset header @@ -138,7 +138,7 @@ void JamArea::save_message(int __mode, gmsg* __msg, JamHdr& __hdr) { // Get message text size char* _txtcpy = NULL; - if(__msg->txt AND (__mode & GMSG_TXT)) { + if(__msg->txt and (__mode & GMSG_TXT)) { // Work on a copy of the original msg text _txtcpy = throw_strdup(__msg->txt); @@ -368,7 +368,7 @@ void JamArea::save_message(int __mode, gmsg* __msg, JamHdr& __hdr) { // Delete msg if requested if(__mode & GMSG_DELETE) { - if(NOT was_deleted) + if(not was_deleted) data->hdrinfo.activemsgs--; __hdr.attribute |= JAMATTR_DELETED; _idx.usercrc = 0xFFFFFFFFL; @@ -447,7 +447,7 @@ void JamArea::save_message(int __mode, gmsg* __msg, JamHdr& __hdr) { scan(); } - if(NOT _was_locked) { + if(not _was_locked) { lseekset(data->fhjhr, 0); write(data->fhjhr, &data->hdrinfo, sizeof(JamHdrInfo)); unlock(); diff --git a/goldlib/gmb3/gmopcbd1.cpp b/goldlib/gmb3/gmopcbd1.cpp index 62aa4ab..b7ce9b2 100644 --- a/goldlib/gmb3/gmopcbd1.cpp +++ b/goldlib/gmb3/gmopcbd1.cpp @@ -140,7 +140,7 @@ void PcbInit(const char* path, int userno) { pcbwide->user->usershdrsize = pcbwide->usershdrsize; if(pcbwide->userno == -1) { pcbwide->user->find(_username); - if(NOT pcbwide->user->found) { + if(not pcbwide->user->found) { pcbwide->userno = 0; //WideLog->printf("* User \"%s\" not found in %sUSERS.", _username, _path); //pcbwide->user->add(_username); diff --git a/goldlib/gmb3/gmopcbd2.cpp b/goldlib/gmb3/gmopcbd2.cpp index 074b478..612a3f1 100644 --- a/goldlib/gmb3/gmopcbd2.cpp +++ b/goldlib/gmb3/gmopcbd2.cpp @@ -97,7 +97,7 @@ void PcbWideOpen() { GFTRK("PcbWideOpen"); - if(NOT pcbwide->isopen) { + if(not pcbwide->isopen) { pcbwide->fhusr = PcbWideTestOpen(pcbwide->users); pcbwide->fhinf = PcbWideTestOpen(pcbwide->usersinf); @@ -201,7 +201,7 @@ void PcbArea::raw_open() { GFTRK("PcbRawOpen"); - if(NOT just_scanning) + if(not just_scanning) data->fhmsg = test_open(path()); data->fhidx = test_open(AddPath(path(), ".idx")); @@ -217,8 +217,8 @@ void PcbArea::raw_scan(int __keep_index, int __scanpm) { // Open the msgbase if it wasn't already int _was_open = isopen; - if(NOT _was_open) { - if(NOT __keep_index) + if(not _was_open) { + if(not __keep_index) just_scanning = true; isopen++; data_open(); @@ -227,7 +227,7 @@ void PcbArea::raw_scan(int __keep_index, int __scanpm) { } int _was_wideopen = wide->isopen; - if(NOT _was_wideopen) + if(not _was_wideopen) PcbWideOpen(); // Load the base header @@ -272,11 +272,11 @@ void PcbArea::raw_scan(int __keep_index, int __scanpm) { if(_idxptr->offset > 0) { _active++; _lastmsgno = _idxptr->num; - if(NOT _firstmsgno) + if(not _firstmsgno) _firstmsgno = _lastmsgno; if(__keep_index) *_msgndxptr++ = _lastmsgno; - if((_lastmsgno >= _lastread) AND (_lastread_reln == 0)) { + if((_lastmsgno >= _lastread) and (_lastread_reln == 0)) { _lastreadfound = _lastmsgno; _lastread_reln = (uint)(_active - (_lastmsgno != _lastread ? 1 : 0)); } @@ -285,7 +285,7 @@ void PcbArea::raw_scan(int __keep_index, int __scanpm) { } // If the exact lastread was not found - if(_active AND (_lastreadfound != _lastread)) { + if(_active and (_lastreadfound != _lastread)) { // Higher than highest or lower than lowest? if(_lastread > _lastmsgno) @@ -338,11 +338,11 @@ void PcbArea::raw_scan(int __keep_index, int __scanpm) { // Free the .IDX buffer throw_free(_idxbuf); - if(NOT _was_wideopen) + if(not _was_wideopen) PcbWideClose(); // Close the msgbase again if we opened it in here - if(NOT _was_open) { + if(not _was_open) { raw_close(); data_close(); isopen--; diff --git a/goldlib/gmb3/gmopcbd3.cpp b/goldlib/gmb3/gmopcbd3.cpp index 929cbe4..372d90a 100644 --- a/goldlib/gmb3/gmopcbd3.cpp +++ b/goldlib/gmb3/gmopcbd3.cpp @@ -55,10 +55,10 @@ int PcbArea::load_message(int __mode, gmsg* __msg, PcbHdr& __hdr) { // Convert attributes __msg->pcboard.status = __hdr.status; - if(NOT islocal()) + if(not islocal()) __msg->attr.uns(__hdr.date[5] != '\xC4'); - __msg->attr.pvt(__hdr.status == '*' OR __hdr.status == '+'); - __msg->attr.rcv(__hdr.status == '+' OR __hdr.status == '-' OR __hdr.status == '`' OR __hdr.status == '^' OR __hdr.status == '#'); + __msg->attr.pvt((__hdr.status == '*') or (__hdr.status == '+')); + __msg->attr.rcv((__hdr.status == '+') or (__hdr.status == '-') or (__hdr.status == '`') or (__hdr.status == '^') or (__hdr.status == '#')); __msg->attr.del(__hdr.activestatus == 226); __msg->pcboard.exthdrflags = __hdr.exthdrflags; @@ -104,7 +104,7 @@ int PcbArea::load_message(int __mode, gmsg* __msg, PcbHdr& __hdr) { // Read the message text, trim spaces and translate PCB linefeeds read(data->fhmsg, _tmptxt, _msgsize); strtrim(_tmptxt); - if(NOT wide->foreign) + if(not wide->foreign) strchg(_tmptxt, 0xE3, 0x0D); //int _line = 0; @@ -138,7 +138,7 @@ int PcbArea::load_message(int __mode, gmsg* __msg, PcbHdr& __hdr) { // Get address and attribute from FidoPCB if(isnet()) { _line++; - if((_line == 1) AND (*_begline == '(' /*)*/)) { + if((_line == 1) and (*_begline == '(' /*)*/)) { Addr _addr; _addr.ResetFast(); char* _ptr = _begline + 1; @@ -148,7 +148,7 @@ int PcbArea::load_message(int __mode, gmsg* __msg, PcbHdr& __hdr) { _ptr += 5; } _addr.set(strskip_wht(_ptr)); - if(NOT _incoming AND strieql(__msg->by, WideUsername[0])) { + if(not _incoming and strieql(__msg->by, WideUsername[0])) { __msg->dest = _addr; __msg->odest = _addr; } @@ -157,7 +157,7 @@ int PcbArea::load_message(int __mode, gmsg* __msg, PcbHdr& __hdr) { __msg->oorig = _addr; } } - else if((_line == 2) AND (*_begline == '(' /*)*/)) { + else if((_line == 2) and (*_begline == '(' /*)*/)) { _src[-1] = NUL; if(striinc("HOLD", _begline)) __msg->attr.hld1(); @@ -184,7 +184,7 @@ int PcbArea::load_message(int __mode, gmsg* __msg, PcbHdr& __hdr) { if(*_eto) strxcpy(__msg->to, _eto, sizeof(__msg->to)); - if(isnet() AND NOT isemail()) { + if(isnet() and not isemail()) { char* ptr = strchr(__msg->by, '@'); if(ptr) { *ptr++ = NUL; @@ -226,7 +226,7 @@ int PcbArea::load_message(int __mode, gmsg* __msg, PcbHdr& __hdr) { throw_free(_tmptxt); - if(NOT(__mode & GMSG_TXT)) + if(not (__mode & GMSG_TXT)) throw_release(__msg->txt); GFTRK(NULL); diff --git a/goldlib/gmb3/gmopcbd4.cpp b/goldlib/gmb3/gmopcbd4.cpp index 2ed7808..4589718 100644 --- a/goldlib/gmb3/gmopcbd4.cpp +++ b/goldlib/gmb3/gmopcbd4.cpp @@ -41,7 +41,7 @@ void PcbArea::lock() { GFTRK("PcbLock"); - if(NOT data->islocked) { + if(not data->islocked) { if(WideCanLock) { long _tries = 0; while(::lock(data->fhmsg, 16, 6) == -1) { @@ -78,7 +78,7 @@ void PcbArea::unlock() { GFTRK("PcbUnlock"); - if(WideCanLock AND data->islocked) + if(WideCanLock and data->islocked) ::unlock(data->fhmsg, 16, 6); lseekset(data->fhmsg, 0); memset(data->base.locked, ' ', 6); @@ -101,7 +101,7 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) { // Lock and refresh base int _was_locked = data->islocked; - if(NOT _was_locked) + if(not _was_locked) lock(); // Reset header @@ -145,7 +145,7 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) { } } else { - if(_status AND NOT _pvt) + if(_status and not _pvt) __hdr.status = _status; else if(_pvt) __hdr.status = '*'; @@ -154,19 +154,18 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) { } _idx.status = __hdr.status; __hdr.activestatus = (__mode & GMSG_DELETE) ? '\xE2' : '\xE1'; - __hdr.echoed = ((isnet() OR isecho()) AND NOT isinternet()) ? 'E' : ' '; + __hdr.echoed = ((isnet() or isecho()) and not isinternet()) ? 'E' : ' '; // Convert dates and times char _dtbuf[9]; struct tm* _tm = gmtime(&__msg->written); memcpy(__hdr.date, strftimei(_dtbuf, 9, __msg->attr.uns() ? "%d-%m-%y" : "%d-%m\xC4%y", _tm), 8); memcpy(__hdr.time, strftimei(_dtbuf, 6, "%H:%M", _tm), 5); - int _year = _tm->tm_year % 100; - _idx.date = (word)YMD2JDN(1900+_year, _tm->tm_mon+1, _tm->tm_mday); + _idx.date = (word)YMD2JDN(1900+_tm->tm_year, _tm->tm_mon+1, _tm->tm_mday); if(__msg->link.first()) { __hdr.hasreply = 'R'; _tm = gmtime(&__msg->pcboard.reply_written); - _year = _tm->tm_year % 100; + int _year = _tm->tm_year % 100; __hdr.replydate = L2B((10000L*_year) + (100L*(_tm->tm_mon+1)) + _tm->tm_mday); memcpy(__hdr.replytime, strftimei(_dtbuf, 6, "%H:%M", _tm), 5); } @@ -216,11 +215,11 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) { uint _txtlen = 0; if(__mode & GMSG_TXT) { __msg->txtlength = _txtlen = strlen(__msg->txt); - if((_tolen > 25) OR isnet()) { + if((_tolen > 25) or isnet()) { __msg->txtlength += sizeof(PcbExtHdr); __hdr.exthdrflags |= 0x01; } - if((_bylen > 25) OR isnet()) { + if((_bylen > 25) or isnet()) { __msg->txtlength += sizeof(PcbExtHdr); __hdr.exthdrflags |= 0x02; } @@ -230,7 +229,7 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) { } // Translate msg text to PCB linefeeds if running non-foreign system - if(NOT wide->foreign) + if(not wide->foreign) strchg(__msg->txt, 0x0D, 0xE3); // Calculate new number of blocks @@ -256,7 +255,7 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) { uint _txtlenwritten = 0; // Write extended headers - if((_tolen > 25) OR isnet()) { + if((_tolen > 25) or isnet()) { PcbExtHdr _ehdr; _ehdr.id = 0x40FF; _ehdr.colon = ':'; @@ -275,7 +274,7 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) { _txtlenwritten += sizeof(PcbExtHdr); } } - if((_bylen > 25) OR isnet()) { + if((_bylen > 25) or isnet()) { PcbExtHdr _ehdr; _ehdr.id = 0x40FF; _ehdr.colon = ':'; @@ -326,7 +325,7 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) { int _imm = __msg->attr.imm(); int _cra = __msg->attr.cra(); int _zon = __msg->attr.zon(); - if(_hld OR _imm OR _cra OR _zon) { + if(_hld or _imm or _cra or _zon) { strcpy(_sbuf, "(" /*)*/); if(_hld) strcat(_sbuf, "HOLD,"); @@ -357,22 +356,22 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) { } // Translate back - if(NOT wide->foreign) + if(not wide->foreign) strchg(__msg->txt, 0xE3, 0x0D); } - if(NOT(__mode & GMSG_DELETE)) { + if(not (__mode & GMSG_DELETE)) { // Set the mail waiting flag int _status = true; // Reset it if the msg is being received - if((__mode & GMSG_UPDATE) AND __msg->attr.rcv()) + if((__mode & GMSG_UPDATE) and __msg->attr.rcv()) _status = false; // Don't touch the flag if the msg was already received - if(NOT (_status AND __msg->attr.rcv())) + if(not (_status and __msg->attr.rcv())) pcbwide->user->update_mail_waiting(__msg->to, board(), _status); } - if((__mode & GMSG_TXT) AND (__mode & GMSG_UPDATE)) { + if((__mode & GMSG_TXT) and (__mode & GMSG_UPDATE)) { __msg->msgno = oldmsgno; __msg->txtstart = oldtxtstart; __msg->txtlength = oldtxtlength; @@ -380,7 +379,7 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) { } // Unlock and update base - if(NOT _was_locked) + if(not _was_locked) unlock(); GFTRK(NULL); diff --git a/goldlib/gmb3/gmoprot.h b/goldlib/gmb3/gmoprot.h index 27fbd0e..94bcbb0 100644 --- a/goldlib/gmb3/gmoprot.h +++ b/goldlib/gmb3/gmoprot.h @@ -122,7 +122,7 @@ void XbbsWideClose(); // ------------------------------------------------------------------ // When not in OS/2, use DUMMY AdeptXBBS functions -#if not defined(__OS2__) +#if !defined(__OS2__) #ifndef GMB_NOXBBS inline void XbbsInit(const char*, int) { } diff --git a/goldlib/gmb3/gmosqsh1.cpp b/goldlib/gmb3/gmosqsh1.cpp index 6dc697b..24109e0 100644 --- a/goldlib/gmb3/gmosqsh1.cpp +++ b/goldlib/gmb3/gmosqsh1.cpp @@ -93,7 +93,7 @@ void SquishInit(const char* userpath, int userno, int direct, int recycle, int s squishwide->user->fh = ::sopen(userfile, O_RDWR|O_CREAT|O_BINARY, WideSharemode, S_STDRW); if(squishwide->user->fh != -1) { squishwide->user->find(_username); - if(NOT squishwide->user->found) { + if(not squishwide->user->found) { WideLog->printf("* User \"%s\" not found in %s.", _username, userfile); squishwide->user->add(_username); WideLog->printf("* Now added with user number %u.", squishwide->user->index); diff --git a/goldlib/gmb3/gmosqsh2.cpp b/goldlib/gmb3/gmosqsh2.cpp index 7fe6563..9a40119 100644 --- a/goldlib/gmb3/gmosqsh2.cpp +++ b/goldlib/gmb3/gmosqsh2.cpp @@ -93,7 +93,7 @@ void SquishArea::raw_scan(int __keep_index, int __scanpm) { } // Open Squish files for scanning unless they are already open - if(NOT isopen) { + if(not isopen) { data->idx = NULL; data->base.totalmsgs = 0; @@ -108,7 +108,7 @@ void SquishArea::raw_scan(int __keep_index, int __scanpm) { // If there appear to be only one record, experience shows that // there may in fact be zero! So check the *.SQD base record for // the exact number of msgs in this case or if requested. - if((data->base.totalmsgs == 1) OR (wide->squishscan == SQS_API)) { + if((data->base.totalmsgs == 1) or (wide->squishscan == SQS_API)) { // Open, read and close data file data->fhsqd = ::sopen(AddPath(path(), ".sqd"), O_RDONLY|O_BINARY, WideSharemode, S_STDRD); @@ -157,9 +157,9 @@ void SquishArea::raw_scan(int __keep_index, int __scanpm) { *_msgndxptr++ = _msgno; // Check for premature end of index (free frames) - if((_msgno <= _lastmsgno) OR (_msgno == 0xFFFFFFFFL)) { + if((_msgno <= _lastmsgno) or (_msgno == 0xFFFFFFFFL)) { _active--; - if((_msgno == _lastmsgno) AND _active == 1) { + if((_msgno == _lastmsgno) and (_active == 1)) { _lastread_reln = 0; _active = 0; } @@ -167,7 +167,7 @@ void SquishArea::raw_scan(int __keep_index, int __scanpm) { } // Get the lastread - if((_msgno >= _lastread) AND (_lastread_reln == 0)) { + if((_msgno >= _lastread) and (_lastread_reln == 0)) { _lastreadfound = _msgno; _lastread_reln = _active - (_msgno != _lastread ? 1 : 0); } @@ -177,7 +177,7 @@ void SquishArea::raw_scan(int __keep_index, int __scanpm) { } // If the exact lastread was not found - if(_active AND (_lastreadfound != _lastread)) { + if(_active and (_lastreadfound != _lastread)) { // Higher than highest or lower than lowest? if(_lastread > _lastmsgno) diff --git a/goldlib/gmb3/gmosqsh3.cpp b/goldlib/gmb3/gmosqsh3.cpp index b19f830..ab3a269 100644 --- a/goldlib/gmb3/gmosqsh3.cpp +++ b/goldlib/gmb3/gmosqsh3.cpp @@ -71,15 +71,15 @@ int SquishArea::load_message(int __mode, gmsg* __msg, SqshHdr& __hdr) { read(_fhsqd, _src, (uint)_frm.ctlsize); // Convert Squish control info to true kludges - while(*_src AND (*_src == CTRL_A) AND _src[1]) { + while(*_src and (*_src == CTRL_A) and _src[1]) { // Copy the kludge char unless it's the AREA: line - if(NOT ((*(dword*)(_src+1) == CHR4_AREA) AND strneql(_src+1, "AREA:", 5))) + if(not ((*(dword*)(_src+1) == CHR4_AREA) and strneql(_src+1, "AREA:", 5))) *_dest++ = *_src; _src++; // Copy the rest of the kludge and add a CR termination - while((*_src != CTRL_A) AND *_src) + while((*_src != CTRL_A) and *_src) *_dest++ = *_src++; *_dest++ = CR; } @@ -156,7 +156,7 @@ int SquishArea::load_message(int __mode, gmsg* __msg, SqshHdr& __hdr) { __msg->attr.lok(__hdr.attr & MSGLOK); if(isnet()) { - __msg->attr.uns(__msg->attr.loc() AND NOT __msg->attr.snt()); + __msg->attr.uns(__msg->attr.loc() and not __msg->attr.snt()); if(wide->direct and __msg->attr.hld() and __msg->attr.cra()) { // Translate hld+cra to dir attribute __msg->attr.dir1(); @@ -165,7 +165,7 @@ int SquishArea::load_message(int __mode, gmsg* __msg, SqshHdr& __hdr) { } } else if(isecho()) - __msg->attr.uns(__msg->attr.loc() AND ((__hdr.attr & MSGSCANNED) ? 0 : 1)); + __msg->attr.uns(__msg->attr.loc() and ((__hdr.attr & MSGSCANNED) ? 0 : 1)); else __msg->attr.uns0(); diff --git a/goldlib/gmb3/gmosqsh4.cpp b/goldlib/gmb3/gmosqsh4.cpp index 4700fbc..611e518 100644 --- a/goldlib/gmb3/gmosqsh4.cpp +++ b/goldlib/gmb3/gmosqsh4.cpp @@ -42,7 +42,7 @@ void SquishArea::lock() { GFTRK("SquishLock"); - if(NOT data->islocked) { + if(not data->islocked) { if(WideCanLock) { long _tries = 0; while(::lock(data->fhsqd, 0, 1) == -1) { @@ -72,7 +72,7 @@ void SquishArea::unlock() { GFTRK("SquishUnlock"); - if(WideCanLock AND data->islocked) + if(WideCanLock and data->islocked) ::unlock(data->fhsqd, 0, 1); lseekset(data->fhsqd, 0); write(data->fhsqd, &data->base, sizeof(SqshBase)); @@ -164,7 +164,7 @@ void SquishArea::delete_msg(uint __reln) { GFTRK("SquishDeleteMsg"); int _was_locked = data->islocked; - if(NOT _was_locked) + if(not _was_locked) lock(); // Setup some local variables for speed @@ -203,7 +203,7 @@ void SquishArea::delete_msg(uint __reln) { if(lastread) lastread--; - if(NOT _was_locked) + if(not _was_locked) unlock(); GFTRK(NULL); @@ -342,10 +342,10 @@ uint SquishArea::find_msgn(ulong __tagn) { register SqshIdx* tag = data->idx; register uint tags = (uint)data->base.totalmsgs; - if(__tagn AND tags AND (__tagn > tag[tags-1].msgno)) + if(__tagn and tags and (__tagn > tag[tags-1].msgno)) return 0; - if(tags AND __tagn) { + if(tags and __tagn) { register long _mid; register long _left = 0; @@ -462,7 +462,7 @@ void SquishArea::save_message(int __mode, gmsg* __msg) { SqshFrm _oldfrm, _newfrm; dword _newframe = SQFRAME_NULL; dword _oldframe = _idx ? _idx[_reln].offset : _base.endframe; - if(NOT(__mode & GMSG_NEW)) { + if(not (__mode & GMSG_NEW)) { // Get the original frame and see if there is still room for the msg read_frm(_oldframe, &_oldfrm); @@ -477,7 +477,7 @@ void SquishArea::save_message(int __mode, gmsg* __msg) { // If there is a max msgs limit and are we writing a new // msg, delete msgs to (hopefully) make room for this msg - if(_base.maxmsgs AND (__mode & GMSG_NEW)) + if(_base.maxmsgs and (__mode & GMSG_NEW)) while(_base.maxmsgs <= _base.totalmsgs) delete_msg((uint)_base.protmsgs); diff --git a/goldlib/gmb3/gmowcat2.cpp b/goldlib/gmb3/gmowcat2.cpp index 3f9d85d..c045161 100644 --- a/goldlib/gmb3/gmowcat2.cpp +++ b/goldlib/gmb3/gmowcat2.cpp @@ -88,7 +88,7 @@ void WCatArea::raw_scan(int __keep_index, int __scanpm) { } // Open WildCat! files for scanning unless they are already open - if(NOT isopen) { + if(not isopen) { data->idx = NULL; data->base.recsize = 0; @@ -131,13 +131,13 @@ void WCatArea::raw_scan(int __keep_index, int __scanpm) { _active++; _msgno = (_ixptr++)->msgno; - if(NOT _firstmsgno) + if(not _firstmsgno) _firstmsgno = _msgno; if(__keep_index) *_msgndxptr++ = _msgno; // Get the lastread - if((_msgno >= _lastread) AND (_lastread_reln == 0)) { + if((_msgno >= _lastread) and (_lastread_reln == 0)) { _lastreadfound = _msgno; _lastread_reln = (uint)(_active - (_msgno != _lastread ? 1 : 0)); } @@ -147,7 +147,7 @@ void WCatArea::raw_scan(int __keep_index, int __scanpm) { } // If the exact lastread was not found - if(_active AND (_lastreadfound != _lastread)) { + if(_active and (_lastreadfound != _lastread)) { // Higher than highest or lower than lowest? if(_lastread > _lastmsgno) @@ -168,7 +168,7 @@ void WCatArea::raw_scan(int __keep_index, int __scanpm) { } // Free index buffer if just counting - if(NOT __keep_index OR __scanpm) + if(not __keep_index or __scanpm) throw_release(data->idx); if(_was_data == NULL) { diff --git a/goldlib/gmb3/gmowcat3.cpp b/goldlib/gmb3/gmowcat3.cpp index f0a895e..2825c14 100644 --- a/goldlib/gmb3/gmowcat3.cpp +++ b/goldlib/gmb3/gmowcat3.cpp @@ -90,13 +90,13 @@ int WCatArea::load_message(int __mode, gmsg* __msg, WCatHdr& __hdr) { __msg->written = __msg->arrived = __msg->received = 0; - if(__hdr.msgdate AND __hdr.msgtime) { + if(__hdr.msgdate and __hdr.msgtime) { JDN2YMD(__hdr.msgdate+1, &_year, &_month, &_day); _time = __hdr.msgtime-1; _hour = (unsigned)(_time / 3600L); _minute = (unsigned)((_time % 3600L) / 60L); _second = (unsigned)(_time - (((long)_hour*3600L)+(long)_minute*60L)); - _tm.tm_year = _year; + _tm.tm_year = _year - 1900; _tm.tm_mon = _month - 1; _tm.tm_mday = _day; _tm.tm_hour = _hour; @@ -110,13 +110,13 @@ int WCatArea::load_message(int __mode, gmsg* __msg, WCatHdr& __hdr) { __msg->written = a + a - b; } - if(__hdr.readdate AND __hdr.readtime) { + if(__hdr.readdate and __hdr.readtime) { JDN2YMD(__hdr.readdate+1, &_year, &_month, &_day); _time = __hdr.readtime-1; _hour = (unsigned)(_time / 3600L); _minute = (unsigned)((_time % 3600L) / 60L); _second = (unsigned)(_time - (((long)_hour*3600L)+(long)_minute*60L)); - _tm.tm_year = _year; + _tm.tm_year = _year - 1900; _tm.tm_mon = _month - 1; _tm.tm_mday = _day; _tm.tm_hour = _hour; diff --git a/goldlib/gmb3/gmowcat4.cpp b/goldlib/gmb3/gmowcat4.cpp index 93423f5..08be8e2 100644 --- a/goldlib/gmb3/gmowcat4.cpp +++ b/goldlib/gmb3/gmowcat4.cpp @@ -41,7 +41,7 @@ void WCatArea::lock() { GFTRK("WCatLock"); - if(NOT data->islocked) { + if(not data->islocked) { if(WideCanLock) { long _tries = 0; while(::lock(data->fhix, 0, 1) == -1) { @@ -70,7 +70,7 @@ void WCatArea::lock() { void WCatArea::unlock() { GFTRK("WCatUnlock"); - if(WideCanLock AND data->islocked) + if(WideCanLock and data->islocked) ::unlock(data->fhix, 0, 1); data->islocked = false; @@ -83,7 +83,7 @@ void WCatArea::unlock() { void WCatArea::save_message(int __mode, gmsg* __msg, WCatHdr& __hdr) { int _was_locked = data->islocked; - if(NOT _was_locked) + if(not _was_locked) lock(); memset(&__hdr, 0, sizeof(WCatHdr)); @@ -114,21 +114,19 @@ void WCatArea::save_message(int __mode, gmsg* __msg, WCatHdr& __hdr) { strc2p(strxcpy(__hdr.subject, __msg->re, sizeof(__hdr.subject))); - if(!*__msg->wildcat.network AND (isnet() OR isecho())) + if(not *__msg->wildcat.network and (isnet() or isecho())) strcpy(__msg->wildcat.network, "FTSC"); strc2p(strcpy(__hdr.network, __msg->wildcat.network)); if(__msg->written) { struct tm* _tm = gmtime(&__msg->written); - int _year = _tm->tm_year % 100; - __hdr.msgdate = (word)(YMD2JDN(1900+_year, _tm->tm_mon+1, _tm->tm_mday)-1); + __hdr.msgdate = (word)(YMD2JDN(1900+_tm->tm_year, _tm->tm_mon+1, _tm->tm_mday)-1); __hdr.msgtime = (((long)_tm->tm_hour*3600L)+((long)_tm->tm_min*60L)+_tm->tm_sec)+1; } if(__msg->received) { struct tm* _tm = gmtime(&__msg->received); - int _year = _tm->tm_year % 100; - __hdr.readdate = (word)YMD2JDN(1900+_year, _tm->tm_mon+1, _tm->tm_mday); + __hdr.readdate = (word)YMD2JDN(1900+_tm->tm_year, _tm->tm_mon+1, _tm->tm_mday); __hdr.readtime = (((long)_tm->tm_hour*3600L)+((long)_tm->tm_min*60L)+_tm->tm_sec)+1; } @@ -198,7 +196,7 @@ void WCatArea::save_message(int __mode, gmsg* __msg, WCatHdr& __hdr) { n++; } - if((__mode & GMSG_NEW) OR (_size > __hdr.msgbytes)) { + if((__mode & GMSG_NEW) or (_size > __hdr.msgbytes)) { if(_size > __hdr.msgbytes) { ulong _magic = MagicHeaderInactive; lseekset(data->fhdat, data->idx[_reln].offset); @@ -220,7 +218,7 @@ void WCatArea::save_message(int __mode, gmsg* __msg, WCatHdr& __hdr) { throw_free(_txt); } - if(NOT _was_locked) + if(not _was_locked) unlock(); GFTRK(NULL); diff --git a/goldlib/gmb3/gmoxbbs.h b/goldlib/gmb3/gmoxbbs.h index 77d1ae7..9d054d5 100644 --- a/goldlib/gmb3/gmoxbbs.h +++ b/goldlib/gmb3/gmoxbbs.h @@ -253,7 +253,7 @@ extern int xbbsdatano; // ------------------------------------------------------------------ -#if not defined(__OS2__) +#if !defined(__OS2__) inline void XbbsArea::open() { } inline void XbbsArea::save_lastread() { } inline void XbbsArea::close() { } diff --git a/goldlib/gmb3/gmoxbbs1.cpp b/goldlib/gmb3/gmoxbbs1.cpp index 5472440..7af002c 100644 --- a/goldlib/gmb3/gmoxbbs1.cpp +++ b/goldlib/gmb3/gmoxbbs1.cpp @@ -169,7 +169,7 @@ void XbbsInit(const char* path, int userno) { xbbswide->user->fh = ::sopen(AddPath(xbbswide->path, "Users"), O_RDONLY|O_BINARY, WideSharemode); if(xbbswide->user->fh != -1) { xbbswide->user->find(_username); - if(NOT xbbswide->user->found) { + if(not xbbswide->user->found) { xbbswide->userno = 0; //WideLog->printf("* User \"%s\" not found in %sUsers.", _username, xbbswide->path); //xbbswide->user->add(_username); diff --git a/goldlib/gmb3/gmoxbbs2.cpp b/goldlib/gmb3/gmoxbbs2.cpp index 92eb02b..7f51fb0 100644 --- a/goldlib/gmb3/gmoxbbs2.cpp +++ b/goldlib/gmb3/gmoxbbs2.cpp @@ -98,7 +98,7 @@ void XbbsArea::raw_scan(int __keep_index, int __scanpm) { } // Open AdeptXBBS files for scanning unless they are already open - if(NOT isopen) { + if(not isopen) { data->idx = NULL; data->idx_size = 0; @@ -138,13 +138,13 @@ void XbbsArea::raw_scan(int __keep_index, int __scanpm) { _active++; _msgno = _active; - if(NOT _firstmsgno) + if(not _firstmsgno) _firstmsgno = _msgno; if(__keep_index) *_msgndxptr++ = _msgno; // Get the lastread - if((_msgno >= _lastread) AND (_lastread_reln == 0)) { + if((_msgno >= _lastread) and (_lastread_reln == 0)) { _lastreadfound = _msgno; _lastread_reln = (uint)(_active - (_msgno != _lastread ? 1 : 0)); } @@ -154,7 +154,7 @@ void XbbsArea::raw_scan(int __keep_index, int __scanpm) { } // If the exact lastread was not found - if(_active AND (_lastreadfound != _lastread)) { + if(_active and (_lastreadfound != _lastread)) { // Higher than highest or lower than lowest? if(_lastread > _lastmsgno) @@ -175,7 +175,7 @@ void XbbsArea::raw_scan(int __keep_index, int __scanpm) { } // Free index buffer if just counting - if(NOT __keep_index OR __scanpm) + if(not __keep_index or __scanpm) throw_release(data->idx); if(_was_data == NULL) { diff --git a/goldlib/gmb3/gmoxbbs3.cpp b/goldlib/gmb3/gmoxbbs3.cpp index 419a595..1a6c2a6 100644 --- a/goldlib/gmb3/gmoxbbs3.cpp +++ b/goldlib/gmb3/gmoxbbs3.cpp @@ -118,13 +118,13 @@ int XbbsArea::load_message(int __mode, gmsg* __msg, XbbsHdr& __hdr) { // Set the unsent attribute #if 0 if(isnet()) - __msg->attr.uns((__msg->attr.loc() AND NOT __msg->attr.snt()) OR (__hdr.xflags & XFLAGS_MSGNET)); + __msg->attr.uns((__msg->attr.loc() and not __msg->attr.snt()) or (__hdr.xflags & XFLAGS_MSGNET)); else __msg->attr.uns(__hdr.xflags & XFLAGS_MSGECHO); #endif - if(isnet() OR isecho()) - __msg->attr.uns(NOT(__hdr.xflags & XFLAGS_MSGSCANNED)); + if(isnet() or isecho()) + __msg->attr.uns(not (__hdr.xflags & XFLAGS_MSGSCANNED)); __msg->adeptxbbs.iflags = __hdr.iflags; __msg->adeptxbbs.oflags = __hdr.oflags; diff --git a/goldlib/gmb3/gmoxbbs4.cpp b/goldlib/gmb3/gmoxbbs4.cpp index 07361c6..a5cf397 100644 --- a/goldlib/gmb3/gmoxbbs4.cpp +++ b/goldlib/gmb3/gmoxbbs4.cpp @@ -182,7 +182,7 @@ void XbbsArea::save_message(int __mode, gmsg* __msg, XbbsHdr& __hdr) { __hdr.xflags |= (ushort)(__msg->attr.arc() ? XFLAGS_MSGARCHIVED : 0); __hdr.xflags |= (ushort)(__msg->attr.tag() ? XFLAGS_MSGTAGGED : 0); - if(NOT (__mode & GMSG_UPDATE)) { + if(not (__mode & GMSG_UPDATE)) { if(__msg->attr.uns()) { __hdr.xflags &= ~(XFLAGS_MSGSCANNED|XFLAGS_MSGGSCAN|XFLAGS_MSGRSCAN); if(isnet()) @@ -212,7 +212,7 @@ void XbbsArea::save_message(int __mode, gmsg* __msg, XbbsHdr& __hdr) { // Write the message text uint _size = strlen(__msg->txt) + 1; - if((__mode & GMSG_NEW) OR (_size > __hdr.length)) + if((__mode & GMSG_NEW) or (_size > __hdr.length)) __hdr.start = filelength(data->fhtext); lseekset(data->fhtext, __hdr.start); lock_file(data->fhtext, __hdr.start, 640L*1024L); @@ -263,14 +263,14 @@ void XbbsArea::save_message(int __mode, gmsg* __msg, XbbsHdr& __hdr) { unlock_file(data->fhindex, position, sizeof(XbbsIdx)); } - if(NOT(__mode & GMSG_DELETE)) { + if(not (__mode & GMSG_DELETE)) { // Add/update personal mail record int _addpm = true; // Remove it if the msg is being received - if((__mode & GMSG_UPDATE) AND __msg->attr.rcv()) + if((__mode & GMSG_UPDATE) and __msg->attr.rcv()) _addpm = false; // Don't touch it if the msg was already received - if(NOT (_addpm AND __msg->attr.rcv())) { + if(not (_addpm and __msg->attr.rcv())) { // Only do it if the person is on this BBS if(wide->user->find(__msg->to)) update_personal_mail(__msg, __hdr, _addpm); @@ -378,7 +378,7 @@ void XbbsArea::update_personal_mail(gmsg* __msg, XbbsHdr& __hdr, int __addpm) { if(_pmirecs) { lseekset(fh, 0); ::write(fh, _pmilist, sizeof(XbbsPmi)*_pmirecs); - if(_pmiptr AND !__addpm) + if(_pmiptr and not __addpm) chsize(fh, sizeof(XbbsPmi)*_pmirecs); ::close(fh); } diff --git a/goldnode/goldnode.cpp b/goldnode/goldnode.cpp index b2ef1c8..0d136db 100644 --- a/goldnode/goldnode.cpp +++ b/goldnode/goldnode.cpp @@ -62,7 +62,7 @@ #define __GPID__ "GoldNode+/386" #elif defined(__linux__) #define __GPID__ "GoldNODE+/LNX" -#elif defined(__FreeBSD__) or defined(__OpenBSD__) +#elif defined(__FreeBSD__) || defined(__OpenBSD__) #define __GPID__ "GoldNODE+/BSD" #else #define __GPID__ "GoldNODE+" @@ -1081,14 +1081,14 @@ static void fatal_error(const char* what) { static int do_if(char* val) { - if(strieql(val, "OS/2") OR strieql(val, "OS2")) { + if(strieql(val, "OS/2") or strieql(val, "OS2")) { #ifdef __OS2__ return true; #else return false; #endif } - else if(strieql(val, "NT") OR strieql(val, "W32") OR strieql(val, "WIN32")) { + else if(strieql(val, "NT") or strieql(val, "W32") or strieql(val, "WIN32")) { #ifdef __WIN32__ return true; #else @@ -1128,7 +1128,7 @@ static int do_if(char* val) { else if(strieql(val, "FIREBIRD")) { return true; } - else if(strieql(val, "YES") OR strieql(val, "TRUE") OR strieql(val, "ON")) + else if(strieql(val, "YES") or strieql(val, "TRUE") or strieql(val, "ON")) return true; return atoi(val) != 0; }