summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
Diffstat (limited to 'ndb')
-rw-r--r--ndb/include/util/ConfigValues.hpp8
-rw-r--r--ndb/src/common/util/ConfigValues.cpp44
-rw-r--r--ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp2
-rw-r--r--ndb/src/kernel/vm/ArrayPool.hpp24
-rw-r--r--ndb/src/kernel/vm/DLFifoList.hpp4
-rw-r--r--ndb/src/kernel/vm/DLList.hpp4
-rw-r--r--ndb/src/kernel/vm/DataBuffer.hpp4
-rw-r--r--ndb/src/kernel/vm/SLList.hpp4
-rw-r--r--ndb/src/ndbapi/NdbDictionaryImpl.cpp2
9 files changed, 51 insertions, 45 deletions
diff --git a/ndb/include/util/ConfigValues.hpp b/ndb/include/util/ConfigValues.hpp
index 48e1363bf4a..3fbeedb25a0 100644
--- a/ndb/include/util/ConfigValues.hpp
+++ b/ndb/include/util/ConfigValues.hpp
@@ -24,8 +24,8 @@ public:
ValueType m_type;
union {
Uint32 m_int;
- const char * m_string;
Uint64 m_int64;
+ const char * m_string;
};
};
@@ -72,14 +72,14 @@ private:
friend class ConstIterator;
bool getByPos(Uint32 pos, Entry *) const;
- Uint64 & get64(Uint32 index) const;
- char * & getString(Uint32 index) const;
+ Uint64 * get64(Uint32 index) const;
+ char ** getString(Uint32 index) const;
Uint32 m_size;
Uint32 m_dataSize;
Uint32 m_stringCount;
Uint32 m_int64Count;
-
+
Uint32 m_values[1];
void * m_data[1];
};
diff --git a/ndb/src/common/util/ConfigValues.cpp b/ndb/src/common/util/ConfigValues.cpp
index 18ecf4bcdc4..7fc99bc526c 100644
--- a/ndb/src/common/util/ConfigValues.cpp
+++ b/ndb/src/common/util/ConfigValues.cpp
@@ -60,7 +60,7 @@ ConfigValues::ConfigValues(Uint32 sz, Uint32 dsz){
ConfigValues::~ConfigValues(){
for(Uint32 i = 0; i<m_stringCount; i++){
- free(getString(i));
+ free(* getString(i));
}
}
@@ -87,10 +87,10 @@ ConfigValues::getByPos(Uint32 pos, Entry * result) const {
result->m_int = val;
break;
case StringType:
- result->m_string = getString(val);
+ result->m_string = * getString(val);
break;
case Int64Type:
- result->m_int64 = get64(val);
+ result->m_int64 = * get64(val);
break;
case InvalidType:
default:
@@ -102,18 +102,23 @@ ConfigValues::getByPos(Uint32 pos, Entry * result) const {
return true;
}
-Uint64 &
+Uint64 *
ConfigValues::get64(Uint32 index) const {
assert(index < m_int64Count);
- Uint64 * ptr = (Uint64*)(&m_values[m_size << 1]);
- return ptr[index];
+ const Uint32 * data = m_values + (m_size << 1);
+ Uint64 * ptr = (Uint64*)data;
+ ptr += index;
+ return ptr;
}
-char * &
+char **
ConfigValues::getString(Uint32 index) const {
- assert(index < m_stringCount);
- char ** ptr = (char**)(((char *)&(m_values[m_size << 1])) + m_dataSize);
- return ptr[-index];
+ assert(index < m_stringCount);
+ const Uint32 * data = m_values + (m_size << 1);
+ char * ptr = (char*)data;
+ ptr += m_dataSize;
+ ptr -= (index * sizeof(char *));
+ return (char**)ptr;
}
bool
@@ -176,7 +181,7 @@ ConfigValues::Iterator::set(Uint32 key, Uint64 value){
return false;
}
- m_cfg.get64(m_cfg.m_values[pos+1]) = value;
+ * m_cfg.get64(m_cfg.m_values[pos+1]) = value;
return true;
}
@@ -191,9 +196,9 @@ ConfigValues::Iterator::set(Uint32 key, const char * value){
return false;
}
- char * & str = m_cfg.getString(m_cfg.m_values[pos+1]);
- free(str);
- str = strdup(value ? value : "");
+ char ** str = m_cfg.getString(m_cfg.m_values[pos+1]);
+ free(* str);
+ * str = strdup(value ? value : "");
return true;
}
@@ -457,7 +462,8 @@ ConfigValuesFactory::put(const ConfigValues::Entry & entry){
case ConfigValues::StringType:{
Uint32 index = m_cfg->m_stringCount++;
m_cfg->m_values[pos+1] = index;
- m_cfg->getString(index) = strdup(entry.m_string ? entry.m_string : "");
+ char ** ref = m_cfg->getString(index);
+ * ref = strdup(entry.m_string ? entry.m_string : "");
m_freeKeys--;
m_freeData -= sizeof(char *);
DEBUG printf("Putting at: %d(%d) (loop = %d) key: %d value(%d): %s\n",
@@ -470,7 +476,7 @@ ConfigValuesFactory::put(const ConfigValues::Entry & entry){
case ConfigValues::Int64Type:{
Uint32 index = m_cfg->m_int64Count++;
m_cfg->m_values[pos+1] = index;
- m_cfg->get64(index) = entry.m_int64;
+ * m_cfg->get64(index) = entry.m_int64;
m_freeKeys--;
m_freeData -= 8;
DEBUG printf("Putting at: %d(%d) (loop = %d) key: %d value64(%d): %lld\n",
@@ -558,7 +564,7 @@ ConfigValues::getPackedSize() const {
break;
case StringType:
size += 8; // key + len
- size += mod4(strlen(getString(m_values[i+1])) + 1);
+ size += mod4(strlen(* getString(m_values[i+1])) + 1);
break;
case InvalidType:
default:
@@ -587,7 +593,7 @@ ConfigValues::pack(void * _dst, Uint32 _len) const {
* (Uint32*)dst = htonl(val); dst += 4;
break;
case Int64Type:{
- Uint64 i64 = get64(val);
+ Uint64 i64 = * get64(val);
Uint32 hi = (i64 >> 32);
Uint32 lo = (i64 & 0xFFFFFFFF);
* (Uint32*)dst = htonl(key); dst += 4;
@@ -596,7 +602,7 @@ ConfigValues::pack(void * _dst, Uint32 _len) const {
}
break;
case StringType:{
- const char * str = getString(val);
+ const char * str = * getString(val);
Uint32 len = strlen(str) + 1;
* (Uint32*)dst = htonl(key); dst += 4;
* (Uint32*)dst = htonl(len); dst += 4;
diff --git a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
index c763d3b4786..fe737fc584b 100644
--- a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
+++ b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
@@ -63,7 +63,7 @@ Ndbfs::Ndbfs(const Configuration & conf) :
const ndb_mgm_configuration_iterator * p = conf.getOwnConfigIterator();
ndbrequire(p != 0);
- m_maxOpenedFiles = 40;
+ m_maxFiles = 40;
//ndb_mgm_get_int_parameter(p, CFG_DB_MAX_OPEN_FILES, &m_maxFiles);
// Create idle AsyncFiles
diff --git a/ndb/src/kernel/vm/ArrayPool.hpp b/ndb/src/kernel/vm/ArrayPool.hpp
index 284d29dcefa..4fc6bb97f73 100644
--- a/ndb/src/kernel/vm/ArrayPool.hpp
+++ b/ndb/src/kernel/vm/ArrayPool.hpp
@@ -795,8 +795,8 @@ inline
void
UnsafeArrayPool<T>::getPtrForce(Ptr<T> & ptr){
Uint32 i = ptr.i;
- if(i < size){
- ptr.p = &theArray[i];
+ if(i < this->size){
+ ptr.p = &this->theArray[i];
} else {
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
__FILE__, __LINE__);
@@ -808,8 +808,8 @@ inline
void
UnsafeArrayPool<T>::getPtrForce(ConstPtr<T> & ptr) const{
Uint32 i = ptr.i;
- if(i < size){
- ptr.p = &theArray[i];
+ if(i < this->size){
+ ptr.p = &this->theArray[i];
} else {
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
__FILE__, __LINE__);
@@ -820,8 +820,8 @@ template <class T>
inline
T *
UnsafeArrayPool<T>::getPtrForce(Uint32 i){
- if(i < size){
- return &theArray[i];
+ if(i < this->size){
+ return &this->theArray[i];
} else {
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
__FILE__, __LINE__);
@@ -833,8 +833,8 @@ template <class T>
inline
const T *
UnsafeArrayPool<T>::getConstPtrForce(Uint32 i) const {
- if(i < size){
- return &theArray[i];
+ if(i < this->size){
+ return &this->theArray[i];
} else {
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
__FILE__, __LINE__);
@@ -847,8 +847,8 @@ inline
void
UnsafeArrayPool<T>::getPtrForce(Ptr<T> & ptr, Uint32 i){
ptr.i = i;
- if(i < size){
- ptr.p = &theArray[i];
+ if(i < this->size){
+ ptr.p = &this->theArray[i];
return ;
} else {
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
@@ -861,8 +861,8 @@ inline
void
UnsafeArrayPool<T>::getPtrForce(ConstPtr<T> & ptr, Uint32 i) const{
ptr.i = i;
- if(i < size){
- ptr.p = &theArray[i];
+ if(i < this->size){
+ ptr.p = &this->theArray[i];
return ;
} else {
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
diff --git a/ndb/src/kernel/vm/DLFifoList.hpp b/ndb/src/kernel/vm/DLFifoList.hpp
index 91b5b421b0c..b139ade831d 100644
--- a/ndb/src/kernel/vm/DLFifoList.hpp
+++ b/ndb/src/kernel/vm/DLFifoList.hpp
@@ -153,11 +153,11 @@ public:
LocalDLFifoList(ArrayPool<T> & thePool, typename DLFifoList<T>::Head & _src)
: DLFifoList<T>(thePool), src(_src)
{
- head = src;
+ this->head = src;
}
~LocalDLFifoList(){
- src = head;
+ src = this->head;
}
private:
typename DLFifoList<T>::Head & src;
diff --git a/ndb/src/kernel/vm/DLList.hpp b/ndb/src/kernel/vm/DLList.hpp
index f16ccd312f7..b7820eb9229 100644
--- a/ndb/src/kernel/vm/DLList.hpp
+++ b/ndb/src/kernel/vm/DLList.hpp
@@ -169,11 +169,11 @@ public:
LocalDLList(ArrayPool<T> & thePool, typename DLList<T>::Head & _src)
: DLList<T>(thePool), src(_src)
{
- head = src;
+ this->head = src;
}
~LocalDLList(){
- src = head;
+ src = this->head;
}
private:
typename DLList<T>::Head & src;
diff --git a/ndb/src/kernel/vm/DataBuffer.hpp b/ndb/src/kernel/vm/DataBuffer.hpp
index 3425fca76a3..7dc89aa638c 100644
--- a/ndb/src/kernel/vm/DataBuffer.hpp
+++ b/ndb/src/kernel/vm/DataBuffer.hpp
@@ -174,11 +174,11 @@ public:
typename DataBuffer<sz>::Head & _src)
: DataBuffer<sz>(thePool), src(_src)
{
- head = src;
+ this->head = src;
}
~LocalDataBuffer(){
- src = head;
+ src = this->head;
}
private:
typename DataBuffer<sz>::Head & src;
diff --git a/ndb/src/kernel/vm/SLList.hpp b/ndb/src/kernel/vm/SLList.hpp
index 47bc7b8b241..5fde41aa3e0 100644
--- a/ndb/src/kernel/vm/SLList.hpp
+++ b/ndb/src/kernel/vm/SLList.hpp
@@ -137,11 +137,11 @@ public:
LocalSLList(ArrayPool<T> & thePool, typename SLList<T>::Head & _src)
: SLList<T>(thePool), src(_src)
{
- head = src;
+ this->head = src;
}
~LocalSLList(){
- src = head;
+ src = this->head;
}
private:
typename SLList<T>::Head & src;
diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
index 9589639a332..348f6db36e4 100644
--- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp
+++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
@@ -1417,7 +1417,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
s = SimpleProperties::pack(w,
&tmpAttr,
DictTabInfo::AttributeMapping,
- DictTabInfo::TableMappingSize, true);
+ DictTabInfo::AttributeMappingSize, true);
w.add(DictTabInfo::AttributeEnd, 1);
}