From b8e64d193b1b4f3197cb0c1db2f8d097e67cd50a Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 1 Dec 2009 21:42:00 +0100 Subject: [PATCH] Update to use Odr_int --- include/yazpp/ir-assoc.h | 2 +- include/yazpp/z-server.h | 2 +- src/yaz-ir-assoc.cpp | 8 ++++---- src/yaz-my-client.cpp | 4 ++-- src/yaz-z-server-sr.cpp | 7 ++++--- src/yaz-z-server.cpp | 4 ++-- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/include/yazpp/ir-assoc.h b/include/yazpp/ir-assoc.h index 4da019b..84a3e36 100644 --- a/include/yazpp/ir-assoc.h +++ b/include/yazpp/ir-assoc.h @@ -77,7 +77,7 @@ class YAZ_EXPORT IR_Assoc: public Z_Assoc { /// Send Services int send_initRequest(char* pRefId=NULL); int send_searchRequest(Yaz_Z_Query *query, char* pResultSetId = NULL, char* pRefId = NULL); - int send_presentRequest(int start, int number, char* pResultSetId = NULL, char* pRefId = NULL); + int send_presentRequest(Odr_int start, Odr_int number, char* pResultSetId = NULL, char* pRefId = NULL); int send_deleteResultSetRequest(char* pResultSetId = 0, char* pRefId = 0); /// Recv Services diff --git a/include/yazpp/z-server.h b/include/yazpp/z-server.h index 33d935f..755052d 100644 --- a/include/yazpp/z-server.h +++ b/include/yazpp/z-server.h @@ -117,7 +117,7 @@ class YAZ_EXPORT Yaz_Facility_Retrieval : public IServer_Facility, const char *resultSetName, int start, int num, Z_RecordComposition *comp, - int *next, int *pres, + Odr_int *next, Odr_int *pres, Odr_oid *oid); void fetch_via_piggyback (Z_Server *s, diff --git a/src/yaz-ir-assoc.cpp b/src/yaz-ir-assoc.cpp index d5854d1..ad35d00 100644 --- a/src/yaz-ir-assoc.cpp +++ b/src/yaz-ir-assoc.cpp @@ -221,10 +221,10 @@ int IR_Assoc::send_searchRequest(Yaz_Z_Query *query, return send_Z_PDU(apdu, 0); } -int IR_Assoc::send_presentRequest(int start, - int number, - char* pResultSetId, - char* pRefId) +int IR_Assoc::send_presentRequest(Odr_int start, + Odr_int number, + char* pResultSetId, + char* pRefId) { Z_APDU *apdu = create_Z_PDU(Z_APDU_presentRequest); Z_PresentRequest *req = apdu->u.presentRequest; diff --git a/src/yaz-my-client.cpp b/src/yaz-my-client.cpp index 90504e2..33186ac 100644 --- a/src/yaz-my-client.cpp +++ b/src/yaz-my-client.cpp @@ -153,7 +153,7 @@ void MyClient::recv_diagrecs(Z_DiagRec **pp, int num) } else r = p->u.defaultFormat; - printf(" [%d] %s", *r->condition, diagbib1_str(*r->condition)); + printf(" [" ODR_INT_PRINTF "] %s", *r->condition, diagbib1_str(*r->condition)); switch (r->which) { case Z_DefaultDiagFormat_v2Addinfo: @@ -277,7 +277,7 @@ void MyClient::recv_searchResponse(Z_SearchResponse *searchResponse) else { printf ("Ok\n"); - printf ("Hits: %d\n", *searchResponse->resultCount); + printf ("Hits: " ODR_INT_PRINTF "\n", *searchResponse->resultCount); } recv_records (searchResponse->records); } diff --git a/src/yaz-z-server-sr.cpp b/src/yaz-z-server-sr.cpp index ed8c6c2..f77e749 100644 --- a/src/yaz-z-server-sr.cpp +++ b/src/yaz-z-server-sr.cpp @@ -12,7 +12,7 @@ Z_Records *Yaz_Facility_Retrieval::pack_records (Z_Server *s, const char *resultSetName, int start, int xnum, Z_RecordComposition *comp, - int *next, int *pres, + Odr_int *next, Odr_int *pres, Odr_oid *format) { int recno, total_length = 0, toget = xnum, dumped_records = 0; @@ -114,7 +114,7 @@ void Yaz_Facility_Retrieval::fetch_via_piggyback (Z_Server *s, Z_RecordComposition comp, *compp = 0; int hits = *res->resultCount; - int *nulint = (int *)odr_malloc (odr_encode(), sizeof(*nulint)); + Odr_int *nulint = (Odr_int *)odr_malloc (odr_encode(), sizeof(*nulint)); *nulint = 0; comp.which = Z_RecordComp_simple; @@ -136,7 +136,8 @@ void Yaz_Facility_Retrieval::fetch_via_piggyback (Z_Server *s, if (toget && !res->records) { - res->presentStatus = (int *) odr_malloc (odr_encode(), sizeof(int)); + res->presentStatus = (Odr_int *) + odr_malloc (odr_encode(), sizeof(Odr_int)); *res->presentStatus = Z_PRES_SUCCESS; res->records = pack_records(s, req->resultSetName, 1, toget, compp, diff --git a/src/yaz-z-server.cpp b/src/yaz-z-server.cpp index ffa9d26..6f077c4 100644 --- a/src/yaz-z-server.cpp +++ b/src/yaz-z-server.cpp @@ -128,7 +128,7 @@ void Z_ServerUtility::create_surrogateDiagnostics( ODR odr, Z_NamePlusRecord *rec, const char *dbname, int error, char *const addinfo) { - int *err = (int *)odr_malloc (odr, sizeof(*err)); + Odr_int *err = (Odr_int *)odr_malloc (odr, sizeof(*err)); Z_DiagRec *drec = (Z_DiagRec *)odr_malloc (odr, sizeof(*drec)); Z_DefaultDiagFormat *dr = (Z_DefaultDiagFormat *) odr_malloc (odr, sizeof(*dr)); @@ -152,7 +152,7 @@ Z_Records *Z_ServerUtility::create_nonSurrogateDiagnostics ( { Z_Records *rec = (Z_Records *) odr_malloc (odr, sizeof(*rec)); - int *err = (int *) + Odr_int *err = (Odr_int *) odr_malloc (odr, sizeof(*err)); Z_DiagRec *drec = (Z_DiagRec *) odr_malloc (odr, sizeof(*drec)); -- 1.7.10.4