diff options
author | unknown <mysqldev@o2k.irixworld.net> | 2004-07-09 12:48:32 +0200 |
---|---|---|
committer | unknown <mysqldev@o2k.irixworld.net> | 2004-07-09 12:48:32 +0200 |
commit | 01aceaaa1575fb3887da7b087dd0b6e550f50440 (patch) | |
tree | d5476b0b93c008afbe122644e788b9bc3957ca9c /ndb/src/ndbapi | |
parent | 6e18271f1c5979a3c337c23c341e75175b1d8b93 (diff) | |
download | mariadb-git-01aceaaa1575fb3887da7b087dd0b6e550f50440.tar.gz |
Irix64 mipspro ndb compile fixes
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
Diffstat (limited to 'ndb/src/ndbapi')
-rw-r--r-- | ndb/src/ndbapi/DictCache.cpp | 11 | ||||
-rw-r--r-- | ndb/src/ndbapi/Ndb.cpp | 8 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbDictionaryImpl.cpp | 32 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbEventOperationImpl.cpp | 12 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbLinHash.hpp | 12 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbOperationScan.cpp | 7 | ||||
-rw-r--r-- | ndb/src/ndbapi/Ndbinit.cpp | 5 | ||||
-rw-r--r-- | ndb/src/ndbapi/TransporterFacade.cpp | 3 |
8 files changed, 55 insertions, 35 deletions
diff --git a/ndb/src/ndbapi/DictCache.cpp b/ndb/src/ndbapi/DictCache.cpp index f6f2106f2aa..5f620f77906 100644 --- a/ndb/src/ndbapi/DictCache.cpp +++ b/ndb/src/ndbapi/DictCache.cpp @@ -157,6 +157,7 @@ GlobalDictCache::put(const char * name, NdbTableImpl * tab) void GlobalDictCache::drop(NdbTableImpl * tab) { + unsigned i; const Uint32 len = strlen(tab->m_internalName.c_str()); Vector<TableVersion> * vers = m_tableHash.getData(tab->m_internalName.c_str(), len); @@ -173,7 +174,7 @@ GlobalDictCache::drop(NdbTableImpl * tab) abort(); } - for(unsigned i = 0; i < sz; i++){ + for(i = 0; i < sz; i++){ TableVersion & ver = (* vers)[i]; if(ver.m_impl == tab){ if(ver.m_refCount == 0 || ver.m_status == RETREIVING || @@ -193,7 +194,7 @@ GlobalDictCache::drop(NdbTableImpl * tab) } } - for(unsigned i = 0; i<sz; i++){ + for(i = 0; i<sz; i++){ TableVersion & ver = (* vers)[i]; ndbout_c("%d: version: %d refCount: %d status: %d impl: %p", i, ver.m_version, ver.m_refCount, ver.m_status, ver.m_impl); @@ -204,6 +205,7 @@ GlobalDictCache::drop(NdbTableImpl * tab) void GlobalDictCache::release(NdbTableImpl * tab){ + unsigned i; const Uint32 len = strlen(tab->m_internalName.c_str()); Vector<TableVersion> * vers = m_tableHash.getData(tab->m_internalName.c_str(), len); @@ -220,7 +222,7 @@ GlobalDictCache::release(NdbTableImpl * tab){ abort(); } - for(unsigned i = 0; i < sz; i++){ + for(i = 0; i < sz; i++){ TableVersion & ver = (* vers)[i]; if(ver.m_impl == tab){ if(ver.m_refCount == 0 || ver.m_status == RETREIVING || @@ -235,7 +237,7 @@ GlobalDictCache::release(NdbTableImpl * tab){ } } - for(unsigned i = 0; i<sz; i++){ + for(i = 0; i<sz; i++){ TableVersion & ver = (* vers)[i]; ndbout_c("%d: version: %d refCount: %d status: %d impl: %p", i, ver.m_version, ver.m_refCount, ver.m_status, ver.m_impl); @@ -244,3 +246,4 @@ GlobalDictCache::release(NdbTableImpl * tab){ abort(); } +template class Vector<GlobalDictCache::TableVersion>; diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index fe7260c4693..8dcb5af3bd8 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -973,13 +973,13 @@ Ndb::StartTransactionNodeSelectionData::init(Uint32 noOfNodes, */ { fragment2PrimaryNodeMap = new Uint32[noOfFragments]; - - for(Uint32 i = 0; i<noOfNodes; i++){ + Uint32 i; + for(i = 0; i<noOfNodes; i++){ fragment2PrimaryNodeMap[i] = nodeIds[i]; } // Sort them (bubble sort) - for(Uint32 i = 0; i<noOfNodes-1; i++) + for(i = 0; i<noOfNodes-1; i++) for(Uint32 j = i+1; j<noOfNodes; j++) if(fragment2PrimaryNodeMap[i] > fragment2PrimaryNodeMap[j]){ Uint32 tmp = fragment2PrimaryNodeMap[i]; @@ -987,7 +987,7 @@ Ndb::StartTransactionNodeSelectionData::init(Uint32 noOfNodes, fragment2PrimaryNodeMap[j] = tmp; } - for(Uint32 i = 0; i<noOfNodes; i++){ + for(i = 0; i<noOfNodes; i++){ fragment2PrimaryNodeMap[i+noOfNodes] = fragment2PrimaryNodeMap[i]; } } diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 348f6db36e4..e91162168b8 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -387,7 +387,8 @@ void NdbTableImpl::buildColumnHash(){ const Uint32 size = m_columns.size(); - for(size_t i = 31; i >= 0; i--){ + size_t i; + for(i = 31; i >= 0; i--){ if(((1 << i) & size) != 0){ m_columnHashMask = (1 << (i + 1)) - 1; break; @@ -396,7 +397,7 @@ NdbTableImpl::buildColumnHash(){ Vector<Uint32> hashValues; Vector<Vector<Uint32> > chains; chains.fill(size, hashValues); - for(size_t i = 0; i<size; i++){ + for(i = 0; i<size; i++){ Uint32 hv = Hash(m_columns[i]->getName()) & 0xFFFE; Uint32 bucket = hv & m_columnHashMask; bucket = (bucket < size ? bucket : bucket - size); @@ -410,7 +411,7 @@ NdbTableImpl::buildColumnHash(){ m_columnHash.fill((unsigned)size-1, tmp); // Default no chaining Uint32 pos = 0; // In overflow vector - for(size_t i = 0; i<size; i++){ + for(i = 0; i<size; i++){ Uint32 sz = chains[i].size(); if(sz == 1){ Uint32 col = chains[i][0]; @@ -1315,6 +1316,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, NdbTableImpl & impl, bool alter) { + unsigned i; if((unsigned)impl.getNoOfPrimaryKeys() > NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY){ m_error.code = 4317; return -1; @@ -1340,7 +1342,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, bool haveAutoIncrement = false; Uint64 autoIncrementValue; - for(unsigned i = 0; i<sz; i++){ + for(i = 0; i<sz; i++){ const NdbColumnImpl * col = impl.m_columns[i]; if(col == 0) continue; @@ -1384,7 +1386,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, abort(); } - for(unsigned i = 0; i<sz; i++){ + for(i = 0; i<sz; i++){ const NdbColumnImpl * col = impl.m_columns[i]; if(col == 0) continue; @@ -1788,7 +1790,7 @@ NdbDictInterface::createIndex(Ndb & ndb, { //validate(); //aggregate(); - + unsigned i; UtilBufferWriter w(m_buffer); const size_t len = strlen(impl.m_externalName.c_str()) + 1; if(len > MAX_TAB_NAME_SIZE) { @@ -1828,7 +1830,7 @@ NdbDictInterface::createIndex(Ndb & ndb, req->setOnline(true); AttributeList attributeList; attributeList.sz = impl.m_columns.size(); - for(unsigned i = 0; i<attributeList.sz; i++){ + for(i = 0; i<attributeList.sz; i++){ const NdbColumnImpl* col = table.getColumn(impl.m_columns[i]->m_name.c_str()); if(col == 0){ @@ -1853,7 +1855,7 @@ NdbDictInterface::createIndex(Ndb & ndb, } if (it == DictTabInfo::UniqueHashIndex) { // Sort index attributes according to primary table (using insertion sort) - for(unsigned i = 1; i < attributeList.sz; i++) { + for(i = 1; i < attributeList.sz; i++) { unsigned int temp = attributeList.id[i]; unsigned int j = i; while((j > 0) && (attributeList.id[j - 1] > temp)) { @@ -1863,7 +1865,7 @@ NdbDictInterface::createIndex(Ndb & ndb, attributeList.id[j] = temp; } // Check for illegal duplicate attributes - for(unsigned i = 0; i<attributeList.sz; i++) { + for(i = 0; i<attributeList.sz; i++) { if ((i != (attributeList.sz - 1)) && (attributeList.id[i] == attributeList.id[i+1])) { m_error.code = 4258; @@ -2043,6 +2045,7 @@ NdbDictInterface::execDROP_INDX_REF(NdbApiSignal * signal, int NdbDictionaryImpl::createEvent(NdbEventImpl & evnt) { + int i; NdbTableImpl* tab = getTable(evnt.getTable()); if(tab == 0){ @@ -2065,7 +2068,7 @@ NdbDictionaryImpl::createEvent(NdbEventImpl & evnt) int attributeList_sz = evnt.m_attrIds.size(); - for (int i = 0; i < attributeList_sz; i++) { + for (i = 0; i < attributeList_sz; i++) { NdbColumnImpl *col_impl = table.getColumn(evnt.m_attrIds[i]); if (col_impl) { evnt.m_facade->addColumn(*(col_impl->m_facade)); @@ -2086,7 +2089,7 @@ NdbDictionaryImpl::createEvent(NdbEventImpl & evnt) int pk_count = 0; evnt.m_attrListBitmask.clear(); - for(int i = 0; i<attributeList_sz; i++){ + for(i = 0; i<attributeList_sz; i++){ const NdbColumnImpl* col = table.getColumn(evnt.m_columns[i]->m_name.c_str()); if(col == 0){ @@ -2104,7 +2107,7 @@ NdbDictionaryImpl::createEvent(NdbEventImpl & evnt) } // Sort index attributes according to primary table (using insertion sort) - for(int i = 1; i < attributeList_sz; i++) { + for(i = 1; i < attributeList_sz; i++) { NdbColumnImpl* temp = evnt.m_columns[i]; unsigned int j = i; while((j > 0) && (evnt.m_columns[j - 1]->m_attrId > temp->m_attrId)) { @@ -2114,7 +2117,7 @@ NdbDictionaryImpl::createEvent(NdbEventImpl & evnt) evnt.m_columns[j] = temp; } // Check for illegal duplicate attributes - for(int i = 1; i<attributeList_sz; i++) { + for(i = 1; i<attributeList_sz; i++) { if (evnt.m_columns[i-1]->m_attrId == evnt.m_columns[i]->m_attrId) { m_error.code = 4258; return -1; @@ -2810,3 +2813,6 @@ NdbDictInterface::execLIST_TABLES_CONF(NdbApiSignal* signal, m_waiter.signal(NO_WAIT); } } + +template class Vector<Uint32>; +template class Vector<Vector<Uint32> >; diff --git a/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/ndb/src/ndbapi/NdbEventOperationImpl.cpp index b73a58d97c4..af84492564b 100644 --- a/ndb/src/ndbapi/NdbEventOperationImpl.cpp +++ b/ndb/src/ndbapi/NdbEventOperationImpl.cpp @@ -93,11 +93,12 @@ NdbEventOperationImpl::NdbEventOperationImpl(NdbEventOperation &N, NdbEventOperationImpl::~NdbEventOperationImpl() { + int i; if (sdata) NdbMem_Free(sdata); - for (int i=0 ; i<3; i++) { + for (i=0 ; i<3; i++) { if (ptr[i].p) NdbMem_Free(ptr[i].p); } - for (int i=0 ; i<2; i++) { + for (i=0 ; i<2; i++) { NdbRecAttr *p = theFirstRecAttrs[i]; while (p) { NdbRecAttr *p_next = p->next(); @@ -1233,8 +1234,9 @@ NdbGlobalEventBuffer::real_wait(NdbGlobalEventBufferHandle *h, int aMillisecondNumber) { // check if there are anything in any of the buffers + int i; int n = 0; - for (int i = 0; i < h->m_nids; i++) + for (i = 0; i < h->m_nids; i++) n += hasData(h->m_bufferIds[i]); if (n) return n; @@ -1243,7 +1245,9 @@ NdbGlobalEventBuffer::real_wait(NdbGlobalEventBufferHandle *h, return -1; n = 0; - for (int i = 0; i < h->m_nids; i++) + for (i = 0; i < h->m_nids; i++) n += hasData(h->m_bufferIds[i]); return n; } + +template class Vector<NdbGlobalEventBufferHandle*>; diff --git a/ndb/src/ndbapi/NdbLinHash.hpp b/ndb/src/ndbapi/NdbLinHash.hpp index f67d4e60200..5d0d52a31d8 100644 --- a/ndb/src/ndbapi/NdbLinHash.hpp +++ b/ndb/src/ndbapi/NdbLinHash.hpp @@ -165,13 +165,14 @@ NdbLinHash<C>::createHashTable() { max = SEGMENTSIZE - 1; slack = SEGMENTSIZE * MAXLOADFCTR; directory[0] = new Segment_t(); - + int i; + /* The first segment cleared before used */ - for(int i = 0; i < SEGMENTSIZE; i++ ) + for(i = 0; i < SEGMENTSIZE; i++ ) directory[0]->elements[i] = 0; /* clear the rest of the directory */ - for( int i = 1; i < DIRECTORYSIZE; i++) + for(i = 1; i < DIRECTORYSIZE; i++) directory[i] = 0; } @@ -203,7 +204,8 @@ NdbLinHash<C>::insertKey( const char* str, Uint32 len, Uint32 lkey1, C* data ) * chain=chainp will copy the contents of HASH_T into chain */ NdbElement_t<C> * oldChain = 0; - for(NdbElement_t<C> * chain = *chainp; chain != 0; chain = chain->next){ + NdbElement_t<C> * chain; + for(chain = *chainp; chain != 0; chain = chain->next){ if(chain->len == len && !memcmp(chain->str, str, len)) return -1; /* Element already exists */ else @@ -211,7 +213,7 @@ NdbLinHash<C>::insertKey( const char* str, Uint32 len, Uint32 lkey1, C* data ) } /* New entry */ - NdbElement_t<C> * chain = new NdbElement_t<C>(); + chain = new NdbElement_t<C>(); chain->len = len; chain->hash = hash; chain->localkey1 = lkey1; diff --git a/ndb/src/ndbapi/NdbOperationScan.cpp b/ndb/src/ndbapi/NdbOperationScan.cpp index 299e6f2adea..929db9a6ea6 100644 --- a/ndb/src/ndbapi/NdbOperationScan.cpp +++ b/ndb/src/ndbapi/NdbOperationScan.cpp @@ -137,6 +137,7 @@ int NdbOperation::openScan(Uint32 aParallelism, bool lockMode, bool lockHoldMode, bool readCommitted) { + Uint32 i; aParallelism = checkParallelism(aParallelism); if(aParallelism == 0){ return 0; @@ -178,7 +179,7 @@ NdbOperation::openScan(Uint32 aParallelism, return -1; } - for (Uint32 i = 0; i < aParallelism; i ++) { + for (i = 0; i < aParallelism; i ++) { tScanRec = theNdb->getNdbScanRec(); if (tScanRec == NULL) { setErrorCodeAbort(4000); @@ -213,7 +214,7 @@ NdbOperation::openScan(Uint32 aParallelism, scanTabReq->transId1 = (Uint32) transId; scanTabReq->transId2 = (Uint32) (transId >> 32); - for (Uint32 i = 0; i < 16 && i < aParallelism ; i++) { + for (i = 0; i < 16 && i < aParallelism ; i++) { scanTabReq->apiOperationPtr[i] = theScanReceiversArray[i]->ptr2int(); }//for @@ -241,7 +242,7 @@ NdbOperation::openScan(Uint32 aParallelism, tSignal = theFirstSCAN_TABINFO_Send; while (tSignal != NULL) { tSignal->setData(theNdbCon->theTCConPtr, 1); - for (int i = 0; i < 16 ; i++) { + for (i = 0; i < 16 ; i++) { tSignal->setData(theScanReceiversArray[i + tParallelism]->ptr2int(), i + 2); }//for tSignal = tSignal->next(); diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp index f451ba885d4..641919d771b 100644 --- a/ndb/src/ndbapi/Ndbinit.cpp +++ b/ndb/src/ndbapi/Ndbinit.cpp @@ -111,12 +111,13 @@ Ndb::Ndb( const char* aDataBase , const char* aSchema) : theCurrentConnectCounter = 1; theCurrentConnectIndex = 0; - for (int i = 0; i < MAX_NDB_NODES ; i++) { + int i; + for (i = 0; i < MAX_NDB_NODES ; i++) { theConnectionArray[i] = NULL; the_release_ind[i] = 0; theDBnodes[i] = 0; }//forg - for (int i = 0; i < 2048 ; i++) { + for (i = 0; i < 2048 ; i++) { theFirstTupleId[i] = 0; theLastTupleId[i] = 0; }//for diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp index e725144a8f8..4ae292f352e 100644 --- a/ndb/src/ndbapi/TransporterFacade.cpp +++ b/ndb/src/ndbapi/TransporterFacade.cpp @@ -992,3 +992,6 @@ TransporterFacade::ThreadData::close(int number){ m_statusFunction[number] = 0; return 0; } + +template class Vector<NodeStatusFunction>; +template class Vector<TransporterFacade::ThreadData::Object_Execute>; |