From: Peter Howkins Date: Mon, 12 Mar 2012 00:14:33 +0000 (+0000) Subject: No easy access to min()/max() macro, rewrite code X-Git-Tag: 2.2.0a~26^2~128 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0a9e7d2db9915b2fbdce0049a8661480701eb2c5;p=oweals%2Fcde.git No easy access to min()/max() macro, rewrite code --- diff --git a/cde/lib/tt/slib/mp_rpc_implement.C b/cde/lib/tt/slib/mp_rpc_implement.C index 9679f090..22c22387 100644 --- a/cde/lib/tt/slib/mp_rpc_implement.C +++ b/cde/lib/tt/slib/mp_rpc_implement.C @@ -50,7 +50,7 @@ #include #include #if defined(linux) -# include +/*# include */ #else # include #endif @@ -313,7 +313,7 @@ _tt_service_rpc(svc_req *rqstp, SVCXPRT *transp) return; } - _Tt_string &svr_cookie = + const _Tt_string &svr_cookie = _tt_s_mp->initial_s_session->auth_cookie(); if (clnt_cookie != svr_cookie) { svcerr_auth(transp, AUTH_BADCRED); @@ -791,8 +791,13 @@ _tt_rpc_add_pattern_with_context(SVCXPRT *transp) // introduced into protocol version 2, it can be assumed that // the caller is using at least xdr version 3. // - _Tt_xdr_version xvers( max(_tt_global->xdr_version(), - TT_CONTEXTS_XDR_VERSION) ); +// _Tt_xdr_version xvers( max(_tt_global->xdr_version(), +// TT_CONTEXTS_XDR_VERSION) ); + if(_tt_global->xdr_version() > TT_CONTEXTS_XDR_VERSION) { + _Tt_xdr_version xvers(_tt_global->xdr_version() ); + } else { + _Tt_xdr_version xvers(TT_CONTEXTS_XDR_VERSION); + } _tt_rpc_add_pattern(transp); } diff --git a/cde/lib/tt/slib/mp_signature.C b/cde/lib/tt/slib/mp_signature.C index 017f3831..259317b3 100644 --- a/cde/lib/tt/slib/mp_signature.C +++ b/cde/lib/tt/slib/mp_signature.C @@ -36,7 +36,7 @@ */ #include #if defined(linux) -# include +/*# include */ #else # include #endif @@ -748,12 +748,18 @@ xdr_version_required() const { int version = TT_TYPESDB_DEFAULT_XDR_VERSION; if (_contexts->count() > 0) { - version = max(version, TT_CONTEXTS_XDR_VERSION); + if(TT_CONTEXTS_XDR_VERSION > version) { + version = TT_CONTEXTS_XDR_VERSION; + } +// version = max(version, TT_CONTEXTS_XDR_VERSION); } switch (_pattern_category) { case TT_HANDLE_PUSH: case TT_HANDLE_ROTATE: - version = max(version, TT_PUSH_ROTATE_XDR_VERSION); + if(TT_PUSH_ROTATE_XDR_VERSION > version) { + version = TT_PUSH_ROTATE_XDR_VERSION; + } +// version = max(version, TT_PUSH_ROTATE_XDR_VERSION); break; } return version; @@ -765,7 +771,10 @@ xdr_version_required_(const _Tt_signature_list_ptr &sigs) int version = TT_TYPESDB_DEFAULT_XDR_VERSION; _Tt_signature_list_cursor sigC( sigs ); while (sigC.next()) { - version = max(version, sigC->xdr_version_required()); + if(sigC->xdr_version_required() > version) { + version = sigC->xdr_version_required(); + } +// version = max(version, sigC->xdr_version_required()); } return version; } diff --git a/cde/lib/tt/slib/mp_typedb.C b/cde/lib/tt/slib/mp_typedb.C index ecf356f5..5ff381e1 100644 --- a/cde/lib/tt/slib/mp_typedb.C +++ b/cde/lib/tt/slib/mp_typedb.C @@ -40,7 +40,7 @@ // #include #if defined(linux) -# include +/*# include */ #else # include #endif @@ -2050,11 +2050,17 @@ xdr_version_required() const int version = TT_TYPESDB_DEFAULT_XDR_VERSION; _Tt_ptype_table_cursor ptypes(ptable); while (ptypes.next()) { - version = max(version, ptypes->xdr_version_required()); + if(ptypes->xdr_version_required() > version) { + version = ptypes->xdr_version_required(); + } +// version = max(version, ptypes->xdr_version_required()); } _Tt_otype_table_cursor otypes(otable); while (otypes.next()) { - version = max(version, otypes->xdr_version_required()); + if(otypes->xdr_version_required() > version) { + version = otypes->xdr_version_required(); + } +// version = max(version, otypes->xdr_version_required()); } return version; }