From 18d26cabfc1744ddea182f54cad903e270f2514b Mon Sep 17 00:00:00 2001 From: Ianos Gnatiuc Date: Mon, 8 Jan 2007 12:09:42 +0000 Subject: [PATCH] Fixed few memory leeks. --- golded.sln | 2 ++ golded3/gcalst.cpp | 18 +++++++++++------ golded3/gcarea.cpp | 43 ++++++++++++++++++++++++++--------------- golded3/gealst.cpp | 2 +- golded3/gecmfd.cpp | 6 +++++- golded3/gectrl.cpp | 10 +++++++--- golded3/gedoit.cpp | 11 ++++++----- golded3/geinit.cpp | 1 + golded3/geline.cpp | 2 +- golded3/gemsgs.cpp | 4 ++-- golded3/genode.cpp | 15 +++++++++----- golded3/gepost.cpp | 7 ++++--- golded3/geprot.h | 2 ++ golded3/geutil.cpp | 14 ++++++++++++++ golded3/gmarea.cpp | 3 ++- golded3/gmarea.h | 6 ++++-- goldlib/gcfg/gedacfg.h | 4 ++-- goldlib/gcfg/gxhpt.cpp | 6 +++--- goldlib/gcfg/gxxbbs.cpp | 2 +- goldlib/gmb3/gmoarea.h | 3 ++- goldlib/gmb3/gmofido.h | 2 +- goldnode/goldnode.cpp | 1 + rddt/rddt.cpp | 2 +- 23 files changed, 111 insertions(+), 55 deletions(-) diff --git a/golded.sln b/golded.sln index ebea242..41e5981 100644 --- a/golded.sln +++ b/golded.sln @@ -52,6 +52,7 @@ Global {C23888DA-7024-4A38-A8C5-CE4BEFA4629A}.Release|x64.ActiveCfg = Release|x64 {C23888DA-7024-4A38-A8C5-CE4BEFA4629A}.Release|x64.Build.0 = Release|x64 {B80E3728-98E5-4A9A-B883-9C064F1FFFA7}.Debug|Win32.ActiveCfg = Debug|Win32 + {B80E3728-98E5-4A9A-B883-9C064F1FFFA7}.Debug|Win32.Build.0 = Debug|Win32 {B80E3728-98E5-4A9A-B883-9C064F1FFFA7}.Debug|x64.ActiveCfg = Debug|x64 {B80E3728-98E5-4A9A-B883-9C064F1FFFA7}.Debug|x64.Build.0 = Debug|x64 {B80E3728-98E5-4A9A-B883-9C064F1FFFA7}.Release|Win32.ActiveCfg = Release|Win32 @@ -59,6 +60,7 @@ Global {B80E3728-98E5-4A9A-B883-9C064F1FFFA7}.Release|x64.ActiveCfg = Release|x64 {B80E3728-98E5-4A9A-B883-9C064F1FFFA7}.Release|x64.Build.0 = Release|x64 {951D76D2-FA57-4C95-8F65-A6C19C122AA5}.Debug|Win32.ActiveCfg = Debug|Win32 + {951D76D2-FA57-4C95-8F65-A6C19C122AA5}.Debug|Win32.Build.0 = Debug|Win32 {951D76D2-FA57-4C95-8F65-A6C19C122AA5}.Debug|x64.ActiveCfg = Debug|x64 {951D76D2-FA57-4C95-8F65-A6C19C122AA5}.Debug|x64.Build.0 = Debug|x64 {951D76D2-FA57-4C95-8F65-A6C19C122AA5}.Release|Win32.ActiveCfg = Release|Win32 diff --git a/golded3/gcalst.cpp b/golded3/gcalst.cpp index 5270316..397b5c0 100644 --- a/golded3/gcalst.cpp +++ b/golded3/gcalst.cpp @@ -141,6 +141,10 @@ Area* AreaList::NewArea(const char *basetype) { return new Area(ap); } +Area* AreaList::NewArea(const std::string &basetype) +{ + return NewArea(basetype.c_str()); +} // ------------------------------------------------------------------ // Write lastreads for the next session @@ -310,11 +314,11 @@ void AreaList::WriteAreaDef(const char* file) else if((*aa)->islocal()) strcpy(type, "Local"); #ifndef GMB_NOXBBS - if(streql((*aa)->basetype(), "ADEPTXBBS")) + if ((*aa)->basetype() == "ADEPTXBBS") strcpy(msgbase, "XBBS"); else #endif - strxcpy(msgbase, (*aa)->basetype(), sizeof(msgbase)); + strxcpy(msgbase, (*aa)->basetype().c_str(), sizeof(msgbase)); if (strchr((*aa)->echoid(), ' ')) gsprintf(PRINTF_DECLARE_BUFFER(echoid), "\"%s\"", (*aa)->echoid()); else @@ -386,11 +390,13 @@ void AreaList::SetAreaDesc(char* echoid, char* desc) { // ------------------------------------------------------------------ #ifndef GMB_NOPCB -void PcbAdjustArea(uint rec, const char* msgfile) { - - for(uint n=0; nbasetype(), "PCBOARD")) { + if (a->basetype() == "PCBOARD") + { if((a->board() == rec) and (*a->path() == NUL)) { a->set_path(msgfile); break; diff --git a/golded3/gcarea.cpp b/golded3/gcarea.cpp index 74bbbb2..3e4abc3 100644 --- a/golded3/gcarea.cpp +++ b/golded3/gcarea.cpp @@ -166,7 +166,8 @@ void AreaList::AddNewArea(AreaCfg* aa) *desc = NUL; // Make sure the path field is 100% correct for the msgbase - if(streql(aa->basetype, "FTS1") or streql(aa->basetype, "OPUS")) { + if ((aa->basetype == "FTS1") || (aa->basetype == "OPUS")) + { if(*aa->path == NUL) return; MapPath(aa->path); @@ -174,7 +175,7 @@ void AreaList::AddNewArea(AreaCfg* aa) strschg_environ(aa->path); } #ifndef GMB_NOHUDS - else if (streql(aa->basetype, "HUDSON")) + else if (aa->basetype == "HUDSON") { if ((aa->board < 1) or (aa->board > 200)) // Ignore areas with invalid numbers return; @@ -182,7 +183,7 @@ void AreaList::AddNewArea(AreaCfg* aa) } #endif #ifndef GMB_NOGOLD - else if (streql(aa->basetype, "GOLDBASE")) + else if (aa->basetype == "GOLDBASE") { if ((aa->board < 1) or (aa->board > 500)) // Ignore areas with invalid numbers return; @@ -190,7 +191,7 @@ void AreaList::AddNewArea(AreaCfg* aa) } #endif #ifndef GMB_NOEZY - else if (streql(aa->basetype, "EZYCOM")) + else if (aa->basetype == "EZYCOM") { // Ignore areas with invalid numbers if ((aa->board < 1) or (aa->board > 1536)) @@ -199,7 +200,8 @@ void AreaList::AddNewArea(AreaCfg* aa) } #endif #ifndef GMB_NOWCAT - else if(streql(aa->basetype, "WILDCAT")) { + else if (aa->basetype == "WILDCAT") + { if(*aa->path == NUL) return; MapPath(aa->path); @@ -208,7 +210,8 @@ void AreaList::AddNewArea(AreaCfg* aa) } #endif #ifndef GMB_NOXBBS - else if(streql(aa->basetype, "ADEPTXBBS")) { + else if (aa->basetype == "ADEPTXBBS") + { if(*aa->path == NUL) return; MapPath(aa->path); @@ -217,7 +220,8 @@ void AreaList::AddNewArea(AreaCfg* aa) } #endif #ifndef GMB_NOSQSH - else if(streql(aa->basetype, "SQUISH")) { + else if (aa->basetype == "SQUISH") + { if(*aa->path == NUL) return; MapPath(aa->path); @@ -226,7 +230,8 @@ void AreaList::AddNewArea(AreaCfg* aa) } #endif #ifndef GMB_NOJAM - else if(streql(aa->basetype, "JAM")) { + else if (aa->basetype == "JAM") + { if(*aa->path == NUL) return; MapPath(aa->path); @@ -235,14 +240,16 @@ void AreaList::AddNewArea(AreaCfg* aa) } #endif #ifndef GMB_NOPCB - else if(streql(aa->basetype, "PCBOARD")) { + else if (aa->basetype == "PCBOARD") + { MapPath(aa->path); StripBackslash(aa->path); strschg_environ(aa->path); } #endif #ifndef GMB_NOSMB - else if(streql(aa->basetype, "SMB")) { + else if (aa->basetype == "SMB") + { if(*aa->path == NUL) return; MapPath(aa->path); @@ -250,7 +257,8 @@ void AreaList::AddNewArea(AreaCfg* aa) strschg_environ(aa->path); } #endif - else if(streql(aa->basetype, "SEPARATOR")) { + else if (aa->basetype == "SEPARATOR") + { } else { return; @@ -302,13 +310,16 @@ void AreaList::AddNewArea(AreaCfg* aa) } break; } - else if(not (*ap)->isseparator()) { + else if(not (*ap)->isseparator()) + { bool eq_path = strieql(aa->path, (*ap)->path()); bool eq_board = (aa->board == (*ap)->board()); - bool eq_msgbase = streql(aa->basetype, (*ap)->basetype()); - bool eq_isfido = ((streql(aa->basetype, "OPUS") or streql(aa->basetype, "FTS1")) - and (streql((*ap)->basetype(), "OPUS") or streql((*ap)->basetype(), "FTS1"))); - if(eq_path and eq_board and (eq_msgbase or eq_isfido)) { + bool eq_msgbase = (aa->basetype == (*ap)->basetype()); + bool eq_isfido = (((aa->basetype == "OPUS") || (aa->basetype == "FTS1")) && + (((*ap)->basetype() == "OPUS") || ((*ap)->basetype() == "FTS1"))); + + if (eq_path and eq_board and (eq_msgbase or eq_isfido)) + { // We had it already, so override with the new data newarea = false; if(strblank((*ap)->desc())) diff --git a/golded3/gealst.cpp b/golded3/gealst.cpp index 6b2e37d..9bf55a1 100644 --- a/golded3/gealst.cpp +++ b/golded3/gealst.cpp @@ -289,7 +289,7 @@ extern "C" int AreaListCmp(const Area** __a, const Area** __b) { else if(B->isseparator()) { return sepfirst?1:-1; } - else if((cmp = strcmp(A->basetype(), B->basetype())) != 0) + else if ((cmp = strcmp(A->basetype().c_str(), B->basetype().c_str())) != 0) return cmp; break; case 'Y': diff --git a/golded3/gecmfd.cpp b/golded3/gecmfd.cpp index 0de0007..eff080e 100644 --- a/golded3/gecmfd.cpp +++ b/golded3/gecmfd.cpp @@ -601,7 +601,11 @@ void CmfMsgs(GMsg* msg, bool torecycle) bool need_fmpt = true; bool need_topt = true; - if(not need_netmail_kludges and streql(AAorig->basetype(), "SQUISH") and strcmp(AAdest->basetype(), "SQUISH") and AAdest->isnet() and AAorig->isnet()) { + if (not need_netmail_kludges && + (AAorig->basetype() == "SQUISH") && + (AAdest->basetype() == "SQUISH") && + AAdest->isnet() && AAorig->isnet()) + { if(msg->orig.point and not strstr(msg->txt, "\001FMPT")) need_netmail_kludges = true; else diff --git a/golded3/gectrl.cpp b/golded3/gectrl.cpp index 0bf45c0..e02e956 100644 --- a/golded3/gectrl.cpp +++ b/golded3/gectrl.cpp @@ -96,9 +96,11 @@ char* MakeTearline(GMsg* msg, char* buf) { void MakeFlags(GMsg* msg, Line** line, char* buf) { // The FrontDoor FLAGS netmail kludge - if(CFG->switches.get(useflags)) { + if (CFG->switches.get(useflags)) + { sprintf(buf, "\001FLAGS "); - if(streql(AA->basetype(), "HUDSON")) { + if (AA->basetype() == "HUDSON") + { if(msg->attr.hld()) strcat(buf, "HLD "); if(msg->attr.frq()) @@ -360,7 +362,9 @@ void DoKludges(int mode, GMsg* msg, int kludges) { msg->orig.make_string(buf2, msg->odom); gsprintf(PRINTF_DECLARE_BUFFER(msg->msgids), "%s %08x", buf2, getMsgId()); } - if(CFG->switches.get(usemsgid) and strcmp(AA->basetype(), "PCBOARD")) { + + if (CFG->switches.get(usemsgid) && (AA->basetype() == "PCBOARD")) + { sprintf(buf, "\001MSGID: %s", msg->msgids); line = AddKludge(line, buf); line->kludge = GKLUD_MSGID; diff --git a/golded3/gedoit.cpp b/golded3/gedoit.cpp index 74c99b3..7eaec4a 100644 --- a/golded3/gedoit.cpp +++ b/golded3/gedoit.cpp @@ -377,14 +377,15 @@ char* GetCurrQuotebuf(char* quotebuf) { strcpy(quotebuf, AA->Quotebuffile()); MakePathname(quotebuf, CFG->goldpath, quotebuf); } - else { - if(streql(AA->basetype(), "EZYCOM")) + else + { + if (AA->basetype() == "EZYCOM") sprintf(quotebuf, "%sgld%05u.qbf", CFG->ezycom.msgbasepath, AA->board()); - else if(streql(AA->basetype(), "FTS1") or streql(AA->basetype(), "OPUS")) + else if ((AA->basetype() == "FTS1") || (AA->basetype() == "OPUS")) sprintf(quotebuf, "%s%s", AA->path(), "golded.qbf"); - else if(streql(AA->basetype(), "GOLDBASE")) + else if (AA->basetype() == "GOLDBASE") sprintf(quotebuf, "%sgoldg%03u.qbf", CFG->goldbasepath, AA->board()); - else if(streql(AA->basetype(), "HUDSON")) + else if (AA->basetype() == "HUDSON") sprintf(quotebuf, "%sgoldh%03u.qbf", CFG->hudsonpath, AA->board()); else sprintf(quotebuf, "%s%s", AA->path(), ".qbf"); diff --git a/golded3/geinit.cpp b/golded3/geinit.cpp index 516bfff..b77be19 100644 --- a/golded3/geinit.cpp +++ b/golded3/geinit.cpp @@ -507,6 +507,7 @@ BOOL WINAPI GoldedCtrlHandler(DWORD dwCtrlType) { void Uninitialize() { delete WideUsername; + LookupNodeClear(); } diff --git a/golded3/geline.cpp b/golded3/geline.cpp index 13f22d5..678d23e 100644 --- a/golded3/geline.cpp +++ b/golded3/geline.cpp @@ -2069,7 +2069,7 @@ void MakeLineIndex(GMsg* msg, int margin, bool getvalue, bool header_recode) { line = AddLine(line, ""); ptr = msg->txt; uint _size = strlen(msg->txt); - if(streql(AA->basetype(), "OPUS") or streql(AA->basetype(), "FTS1")) + if ((AA->basetype() == "OPUS") || (AA->basetype() == "FTS1")) idxadjust = 190; for (idx=0; idx < _size; ptr+=16,idx+=16) { diff --git a/golded3/gemsgs.cpp b/golded3/gemsgs.cpp index 6a3cd05..617f56d 100644 --- a/golded3/gemsgs.cpp +++ b/golded3/gemsgs.cpp @@ -494,7 +494,7 @@ void TokenXlat(int mode, std::string &input, GMsg* msg, GMsg* oldmsg, int __orig if (strnieql(it2str(input, dst), "@area", 5)) { - if (tokenxchg(input, dst, "@areatype", AA->basetype())) + if (tokenxchg(input, dst, "@areatype", AA->basetype().c_str())) continue; char areapath[GMAXPATH]; @@ -958,7 +958,7 @@ void GMsg::LinesToText() { strxcpy(re, _buf, sizeof(ISub)); } - bool _lfterm = EDIT->CrLfTerm() and strcmp(AA->basetype(), "PCBOARD"); + bool _lfterm = EDIT->CrLfTerm() and (AA->basetype() == "PCBOARD"); bool _hardterm = AA->Edithardterm() or AA->requirehardterm(); bool _softterm = AA->requiresoftterm(); diff --git a/golded3/genode.cpp b/golded3/genode.cpp index 0b555ca..eb71023 100644 --- a/golded3/genode.cpp +++ b/golded3/genode.cpp @@ -1095,10 +1095,15 @@ struct location_item bool operator==(Addr &other) { return addr.equals(other); } }; +std::vector g_LocationCash; + +void LookupNodeClear() +{ + g_LocationCash.clear(); +} + void LookupNodeLocation(GMsg* msg, std::string &location, int what) { - static std::vector cash; - Subj statuslinebak; strcpy(statuslinebak, information); @@ -1119,8 +1124,8 @@ void LookupNodeLocation(GMsg* msg, std::string &location, int what) if (addr.zone == 0) addr.zone = AA->Aka().addr.zone; - std::vector::iterator it = cash.begin(); - std::vector::iterator end = cash.end(); + std::vector::iterator it = g_LocationCash.begin(); + std::vector::iterator end = g_LocationCash.end(); while ((it != end) && (*it < addr)) it++; @@ -1165,7 +1170,7 @@ void LookupNodeLocation(GMsg* msg, std::string &location, int what) } item.loc = location = city; - cash.insert(it, item); + g_LocationCash.insert(it, item); } update_statusline(statuslinebak); diff --git a/golded3/gepost.cpp b/golded3/gepost.cpp index 7cef54e..6e689ab 100644 --- a/golded3/gepost.cpp +++ b/golded3/gepost.cpp @@ -1001,7 +1001,7 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) { { if (CFG->replylink != REPLYLINK_NONE) { - if ((CFG->replylink == REPLYLINK_DIRECT) or streql(AA->basetype(), "JAM")) + if ((CFG->replylink == REPLYLINK_DIRECT) or (AA->basetype() == "JAM")) reply_msgno = omsg->msgno; else if (CFG->replylink == REPLYLINK_CHAIN) GetLastLink(omsg, reply_msgno); @@ -1158,7 +1158,7 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) { uint32_t replynext; bool ok2save = false; - if (streql(AA->basetype(), "SQUISH")) + if (AA->basetype() == "SQUISH") { if (reply->link.first()) { @@ -1177,7 +1177,8 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) { ok2save = true; } } - else if(streql(AA->basetype(), "JAM")) { + else if (AA->basetype() == "JAM") + { if(reply->link.first()) { replynext = reply->link.first(); do { diff --git a/golded3/geprot.h b/golded3/geprot.h index 7784389..b96e2d7 100644 --- a/golded3/geprot.h +++ b/golded3/geprot.h @@ -304,6 +304,7 @@ const char *lookup_nodelist(ftn_addr* addr); void LookupNodeLocation(GMsg* msg, std::string &location, int what); void LookupNode(GMsg* msg, const char* name, int what); +void LookupNodeClear(); void CheckNodelists(); @@ -481,6 +482,7 @@ char* strtmp(const char* str); vattr quotecolor(const char* line); void doinvalidate(char* text, const char* find, const char* replace, bool is_tearline = false); bool find(const std::vector &vec, const char *str); +bool find(const std::vector &vec, const std::string &str); vattr GetColorName(const char *name, Addr &addr, vattr color); diff --git a/golded3/geutil.cpp b/golded3/geutil.cpp index 47616d2..c8eb21c 100644 --- a/golded3/geutil.cpp +++ b/golded3/geutil.cpp @@ -744,3 +744,17 @@ bool find(const std::vector &vec, const char *str) { return false; } + +bool find(const std::vector &vec, const std::string &str) +{ + std::vector::const_iterator it = vec.begin(); + std::vector::const_iterator end = vec.end(); + + for (; it != end; it++) + { + if ((*it) == str) + return true; + } + + return false; +} diff --git a/golded3/gmarea.cpp b/golded3/gmarea.cpp index 6be7c0f..67bdc3a 100644 --- a/golded3/gmarea.cpp +++ b/golded3/gmarea.cpp @@ -300,7 +300,8 @@ void Area::SaveMsg(int mode, GMsg* msg) { echopost++; } - if(streql(basetype(), "JAM") and (isecho() or isnet())) { + if ((basetype() == "JAM") && (isecho() or isnet())) + { Path p; sprintf(file, "%s%smail.jam", CFG->jampath, isecho() ? "echo" : "net"); diff --git a/golded3/gmarea.h b/golded3/gmarea.h index 8858a16..447ba0a 100644 --- a/golded3/gmarea.h +++ b/golded3/gmarea.h @@ -192,7 +192,7 @@ public: char sortspec[20]; // Active msgbases (bitmap of MT_* contants) - std::vector basetypes; + std::vector basetypes; // Additional items to the area scan menu GAreaListScan ListScan; @@ -216,6 +216,7 @@ public: // Return pointer to a new'd area of the specified format Area* NewArea(const char *basetype); + Area* NewArea(const std::string &basetype); // Sort areas void Sort(const char* specs=NULL, int first=0, int last=-1); @@ -489,7 +490,7 @@ public: int areaid() const { return area->areaid(); } int groupid() const { return area->groupid(); } uint type() const { return area->type(); } - const char *basetype() const { return area->basetype(); } + const std::string &basetype() const { return area->basetype(); } uint board() const { return area->board(); } const ftn_addr& aka() const { return area->aka(); } int originno() const { return area->originno(); } @@ -515,6 +516,7 @@ public: void set_groupid(int g) { area->set_groupid(g); } void set_type(uint t) { area->set_type(t); } void set_basetype(const char *m) { area->set_basetype(m); } + void set_basetype(const std::string &m) { area->set_basetype(m); } void set_board(uint b) { area->set_board(b); } void set_aka(ftn_addr& a) { area->set_aka(a); } void set_originno(int o) { area->set_originno(o); } diff --git a/goldlib/gcfg/gedacfg.h b/goldlib/gcfg/gedacfg.h index e563656..c82d843 100644 --- a/goldlib/gcfg/gedacfg.h +++ b/goldlib/gcfg/gedacfg.h @@ -65,7 +65,7 @@ public: int originno; // Origin number uint board; // Board number (Hudson/Goldbase/Ezycom/PCBoard fmts) uint type; // Type of msgarea (GMB_xxx) - const char *basetype; // Type of msgbase + std::string basetype; // Type of msgbase ftn_addr aka; // The AKA to use in the area ftn_attr attr; // Default attributes byte scan : 1; // TRUE if listed with AREASCAN @@ -77,7 +77,7 @@ public: int setorigin(std::string& origin); - bool isseparator() const { return streql(basetype, "SEPARATOR"); } + bool isseparator() const { return (basetype == "SEPARATOR"); } bool isnet() const { return !!(type & GMB_NET); } bool isecho() const { return !!(type & GMB_ECHO); } diff --git a/goldlib/gcfg/gxhpt.cpp b/goldlib/gcfg/gxhpt.cpp index 0f72ea3..4b59c8c 100644 --- a/goldlib/gcfg/gxhpt.cpp +++ b/goldlib/gcfg/gxhpt.cpp @@ -358,19 +358,19 @@ void gareafile::ReadHPTFile(char* path, char* file, char* origin, int group) { switch(aa.type) { case GMB_NET: aa.attr = attribsnet; - if(*aa.basetype == '\0') + if (aa.basetype.empty()) aa.basetype = fidomsgtype; AddNewArea(aa); break; case GMB_ECHO: aa.attr = attribsecho; - if(*aa.basetype == '\0') + if (aa.basetype.empty()) aa.basetype = fidomsgtype; AddNewArea(aa); break; case GMB_LOCAL: aa.attr = attribslocal; - if(*aa.basetype == '\0') + if (aa.basetype.empty()) aa.basetype = fidomsgtype; AddNewArea(aa); break; diff --git a/goldlib/gcfg/gxxbbs.cpp b/goldlib/gcfg/gxxbbs.cpp index 97c8b86..4929544 100644 --- a/goldlib/gcfg/gxxbbs.cpp +++ b/goldlib/gcfg/gxxbbs.cpp @@ -83,7 +83,7 @@ void gareafile::ReadAdeptXbbsFile(char* path, char* file, char* options) { break; case CRC_AREAEND: aa.setechoid(*usenet ? usenet : name); - if(streql(aa.basetype, "OPUS") or streql(aa.basetype, "FTS1")) + if ((aa.basetype == "OPUS") || (aa.basetype == "FTS1")) aa.setpath(apath); else { sprintf(buf, "%s%s", apath, name); diff --git a/goldlib/gmb3/gmoarea.h b/goldlib/gmb3/gmoarea.h index ace31ee..4d40ce3 100644 --- a/goldlib/gmb3/gmoarea.h +++ b/goldlib/gmb3/gmoarea.h @@ -81,7 +81,7 @@ public: int areaid() const { return cfg.areaid; } int groupid() const { return cfg.groupid; } uint type() const { return cfg.type; } - const char *basetype() const { return cfg.basetype; } + const std::string &basetype() const { return cfg.basetype; } uint board() const { return cfg.board; } const ftn_addr& aka() const { return cfg.aka; } int originno() const { return cfg.originno; } @@ -104,6 +104,7 @@ public: void set_groupid(int g) { cfg.groupid = g; } void set_type(uint t) { cfg.type = t; } void set_basetype(const char *m) { cfg.basetype = m; } + void set_basetype(const std::string &m) { cfg.basetype = m; } void set_board(uint b) { cfg.board = b; } void set_aka(ftn_addr& a) { cfg.aka = a; } void set_originno(int o) { cfg.originno = o; } diff --git a/goldlib/gmb3/gmofido.h b/goldlib/gmb3/gmofido.h index 25ed511..00d4df4 100644 --- a/goldlib/gmb3/gmofido.h +++ b/goldlib/gmb3/gmofido.h @@ -139,7 +139,7 @@ protected: FidoWide* wide; FidoData* data; - inline bool isopus() const { return streql(cfg.basetype, "OPUS"); } + inline bool isopus() const { return (cfg.basetype == "OPUS"); } void data_open(); void data_close(); diff --git a/goldnode/goldnode.cpp b/goldnode/goldnode.cpp index f2e03ee..67a8c7d 100644 --- a/goldnode/goldnode.cpp +++ b/goldnode/goldnode.cpp @@ -55,6 +55,7 @@ #endif #include +#include // ------------------------------------------------------------------ // Config versions diff --git a/rddt/rddt.cpp b/rddt/rddt.cpp index aabd64c..8be281d 100644 --- a/rddt/rddt.cpp +++ b/rddt/rddt.cpp @@ -37,7 +37,7 @@ using namespace std; #include #include #include - +#include int debug = false;