diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2012-09-30 13:51:29 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2012-09-30 13:51:29 (GMT) |
commit | ceb4115c7b941039411e1793e01239610ff112a2 (patch) | |
tree | d18c06222e0f84d6077b586e5633053a8bc09da8 /qtools/qarray.h | |
parent | f6d511e52eb55c5d5b980c4d226f2ea80b396095 (diff) | |
download | Doxygen-ceb4115c7b941039411e1793e01239610ff112a2.zip Doxygen-ceb4115c7b941039411e1793e01239610ff112a2.tar.gz Doxygen-ceb4115c7b941039411e1793e01239610ff112a2.tar.bz2 |
Release-1.8.2-20120930
Diffstat (limited to 'qtools/qarray.h')
-rw-r--r-- | qtools/qarray.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/qtools/qarray.h b/qtools/qarray.h index 90dcbb7..3d67fe9 100644 --- a/qtools/qarray.h +++ b/qtools/qarray.h @@ -55,19 +55,19 @@ protected: public: QArray() {} - QArray( int size ) : QGArray(size*sizeof(type)) {} + QArray( int size ) : QGArray(size*(int)sizeof(type)) {} QArray( const QArray<type> &a ) : QGArray(a) {} ~QArray() {} QArray<type> &operator=(const QArray<type> &a) { return (QArray<type>&)QGArray::assign(a); } type *data() const { return (type *)QGArray::data(); } uint nrefs() const { return QGArray::nrefs(); } - uint size() const { return QGArray::size()/sizeof(type); } + uint size() const { return QGArray::size()/(int)sizeof(type); } uint count() const { return size(); } bool isEmpty() const { return QGArray::size() == 0; } bool isNull() const { return QGArray::data() == 0; } - bool resize( uint size ) { return QGArray::resize(size*sizeof(type)); } - bool truncate( uint pos ) { return QGArray::resize(pos*sizeof(type)); } + bool resize( uint size ) { return QGArray::resize(size*(int)sizeof(type)); } + bool truncate( uint pos ) { return QGArray::resize(pos*(int)sizeof(type)); } bool fill( const type &d, int size = -1 ) { return QGArray::fill((char*)&d,size,sizeof(type) ); } void detach() { QGArray::detach(); } @@ -94,9 +94,9 @@ public: int bsearch( const type &d ) const { return QGArray::bsearch((const char*)&d,sizeof(type)); } type& operator[]( int i ) const - { return (type &)(*(type *)QGArray::at(i*sizeof(type))); } + { return (type &)(*(type *)QGArray::at(i*(int)sizeof(type))); } type& at( uint i ) const - { return (type &)(*(type *)QGArray::at(i*sizeof(type))); } + { return (type &)(*(type *)QGArray::at(i*(int)sizeof(type))); } operator const type*() const { return (const type *)QGArray::data(); } bool operator==( const QArray<type> &a ) const { return isEqual(a); } bool operator!=( const QArray<type> &a ) const { return !isEqual(a); } |