Add some type casts and in other cases change integer type.
Z_DefaultDiagFormat *dd = ds->u.defaultDiagRec;
/* ### should check `dd->diagnosticSetId' */
printf("code=" ODR_INT_PRINTF " (%s)", *dd->condition,
- diagbib1_str(*dd->condition));
+ diagbib1_str((int) *dd->condition));
/* Both types of addinfo are the same, so use type-pun */
if (dd->u.v2Addinfo != 0)
printf(",\n\taddinfo='%s'", dd->u.v2Addinfo);
printf("Unknown diagset: %s\n", diag_name);
}
printf(" [" ODR_INT_PRINTF "] %s",
- *r->condition, diagbib1_str(*r->condition));
+ *r->condition, diagbib1_str((int) *r->condition));
switch (r->which)
{
case Z_DefaultDiagFormat_v2Addinfo:
num_entries = res->entries->num_entries;
for (i = 0; i < num_entries; i++)
{
- int pos_term = res->positionOfTerm ? *res->positionOfTerm : -1;
+ Odr_int pos_term = res->positionOfTerm ? *res->positionOfTerm : -1;
if (entries[i]->which == Z_Entry_termInfo)
{
printf("%c ", i + 1 == pos_term ? '*' : ' ');
size_t i;
for (i = sizeof(uval); i > 0; )
{
- tmp[--i] = uval;
+ tmp[--i] = (unsigned char ) uval; /* only want lower 8 bits */
uval >>= 8;
}
for (i = 0; i < sizeof(uval)-1; i++)
#define CCL_CHARS "#?\\"
static int has_ccl_masking(const char *src_str,
- int src_len,
+ size_t src_len,
const char **truncation_aliases,
const char **mask_aliases)
{
static struct ccl_rpn_node *ccl_term_one_use(CCL_parser cclp,
struct ccl_rpn_attr *attr_use,
ccl_qualifier_t *qa,
- int no, int term_len,
+ size_t no, int term_len,
const char **truncation_aliases,
const char **mask_aliases,
int is_phrase,
#endif
#include <stdio.h>
#include <stdlib.h>
+/* avoid that bison stuff defines malloc/free - already in stdlib.h */
+#ifdef _MSC_VER
+#define _STDLIB_H 1
+#endif
#include <string.h>
#include <yaz/yaz-iconv.h>
#include <yaz/xmalloc.h>
}
*outp++ = '@';
(*outbytesleft)--;
- *outp++ = x;
+ *outp++ = (unsigned char) x;
(*outbytesleft)--;
}
else if (x <= 255)
yaz_iconv_set_errno(cd, YAZ_ICONV_E2BIG);
return (size_t)(-1);
}
- *outp++ = x;
+ *outp++ = (unsigned char) x;
(*outbytesleft)--;
}
else
yaz_iconv_set_errno(cd, YAZ_ICONV_E2BIG);
return (size_t) (-1);
}
- *(*outbuf)++ = y;
+ *(*outbuf)++ = (char) y;
(*outbytesleft)--;
}
else
yaz_iconv_set_errno(cd, YAZ_ICONV_EILSEQ);
return (size_t) -1;
}
- out[k++] = x;
+ out[k++] = (unsigned char ) x;
break;
}
*outbytesleft -= k;
Z_ReferenceId *referenceId,
Odr_oid *oid, int *errcode)
{
- int recno, dumped_records = 0;
+ int recno;
+ Odr_int dumped_records = 0;
int toget = odr_int_to_int(*num);
Z_Records *records =
(Z_Records *) odr_malloc(a->encode, sizeof(*records));
else
this_length = odr_total(a->encode) - total_length - dumped_records;
yaz_log(log_requestdetail, " fetched record, len=" ODR_INT_PRINTF
- " total=" ODR_INT_PRINTF " dumped=%d",
+ " total=" ODR_INT_PRINTF " dumped=" ODR_INT_PRINTF,
this_length, total_length, dumped_records);
if (a->preferredMessageSize > 0 &&
this_length + total_length > a->preferredMessageSize)