Irix64 mipspro ndb compile fixes

parent 63fca63e
......@@ -105,19 +105,19 @@ ConfigValues::getByPos(Uint32 pos, Entry * result) const {
Uint64 *
ConfigValues::get64(Uint32 index) const {
assert(index < m_int64Count);
const Uint32 * data = m_values + (m_size << 1);
const Uint32 * data = m_values + (m_size << 1);
Uint64 * ptr = (Uint64*)data;
ptr += index;
ptr += index;
return ptr;
}
char **
ConfigValues::getString(Uint32 index) const {
assert(index < m_stringCount);
const Uint32 * data = m_values + (m_size << 1);
char * ptr = (char*)data;
const Uint32 * data = m_values + (m_size << 1);
char * ptr = (char*)data;
ptr += m_dataSize;
ptr -= (index * sizeof(char *));
ptr -= (index * sizeof(char *));
return (char**)ptr;
}
......@@ -261,9 +261,9 @@ directory(Uint32 sz){
ConfigValuesFactory::ConfigValuesFactory(Uint32 keys, Uint32 data){
m_sectionCounter = (1 << KP_SECTION_SHIFT);
m_freeKeys = directory(keys);
m_freeData = data;
m_freeData = ((data + 7) & ~7);
m_currentSection = 0;
m_cfg = create(m_freeKeys, data);
m_cfg = create(m_freeKeys, m_freeData);
}
ConfigValuesFactory::ConfigValuesFactory(ConfigValues * cfg){
......@@ -316,7 +316,8 @@ ConfigValuesFactory::expand(Uint32 fk, Uint32 fs){
m_freeKeys = (m_freeKeys >= fk ? m_cfg->m_size : fk + m_cfg->m_size);
m_freeData = (m_freeData >= fs ? m_cfg->m_dataSize : fs + m_cfg->m_dataSize);
m_freeKeys = directory(m_freeKeys);
m_freeData = ((m_freeData + 7) & ~7);
ConfigValues * m_tmp = m_cfg;
m_cfg = create(m_freeKeys, m_freeData);
put(* m_tmp);
......@@ -333,6 +334,7 @@ ConfigValuesFactory::shrink(){
m_freeKeys = m_cfg->m_size - m_freeKeys;
m_freeData = m_cfg->m_dataSize - m_freeData;
m_freeKeys = directory(m_freeKeys);
m_freeData = ((m_freeData + 7) & ~7);
ConfigValues * m_tmp = m_cfg;
m_cfg = create(m_freeKeys, m_freeData);
......@@ -462,7 +464,7 @@ ConfigValuesFactory::put(const ConfigValues::Entry & entry){
case ConfigValues::StringType:{
Uint32 index = m_cfg->m_stringCount++;
m_cfg->m_values[pos+1] = index;
char ** ref = m_cfg->getString(index);
char ** ref = m_cfg->getString(index);
* ref = strdup(entry.m_string ? entry.m_string : "");
m_freeKeys--;
m_freeData -= sizeof(char *);
......
......@@ -243,20 +243,17 @@ MgmtSrvr::startEventLog()
char clusterLog[MAXPATHLEN];
NdbConfig_ClusterLogFileName(clusterLog, sizeof(clusterLog));
if(ndb_mgm_get_string_parameter(iter, CFG_LOG_DESTINATION, &tmp) == 0){
logdest.assign(tmp);
}
ndb_mgm_destroy_iterator(iter);
if(logdest.length()==0) {
if(logdest.length() == 0 || logdest == "") {
logdest.assfmt("FILE:filename=%s,maxsize=1000000,maxfiles=6",
clusterLog);
}
if(!g_EventLogger.addHandler(logdest)) {
ndbout << "ERROR: cannot parse \"" << logdest << "\"" << endl;
exit(1);
ndbout << "Warning: could not add log destination \"" << logdest.c_str() << "\"" << endl;
}
}
......
......@@ -337,7 +337,6 @@ static const tab2 table2[] = {
const int tab_sz = sizeof(table)/sizeof(table[0]);
const int tab2_sz = sizeof(table2)/sizeof(table2[0]);
template<typename T>
int
matchType(const NdbDictionary::Column * col){
return 1;
......@@ -382,7 +381,7 @@ NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition op,
return -1;
}
if(!matchType<T>(col)){
if(!matchType(col)){
/**
* Code not reached
*/
......@@ -777,3 +776,9 @@ main(void){
return 0;
}
#endif
template class Vector<NdbScanFilterImpl::State>;
template int NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition, Uint32 attrId, Uint32);
template int NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition, Uint32 attrId, Uint64);
......@@ -28,7 +28,8 @@
HugoCalculator::HugoCalculator(const NdbDictionary::Table& tab) : m_tab(tab) {
// The "id" column of this table is found in the first integer column
for (int i=0; i<m_tab.getNoOfColumns(); i++){
int i;
for (i=0; i<m_tab.getNoOfColumns(); i++){
const NdbDictionary::Column* attr = m_tab.getColumn(i);
if (attr->getType() == NdbDictionary::Column::Unsigned){
m_idCol = i;
......@@ -37,7 +38,7 @@ HugoCalculator::HugoCalculator(const NdbDictionary::Table& tab) : m_tab(tab) {
}
// The "number of updates" column for this table is found in the last column
for (int i=m_tab.getNoOfColumns()-1; i>=0; i--){
for (i=m_tab.getNoOfColumns()-1; i>=0; i--){
const NdbDictionary::Column* attr = m_tab.getColumn(i);
if (attr->getType() == NdbDictionary::Column::Unsigned){
m_updatesCol = i;
......@@ -102,7 +103,8 @@ HugoCalculator::calcValue(int record,
// Fill buf with some pattern so that we can detect
// anomalies in the area that we don't fill with chars
for (int i = 0; i<attr->getLength(); i++)
int i;
for (i = 0; i<attr->getLength(); i++)
buf[i] = ((i+2) % 255);
// Calculate length of the string to create. We want the string
......@@ -116,7 +118,7 @@ HugoCalculator::calcValue(int record,
else
len++;
}
for(int i=0; i < len; i++)
for(i=0; i < len; i++)
buf[i] = a[((val^i)%25)];
buf[len] = 0;
}
......
......@@ -678,17 +678,18 @@ NdbDictionary::Table*
NDBT_Tables::getTable(const char* _nam){
// Search tables list to find a table
NDBT_Table* tab = NULL;
for (int i=0; i<numTestTables; i++){
int i;
for (i=0; i<numTestTables; i++){
if (strcmp(test_tables[i]->getName(), _nam) == 0){
return test_tables[i];
}
}
for (int i=0; i<numFailTables; i++){
for (i=0; i<numFailTables; i++){
if (strcmp(fail_tables[i]->getName(), _nam) == 0){
return fail_tables[i];
}
}
for (int i=0; i<numUtilTables; i++){
for (i=0; i<numUtilTables; i++){
if (strcmp(util_tables[i]->getName(), _nam) == 0){
return util_tables[i];
}
......
......@@ -336,24 +336,24 @@ NDBT_TestCaseImpl1::NDBT_TestCaseImpl1(NDBT_TestSuite* psuite,
NDBT_TestCaseImpl1::~NDBT_TestCaseImpl1(){
NdbCondition_Destroy(waitThreadsCondPtr);
NdbMutex_Destroy(waitThreadsMutexPtr);
for(size_t i = 0; i < initializers.size(); i++)
size_t i;
for(i = 0; i < initializers.size(); i++)
delete initializers[i];
initializers.clear();
for(size_t i = 0; i < verifiers.size(); i++)
for(i = 0; i < verifiers.size(); i++)
delete verifiers[i];
verifiers.clear();
for(size_t i = 0; i < finalizers.size(); i++)
for(i = 0; i < finalizers.size(); i++)
delete finalizers[i];
finalizers.clear();
for(size_t i = 0; i < steps.size(); i++)
for(i = 0; i < steps.size(); i++)
delete steps[i];
steps.clear();
results.clear();
for(size_t i = 0; i < testTables.size(); i++)
for(i = 0; i < testTables.size(); i++)
delete testTables[i];
testTables.clear();
for(size_t i = 0; i < testResults.size(); i++)
for(i = 0; i < testResults.size(); i++)
delete testResults[i];
testResults.clear();
......@@ -487,7 +487,8 @@ void NDBT_TestCaseImpl1::waitSteps(){
waitThreadsMutexPtr);
unsigned completedSteps = 0;
for(unsigned i=0; i<steps.size(); i++){
unsigned i;
for(i=0; i<steps.size(); i++){
if (results[i] != NORESULT){
completedSteps++;
if (results[i] == NDBT_OK)
......@@ -501,7 +502,7 @@ void NDBT_TestCaseImpl1::waitSteps(){
NdbMutex_Unlock(waitThreadsMutexPtr);
void *status;
for(unsigned i=0; i<steps.size();i++){
for(i=0; i<steps.size();i++){
NdbThread_WaitFor(threads[i], &status);
NdbThread_Destroy(&threads[i]);
}
......@@ -633,12 +634,12 @@ int NDBT_TestCaseImpl1::runSteps(NDBT_Context* ctx){
numStepsOk = 0;
numStepsFail = 0;
numStepsCompleted = 0;
for (unsigned i = 0; i < steps.size(); i++)
unsigned i;
for (i = 0; i < steps.size(); i++)
startStepInThread(i, ctx);
waitSteps();
for(unsigned i = 0; i < steps.size(); i++)
for(i = 0; i < steps.size(); i++)
if (results[i] != NDBT_OK)
res = NDBT_FAILED;
return res;
......@@ -1091,20 +1092,20 @@ void NDBT_TestCaseImpl1::print(){
abort();
}
}
for(unsigned i=0; i<initializers.size(); i++){
unsigned i;
for(i=0; i<initializers.size(); i++){
ndbout << "Initializers[" << i << "]: " << endl;
initializers[i]->print();
}
for(unsigned i=0; i<steps.size(); i++){
for(i=0; i<steps.size(); i++){
ndbout << "Step[" << i << "]: " << endl;
steps[i]->print();
}
for(unsigned i=0; i<verifiers.size(); i++){
for(i=0; i<verifiers.size(); i++){
ndbout << "Verifier[" << i << "]: " << endl;
verifiers[i]->print();
}
for(unsigned i=0; i<finalizers.size(); i++){
for(i=0; i<finalizers.size(); i++){
ndbout << "Finalizer[" << i << "]: " << endl;
finalizers[i]->print();
}
......
......@@ -121,7 +121,8 @@ getStatus(){
retries++;
continue;
}
for (int i = 0; i < status->no_of_nodes; i++){
int count = status->no_of_nodes;
for (int i = 0; i < count; i++){
node = &status->node_states[i];
switch(node->node_type){
case NDB_MGM_NODE_TYPE_NDB:
......@@ -142,7 +143,7 @@ getStatus(){
apiNodes.clear();
free(status);
status = NULL;
i = status->no_of_nodes;
count = 0;
ndbout << "kalle"<< endl;
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment