diff options
author | unknown <joreland@mysql.com> | 2004-11-08 13:59:04 +0100 |
---|---|---|
committer | unknown <joreland@mysql.com> | 2004-11-08 13:59:04 +0100 |
commit | 2f182b3eb0b9402ed5e946caf6e2a94451e1d6b8 (patch) | |
tree | 01e18a1c10b5654ce4ff3520816b7e8ae2250d9b | |
parent | 70663052d8ba2fa319fb2c4ae6db47922239066d (diff) | |
download | mariadb-git-2f182b3eb0b9402ed5e946caf6e2a94451e1d6b8.tar.gz |
compile fix for ndbapi test program on irix (variable scope)
ndb/test/include/NDBT_Test.hpp:
compile fix for ndbapi test program on irix
ndb/test/ndbapi/ScanFunctions.hpp:
compile fix for ndbapi test program on irix
ndb/test/ndbapi/testDataBuffers.cpp:
compile fix for ndbapi test program on irix
ndb/test/ndbapi/testDeadlock.cpp:
compile fix for ndbapi test program on irix
ndb/test/ndbapi/testDict.cpp:
compile fix for ndbapi test program on irix
ndb/test/ndbapi/testIndex.cpp:
compile fix for ndbapi test program on irix
ndb/test/ndbapi/testLcp.cpp:
compile fix for ndbapi test program on irix
ndb/test/ndbapi/testNdbApi.cpp:
compile fix for ndbapi test program on irix
ndb/test/ndbapi/testOIBasic.cpp:
compile fix for ndbapi test program on irix
ndb/test/ndbapi/testReadPerf.cpp:
compile fix for ndbapi test program on irix
ndb/test/ndbapi/testRestartGci.cpp:
compile fix for ndbapi test program on irix
ndb/test/ndbapi/testScanPerf.cpp:
compile fix for ndbapi test program on irix
ndb/test/ndbapi/testSystemRestart.cpp:
compile fix for ndbapi test program on irix
-rw-r--r-- | ndb/test/include/NDBT_Test.hpp | 4 | ||||
-rw-r--r-- | ndb/test/ndbapi/ScanFunctions.hpp | 20 | ||||
-rw-r--r-- | ndb/test/ndbapi/testDataBuffers.cpp | 50 | ||||
-rw-r--r-- | ndb/test/ndbapi/testDeadlock.cpp | 7 | ||||
-rw-r--r-- | ndb/test/ndbapi/testDict.cpp | 5 | ||||
-rw-r--r-- | ndb/test/ndbapi/testIndex.cpp | 24 | ||||
-rw-r--r-- | ndb/test/ndbapi/testLcp.cpp | 7 | ||||
-rw-r--r-- | ndb/test/ndbapi/testNdbApi.cpp | 16 | ||||
-rw-r--r-- | ndb/test/ndbapi/testOIBasic.cpp | 19 | ||||
-rw-r--r-- | ndb/test/ndbapi/testReadPerf.cpp | 5 | ||||
-rw-r--r-- | ndb/test/ndbapi/testRestartGci.cpp | 5 | ||||
-rw-r--r-- | ndb/test/ndbapi/testScanPerf.cpp | 5 | ||||
-rw-r--r-- | ndb/test/ndbapi/testSystemRestart.cpp | 12 |
13 files changed, 97 insertions, 82 deletions
diff --git a/ndb/test/include/NDBT_Test.hpp b/ndb/test/include/NDBT_Test.hpp index b0b5fe15960..8b69faebde8 100644 --- a/ndb/test/include/NDBT_Test.hpp +++ b/ndb/test/include/NDBT_Test.hpp @@ -392,10 +392,10 @@ C##suitname():NDBT_TestSuite(#suitname){ \ // Add a number of equal steps to the testcase #define STEPS(stepfunc, num) \ - for (int i = 0; i < num; i++){ \ + { int i; for (i = 0; i < num; i++){ \ pts = new NDBT_ParallelStep(pt, #stepfunc, stepfunc); \ pt->addStep(pts);\ - } + } } #define VERIFIER(stepfunc) \ ptv = new NDBT_Verifier(pt, #stepfunc, stepfunc); \ diff --git a/ndb/test/ndbapi/ScanFunctions.hpp b/ndb/test/ndbapi/ScanFunctions.hpp index 2ff4b751c33..6964f8c73a8 100644 --- a/ndb/test/ndbapi/ScanFunctions.hpp +++ b/ndb/test/ndbapi/ScanFunctions.hpp @@ -286,36 +286,36 @@ void AttribList::buildAttribList(const NdbDictionary::Table* pTab){ attr = new Attrib; attr->numAttribs = 0; attriblist.push_back(attr); - - for(int i = 1; i < pTab->getNoOfColumns(); i++){ + int i; + for(i = 1; i < pTab->getNoOfColumns(); i++){ attr = new Attrib; attr->numAttribs = i; for(int a = 0; a<i; a++) attr->attribs[a] = a; attriblist.push_back(attr); } - for(int i = pTab->getNoOfColumns()-1; i > 0; i--){ + for(i = pTab->getNoOfColumns()-1; i > 0; i--){ attr = new Attrib; attr->numAttribs = i; for(int a = 0; a<i; a++) attr->attribs[a] = a; attriblist.push_back(attr); } - for(int i = pTab->getNoOfColumns(); i > 0; i--){ + for(i = pTab->getNoOfColumns(); i > 0; i--){ attr = new Attrib; attr->numAttribs = pTab->getNoOfColumns() - i; for(int a = 0; a<pTab->getNoOfColumns() - i; a++) attr->attribs[a] = pTab->getNoOfColumns()-a-1; attriblist.push_back(attr); } - for(int i = 1; i < pTab->getNoOfColumns(); i++){ + for(i = 1; i < pTab->getNoOfColumns(); i++){ attr = new Attrib; attr->numAttribs = pTab->getNoOfColumns() - i; for(int a = 0; a<pTab->getNoOfColumns() - i; a++) attr->attribs[a] = pTab->getNoOfColumns()-a-1; attriblist.push_back(attr); } - for(int i = 1; i < pTab->getNoOfColumns(); i++){ + for(i = 1; i < pTab->getNoOfColumns(); i++){ attr = new Attrib; attr->numAttribs = 2; for(int a = 0; a<2; a++){ @@ -345,11 +345,11 @@ void AttribList::buildAttribList(const NdbDictionary::Table* pTab){ attriblist.push_back(attr); #if 1 - for(size_t i = 0; i < attriblist.size(); i++){ + for(size_t j = 0; j < attriblist.size(); j++){ - g_info << attriblist[i]->numAttribs << ": " ; - for(int a = 0; a < attriblist[i]->numAttribs; a++) - g_info << attriblist[i]->attribs[a] << ", "; + g_info << attriblist[j]->numAttribs << ": " ; + for(int a = 0; a < attriblist[j]->numAttribs; a++) + g_info << attriblist[j]->attribs[a] << ", "; g_info << endl; } #endif diff --git a/ndb/test/ndbapi/testDataBuffers.cpp b/ndb/test/ndbapi/testDataBuffers.cpp index 04602f51d5f..03d52252334 100644 --- a/ndb/test/ndbapi/testDataBuffers.cpp +++ b/ndb/test/ndbapi/testDataBuffers.cpp @@ -123,15 +123,15 @@ chkerror(char const* fmt, ...) // alignment of addresses and data sizes -static bool isAligned(unsigned x) +static bool isAligned(UintPtr x) { return ((x & 3) == 0); } static bool isAligned(char* p) { - return isAligned(unsigned(p)); + return isAligned(UintPtr(p)); } -static unsigned toAligned(unsigned x) +static unsigned toAligned(UintPtr x) { while (! isAligned(x)) x++; @@ -223,10 +223,10 @@ testcase(int flag) noRandom = ! (flag & 8); ndbout << (noRandom ? "simple sizes" : "randomize sizes") << endl; - int smax = 0, stot = 0; + int smax = 0, stot = 0, i; if (xverbose) ndbout << "- define table " << tab << endl; - for (int i = 0; i < attrcnt; i++) { + for (i = 0; i < attrcnt; i++) { col& c = ccol[i]; memset(&c, 0, sizeof(c)); sprintf(c.aAttrName, "C%d", i); @@ -266,7 +266,7 @@ testcase(int flag) return ndberror("getNdbSchemaOp"); if (top->createTable(tab) < 0) return ndberror("createTable"); - for (int i = 0; i < attrcnt; i++) { + for (i = 0; i < attrcnt; i++) { col& c = ccol[i]; if (top->createAttribute( c.aAttrName, @@ -299,7 +299,7 @@ testcase(int flag) return ndberror("getNdbOperation key=%d", key); if (op->deleteTuple() < 0) return ndberror("deleteTuple key=%d", key); - for (int i = 0; i < attrcnt; i++) { + for (i = 0; i < attrcnt; i++) { col& c = ccol[i]; if (i == 0) { if (op->equal(c.aAttrName, (char*)&key, sizeof(key)) < 0) @@ -329,7 +329,7 @@ testcase(int flag) return ndberror("getNdbOperation key=%d", key); if (op->insertTuple() < 0) return ndberror("insertTuple key=%d", key); - for (int i = 0; i < attrcnt; i++) { + for (i = 0; i < attrcnt; i++) { col& c = ccol[i]; if (i == 0) { if (op->equal(c.aAttrName, (char*)&key, sizeof(key)) < 0) @@ -362,7 +362,7 @@ testcase(int flag) return ndberror("getNdbOperation key=%d", key); if (op->readTuple() < 0) return ndberror("readTuple key=%d", key); - for (int i = 0; i < attrcnt; i++) { + for (i = 0; i < attrcnt; i++) { col& c = ccol[i]; if (i == 0) { if (op->equal(c.aAttrName, (char*)&key, sizeof(key)) < 0) @@ -371,7 +371,7 @@ testcase(int flag) if (xverbose) { char tmp[20]; if (useBuf) - sprintf(tmp, "0x%x", int(c.buf + off)); + sprintf(tmp, "0x%p", c.buf + off); else strcpy(tmp, "ndbapi"); ndbout << "--- column " << i << " addr=" << tmp << endl; @@ -388,23 +388,24 @@ testcase(int flag) } if (con->execute(Commit) != 0) return ndberror("execute key=%d", key); - for (int i = 0; i < attrcnt; i++) { + for (i = 0; i < attrcnt; i++) { col& c = ccol[i]; if (i == 0) { } else if (useBuf) { - for (int j = 0; j < off; j++) { + int j; + for (j = 0; j < off; j++) { if (c.buf[j] != 'B') { return chkerror("mismatch before key=%d col=%d pos=%d ok=%02x bad=%02x", key, i, j, 'B', c.buf[j]); } } - for (int j = 0; j < c.aArraySize; j++) { + for (j = 0; j < c.aArraySize; j++) { if (c.buf[j + off] != byteVal(key, i, j)) { return chkerror("mismatch key=%d col=%d pos=%d ok=%02x bad=%02x", key, i, j, byteVal(key, i, j), c.buf[j]); } } - for (int j = c.aArraySize + off; j < c.bufsiz; j++) { + for (j = c.aArraySize + off; j < c.bufsiz; j++) { if (c.buf[j] != 'B') { return chkerror("mismatch after key=%d col=%d pos=%d ok=%02x bad=%02x", key, i, j, 'B', c.buf[j]); @@ -431,7 +432,8 @@ testcase(int flag) if (xverbose) ndbout << "- scan" << endl; char found[MaxOper]; - for (int k = 0; k < opercnt; k++) + int k; + for (k = 0; k < opercnt; k++) found[k] = 0; for (key = 0; key < opercnt; key++) { int off = makeOff(key); @@ -459,7 +461,7 @@ testcase(int flag) if (op->interpret_exit_ok() < 0) return ndberror("interpret_exit_ok"); } - for (int i = 0; i < attrcnt; i++) { + for (i = 0; i < attrcnt; i++) { col& c = ccol[i]; if (i == 0) { if (op->getValue(c.aAttrName, (char*)&newkey) < 0) @@ -468,7 +470,7 @@ testcase(int flag) if (xverbose) { char tmp[20]; if (useBuf) - sprintf(tmp, "0x%x", int(c.buf + off)); + sprintf(tmp, "0x%p", c.buf + off); else strcpy(tmp, "ndbapi"); ndbout << "--- column " << i << " addr=" << tmp << endl; @@ -489,22 +491,23 @@ testcase(int flag) while ((ret = rs->nextResult()) == 0) { if (key != newkey) return ndberror("unexpected key=%d newkey=%d", key, newkey); - for (int i = 1; i < attrcnt; i++) { + for (i = 1; i < attrcnt; i++) { col& c = ccol[i]; if (useBuf) { - for (int j = 0; j < off; j++) { + int j; + for (j = 0; j < off; j++) { if (c.buf[j] != 'C') { return chkerror("mismatch before key=%d col=%d pos=%d ok=%02x bad=%02x", key, i, j, 'C', c.buf[j]); } } - for (int j = 0; j < c.aArraySize; j++) { + for (j = 0; j < c.aArraySize; j++) { if (c.buf[j + off] != byteVal(key, i, j)) { return chkerror("mismatch key=%d col=%d pos=%d ok=%02x bad=%02x", key, i, j, byteVal(key, i, j), c.buf[j]); } } - for (int j = c.aArraySize + off; j < c.bufsiz; j++) { + for (j = c.aArraySize + off; j < c.bufsiz; j++) { if (c.buf[j] != 'C') { return chkerror("mismatch after key=%d col=%d pos=%d ok=%02x bad=%02x", key, i, j, 'C', c.buf[j]); @@ -533,7 +536,7 @@ testcase(int flag) } con = 0; op = 0; - for (int k = 0; k < opercnt; k++) + for (k = 0; k < opercnt; k++) if (! found[k]) return ndberror("key %d not found", k); ndbout << "scanned " << key << endl; @@ -545,6 +548,7 @@ testcase(int flag) NDB_COMMAND(testDataBuffers, "testDataBuffers", "testDataBuffers", "testDataBuffers", 65535) { + int i; ndb_init(); while (++argv, --argc > 0) { char const* p = argv[0]; @@ -602,7 +606,7 @@ NDB_COMMAND(testDataBuffers, "testDataBuffers", "testDataBuffers", "testDataBuff } } unsigned ok = true; - for (int i = 1; 0 == loopcnt || i <= loopcnt; i++) { + for (i = 1; 0 == loopcnt || i <= loopcnt; i++) { ndbout << "=== loop " << i << " ===" << endl; for (int flag = 0; flag < (1<<testbits); flag++) { if (testcase(flag) < 0) { diff --git a/ndb/test/ndbapi/testDeadlock.cpp b/ndb/test/ndbapi/testDeadlock.cpp index 66fa48173cc..eb985e815ac 100644 --- a/ndb/test/ndbapi/testDeadlock.cpp +++ b/ndb/test/ndbapi/testDeadlock.cpp @@ -459,7 +459,8 @@ wl1822_main(char scantx) static const unsigned thrcount = 2; // create threads for tx1 and tx2 Thr* thrlist[2]; - for (int n = 0; n < thrcount; n++) { + int n; + for (n = 0; n < thrcount; n++) { Thr& thr = *(thrlist[n] = new Thr(1 + n)); CHK(thr.m_ret == 0); } @@ -472,7 +473,7 @@ wl1822_main(char scantx) if (runstep != 0) thr.start(runstep); } - for (int n = 0; n < thrcount; n++) { + for (n = 0; n < thrcount; n++) { Thr& thr = *thrlist[n]; Runstep runstep = wl1822_step[i][n]; if (runstep != 0) @@ -480,7 +481,7 @@ wl1822_main(char scantx) } } // delete threads - for (int n = 0; n < thrcount; n++) { + for (n = 0; n < thrcount; n++) { Thr& thr = *thrlist[n]; thr.exit(); thr.join(); diff --git a/ndb/test/ndbapi/testDict.cpp b/ndb/test/ndbapi/testDict.cpp index 89232de2535..9552e321f00 100644 --- a/ndb/test/ndbapi/testDict.cpp +++ b/ndb/test/ndbapi/testDict.cpp @@ -1431,11 +1431,12 @@ int runTestDictionaryPerf(NDBT_Context* ctx, NDBT_Step* step){ Vector<char*> cols; Vector<const NdbDictionary::Table*> tabs; + int i; Ndb* pNdb = GETNDB(step); const Uint32 count = NDBT_Tables::getNumTables(); - for (int i=0; i < count; i++){ + for (i=0; i < count; i++){ const NdbDictionary::Table * tab = NDBT_Tables::getTable(i); pNdb->getDictionary()->createTable(* tab); @@ -1458,7 +1459,7 @@ runTestDictionaryPerf(NDBT_Context* ctx, NDBT_Step* step){ Uint32 size = cols.size() / 2; char ** columns = &cols[0]; Uint64 start = NdbTick_CurrentMillisecond(); - for(int i = 0; i<times; i++){ + for(i = 0; i<times; i++){ int j = 2 * (rand() % size); const NdbDictionary::Table* tab = (const NdbDictionary::Table*)tcols[j]; const char * col = tcols[j+1]; diff --git a/ndb/test/ndbapi/testIndex.cpp b/ndb/test/ndbapi/testIndex.cpp index ed9e114fd92..6623ad35a7f 100644 --- a/ndb/test/ndbapi/testIndex.cpp +++ b/ndb/test/ndbapi/testIndex.cpp @@ -58,7 +58,9 @@ void AttribList::buildAttribList(const NdbDictionary::Table* pTab){ // Build attrib definitions that describes which attributes to build index // Try to build strange combinations, not just "all" or all PK's - for(int i = 1; i <= pTab->getNoOfColumns(); i++){ + int i; + + for(i = 1; i <= pTab->getNoOfColumns(); i++){ attr = new Attrib; attr->numAttribs = i; for(int a = 0; a<i; a++) @@ -66,7 +68,7 @@ void AttribList::buildAttribList(const NdbDictionary::Table* pTab){ attriblist.push_back(attr); } int b = 0; - for(int i = pTab->getNoOfColumns()-1; i > 0; i--){ + for(i = pTab->getNoOfColumns()-1; i > 0; i--){ attr = new Attrib; attr->numAttribs = i; b++; @@ -74,21 +76,21 @@ void AttribList::buildAttribList(const NdbDictionary::Table* pTab){ attr->attribs[a] = a+b; attriblist.push_back(attr); } - for(int i = pTab->getNoOfColumns(); i > 0; i--){ + for(i = pTab->getNoOfColumns(); i > 0; i--){ attr = new Attrib; attr->numAttribs = pTab->getNoOfColumns() - i; for(int a = 0; a<pTab->getNoOfColumns() - i; a++) attr->attribs[a] = pTab->getNoOfColumns()-a-1; attriblist.push_back(attr); } - for(int i = 1; i < pTab->getNoOfColumns(); i++){ + for(i = 1; i < pTab->getNoOfColumns(); i++){ attr = new Attrib; attr->numAttribs = pTab->getNoOfColumns() - i; for(int a = 0; a<pTab->getNoOfColumns() - i; a++) attr->attribs[a] = pTab->getNoOfColumns()-a-1; attriblist.push_back(attr); } - for(int i = 1; i < pTab->getNoOfColumns(); i++){ + for(i = 1; i < pTab->getNoOfColumns(); i++){ attr = new Attrib; attr->numAttribs = 2; for(int a = 0; a<2; a++){ @@ -226,8 +228,8 @@ int runCreateIndexes(NDBT_Context* ctx, NDBT_Step* step){ while (l < loops && result == NDBT_OK){ - - for (unsigned int i = 0; i < attrList.attriblist.size(); i++){ + unsigned int i; + for (i = 0; i < attrList.attriblist.size(); i++){ // Try to create index if (create_index(ctx, i, pTab, pNdb, attrList.attriblist[i], logged) == NDBT_FAILED) @@ -235,7 +237,7 @@ int runCreateIndexes(NDBT_Context* ctx, NDBT_Step* step){ } // Now drop all indexes that where created - for (unsigned int i = 0; i < attrList.attriblist.size(); i++){ + for (i = 0; i < attrList.attriblist.size(); i++){ // Try to drop index if (drop_index(i, pNdb, pTab, attrList.attriblist[i]) != NDBT_OK) @@ -1083,8 +1085,8 @@ runUniqueNullTransactions(NDBT_Context* ctx, NDBT_Step* step){ else pIdx.setType(NdbDictionary::Index::UniqueHashIndex); pIdx.setStoredIndex(logged); - - for (int c = 0; c< pTab->getNoOfColumns(); c++){ + int c; + for (c = 0; c< pTab->getNoOfColumns(); c++){ const NdbDictionary::Column * col = pTab->getColumn(c); if(col->getPrimaryKey()){ pIdx.addIndexColumn(col->getName()); @@ -1093,7 +1095,7 @@ runUniqueNullTransactions(NDBT_Context* ctx, NDBT_Step* step){ } int colId = -1; - for (int c = 0; c< pTab->getNoOfColumns(); c++){ + for (c = 0; c< pTab->getNoOfColumns(); c++){ const NdbDictionary::Column * col = pTab->getColumn(c); if(col->getNullable()){ pIdx.addIndexColumn(col->getName()); diff --git a/ndb/test/ndbapi/testLcp.cpp b/ndb/test/ndbapi/testLcp.cpp index c92be091a97..d11692db761 100644 --- a/ndb/test/ndbapi/testLcp.cpp +++ b/ndb/test/ndbapi/testLcp.cpp @@ -85,7 +85,8 @@ main(int argc, char ** argv){ g_info << " where ZLCP_OP_WRITE_RT_BREAK is finished before SAVE_PAGES" << endl; require(!pause_lcp()); - for(size_t j = 0; j<g_rows; j++){ + size_t j; + for(j = 0; j<g_rows; j++){ require(!do_op(j)); } require(!continue_lcp(5900)); @@ -98,7 +99,7 @@ main(int argc, char ** argv){ << endl; require(!load_table()); require(!pause_lcp()); - for(size_t j = 0; j<g_rows; j++){ + for(j = 0; j<g_rows; j++){ require(!do_op(j)); } require(!continue_lcp(5901)); @@ -109,7 +110,7 @@ main(int argc, char ** argv){ g_info << "Testing pre LCP operations, undo-ed at commit" << endl; require(!load_table()); require(!pause_lcp()); - for(size_t j = 0; j<g_rows; j++){ + for(j = 0; j<g_rows; j++){ require(!do_op(j)); } require(!continue_lcp(5902)); diff --git a/ndb/test/ndbapi/testNdbApi.cpp b/ndb/test/ndbapi/testNdbApi.cpp index 74cb1f8bcd0..a1ebac609b6 100644 --- a/ndb/test/ndbapi/testNdbApi.cpp +++ b/ndb/test/ndbapi/testNdbApi.cpp @@ -88,10 +88,10 @@ int runTestMaxNdb(NDBT_Context* ctx, NDBT_Step* step){ oldi = i; - for(size_t i = 0; i < ndbVector.size(); i++){ - delete ndbVector[i]; - if(((i+1) % 250) == 0){ - ndbout << "Deleted " << (Uint64) i << " ndb objects " << endl; + for(size_t j = 0; j < ndbVector.size(); j++){ + delete ndbVector[j]; + if(((j+1) % 250) == 0){ + ndbout << "Deleted " << (Uint64) j << " ndb objects " << endl; } } ndbVector.clear(); @@ -178,8 +178,8 @@ int runTestMaxTransaction(NDBT_Context* ctx, NDBT_Step* step){ oldi = i; - for(size_t i = 0; i < conVector.size(); i++){ - pNdb->closeTransaction(conVector[i]); + for(size_t j = 0; j < conVector.size(); j++){ + pNdb->closeTransaction(conVector[j]); } conVector.clear(); l++; @@ -537,8 +537,8 @@ int runTestDeleteNdb(NDBT_Context* ctx, NDBT_Step* step){ } // Delete the ndb objects - for(size_t i = 0; i < ndbVector.size(); i++) - delete ndbVector[i]; + for(size_t j = 0; j < ndbVector.size(); j++) + delete ndbVector[j]; ndbVector.clear(); l++; } diff --git a/ndb/test/ndbapi/testOIBasic.cpp b/ndb/test/ndbapi/testOIBasic.cpp index 21862e02328..41f0686e63b 100644 --- a/ndb/test/ndbapi/testOIBasic.cpp +++ b/ndb/test/ndbapi/testOIBasic.cpp @@ -407,10 +407,11 @@ Col::verify(const void* addr) const const unsigned char* p = (const unsigned char*)addr; unsigned n = (p[0] << 8) | p[1]; assert(n <= m_length); - for (unsigned i = 0; i < n; i++) { + unsigned i; + for (i = 0; i < n; i++) { assert(p[2 + i] != 0); } - for (unsigned i = n; i < m_length; i++) { + for (i = n; i < m_length; i++) { assert(p[2 + i] == 0); } } @@ -3021,7 +3022,8 @@ runstep(Par par, const char* fname, TFunc func, unsigned mode) { LL2(fname); const int threads = (mode & ST ? 1 : par.m_threads); - for (int n = 0; n < threads; n++) { + int n; + for (n = 0; n < threads; n++) { LL4("start " << n); Thr& thr = *g_thrlist[n]; thr.m_par.m_tab = par.m_tab; @@ -3033,7 +3035,7 @@ runstep(Par par, const char* fname, TFunc func, unsigned mode) thr.start(); } unsigned errs = 0; - for (int n = threads - 1; n >= 0; n--) { + for (n = threads - 1; n >= 0; n--) { LL4("stop " << n); Thr& thr = *g_thrlist[n]; thr.stopped(); @@ -3301,10 +3303,11 @@ runtest(Par par) CHK(con.connect() == 0); par.m_con = &con; g_thrlist = new Thr* [par.m_threads]; - for (unsigned n = 0; n < par.m_threads; n++) { + unsigned n; + for (n = 0; n < par.m_threads; n++) { g_thrlist[n] = 0; } - for (unsigned n = 0; n < par.m_threads; n++) { + for (n = 0; n < par.m_threads; n++) { g_thrlist[n] = new Thr(par, n); Thr& thr = *g_thrlist[n]; assert(thr.m_thread != 0); @@ -3330,11 +3333,11 @@ runtest(Par par) } } } - for (unsigned n = 0; n < par.m_threads; n++) { + for (n = 0; n < par.m_threads; n++) { Thr& thr = *g_thrlist[n]; thr.exit(); } - for (unsigned n = 0; n < par.m_threads; n++) { + for (n = 0; n < par.m_threads; n++) { Thr& thr = *g_thrlist[n]; thr.join(); delete &thr; diff --git a/ndb/test/ndbapi/testReadPerf.cpp b/ndb/test/ndbapi/testReadPerf.cpp index 8d0d78cbe8c..380a809ad00 100644 --- a/ndb/test/ndbapi/testReadPerf.cpp +++ b/ndb/test/ndbapi/testReadPerf.cpp @@ -99,7 +99,8 @@ main(int argc, const char** argv){ { "verbose", 'v', arg_flag, &verbose, "Print verbose status", "verbose" } }; const int num_args = 1 + P_MAX; - for(int i = 0; i<P_MAX; i++){ + int i; + for(i = 0; i<P_MAX; i++){ args[i+1].long_name = g_paramters[i].name; args[i+1].short_name = * g_paramters[i].name; args[i+1].type = arg_integer; @@ -127,7 +128,7 @@ main(int argc, const char** argv){ g_err << "Wait until ready failed" << endl; goto error; } - for(int i = optind; i<argc; i++){ + for(i = optind; i<argc; i++){ const char * T = argv[i]; g_info << "Testing " << T << endl; BaseString::snprintf(g_table, sizeof(g_table), T); diff --git a/ndb/test/ndbapi/testRestartGci.cpp b/ndb/test/ndbapi/testRestartGci.cpp index e817245af55..4e541d1f38f 100644 --- a/ndb/test/ndbapi/testRestartGci.cpp +++ b/ndb/test/ndbapi/testRestartGci.cpp @@ -132,7 +132,8 @@ int runVerifyInserts(NDBT_Context* ctx, NDBT_Step* step){ // RULE1: The vector with saved records should have exactly as many // records with lower or same gci as there are in DB int recordsWithLowerOrSameGci = 0; - for (unsigned i = 0; i < savedRecords.size(); i++){ + unsigned i; + for (i = 0; i < savedRecords.size(); i++){ if (savedRecords[i].m_gci <= restartGCI) recordsWithLowerOrSameGci++; } @@ -144,7 +145,7 @@ int runVerifyInserts(NDBT_Context* ctx, NDBT_Step* step){ // RULE2: The records found in db should have same or lower // gci as in the vector - for (unsigned i = 0; i < savedRecords.size(); i++){ + for (i = 0; i < savedRecords.size(); i++){ CHECK(hugoOps.startTransaction(pNdb) == 0); CHECK(hugoOps.pkReadRecord(pNdb, i) == 0); if (hugoOps.execute_Commit(pNdb) != 0){ diff --git a/ndb/test/ndbapi/testScanPerf.cpp b/ndb/test/ndbapi/testScanPerf.cpp index c1334125978..003fc67179f 100644 --- a/ndb/test/ndbapi/testScanPerf.cpp +++ b/ndb/test/ndbapi/testScanPerf.cpp @@ -80,7 +80,8 @@ main(int argc, const char** argv){ { "verbose", 'v', arg_flag, &verbose, "Print verbose status", "verbose" } }; const int num_args = 1 + P_MAX; - for(int i = 0; i<P_MAX; i++){ + int i; + for(i = 0; i<P_MAX; i++){ args[i+1].long_name = g_paramters[i].name; args[i+1].short_name = * g_paramters[i].name; args[i+1].type = arg_integer; @@ -107,7 +108,7 @@ main(int argc, const char** argv){ g_err << "Wait until ready failed" << endl; goto error; } - for(int i = optind; i<argc; i++){ + for(i = optind; i<argc; i++){ const char * T = argv[i]; g_info << "Testing " << T << endl; BaseString::snprintf(g_tablename, sizeof(g_tablename), T); diff --git a/ndb/test/ndbapi/testSystemRestart.cpp b/ndb/test/ndbapi/testSystemRestart.cpp index f8f2b84acc4..35016896495 100644 --- a/ndb/test/ndbapi/testSystemRestart.cpp +++ b/ndb/test/ndbapi/testSystemRestart.cpp @@ -452,7 +452,7 @@ int runSystemRestart3(NDBT_Context* ctx, NDBT_Step* step){ } Vector<int> nodeIds; - for(Uint32 i = 0; i<nodeCount; i++) + for(i = 0; i<nodeCount; i++) nodeIds.push_back(restarter.getDbNodeId(i)); Uint32 currentRestartNodeIndex = 0; @@ -561,7 +561,7 @@ int runSystemRestart4(NDBT_Context* ctx, NDBT_Step* step){ } Vector<int> nodeIds; - for(Uint32 i = 0; i<nodeCount; i++) + for(i = 0; i<nodeCount; i++) nodeIds.push_back(restarter.getDbNodeId(i)); Uint32 currentRestartNodeIndex = 0; @@ -691,7 +691,7 @@ int runSystemRestart5(NDBT_Context* ctx, NDBT_Step* step){ } Vector<int> nodeIds; - for(Uint32 i = 0; i<nodeCount; i++) + for(i = 0; i<nodeCount; i++) nodeIds.push_back(restarter.getDbNodeId(i)); Uint32 currentRestartNodeIndex = 0; @@ -821,7 +821,7 @@ int runSystemRestart6(NDBT_Context* ctx, NDBT_Step* step){ } Vector<int> nodeIds; - for(Uint32 i = 0; i<nodeCount; i++) + for(i = 0; i<nodeCount; i++) nodeIds.push_back(restarter.getDbNodeId(i)); Uint32 currentRestartNodeIndex = 0; @@ -877,7 +877,7 @@ int runSystemRestart7(NDBT_Context* ctx, NDBT_Step* step){ } Vector<int> nodeIds; - for(Uint32 i = 0; i<nodeCount; i++) + for(i = 0; i<nodeCount; i++) nodeIds.push_back(restarter.getDbNodeId(i)); int a_nodeIds[64]; @@ -952,7 +952,7 @@ int runSystemRestart8(NDBT_Context* ctx, NDBT_Step* step){ } Vector<int> nodeIds; - for(Uint32 i = 0; i<nodeCount; i++) + for(i = 0; i<nodeCount; i++) nodeIds.push_back(restarter.getDbNodeId(i)); int a_nodeIds[64]; |