Greetings Neil,
I should have read the error message more carefully. Try the attached
patch (again, applied to the clean package).
Thanks yet again for this,
Lachlan
On Fri, 20 Jun 2003 02:27, Neil Kohl wrote:
> No complaints about ResultMatch. Still getting 2 errors in
> search.cc:
>
> "search.cc", line 2301: Error: An integer constant expression is
> required within the array subscript operator.
>
> Almost there...
--
[EMAIL PROTECTED]
ht://Dig developer DownUnder (http://www.htdig.org)
diff -c -r ../cvs/htdig/db/configure ./db/configure
*** ../cvs/htdig/db/configure Wed May 28 00:45:53 2003
--- ./db/configure Thu Jun 19 21:42:11 2003
***************
*** 12698,12711 ****
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* System header to define __stub macros and hopefully few prototypes,
! which can conflict with char $ac_func (); below.
! Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
! <limits.h> exists even on freestanding compilers. */
! #ifdef __STDC__
! # include <limits.h>
! #else
! # include <assert.h>
! #endif
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
--- 12698,12706 ----
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* System header to define __stub macros and hopefully few prototypes,
! which can conflict with char $ac_func (); below. */
! /* Don't use limits.h as it defines select on Sun's C++ compiler */
! #include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
diff -c -r ../cvs/htdig/db/db.c ./db/db.c
*** ../cvs/htdig/db/db.c Sun Feb 3 05:18:05 2002
--- ./db/db.c Fri Jun 20 00:20:51 2003
***************
*** 1046,1057 ****
* If compression is on, the minimum page size must be multiplied
* by the compression factor.
*/
! #ifdef HAVE_ZLIB
if(F_ISSET(dbp, DB_AM_CMPR)) {
if(iopsize < DB_CMPR_MULTIPLY(dbenv, DB_MIN_PGSIZE))
iopsize = DB_CMPR_MULTIPLY(dbenv, DB_MIN_PGSIZE);
}
! #endif /* HAVE_ZLIB */
/*
* Sheer paranoia, but we don't want anything that's not a power-of-2
--- 1046,1057 ----
* If compression is on, the minimum page size must be multiplied
* by the compression factor.
*/
! #ifdef HAVE_LIBZ
if(F_ISSET(dbp, DB_AM_CMPR)) {
if(iopsize < DB_CMPR_MULTIPLY(dbenv, DB_MIN_PGSIZE))
iopsize = DB_CMPR_MULTIPLY(dbenv, DB_MIN_PGSIZE);
}
! #endif /* HAVE_LIBZ */
/*
* Sheer paranoia, but we don't want anything that's not a power-of-2
diff -c -r ../cvs/htdig/htcommon/URL.h ./htcommon/URL.h
*** ../cvs/htdig/htcommon/URL.h Sat Jan 11 13:33:28 2003
--- ./htcommon/URL.h Wed Jun 18 21:50:01 2003
***************
*** 91,97 ****
//String &encodeURL(String &, char *valid = "[EMAIL PROTECTED]&/:");
//String &encodeURL(String &, char *reserved = ";/?:@&=+$,");
// char *unreserved = "-_.!~*'()");
! String &encodeURL(String &, char *valid = UNRESERVED);
String &decodeURL(String &);
--- 91,97 ----
//String &encodeURL(String &, char *valid = "[EMAIL PROTECTED]&/:");
//String &encodeURL(String &, char *reserved = ";/?:@&=+$,");
// char *unreserved = "-_.!~*'()");
! String &encodeURL(String &, char *valid = (char *)UNRESERVED);
String &decodeURL(String &);
diff -c -r ../cvs/htdig/htdb/htdb_stat.cc ./htdb/htdb_stat.cc
*** ../cvs/htdig/htdb/htdb_stat.cc Sun Feb 3 05:18:12 2002
--- ./htdb/htdb_stat.cc Thu Jun 19 21:13:41 2003
***************
*** 80,86 ****
DB_ENV *dbenv;
int interrupted;
! char *internal;
const char
*progname = "htdb_stat"; /* Program name. */
--- 80,86 ----
DB_ENV *dbenv;
int interrupted;
! char *stats_internal;
const char
*progname = "htdb_stat"; /* Program name. */
***************
*** 105,111 ****
switch (ch) {
case 'C':
ttype = T_LOCK;
! if (!argcheck(internal = optarg, "Acflmo"))
usage();
break;
case 'c':
--- 105,111 ----
switch (ch) {
case 'C':
ttype = T_LOCK;
! if (!argcheck(stats_internal = optarg, "Acflmo"))
usage();
break;
case 'c':
***************
*** 126,132 ****
break;
case 'M':
ttype = T_MPOOL;
! if (!argcheck(internal = optarg, "Ahlm"))
usage();
break;
case 'm':
--- 126,132 ----
break;
case 'M':
ttype = T_MPOOL;
! if (!argcheck(stats_internal = optarg, "Ahlm"))
usage();
break;
case 'm':
***************
*** 544,551 ****
DB_LOCK_STAT *sp;
int ret;
! if (internal != NULL) {
! CDB___lock_dump_region(dbenvp, internal, stdout);
return (0);
}
--- 544,551 ----
DB_LOCK_STAT *sp;
int ret;
! if (stats_internal != NULL) {
! CDB___lock_dump_region(dbenvp, stats_internal, stdout);
return (0);
}
***************
*** 631,638 ****
DB_MPOOL_STAT *gsp;
int ret;
! if (internal != NULL) {
! CDB___memp_dump_region(dbenvp, internal, stdout);
return (1);
}
--- 631,638 ----
DB_MPOOL_STAT *gsp;
int ret;
! if (stats_internal != NULL) {
! CDB___memp_dump_region(dbenvp, stats_internal, stdout);
return (1);
}
diff -c -r ../cvs/htdig/htdoc/require.html ./htdoc/require.html
*** ../cvs/htdig/htdoc/require.html Sun Jun 15 11:39:53 2003
--- ./htdoc/require.html Fri Jun 20 00:09:04 2003
***************
*** 250,274 ****
</li>
-->
<li>
! FreeBSD 4.6 (using gcc 2.95.3) <!-- [EMAIL PROTECTED] -->
</li>
<li>
! Mandrake Linux 8.2 (using gcc 3.2) <!-- [EMAIL PROTECTED] -->
</li>
<li>
! Debian, 2.2.19 kernel (using gcc 2.95.4) <!-- [EMAIL PROTECTED] -->
</li>
<li>
! Debian on an Alpha <!-- [EMAIL PROTECTED] -->
</li>
<li>
RedHat 7.3, 8.0 <!-- Jim Cole -->
</li>
<li>
! Sun Solaris 2.8 = SunOS 5.8 (using gcc 3.1) <!-- [EMAIL PROTECTED] -->
</li>
<li>
! Sun Solaris 2.8 = SunOS 5.8 (using Sun's cc / g++ 3.1) <!-- [EMAIL PROTECTED] -->
</li>
<li>
Mac OS X 10.2 (using gcc) <!-- Jim Cole -->
--- 250,274 ----
</li>
-->
<li>
! FreeBSD 4.6 (using gcc 2.95.3) <!-- lha -->
</li>
<li>
! Mandrake Linux 8.2 (using gcc 3.2) <!-- lha -->
</li>
<li>
! Debian, 2.2.19 kernel (using gcc 2.95.4) <!-- lha -->
</li>
<li>
! Debian on an Alpha <!-- lha -->
</li>
<li>
RedHat 7.3, 8.0 <!-- Jim Cole -->
</li>
<li>
! Sun Solaris 2.8 = SunOS 5.8 (using gcc 3.1) <!-- lha -->
</li>
<li>
! Sun Solaris 2.8 = SunOS 5.8 (using Sun's cc / g++ 3.1) <!-- lha -->
</li>
<li>
Mac OS X 10.2 (using gcc) <!-- Jim Cole -->
diff -c -r ../cvs/htdig/htlib/HtTime.h ./htlib/HtTime.h
*** ../cvs/htdig/htlib/HtTime.h Sat Feb 2 09:49:33 2002
--- ./htlib/HtTime.h Wed Jun 18 21:50:53 2003
***************
*** 95,101 ****
}
return(0);
}
! Progression(double nperiod=.1,char *nlabel="progression")
{
label=nlabel;
period=nperiod;
--- 95,101 ----
}
return(0);
}
! Progression(double nperiod=.1,char *nlabel=(char *)"progression")
{
label=nlabel;
period=nperiod;
diff -c -r ../cvs/htdig/htlib/gregex.h ./htlib/gregex.h
*** ../cvs/htdig/htlib/gregex.h Tue Dec 31 18:59:05 2002
--- ./htlib/gregex.h Wed Jun 18 23:00:05 2003
***************
*** 527,533 ****
/* For now unconditionally define __restrict_arr to expand to nothing.
Ideally we would have a test for the compiler which allows defining
it to restrict. */
! #define __restrict_arr
/* POSIX compatibility. */
extern int regcomp _RE_ARGS ((regex_t *__restrict __preg,
--- 527,535 ----
/* For now unconditionally define __restrict_arr to expand to nothing.
Ideally we would have a test for the compiler which allows defining
it to restrict. */
! #ifndef __restrict_arr
! # define __restrict_arr
! #endif
/* POSIX compatibility. */
extern int regcomp _RE_ARGS ((regex_t *__restrict __preg,
diff -c -r ../cvs/htdig/htlib/htString.h ./htlib/htString.h
*** ../cvs/htdig/htlib/htString.h Sat Feb 2 09:49:34 2002
--- ./htlib/htString.h Wed Jun 18 21:50:29 2003
***************
*** 131,137 ****
inline String &trunc() { Length = 0; return *this; }
String &chop(int n = 1);
String &chop(char ch = '\n');
! String &chop(const char *str = "\r\n");
//
// SubStrings
--- 131,137 ----
inline String &trunc() { Length = 0; return *this; }
String &chop(int n = 1);
String &chop(char ch = '\n');
! String &chop(const char *str = (char *)"\r\n");
//
// SubStrings
diff -c -r ../cvs/htdig/htnet/Connection.h ./htnet/Connection.h
*** ../cvs/htdig/htnet/Connection.h Wed Jun 18 21:46:05 2003
--- ./htnet/Connection.h Wed Jun 18 21:48:11 2003
***************
*** 66,76 ****
int Listen(int n = 5);
// IO
! String* Read_Line(String &, char *terminator = "\n");
! char* Read_Line(char *buffer, int maxlength, char *terminator = "\n");
! String* Read_Line(char *terminator = "\n");
virtual int Read_Char();
! int Write_Line(char *buffer, char *eol = "\n");
int Write(char *buffer, int maxlength = -1);
int Read(char *buffer, int maxlength);
--- 66,76 ----
int Listen(int n = 5);
// IO
! String* Read_Line(String &, char *terminator = (char *)"\n");
! char* Read_Line(char *buffer, int maxlength, char *terminator=(char *)"\n");
! String* Read_Line(char *terminator = (char *)"\n");
virtual int Read_Char();
! int Write_Line(char *buffer, char *eol = (char *)"\n");
int Write(char *buffer, int maxlength = -1);
int Read(char *buffer, int maxlength);
diff -c -r ../cvs/htdig/htnet/Connection.h~ ./htnet/Connection.h~
*** ../cvs/htdig/htnet/Connection.h~ Wed Jun 18 21:44:32 2003
--- ./htnet/Connection.h~ Wed Jun 18 21:46:05 2003
***************
*** 66,76 ****
int Listen(int n = 5);
// IO
! String* Read_Line(String &, char *terminator = (char*)"\n");
! char* Read_Line(char *buffer, int maxlength, char *terminator = (char*)"\n");
! String* Read_Line(char *terminator = (char*)"\n");
virtual int Read_Char();
! int Write_Line(char *buffer, char *eol = (char*)"\n");
int Write(char *buffer, int maxlength = -1);
int Read(char *buffer, int maxlength);
--- 66,76 ----
int Listen(int n = 5);
// IO
! String* Read_Line(String &, char *terminator = "\n");
! char* Read_Line(char *buffer, int maxlength, char *terminator = "\n");
! String* Read_Line(char *terminator = "\n");
virtual int Read_Char();
! int Write_Line(char *buffer, char *eol = "\n");
int Write(char *buffer, int maxlength = -1);
int Read(char *buffer, int maxlength);
diff -c -r ../cvs/htdig/htnet/HtCookie.cc ./htnet/HtCookie.cc
*** ../cvs/htdig/htnet/HtCookie.cc Sat Feb 1 23:59:14 2003
--- ./htnet/HtCookie.cc Wed Jun 18 22:01:51 2003
***************
*** 465,471 ****
HtCookie::DateFormat HtCookie::RecognizeDateFormat(const char *datestring)
{
! register char *s;
if (datestring)
{
--- 465,471 ----
HtCookie::DateFormat HtCookie::RecognizeDateFormat(const char *datestring)
{
! register const char *s;
if (datestring)
{
diff -c -r ../cvs/htdig/htnet/HtFTP.cc ./htnet/HtFTP.cc
*** ../cvs/htdig/htnet/HtFTP.cc Fri Aug 30 07:21:34 2002
--- ./htnet/HtFTP.cc Thu Jun 19 21:07:00 2003
***************
*** 172,178 ****
if (_modification_time && *_modification_time >= HtDateTime(stat_buf.st_mtime))
return Transport::Document_not_changed;
! char *ext = strrchr(_url.path(), '.');
if (ext == NULL)
return Transport::Document_not_local;
--- 172,178 ----
if (_modification_time && *_modification_time >= HtDateTime(stat_buf.st_mtime))
return Transport::Document_not_changed;
! const char *ext = strrchr(_url.path(), '.');
if (ext == NULL)
return Transport::Document_not_local;
diff -c -r ../cvs/htdig/htnet/Transport.cc ./htnet/Transport.cc
*** ../cvs/htdig/htnet/Transport.cc Wed Jun 18 21:46:07 2003
--- ./htnet/Transport.cc Wed Jun 18 21:47:21 2003
***************
*** 418,424 ****
// Recognize the possible date format sent by the server
Transport::DateFormat Transport::RecognizeDateFormat (const char *datestring)
{
! register char *s;
if((s=strchr(datestring, ',')))
{
--- 418,424 ----
// Recognize the possible date format sent by the server
Transport::DateFormat Transport::RecognizeDateFormat (const char *datestring)
{
! register const char *s;
if((s=strchr(datestring, ',')))
{
diff -c -r ../cvs/htdig/htnet/Transport.cc~ ./htnet/Transport.cc~
*** ../cvs/htdig/htnet/Transport.cc~ Wed Jun 18 21:43:09 2003
--- ./htnet/Transport.cc~ Wed Jun 18 21:46:07 2003
***************
*** 418,424 ****
// Recognize the possible date format sent by the server
Transport::DateFormat Transport::RecognizeDateFormat (const char *datestring)
{
! register const char *s;
if((s=strchr(datestring, ',')))
{
--- 418,424 ----
// Recognize the possible date format sent by the server
Transport::DateFormat Transport::RecognizeDateFormat (const char *datestring)
{
! register char *s;
if((s=strchr(datestring, ',')))
{
diff -c -r ../cvs/htdig/htsearch/ResultMatch.h ./htsearch/ResultMatch.h
*** ../cvs/htdig/htsearch/ResultMatch.h Sat Feb 2 09:49:35 2002
--- ./htsearch/ResultMatch.h Thu Jun 19 21:17:07 2003
***************
*** 65,71 ****
// The purpose of the derived classes is to define their own.
virtual CmpFun getSortFun() = 0;
! private:
enum SortType
{
SortByScore,
--- 65,72 ----
// The purpose of the derived classes is to define their own.
virtual CmpFun getSortFun() = 0;
! // Sun's C++ compiler doesn't like private types used in other structs
! // so make this public
enum SortType
{
SortByScore,
***************
*** 74,79 ****
--- 75,81 ----
SortByID
};
+ private:
double score;
int anchor;
int id;
diff -c -r ../cvs/htdig/htword/WordBitCompress.h ./htword/WordBitCompress.h
*** ../cvs/htdig/htword/WordBitCompress.h Mon Dec 30 23:42:59 2002
--- ./htword/WordBitCompress.h Wed Jun 18 21:52:00 2003
***************
*** 135,141 ****
}
// get/put an integer using n bits
! void put_uint(unsigned int v,int n,const char *tag="NOTAG");
unsigned int get_uint( int n,const char *tag=(char*)NULL);
// get/put n bits of data stored in vals
--- 135,141 ----
}
// get/put an integer using n bits
! void put_uint(unsigned int v,int n,const char *tag=(char*)"NOTAG");
unsigned int get_uint( int n,const char *tag=(char*)NULL);
// get/put n bits of data stored in vals
***************
*** 219,229 ****
public:
int verbose;
// get/put an integer using a variable number of bits
! void put_uint_vl(unsigned int v,int maxn,const char *tag="NOTAG");
unsigned int get_uint_vl( int maxn,const char *tag=(char*)NULL);
// get/put an integer checking for an expected value
! void put_uint_ex(unsigned int v,unsigned int ex,int maxn,const char *tag="NOTAG")
{
if(v==ex){put(1,tag);}
else{put(0,tag);put_uint(v,maxn,(char*)NULL);}
--- 219,229 ----
public:
int verbose;
// get/put an integer using a variable number of bits
! void put_uint_vl(unsigned int v,int maxn,const char *tag=(char*)"NOTAG");
unsigned int get_uint_vl( int maxn,const char *tag=(char*)NULL);
// get/put an integer checking for an expected value
! void put_uint_ex(unsigned int v,unsigned int ex,int maxn,const char *tag=(char*)"NOTAG")
{
if(v==ex){put(1,tag);}
else{put(0,tag);put_uint(v,maxn,(char*)NULL);}
***************
*** 237,247 ****
// compress/decompress an array of unsigned ints (choosing best method)
int put_vals(unsigned int *vals,int n,const char *tag);
! int get_vals(unsigned int **pres,const char *tag="BADTAG!");
// compress/decompress an array of bytes (very simple)
int put_fixedbitl(byte *vals,int n,const char *tag);
! int get_fixedbitl(byte **pres,const char *tag="BADTAG!");
// compress/decompress an array of unsigned ints (very simple)
void get_fixedbitl(unsigned int *res,int n);
--- 237,247 ----
// compress/decompress an array of unsigned ints (choosing best method)
int put_vals(unsigned int *vals,int n,const char *tag);
! int get_vals(unsigned int **pres,const char *tag=(char*)"BADTAG!");
// compress/decompress an array of bytes (very simple)
int put_fixedbitl(byte *vals,int n,const char *tag);
! int get_fixedbitl(byte **pres,const char *tag=(char*)"BADTAG!");
// compress/decompress an array of unsigned ints (very simple)
void get_fixedbitl(unsigned int *res,int n);
diff -c -r ../cvs/htdig/htword/WordKey.cc ./htword/WordKey.cc
*** ../cvs/htdig/htword/WordKey.cc Sat Feb 2 09:49:36 2002
--- ./htword/WordKey.cc Wed Jun 18 22:21:43 2003
***************
*** 82,88 ****
const WordKeyInfo& info = *WordKey::Info();
if(a_length < info.num_length || b_length < info.num_length) {
! fprintf(stderr, "WordKey::Compare: key length for a or b < info.num_length\n");
return NOTOK;
}
--- 82,88 ----
const WordKeyInfo& info = *WordKey::Info();
if(a_length < info.num_length || b_length < info.num_length) {
! fprintf(stderr, "WordKey::Compare: key length %d or %d < info.num_length = %d\n", a_length, b_length, info.num_length);
return NOTOK;
}
diff -c -r ../cvs/htdig/test/search.cc ./test/search.cc
*** ../cvs/htdig/test/search.cc Tue May 27 22:51:27 2003
--- ./test/search.cc Fri Jun 20 16:48:34 2003
***************
*** 2298,2304 ****
//
WordSort *tmp = new WordSort[cursors_length];
! memset((char*)tmp, '\0', sizeof(WordSort[cursors_length]));
unsigned int i;
for(i = 0; i < cursors_length; i++) {
--- 2298,2304 ----
//
WordSort *tmp = new WordSort[cursors_length];
! memset((char*)tmp, '\0', cursors_length * sizeof(WordSort[0]));
unsigned int i;
for(i = 0; i < cursors_length; i++) {
***************
*** 2328,2334 ****
stripped = 0;
WordTree** tmp = new WordTree*[cursors_length];
! memset((char*)tmp, '\0', sizeof(WordTree*[cursors_length]));
unsigned int from;
unsigned int to;
--- 2328,2334 ----
stripped = 0;
WordTree** tmp = new WordTree*[cursors_length];
! memset((char*)tmp, '\0', cursors_length * sizeof(WordTree*[0]));
unsigned int from;
unsigned int to;