-/* $Id: api.h,v 1.36 2006-06-07 10:14:40 adam Exp $
+/* $Id: api.h,v 1.37 2006-06-07 10:50:08 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
/** Scan Term Descriptor */
typedef struct {
- int occurrences; /* scan term occurrences */
+ zint occurrences; /* scan term occurrences */
char *term; /* scan term string */
} ZebraScanEntry;
-/* $Id: recctrl.h,v 1.21 2006-06-07 10:14:40 adam Exp $
+/* $Id: recctrl.h,v 1.22 2006-06-07 10:50:08 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
char *encoding; /* preferred character encoding */
zint localno; /* local id of record */
int score; /* score 0-1000 or -1 if none */
- int staticrank; /* static rank >= 0, 0 if none */
+ zint staticrank; /* static rank >= 0, 0 if none */
int recordSize; /* size of record in bytes */
char *fname; /* name of file (or NULL if internal) */
data1_handle dh;
-/* $Id: ranksimilarity.c,v 1.9 2006-05-19 23:20:24 adam Exp $
+/* $Id: ranksimilarity.c,v 1.10 2006-06-07 10:50:08 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
/* staticrank = 0 is highest, MAXINT lowest */
- score = INT_MAX - staticrank; /* but score is reverse (logical) */
+ if (staticrank >= INT_MAX)
+ score = 0;
+ else
+ { /* but score is reverse (logical) */
+ score = INT_MAX - CAST_ZINT_TO_INT(staticrank);
+ }
/* debugging statistics output */
-/* $Id: rankstatic.c,v 1.7 2006-05-19 23:20:24 adam Exp $
+/* $Id: rankstatic.c,v 1.8 2006-06-07 10:50:08 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
/* if we set *stop_flag = 1, we stop processing (of result set list) */
/* staticrank = 0 is highest, MAXINT lowest */
- return INT_MAX - staticrank; /* but score is reverse (logical) */
+ if (staticrank >= INT_MAX)
+ return 0;
+ /* but score is reverse (logical) */
+ return INT_MAX - CAST_ZINT_TO_INT(staticrank);
}
/*
-/* $Id: zrpn.c,v 1.216 2006-06-06 21:01:30 adam Exp $
+/* $Id: zrpn.c,v 1.217 2006-06-07 10:50:08 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
}
-static void esc_str(char *out_buf, int out_size,
+static void esc_str(char *out_buf, size_t out_size,
const char *in_buf, int in_size)
{
int k;
-/* $Id: zserver.c,v 1.147 2006-06-07 10:14:41 adam Exp $
+/* $Id: zserver.c,v 1.148 2006-06-07 10:50:09 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
for (i = 0; i < r->num_entries; i++)
{
r->entries[i].term = entries[i].term;
- r->entries[i].occurrences = entries[i].occurrences;
+ r->entries[i].occurrences =
+ CAST_ZINT_TO_INT(entries[i].occurrences);
}
}
else
-/* $Id: snippet.c,v 1.7 2006-06-07 10:14:42 adam Exp $
+/* $Id: snippet.c,v 1.8 2006-06-07 10:50:09 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
while(1)
{
- int window_start;
- int first_seq_no_best_window = 0;
- int last_seq_no_best_window = 0;
+ zint window_start;
+ zint first_seq_no_best_window = 0;
+ zint last_seq_no_best_window = 0;
int number_best_window = 0;
zebra_snippet_word *hit_w, *doc_w;
int min_ord = 0; /* not set yet */
{
zebra_snippet_word *look_w = hit_w;
int number_this = 0;
- int seq_no_last = 0;
+ zint seq_no_last = 0;
while (look_w && look_w->seqno < hit_w->seqno + window_size)
{
if (look_w->ord == ord)