From 80fee38926477efd73c739731c5670d59c5d1bf7 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 19 Jan 2010 13:54:54 +0100 Subject: [PATCH] More odr_int casts --- src/seshigh.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/seshigh.c b/src/seshigh.c index cdc9fdc..006c3fa 100644 --- a/src/seshigh.c +++ b/src/seshigh.c @@ -127,6 +127,16 @@ static void wr_diag(WRBUF w, int error, const char *addinfo) wrbuf_puts(w, " "); } +static int odr_int_to_int(Odr_int v) +{ + if (v >= INT_MAX) + return INT_MAX; + else if (v <= INT_MIN) + return INT_MIN; + else + return (int) v; +} + /* * Create and initialize a new association-handle. * channel : iochannel for the current line. @@ -836,15 +846,6 @@ static int ccl2pqf(ODR odr, const Odr_oct *ccl, CCL_bibset bibset, return 0; } -static int odr_int_to_int(Odr_int v) -{ - if (v >= INT_MAX) - return INT_MAX; - else if (v <= INT_MIN) - return INT_MIN; - else return v; -} - static void srw_bend_search(association *assoc, request *req, Z_SRW_PDU *sr, Z_SRW_PDU *res, @@ -2289,10 +2290,10 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) yaz_log(log_requestdetail, "Negotiated to v%d: %s", assoc->version, options); if (*req->maximumRecordSize < assoc->maximumRecordSize) - assoc->maximumRecordSize = *req->maximumRecordSize; + assoc->maximumRecordSize = odr_int_to_int(*req->maximumRecordSize); if (*req->preferredMessageSize < assoc->preferredMessageSize) - assoc->preferredMessageSize = *req->preferredMessageSize; + assoc->preferredMessageSize = odr_int_to_int(*req->preferredMessageSize); resp->preferredMessageSize = odr_intdup(assoc->encode, assoc->preferredMessageSize); -- 1.7.10.4