From 054510bddc1801d3900fb0c801a0169dd588b466 Mon Sep 17 00:00:00 2001 From: chatty Date: Tue, 10 May 1994 10:02:49 +0000 Subject: replaced TRUE/FALSE by true/false --- comm/OLD/PortServer.cc | 53 ++++++++++++++++++++++++++++++++------------------ comm/OLD/ReqMgr.h | 4 ++-- 2 files changed, 36 insertions(+), 21 deletions(-) (limited to 'comm/OLD') diff --git a/comm/OLD/PortServer.cc b/comm/OLD/PortServer.cc index dc4c334..d66f722 100644 --- a/comm/OLD/PortServer.cc +++ b/comm/OLD/PortServer.cc @@ -22,12 +22,27 @@ #include // sometimes, cuserid is declared in stdio.h ... #include +#ifdef __osf__ +extern "C" { +#endif #include +#ifdef __osf__ +} +#endif + +#ifdef __osf__ +extern "C" { + unsigned short htons (unsigned short); + unsigned short ntohs (unsigned short); + int gethostname (char*, int); +} +#endif + #define DEFKEY "%s:" // *** horrible patch -bool PortServerInquireSysError = FALSE; +bool PortServerInquireSysError = false; /*?class UchPortServer The class \typ{UchPortServer} described here implements the communication with the port server. @@ -57,7 +72,7 @@ UchPortServer :: UchPortServer (const char* serv, const char* host) portno = atoi (port); else portno = 3003; -// Error (ErrFatal, "getservbyname", "service not available"); +// ::Error (ErrFatal, "getservbyname", "service not available"); } /* open datagram socket */ @@ -81,7 +96,7 @@ static void SendRequest (UchDatagram* to, UchPortServerReq req) { UchMsgBuffer buf (256); - buf.Append (req); + buf.WriteMsg (req); to->Write (buf); } @@ -127,11 +142,11 @@ UchPortServer :: Remove (const char* key, UchInetAddress& addr, int id) SendRequest (Serv, req); } -static bool expired = FALSE; +static bool expired = false; static void Expire (Millisecond) { - expired = TRUE; + expired = true; } @@ -150,27 +165,27 @@ UchInetAddress* UchPortServer :: Inquire (const char* key, int timeout) { // *** horrible patch -PortServerInquireSysError = FALSE; +PortServerInquireSysError = false; UchPortServerReq req (PortServInquire, 0, 0, 0, MakeKey (key)); SendRequest (Serv, req); UchMsgBuffer buf (256); - expired = FALSE; + expired = false; CcuTimer timer (timeout * 1000, Expire); int n = Serv->Receive (buf); if (expired) { - Error (ErrWarn, "UchPortServer::Inquire", "timeout"); + ::Error (ErrWarn, "UchPortServer::Inquire", "timeout"); return 0; } if (n <= 0) { SysError (ErrWarn, "Inquire"); // *** horrible patch -PortServerInquireSysError = TRUE; +PortServerInquireSysError = true; return 0; } - if (! buf.Get (req)) { - Error (ErrWarn, "UchPortServer::Inquire", "could not read answer"); + if (! buf.ReadMsg (req)) { + ::Error (ErrWarn, "UchPortServer::Inquire", "could not read answer"); return 0; } switch (req.Type) { @@ -179,7 +194,7 @@ PortServerInquireSysError = TRUE; case PortServFail : return 0; } - Error (ErrWarn, "UchPortServer::Inquire", "unexpected answer type"); + ::Error (ErrWarn, "UchPortServer::Inquire", "unexpected answer type"); return 0; } @@ -206,12 +221,12 @@ UchPortServer :: Match (const char* key, PortServMatchFun f, int timeout) UchMsgBuffer buf (1024); for (;;) { buf.Flush (); - expired = FALSE; + expired = false; CcuTimer timer (timeout * 1000, Expire); int n = Serv->Receive (buf); if (expired) { - Error (ErrWarn, "UchPortServer::Match", "timeout"); + ::Error (ErrWarn, "UchPortServer::Match", "timeout"); return 0; } @@ -219,8 +234,8 @@ UchPortServer :: Match (const char* key, PortServMatchFun f, int timeout) SysError (ErrWarn, "Match"); break; } - if (! buf.Get (req)) { - Error (ErrWarn, "Match", "could not read message"); + if (! buf.ReadMsg (req)) { + ::Error (ErrWarn, "Match", "could not read message"); continue; } switch (req.Type) { @@ -231,10 +246,10 @@ UchPortServer :: Match (const char* key, PortServMatchFun f, int timeout) break; case PortServEndMatch: if (nb != req.Ident) - Error (ErrWarn, "Match", "lost answers"); + ::Error (ErrWarn, "Match", "lost answers"); return req.Ident; default: - Error (ErrWarn, "Match", "unexpected answer type"); + ::Error (ErrWarn, "Match", "unexpected answer type"); return -1; } } @@ -298,7 +313,7 @@ UchPortServer :: MakeKey (const char* key) if (! l) l = cuserid (0); if (! l) { - Error (ErrWarn, "UchPortServer::MakeKey", "getlogin failed"); + ::Error (ErrWarn, "UchPortServer::MakeKey", "getlogin failed"); strcpy (p, "???"); } strcpy (p, l); diff --git a/comm/OLD/ReqMgr.h b/comm/OLD/ReqMgr.h index 811cca7..eeb10d9 100644 --- a/comm/OLD/ReqMgr.h +++ b/comm/OLD/ReqMgr.h @@ -62,10 +62,10 @@ protected: public: -inline MsgType (const char* n, msg_kind k) : Name (n), Kind (k), DefaultConstructor (FALSE) {} +inline MsgType (const char* n, msg_kind k) : Name (n), Kind (k), DefaultConstructor (false) {} inline void AddField (MsgField* f) { Fields.Append (f); } inline void AddConstructor (MsgConstructor* f) { Constructors.Append (f); } -inline void UseDefaultConstructor () { DefaultConstructor = TRUE; } +inline void UseDefaultConstructor () { DefaultConstructor = true; } inline const char* GetName () const { return Name; } void DumpDecl (ofstream&, int); void DumpCode (ofstream&, int); -- cgit v1.1