mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
No easy access to min()/max() macro, rewrite code
This commit is contained in:
parent
fc4f30fa88
commit
0a9e7d2db9
3 changed files with 31 additions and 11 deletions
|
@ -50,7 +50,7 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#if defined(linux)
|
#if defined(linux)
|
||||||
# include <g++/minmax.h>
|
/*# include <g++/minmax.h>*/
|
||||||
#else
|
#else
|
||||||
# include <macros.h>
|
# include <macros.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -313,7 +313,7 @@ _tt_service_rpc(svc_req *rqstp, SVCXPRT *transp)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_Tt_string &svr_cookie =
|
const _Tt_string &svr_cookie =
|
||||||
_tt_s_mp->initial_s_session->auth_cookie();
|
_tt_s_mp->initial_s_session->auth_cookie();
|
||||||
if (clnt_cookie != svr_cookie) {
|
if (clnt_cookie != svr_cookie) {
|
||||||
svcerr_auth(transp, AUTH_BADCRED);
|
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
|
// introduced into protocol version 2, it can be assumed that
|
||||||
// the caller is using at least xdr version 3.
|
// the caller is using at least xdr version 3.
|
||||||
//
|
//
|
||||||
_Tt_xdr_version xvers( max(_tt_global->xdr_version(),
|
// _Tt_xdr_version xvers( max(_tt_global->xdr_version(),
|
||||||
TT_CONTEXTS_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);
|
_tt_rpc_add_pattern(transp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
*/
|
*/
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#if defined(linux)
|
#if defined(linux)
|
||||||
# include <g++/minmax.h>
|
/*# include <g++/minmax.h>*/
|
||||||
#else
|
#else
|
||||||
# include <macros.h>
|
# include <macros.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -748,12 +748,18 @@ xdr_version_required() const
|
||||||
{
|
{
|
||||||
int version = TT_TYPESDB_DEFAULT_XDR_VERSION;
|
int version = TT_TYPESDB_DEFAULT_XDR_VERSION;
|
||||||
if (_contexts->count() > 0) {
|
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) {
|
switch (_pattern_category) {
|
||||||
case TT_HANDLE_PUSH:
|
case TT_HANDLE_PUSH:
|
||||||
case TT_HANDLE_ROTATE:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
return version;
|
return version;
|
||||||
|
@ -765,7 +771,10 @@ xdr_version_required_(const _Tt_signature_list_ptr &sigs)
|
||||||
int version = TT_TYPESDB_DEFAULT_XDR_VERSION;
|
int version = TT_TYPESDB_DEFAULT_XDR_VERSION;
|
||||||
_Tt_signature_list_cursor sigC( sigs );
|
_Tt_signature_list_cursor sigC( sigs );
|
||||||
while (sigC.next()) {
|
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;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
//
|
//
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#if defined(linux)
|
#if defined(linux)
|
||||||
# include <g++/minmax.h>
|
/*# include <g++/minmax.h>*/
|
||||||
#else
|
#else
|
||||||
# include <macros.h>
|
# include <macros.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -2050,11 +2050,17 @@ xdr_version_required() const
|
||||||
int version = TT_TYPESDB_DEFAULT_XDR_VERSION;
|
int version = TT_TYPESDB_DEFAULT_XDR_VERSION;
|
||||||
_Tt_ptype_table_cursor ptypes(ptable);
|
_Tt_ptype_table_cursor ptypes(ptable);
|
||||||
while (ptypes.next()) {
|
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);
|
_Tt_otype_table_cursor otypes(otable);
|
||||||
while (otypes.next()) {
|
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;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue