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

@@ -33,7 +33,7 @@
template <class T>
CC_Boolean CC_TPtrDlistIterator<T>::operator+=(size_t n)
{
for ( int i = 0; i < n ; i++ ) {
for ( size_t i = 0; i < n ; i++ ) {
if ( !(++(*this)) ) {
return (FALSE);
}

View File

@@ -46,7 +46,7 @@ template<class T>
T *CC_TPtrSlist<T>::removeAt(size_t pos) {
CC_TPtrSlistIterator<T> iter( *this );
for( int i = 0; i <= pos; i++ ) {
for( size_t i = 0; i <= pos; i++ ) {
if ( !(++iter) ) {
throw(CASTCCBEXCEPT ccBoundaryException(0,0,i));
}

View File

@@ -82,7 +82,7 @@ public:
CC_TPtrSlist(const CC_TPtrSlist<T> &);
CC_TPtrSlist() { destructed = FALSE; }
~CC_TPtrSlist();
virtual ~CC_TPtrSlist();
virtual void clearAndDestroy();
virtual void clear(); /* clear only removes item, but not calling
@@ -104,7 +104,7 @@ public:
{
// Hack to get it passed to iter
CC_TPtrSlistIterator<T> iter( *(CC_TPtrSlist<T> *)this );
for ( int i = 0; i <=pos; i++ ) {
for ( size_t i = 0; i <=pos; i++ ) {
if ( !(++iter) ) {
throw(CASTCCBEXCEPT ccBoundaryException(0,0,i));
}
@@ -161,7 +161,7 @@ public:
CC_Boolean get_destructed() const
{ return (destructed); }
CC_Boolean set_destructed(CC_Boolean what)
void set_destructed(CC_Boolean what)
{ destructed = what; }
};

View File

@@ -34,8 +34,9 @@ public: // functions
CC_String (const char *string)
{
f_string = new char[strlen(string) + 1];
strcpy (f_string, string);
int len = strlen(string);
f_string = new char[len + 1];
*((char *) memcpy(f_string, string, len) + len) = '\0';
}
CC_String()

View File

@@ -27,8 +27,9 @@
//--------------------------------------------------------------
CC_Tokenizer::CC_Tokenizer( const CC_String &s )
{
str_ = new char [s.length()+1];
strcpy(str_, s.data() );
int len = s.length();
str_ = new char [len + 1];
*((char *) memcpy(str_, s.data(), len) + len) = '\0';
current_ptr = str_;
touched = FALSE;
}

View File

@@ -58,7 +58,7 @@ hashTable<K,V>::~hashTable()
CC_TPtrSlist<kv_pair<K, V> > * b = 0;
kv_pair<K, V> * r = 0;
for (int i=0; i<f_buckets.length(); i++ ) {
for (size_t i=0; i<f_buckets.length(); i++ ) {
b = f_buckets[i];
@@ -78,7 +78,7 @@ void hashTable<K,V>::clearAndDestroy()
CC_TPtrSlist<kv_pair<K, V> >* b = 0;
for (int i=0; i<f_buckets.length(); i++ ) {
for (size_t i=0; i<f_buckets.length(); i++ ) {
b = f_buckets[i];
if ( b ) {

View File

@@ -66,8 +66,8 @@ template <class K, class V> class hashTable
friend class hashTableIterator<K, V>;
protected:
pointer_vector<CC_TPtrSlist<kv_pair<K, V> > > f_buckets;
unsigned (*f_hash_func_ptr)(const K&);
pointer_vector<CC_TPtrSlist<kv_pair<K, V> > > f_buckets;
size_t f_items;
protected:

View File

@@ -53,7 +53,7 @@ public:
{
// Hack to get it passed to iter
CC_TPtrSlistIterator<T> iter( *(CC_TPtrSlist<T> *)this );
for ( int i = 0; i <=pos; i++ ) {
for ( size_t i = 0; i <=pos; i++ ) {
if ( !(++iter) ) {
throw(CASTCCBEXCEPT ccBoundaryException(0,0,i));
}

View File

@@ -39,7 +39,7 @@ template <class T>
pointer_vector<T>::pointer_vector(size_t n, T* t)
: f_array(new Tptr[n]), f_size(n), f_items(0)
{
for ( int i=0; i<f_size; i++ )
for ( size_t i=0; i<f_size; i++ )
f_array[i] = t;
}
@@ -52,7 +52,7 @@ pointer_vector<T>::~pointer_vector()
template <class T>
T* pointer_vector<T>::operator[](ptrdiff_t i) const
{
if ( i<0 || i>= f_size )
if ( i < 0 || i >= (ptrdiff_t)f_size )
throw(CASTCCBEXCEPT ccBoundaryException(0, f_size-1, i));
else
return f_array[i];
@@ -61,7 +61,7 @@ T* pointer_vector<T>::operator[](ptrdiff_t i) const
template <class T>
T*& pointer_vector<T>::operator[](ptrdiff_t i)
{
if ( i<0 || i>= f_size )
if ( i < 0 || i >= (ptrdiff_t)f_size )
throw(CASTCCBEXCEPT ccBoundaryException(0, f_size-1, i));
else
return f_array[i];

View File

@@ -32,4 +32,7 @@ typedef unsigned int CC_Boolean;
#define TRUE 1
#define FALSE 0
#undef MIN
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
#endif