dtinfo subdirectory DtMmdb

This commit is contained in:
Ulrich Wilkens
2013-08-28 19:16:37 +02:00
committed by Jon Trulson
parent 0be684281d
commit fbd81ef151
159 changed files with 735 additions and 588 deletions

View File

@@ -97,7 +97,7 @@ dyn_memory_index::~dyn_memory_index()
my_oid().asciiOut(oid_t_out);
*/
abs_storage* x = get_store();
get_store();
fstream out(
form("%s.%s", storage_ptr->my_path(), storage_ptr->my_name()),
ios::out

View File

@@ -241,6 +241,8 @@ debug(cerr, t);
int fast_mphf::hashTo(const key_type& k)
{
unsigned int i;
if ( v_long_string_core_indexed == false ) {
v_long_string_core_indexed = true;
}
@@ -255,7 +257,7 @@ debug(cerr, k);
throw(stringException("hash table empty"));
}
int i = v_tbl0 -> atoi(k.get(), k.size(), r, v_key_set_sz); // for halmphf
i = v_tbl0 -> atoi(k.get(), k.size(), r, v_key_set_sz); // for halmphf
if ( i < v_p1 ) {
@@ -281,7 +283,7 @@ debug(cerr, k);
int fast_mphf::gValue(int i, int& gvalue, int& ctl_bit)
{
if ( !INRANGE(i, 0, v_no_ps-1) ) {
if ( !INRANGE(i, 0, (int) v_no_ps-1) ) {
throw(boundaryException(0, v_no_ps-1, i));
}
@@ -428,7 +430,7 @@ fast_mphf::print_mapping(const char *key_file, int option)
}
char *hash_table = new char[v_hash_tbl_sz];
for (int i = 0; i < v_hash_tbl_sz; hash_table[i++] = 0 );
for (unsigned int i = 0; i < v_hash_tbl_sz; hash_table[i++] = 0 );
ostring lbuf(LBUFSIZ);
@@ -470,7 +472,7 @@ void fast_mphf::print_tbls(ostream& out)
void fast_mphf::print_gvalues(ostream& out)
{
int gv, cbit;
for (int i = 0; i<v_no_ps; i++ ) {
for (unsigned int i = 0; i<v_no_ps; i++ ) {
out << i;
gValue(i, gv, cbit);
out << " " << gv << " " << cbit << "\n";
@@ -479,7 +481,7 @@ void fast_mphf::print_gvalues(ostream& out)
int fast_mphf::print_bits(unsigned x, ostream& out)
{
for ( int i=0; i<8*sizeof(unsigned); i++ ) {
for ( unsigned int i=0; i<8*sizeof(unsigned); i++ ) {
if ( BIT_TEST(x, 0x80000000) )
out << "1";
else

View File

@@ -107,11 +107,13 @@ oid_t c_index::first_of_invlist(int ind)
Boolean c_index::get_key_string(const handler& t) const
{
ostringstream out(v_static_key.get());
ostringstream out;
int len;
((handler&)t) -> asciiOut(out);
v_static_key.set_size(out.str().size());
strcpy(v_static_key.get(), out.str().c_str());
len = out.str().size();
v_static_key.set_size(len);
*((char *) memcpy(v_static_key.get(), out.str().c_str(), len) + len) = '\0';
return true;
}
@@ -119,12 +121,14 @@ Boolean c_index::get_key_string(const handler& t) const
Boolean c_index::get_key_string(const oid_t& t) const
{
v_static_key.reset();
int len;
ostringstream out(v_static_key.get());
t.asciiOut(out);
v_static_key.set_size(out.str().size());
strcpy(v_static_key.get(), out.str().c_str());
len = out.str().size();
v_static_key.set_size(len);
*((char *) memcpy(v_static_key.get(), out.str().c_str(), len) + len) = '\0';
return true;
}

View File

@@ -140,7 +140,7 @@ ostream& operator <<(ostream&s, inv_lists& o)
void inv_lists::insert_to_list(int index, oid_t& id)
{
if ( !INRANGE(index, 1, v_sz) ) {
if ( !INRANGE(index, 1, (int) v_sz) ) {
throw(boundaryException(1, v_sz, index));
}