I have J1ArraySet working, but J1Test and First/next do not
seem to work. This is on amd64, 64bit Linux, built from
latest sources. This (Felix) code:
Judy1Set(ja,word 1,je,pires);
print "1 was unset="; println$ ires;
Judy1Set(ja,word 1,je,pires);
print "1 was unset="; println$ ires;
Judy1Set(ja,word 9,je,pires);
print "9 was unset="; println$ ires;
Judy1Set(ja,word 7,je,pires);
print "7 was unset="; println$ ires;
Judy1Set(ja,word 23,je,pires);
print "23 was unset="; println$ ires;
Judy1Set(ja,word 7,je,pires);
print "7 was unset="; println$ ires;
prints:
1 was unset=1
1 was unset=0
9 was unset=1
7 was unset=1
23 was unset=1
7 was unset=0
which indicates the 'right' bits really are stored
in the array .. but this code:
var i : int;
forall i in 0 upto 10 do
Judy1Test(ja,word i,je,pires);
print i; print " isset="; println$ ires;
done;
0 isset=-1
...
10 isset=-1
gives an error for all values 0 thru 10.
The actual (C++) code is:
PTF i = 0;
_jt_3:;
if(!!(10 < PTF i ) ) goto _jt_4;
{
_a4582t_5997 _tmp6053 = (Word_t)(PTF i) ;
*(PTF pires)=Judy1Test((PTF ja),_tmp6053,(PTF je));
}
*(&std::cout)<<(PTF i);
{
_a2055t_6001 _tmp6054 = _a2055t_6001(" isset=");
*(&std::cout)<<_tmp6054;
}
*(&std::cout)<<(PTF ires);
*(&std::cout)<<std::endl;
++(PTF i);
goto _jt_3;
_jt_4:;
So even though 'set' is reporting whether a bit is set
or not, 'test' isn't. First, Count etc return -1 too.
The array is created by:
PTF ja = mkj1();
where:
void **mkj1(){
void **m =(void**)malloc(sizeof(void*));
*m=0;
return m;
}
Can anyone see what I am doing wrong?
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Judy-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/judy-devel