diff options
author | unknown <joreland@mysql.com> | 2004-05-26 10:56:32 +0200 |
---|---|---|
committer | unknown <joreland@mysql.com> | 2004-05-26 10:56:32 +0200 |
commit | 1a9eb476f185d94ec13ed4f13dbfbdb14f9217c1 (patch) | |
tree | 32b839686028c5bc61304dbd566705a3bc085f6d /ndb/include/util/Bitmask.hpp | |
parent | 3cfddc421d53e28f398a2db98002cab2be15fc9e (diff) | |
download | mariadb-git-1a9eb476f185d94ec13ed4f13dbfbdb14f9217c1.tar.gz |
WL1371 - Cleanup configuration handling
WL1356 - Discless db node
WL1357 - sp 1-2
Diffstat (limited to 'ndb/include/util/Bitmask.hpp')
-rw-r--r-- | ndb/include/util/Bitmask.hpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/ndb/include/util/Bitmask.hpp b/ndb/include/util/Bitmask.hpp index 00255d3a86b..7355742f845 100644 --- a/ndb/include/util/Bitmask.hpp +++ b/ndb/include/util/Bitmask.hpp @@ -134,7 +134,7 @@ public: /** * getText - Return as hex-digits (only for debug routines). */ - static void getText(unsigned size, const Uint32 data[], char* buf); + static char* getText(unsigned size, const Uint32 data[], char* buf); }; inline bool @@ -302,9 +302,10 @@ BitmaskImpl::setField(unsigned size, Uint32 data[], set(size, data, pos + i, val & (1 << i)); } -inline void +inline char * BitmaskImpl::getText(unsigned size, const Uint32 data[], char* buf) { + char * org = buf; const char* const hex = "0123456789abcdef"; for (int i = (size-1); i >= 0; i--) { Uint32 x = data[i]; @@ -315,6 +316,7 @@ BitmaskImpl::getText(unsigned size, const Uint32 data[], char* buf) buf += 8; } *buf = 0; + return org; } /** @@ -333,7 +335,7 @@ public: Uint32 data[size]; #if 0 Data & operator=(const Bitmask<size> & src) { - src.assign(size, data); + src.copyto(size, data); return *this; } #endif @@ -346,6 +348,8 @@ public: STATIC_CONST( NotFound = BitmaskImpl::NotFound ); STATIC_CONST( TextLength = size * 8 ); + Bitmask() { clear();} + /** * assign - Set all bits in <em>dst</em> to corresponding in <em>src/<em> */ @@ -359,9 +363,9 @@ public: void assign(const Bitmask<size> & src); /** - * assign <em>dst</em> of size <em>sz</em> to <em>this</em> + * copy this to <em>dst</em> */ - void assign(unsigned sz, Uint32 dst[]) const; + void copyto(unsigned sz, Uint32 dst[]) const; /** * assign <em>this</em> according to <em>src/em> @@ -469,7 +473,7 @@ public: /** * getText - Return as hex-digits (only for debug routines). */ - static void getText(const Uint32 data[], char* buf); + static char* getText(const Uint32 data[], char* buf); char* getText(char* buf) const; }; @@ -498,12 +502,12 @@ template <unsigned size> inline void Bitmask<size>::assign(const Bitmask<size> & src) { - assign(rep.data, src); + assign(rep.data, src.rep.data); } template <unsigned size> inline void -Bitmask<size>::assign(unsigned sz, Uint32 dst[]) const +Bitmask<size>::copyto(unsigned sz, Uint32 dst[]) const { BitmaskImpl::assign(sz, dst, rep.data); } @@ -716,18 +720,17 @@ Bitmask<size>::bitXOR(const Bitmask<size>& mask2) } template <unsigned size> -void +char * Bitmask<size>::getText(const Uint32 data[], char* buf) { - BitmaskImpl::getText(size, data, buf); + return BitmaskImpl::getText(size, data, buf); } template <unsigned size> inline char * Bitmask<size>::getText(char* buf) const { - getText(rep.data, buf); - return buf; + return getText(rep.data, buf); } template <unsigned size> |