#include "encode.h"
int
-do_encode(encpage_t * enc, const U8 * src, STRLEN * slen, U8 * dst,
+do_encode(const encpage_t * enc, const U8 * src, STRLEN * slen, U8 * dst,
STRLEN dlen, STRLEN * dout, int approx, const U8 *term, STRLEN tlen)
{
const U8 *s = src;
U8 *dend = d + dlen, *dlast = d;
int code = 0;
while (s < send) {
- encpage_t *e = enc;
+ const encpage_t *e = enc;
U8 byte = *s;
while (byte > e->max)
e++;
if (approx && (e->slen & 0x80))
code = ENCODE_FALLBACK;
last = s;
- if (term && d-dlast == tlen && memEQ(dlast, term, tlen)) {
+ if (term && (STRLEN)(d-dlast) == tlen && memEQ(dlast, term, tlen)) {
code = ENCODE_FOUND_TERM;
break;
}