diff options
-rw-r--r-- | ace/Containers_T.cpp | 36 | ||||
-rw-r--r-- | ace/Containers_T.h | 42 | ||||
-rw-r--r-- | ace/Map_Manager.cpp | 72 | ||||
-rw-r--r-- | ace/Map_Manager.h | 12 | ||||
-rw-r--r-- | ace/Map_Manager.i | 16 | ||||
-rw-r--r-- | ace/Msg_WFMO_Reactor.cpp | 6 | ||||
-rw-r--r-- | ace/Process.cpp | 19 | ||||
-rw-r--r-- | ace/Read_Buffer.cpp | 12 | ||||
-rw-r--r-- | ace/SString.cpp | 19 | ||||
-rw-r--r-- | ace/SString.h | 54 | ||||
-rw-r--r-- | ace/SString.i | 36 | ||||
-rw-r--r-- | ace/Select_Reactor_Base.cpp | 10 | ||||
-rw-r--r-- | ace/Thread_Manager.cpp | 4 | ||||
-rw-r--r-- | ace/Thread_Manager.h | 2 | ||||
-rw-r--r-- | ace/Timer_Heap_T.cpp | 40 | ||||
-rw-r--r-- | ace/Timer_Heap_T.h | 25 | ||||
-rw-r--r-- | ace/WFMO_Reactor.cpp | 154 | ||||
-rw-r--r-- | ace/WFMO_Reactor.h | 28 | ||||
-rw-r--r-- | ace/WFMO_Reactor.i | 6 |
19 files changed, 300 insertions, 293 deletions
diff --git a/ace/Containers_T.cpp b/ace/Containers_T.cpp index 44ab889ab61..b7c274a8229 100644 --- a/ace/Containers_T.cpp +++ b/ace/Containers_T.cpp @@ -542,7 +542,7 @@ ACE_Unbounded_Queue<T>::reset (void) } template <class T> int -ACE_Unbounded_Queue<T>::get (T *&item, size_t index) const +ACE_Unbounded_Queue<T>::get (T *&item, size_t slot) const { // ACE_TRACE ("ACE_Unbounded_Queue<T>::get"); @@ -552,7 +552,7 @@ ACE_Unbounded_Queue<T>::get (T *&item, size_t index) const for (i = 0; i < this->cur_size_; i++) { - if (i == index) + if (i == slot) break; curr = curr->next_; @@ -569,7 +569,7 @@ ACE_Unbounded_Queue<T>::get (T *&item, size_t index) const template <class T> int ACE_Unbounded_Queue<T>::set (const T &item, - size_t index) + size_t slot) { // ACE_TRACE ("ACE_Unbounded_Queue<T>::set"); @@ -578,7 +578,7 @@ ACE_Unbounded_Queue<T>::set (const T &item, size_t i; for (i = 0; - i < index && i < this->cur_size_; + i < slot && i < this->cur_size_; i++) curr = curr->next_; @@ -594,7 +594,7 @@ ACE_Unbounded_Queue<T>::set (const T &item, // A common case will be increasing the set size by 1. // Therefore, we'll optimize for this case. - if (i == index) + if (i == slot) { // Try to expand the size of the set by 1. if (this->enqueue_tail (item) == -1) @@ -607,7 +607,7 @@ ACE_Unbounded_Queue<T>::set (const T &item, T dummy; // We need to expand the list by multiple (dummy) items. - for (; i < index; i++) + for (; i < slot; i++) { // This head points to the existing dummy node, which is // about to be overwritten when we add the new dummy @@ -851,12 +851,12 @@ ACE_Double_Linked_List<T>::reset (void) } template <class T> int -ACE_Double_Linked_List<T>::get (T *&item, size_t index) +ACE_Double_Linked_List<T>::get (T *&item, size_t slot) { ACE_Double_Linked_List_Iterator<T> iter (*this); for (size_t i = 0; - i < index && !iter.done (); + i < slot && !iter.done (); i++) iter.advance (); @@ -2368,30 +2368,30 @@ ACE_Array_Base<T>::operator= (const ACE_Array_Base<T> &s) } } -// Set an item in the array at location index. +// Set an item in the array at location slot. template <class T> int -ACE_Array_Base<T>::set (const T &new_item, size_t index) +ACE_Array_Base<T>::set (const T &new_item, size_t slot) { - if (this->in_range (index)) + if (this->in_range (slot)) { - this->array_[index] = new_item; + this->array_[slot] = new_item; return 0; } else return -1; } -// Get an item in the array at location index. +// Get an item in the array at location slot. template <class T> int -ACE_Array_Base<T>::get (T &item, size_t index) const +ACE_Array_Base<T>::get (T &item, size_t slot) const { - if (this->in_range (index)) + if (this->in_range (slot)) { // Copies the item. If you don't want to copy, use operator [] // instead (but then you'll be responsible for range checking). - item = this->array_[index]; + item = this->array_[slot]; return 0; } else @@ -2453,8 +2453,8 @@ ACE_Array<T>::operator== (const ACE_Array<T> &s) const else if (this->size () != s.size ()) return 0; - for (size_t index = 0; index < s.size (); index++) - if ((*this)[index] != s[index]) + for (size_t slot = 0; slot < s.size (); slot++) + if ((*this)[slot] != s[slot]) return 0; return 1; diff --git a/ace/Containers_T.h b/ace/Containers_T.h index 73ef014d561..951871f58f1 100644 --- a/ace/Containers_T.h +++ b/ace/Containers_T.h @@ -477,14 +477,14 @@ public: void reset (void); // Reset the <ACE_Unbounded_Queue> to be empty. - int get (T *&item, size_t index = 0) const; - // Get the <index>th element in the set. Returns -1 if the element + int get (T *&item, size_t slot = 0) const; + // Get the <slot>th element in the set. Returns -1 if the element // isn't in the range <0..size() - 1>, else 0. - int set (const T &item, size_t index); - // Set the <index>th element in the set. Will pad out the set with - // empty nodes if <index> is beyond the range <0..size() - 1>. - // Returns -1 on failure, 0 if <index> isn't initially in range, and + int set (const T &item, size_t slot); + // Set the <slot>th element in the set. Will pad out the set with + // empty nodes if <slot> is beyond the range <0..size() - 1>. + // Returns -1 on failure, 0 if <slot> isn't initially in range, and // 0 otherwise. size_t size (void) const; @@ -650,8 +650,8 @@ public: // Notice that since no one is interested in the items within, // This operation will delete all items. - int get (T *&item, size_t index = 0); - // Get the <index>th element in the set. Returns -1 if the element + int get (T *&item, size_t slot = 0); + // Get the <slot>th element in the set. Returns -1 if the element // isn't in the range <0..size() - 1>, else 0. size_t size (void) const; @@ -743,7 +743,7 @@ public: // = Additional utility methods. - int get (T *&item, size_t index = 0); + int get (T *&item, size_t slot = 0); // Delegates to ACE_Double_Linked_List. void dump (void) const; @@ -1427,21 +1427,21 @@ public: // = Set/get methods. - T &operator [] (size_t index); - // Set item in the array at location <index>. Doesn't + T &operator [] (size_t slot); + // Set item in the array at location <slot>. Doesn't // perform range checking. - const T &operator [] (size_t index) const; - // Get item in the array at location <index>. Doesn't + const T &operator [] (size_t slot) const; + // Get item in the array at location <slot>. Doesn't // perform range checking. - int set (const T &new_item, size_t index); - // Set an item in the array at location <index>. Returns - // -1 if <index> is not in range, else returns 0. + int set (const T &new_item, size_t slot); + // Set an item in the array at location <slot>. Returns + // -1 if <slot> is not in range, else returns 0. - int get (T &item, size_t index) const; - // Get an item in the array at location <index>. Returns -1 if - // <index> is not in range, else returns 0. Note that this function + int get (T &item, size_t slot) const; + // Get an item in the array at location <slot>. Returns -1 if + // <slot> is not in range, else returns 0. Note that this function // copies the item. If you want to avoid the copy, you can use // the const operator [], but then you'll be responsible for range checking. @@ -1463,8 +1463,8 @@ public: // It does not affect new_size private: - int in_range (size_t index) const; - // Returns 1 if <index> is within range, i.e., 0 >= <index> < + int in_range (size_t slot) const; + // Returns 1 if <slot> is within range, i.e., 0 >= <slot> < // <cur_size_>, else returns 0. size_t max_size_; diff --git a/ace/Map_Manager.cpp b/ace/Map_Manager.cpp index 4fa80e02dc5..00b30a0a646 100644 --- a/ace/Map_Manager.cpp +++ b/ace/Map_Manager.cpp @@ -79,9 +79,9 @@ ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::bind_i (const EXT_ID &ext_id, const INT_ID &int_id) { // Try to find the key. - size_t index = 0; + size_t slot = 0; int result = this->find_and_return_index (ext_id, - index); + slot); if (result == 0) { @@ -124,14 +124,14 @@ ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::next_free (size_t &free_slot) } template <class EXT_ID, class INT_ID, class ACE_LOCK> void -ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::shared_move (size_t index, +ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::shared_move (size_t slot, ACE_Map_Entry<EXT_ID, INT_ID> ¤t_list, size_t current_list_id, ACE_Map_Entry<EXT_ID, INT_ID> &new_list, size_t new_list_id) { // Grab the entry. - ENTRY &entry = this->search_structure_[index]; + ENTRY &entry = this->search_structure_[slot]; // // Remove from current list. @@ -169,16 +169,16 @@ ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::shared_move (size_t index, entry.prev (new_list_id); // Fix entry before us. - new_list.next (index); + new_list.next (slot); // Fix entry after us. if (new_list_next == new_list_id) { - new_list.prev (index); + new_list.prev (slot); } else { - this->search_structure_[new_list_next].prev (index); + this->search_structure_[new_list_next].prev (slot); } } @@ -190,17 +190,17 @@ ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::shared_bind (const EXT_ID &ext_id, // therefore, simply adds to the map. // Find an empty slot. - size_t index = 0; - int result = this->next_free (index); + size_t slot = 0; + int result = this->next_free (slot); if (result == 0) { // Copy key and value. - this->search_structure_[index].int_id_ = int_id; - this->search_structure_[index].ext_id_ = ext_id; + this->search_structure_[slot].int_id_ = int_id; + this->search_structure_[slot].ext_id_ = ext_id; // Move from free list to occupied list - this->move_from_free_list_to_occupied_list (index); + this->move_from_free_list_to_occupied_list (slot); // Update the current size. ++this->cur_size_; @@ -216,15 +216,15 @@ ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::rebind_i (const EXT_ID &ext_id, INT_ID &old_int_id) { // First try to find the key. - size_t index = 0; + size_t slot = 0; int result = this->find_and_return_index (ext_id, - index); + slot); if (result == 0) { // We found it, so make copies of the old entries and rebind // current entries. - ENTRY &ss = this->search_structure_[index]; + ENTRY &ss = this->search_structure_[slot]; old_ext_id = ss.ext_id_; old_int_id = ss.int_id_; ss.ext_id_ = ext_id; @@ -249,15 +249,15 @@ ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::rebind_i (const EXT_ID &ext_id, INT_ID &old_int_id) { // First try to find the key. - size_t index = 0; + size_t slot = 0; int result = this->find_and_return_index (ext_id, - index); + slot); if (result == 0) { // We found it, so make copies of the old entries and rebind // current entries. - ENTRY &ss = this->search_structure_[index]; + ENTRY &ss = this->search_structure_[slot]; old_int_id = ss.int_id_; ss.ext_id_ = ext_id; ss.int_id_ = int_id; @@ -281,14 +281,14 @@ ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::rebind_i (const EXT_ID &ext_id, { // First try to find the key. - size_t index = 0; + size_t slot = 0; int result = this->find_and_return_index (ext_id, - index); + slot); if (result == 0) { // We found it, so rebind current entries. - ENTRY &ss = this->search_structure_[index]; + ENTRY &ss = this->search_structure_[slot]; ss.ext_id_ = ext_id; ss.int_id_ = int_id; @@ -310,15 +310,15 @@ ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::trybind_i (const EXT_ID &ext_id, INT_ID &int_id) { // Try to find the key. - size_t index = 0; + size_t slot = 0; int result = this->find_and_return_index (ext_id, - index); + slot); if (result == 0) { // Key was found. Make a copy of value, but *don't* update // anything in the map! - int_id = this->search_structure_[index].int_id_; + int_id = this->search_structure_[slot].int_id_; return 1; } else @@ -331,7 +331,7 @@ ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::trybind_i (const EXT_ID &ext_id, template <class EXT_ID, class INT_ID, class ACE_LOCK> int ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::find_and_return_index (const EXT_ID &ext_id, - size_t &index) + size_t &slot) { // Go through the entire occupied list looking for the key. for (size_t i = this->occupied_list_.next (); @@ -341,8 +341,8 @@ ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::find_and_return_index (const EXT_ID & if (this->equal (this->search_structure_[i].ext_id_, ext_id)) { - // If found, return index. - index = i; + // If found, return slot. + slot = i; return 0; } } @@ -356,14 +356,14 @@ ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::find_i (const EXT_ID &ext_id, INT_ID &int_id) { // Try to find the key. - size_t index = 0; + size_t slot = 0; int result = this->find_and_return_index (ext_id, - index); + slot); if (result == 0) { // Key was found. Make a copy of value. - int_id = this->search_structure_[index].int_id_; + int_id = this->search_structure_[slot].int_id_; } return result; @@ -371,16 +371,16 @@ ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::find_i (const EXT_ID &ext_id, template <class EXT_ID, class INT_ID, class ACE_LOCK> int ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::unbind_and_return_index (const EXT_ID &ext_id, - size_t &index) + size_t &slot) { // Try to find the key. int result = this->find_and_return_index (ext_id, - index); + slot); if (result == 0) { // Move from occupied list to free list - this->move_from_occupied_list_to_free_list (index); + this->move_from_occupied_list_to_free_list (slot); // Update the current size. --this->cur_size_; @@ -394,14 +394,14 @@ ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::unbind_i (const EXT_ID &ext_id, INT_ID &int_id) { // Unbind the entry. - size_t index = 0; + size_t slot = 0; int result = this->unbind_and_return_index (ext_id, - index); + slot); if (result == 0) { // If found, copy the value. - int_id = this->search_structure_[index].int_id_; + int_id = this->search_structure_[slot].int_id_; } return result; diff --git a/ace/Map_Manager.h b/ace/Map_Manager.h index 9a7ea27de27..3a1969b7707 100644 --- a/ace/Map_Manager.h +++ b/ace/Map_Manager.h @@ -278,7 +278,7 @@ protected: // called with locks held. int find_and_return_index (const EXT_ID &ext_id, - size_t &index); + size_t &slot); // Performs a find using <ext_id> as the key. Must be called with // locks held. @@ -292,7 +292,7 @@ protected: // with locks held. int unbind_and_return_index (const EXT_ID &ext_id, - size_t &index); + size_t &slot); // Performs an unbind using <ext_id> as the key. Must be called // with locks held. @@ -320,16 +320,16 @@ protected: size_t occupied_list_id (void) const; // Id of the occupied list sentinel. - int next_free (size_t &index); + int next_free (size_t &slot); // Finds the next free slot. - void move_from_free_list_to_occupied_list (size_t index); + void move_from_free_list_to_occupied_list (size_t slot); // Move from free list to occupied list. - void move_from_occupied_list_to_free_list (size_t index); + void move_from_occupied_list_to_free_list (size_t slot); // Move from occupied list to free list. - void shared_move (size_t index, + void shared_move (size_t slot, ACE_Map_Entry<EXT_ID, INT_ID> ¤t_list, size_t current_list_id, ACE_Map_Entry<EXT_ID, INT_ID> &new_list, diff --git a/ace/Map_Manager.i b/ace/Map_Manager.i index ded8b4b0357..d837cbd06b1 100644 --- a/ace/Map_Manager.i +++ b/ace/Map_Manager.i @@ -131,9 +131,9 @@ ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::find (const EXT_ID &ext_id) { ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - size_t index = 0; + size_t slot = 0; return this->find_and_return_index (ext_id, - index); + slot); } template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int @@ -150,9 +150,9 @@ template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::unbind_i (const EXT_ID &ext_id) { // Unbind the entry. - size_t index = 0; + size_t slot = 0; return this->unbind_and_return_index (ext_id, - index); + slot); } template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int @@ -195,9 +195,9 @@ ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::mutex (void) } template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE void -ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::move_from_free_list_to_occupied_list (size_t index) +ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::move_from_free_list_to_occupied_list (size_t slot) { - this->shared_move (index, + this->shared_move (slot, this->free_list_, this->free_list_id (), this->occupied_list_, @@ -205,9 +205,9 @@ ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::move_from_free_list_to_occupied_list } template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE void -ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::move_from_occupied_list_to_free_list (size_t index) +ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::move_from_occupied_list_to_free_list (size_t slot) { - this->shared_move (index, + this->shared_move (slot, this->occupied_list_, this->occupied_list_id (), this->free_list_, diff --git a/ace/Msg_WFMO_Reactor.cpp b/ace/Msg_WFMO_Reactor.cpp index f501be57885..14f78f76fa3 100644 --- a/ace/Msg_WFMO_Reactor.cpp +++ b/ace/Msg_WFMO_Reactor.cpp @@ -80,10 +80,10 @@ ACE_Msg_WFMO_Reactor::dispatch_window_messages (void) } DWORD -ACE_Msg_WFMO_Reactor::poll_remaining_handles (size_t index) +ACE_Msg_WFMO_Reactor::poll_remaining_handles (size_t slot) { - return ::MsgWaitForMultipleObjects (this->handler_rep_.max_handlep1 () - index, - this->handler_rep_.handles () + index, + return ::MsgWaitForMultipleObjects (this->handler_rep_.max_handlep1 () - slot, + this->handler_rep_.handles () + slot, FALSE, 0, QS_ALLINPUT); diff --git a/ace/Process.cpp b/ace/Process.cpp index 2f4abe189f7..32362e7cc03 100644 --- a/ace/Process.cpp +++ b/ace/Process.cpp @@ -273,14 +273,14 @@ ACE_Process_Options::inherit_environment (void) // Get the existing environment. LPTSTR existing_environment = ::GetEnvironmentStrings (); - int index = 0; + int slot = 0; - while (existing_environment[index] != '\0') + while (existing_environment[slot] != '\0') { - int len = ACE_OS::strlen (existing_environment + index); + int len = ACE_OS::strlen (existing_environment + slot); // Add the string to our env buffer. - if (this->setenv_i (existing_environment+index, len) == -1) + if (this->setenv_i (existing_environment + slot, len) == -1) { ACE_ERROR ((LM_ERROR, "%p.\n", "ACE_Process_Options::ACE_Process_Options")); @@ -288,7 +288,7 @@ ACE_Process_Options::inherit_environment (void) } // Skip to the next word. - index += len + 1; + slot += len + 1; } ::FreeEnvironmentStrings (existing_environment); @@ -413,18 +413,17 @@ ACE_Process_Options::setenv (LPCTSTR variable_name, } int -ACE_Process_Options::setenv_i (LPTSTR assignment, int len) +ACE_Process_Options::setenv_i (LPTSTR assignment, + int len) { // Add one for the null char. len++; // If environment larger than allocated buffer return. Also check to // make sure we have enough room. - if ( environment_argv_index_ == max_environ_argv_index_ || - (len + environment_buf_index_) >= environment_buf_len_ ) - { + if (environment_argv_index_ == max_environ_argv_index_ + || (len + environment_buf_index_) >= environment_buf_len_) return -1; - } // Copy the new environment string. ACE_OS::memcpy (environment_buf_ + environment_buf_index_, diff --git a/ace/Read_Buffer.cpp b/ace/Read_Buffer.cpp index 17c546ccdf5..b203f3b8d0e 100644 --- a/ace/Read_Buffer.cpp +++ b/ace/Read_Buffer.cpp @@ -89,18 +89,18 @@ ACE_Read_Buffer::rec_read (int term, int search, int replace) char buf[BUFSIZ]; int c = EOF; - size_t index = 0; + size_t slot = 0; int done = 0; // Read in the file char by char - while (index < BUFSIZ) + while (slot < BUFSIZ) { c = getc (this->stream_); // Don't insert EOF into the buffer... if (c == EOF) { - if (index == 0) + if (slot == 0) return 0; else { @@ -120,7 +120,7 @@ ACE_Read_Buffer::rec_read (int term, int search, int replace) c = replace; } - buf[index++] = (char) c; + buf[slot++] = (char) c; // Substitutions must be made before checking for termination. if (done) @@ -128,7 +128,7 @@ ACE_Read_Buffer::rec_read (int term, int search, int replace) } // Increment the number of bytes. - this->size_ += index; + this->size_ += slot; char *result; @@ -156,7 +156,7 @@ ACE_Read_Buffer::rec_read (int term, int search, int replace) // Copy buf into the appropriate location starting from end of // buffer. Peter says this is confusing and that we should use // memcpy() ;-) - for (size_t j = index; j > 0; j--) + for (size_t j = slot; j > 0; j--) *--result = buf[j - 1]; return result; diff --git a/ace/SString.cpp b/ace/SString.cpp index 373b045b963..ce850e4673f 100644 --- a/ace/SString.cpp +++ b/ace/SString.cpp @@ -37,7 +37,8 @@ ACE_Tokenizer::delimiter (TCHAR d) } int -ACE_Tokenizer::delimiter_replace (TCHAR d, TCHAR replacement) +ACE_Tokenizer::delimiter_replace (TCHAR d, + TCHAR replacement) { if (delimiter_index_ == MAX_DELIMITERS) return -1; @@ -50,7 +51,9 @@ ACE_Tokenizer::delimiter_replace (TCHAR d, TCHAR replacement) } int -ACE_Tokenizer::preserve_designators (TCHAR start, TCHAR stop, int strip) +ACE_Tokenizer::preserve_designators (TCHAR start, + TCHAR stop, + int strip) { if (preserves_index_ == MAX_PRESERVES) return -1; @@ -63,11 +66,13 @@ ACE_Tokenizer::preserve_designators (TCHAR start, TCHAR stop, int strip) } int -ACE_Tokenizer::is_delimiter (TCHAR d, int &replace, TCHAR &r) +ACE_Tokenizer::is_delimiter (TCHAR d, + int &replace, + TCHAR &r) { replace = 0; - for (int x=0; x < delimiter_index_; x++) + for (int x = 0; x < delimiter_index_; x++) if (delimiters_[x].delimiter_ == d) { if (delimiters_[x].replace_) @@ -82,9 +87,11 @@ ACE_Tokenizer::is_delimiter (TCHAR d, int &replace, TCHAR &r) } int -ACE_Tokenizer::is_preserve_designator (TCHAR start, TCHAR &stop, int &strip) +ACE_Tokenizer::is_preserve_designator (TCHAR start, + TCHAR &stop, + int &strip) { - for (int x=0; x < preserves_index_; x++) + for (int x = 0; x < preserves_index_; x++) if (preserves_[x].start_ == start) { stop = preserves_[x].stop_; diff --git a/ace/SString.h b/ace/SString.h index b7fe755c629..02fca56ed17 100644 --- a/ace/SString.h +++ b/ace/SString.h @@ -81,12 +81,12 @@ public: ~ACE_CString (void); // Deletes the memory... - const char &operator [] (size_t index) const; - // Return the <index'th> character in the string (doesn't perform + const char &operator [] (size_t slot) const; + // Return the <slot'th> character in the string (doesn't perform // bounds checking). - char &operator [] (size_t index); - // Return the <index'th> character by reference in the string + char &operator [] (size_t slot); + // Return the <slot'th> character by reference in the string // (doesn't perform bounds checking). ACE_CString &operator = (const ACE_CString &); @@ -128,23 +128,23 @@ public: int strstr (const ACE_CString &s) const; // Comparison operator that will match substrings. Returns the - // index of the first location that matches, else -1. + // slot of the first location that matches, else -1. int find (const ACE_CString &str, int pos = 0) const; - // Find <str> starting at pos. Returns the index of the first + // Find <str> starting at pos. Returns the slot of the first // location that matches, else npos. int find (const char *s, int pos = 0) const; - // Find <s> starting at pos. Returns the index of the first + // Find <s> starting at pos. Returns the slot of the first // location that matches, else npos. int find (char c, int pos = 0) const; - // Find <c> starting at pos. Returns the index of the first + // Find <c> starting at pos. Returns the slot of the first // location that matches, else npos. int rfind (char c, int pos = npos) const; // Find <c> starting at pos (counting from the end). Returns the - // index of the first location that matches, else npos. + // slot of the first location that matches, else npos. int operator == (const ACE_CString &s) const; // Equality comparison operator (must match entire string). @@ -238,12 +238,12 @@ public: ~ACE_WString (void); // Deletes the memory... - ACE_USHORT16 operator [] (size_t index) const; - // Return the <index'th> character in the string (doesn't perform + ACE_USHORT16 operator [] (size_t slot) const; + // Return the <slot'th> character in the string (doesn't perform // bounds checking). - ACE_USHORT16 &operator [] (size_t index); - // Return the <index'th> character by reference in the string + ACE_USHORT16 &operator [] (size_t slot); + // Return the <slot'th> character by reference in the string // (doesn't perform bounds checking). ACE_WString &operator = (const ACE_WString &); @@ -286,23 +286,23 @@ public: int strstr (const ACE_WString &s) const; // Comparison operator that will match substrings. Returns the - // index of the first location that matches, else -1. + // slot of the first location that matches, else -1. int find (const ACE_WString &str, int pos = 0) const; - // Find <str> starting at pos. Returns the index of the first + // Find <str> starting at pos. Returns the slot of the first // location that matches, else npos. int find (const ACE_USHORT16 *s, int pos = 0) const; - // Find <s> starting at pos. Returns the index of the first + // Find <s> starting at pos. Returns the slot of the first // location that matches, else npos. int find (ACE_USHORT16 c, int pos = 0) const; - // Find <c> starting at pos. Returns the index of the first + // Find <c> starting at pos. Returns the slot of the first // location that matches, else npos. int rfind (ACE_USHORT16 c, int pos = npos) const; // Find <c> starting at pos (counting from the end). Returns the - // index of the first location that matches, else npos. + // slot of the first location that matches, else npos. int operator == (const ACE_WString &s) const; // Equality comparison operator (must match entire string). @@ -393,12 +393,12 @@ public: ~ACE_SString (void); // Default dtor. - char operator [] (size_t index) const; - // Return the <index'th> character in the string (doesn't perform + char operator [] (size_t slot) const; + // Return the <slot'th> character in the string (doesn't perform // bounds checking). - char &operator [] (size_t index); - // Return the <index'th> character by reference in the string + char &operator [] (size_t slot); + // Return the <slot'th> character by reference in the string // (doesn't perform bounds checking). ACE_SString &operator = (const ACE_SString &); @@ -433,23 +433,23 @@ public: int strstr (const ACE_SString &s) const; // Comparison operator that will match substrings. Returns the - // index of the first location that matches, else -1. + // slot of the first location that matches, else -1. int find (const ACE_SString &str, int pos = 0) const; - // Find <str> starting at pos. Returns the index of the first + // Find <str> starting at pos. Returns the slot of the first // location that matches, else npos. int find (const char *s, int pos = 0) const; - // Find <s> starting at pos. Returns the index of the first + // Find <s> starting at pos. Returns the slot of the first // location that matches, else npos. int find (char c, int pos = 0) const; - // Find <c> starting at pos. Returns the index of the first + // Find <c> starting at pos. Returns the slot of the first // location that matches, else npos. int rfind (char c, int pos = npos) const; // Find <c> starting at pos (counting from the end). Returns the - // index of the first location that matches, else npos. + // slot of the first location that matches, else npos. int operator == (const ACE_SString &s) const; // Equality comparison operator (must match entire string). diff --git a/ace/SString.i b/ace/SString.i index 8e7157da963..44526a9fdc8 100644 --- a/ace/SString.i +++ b/ace/SString.i @@ -140,22 +140,22 @@ ACE_CString::substr (size_t offset, return this->substring (offset, length); } -// Return the <index'th> character in the string. +// Return the <slot'th> character in the string. ACE_INLINE const char & -ACE_CString::operator[] (size_t index) const +ACE_CString::operator[] (size_t slot) const { ACE_TRACE ("ACE_CString::operator[]"); - return this->rep_[index]; + return this->rep_[slot]; } -// Return the <index'th> character in the string by reference. +// Return the <slot'th> character in the string by reference. ACE_INLINE char & -ACE_CString::operator[] (size_t index) +ACE_CString::operator[] (size_t slot) { ACE_TRACE ("ACE_CString::operator[]"); - return this->rep_[index]; + return this->rep_[slot]; } // Get a copy of the underlying representation. @@ -340,22 +340,22 @@ ACE_SString::substr (size_t offset, return this->substring (offset, length); } -// Return the <index'th> character in the string. +// Return the <slot'th> character in the string. ACE_INLINE char -ACE_SString::operator[] (size_t index) const +ACE_SString::operator[] (size_t slot) const { ACE_TRACE ("ACE_SString::operator[]"); - return this->rep_[index]; + return this->rep_[slot]; } -// Return the <index'th> character in the string by reference. +// Return the <slot'th> character in the string by reference. ACE_INLINE char & -ACE_SString::operator[] (size_t index) +ACE_SString::operator[] (size_t slot) { ACE_TRACE ("ACE_SString::operator[]"); - return this->rep_[index]; + return this->rep_[slot]; } // Get the underlying pointer (does not make a copy, so beware!). @@ -603,22 +603,22 @@ ACE_WString::compare (const ACE_WString &s) const this->len_ * sizeof (ACE_USHORT16)); } -// Return the <index'th> character in the string. +// Return the <slot'th> character in the string. ACE_INLINE ACE_USHORT16 -ACE_WString::operator[] (size_t index) const +ACE_WString::operator[] (size_t slot) const { ACE_TRACE ("ACE_WString::operator[]"); - return this->rep_[index]; + return this->rep_[slot]; } -// Return the <index'th> character in the string. +// Return the <slot'th> character in the string. ACE_INLINE ACE_USHORT16 & -ACE_WString::operator[] (size_t index) +ACE_WString::operator[] (size_t slot) { ACE_TRACE ("ACE_WString::operator[]"); - return this->rep_[index]; + return this->rep_[slot]; } ACE_INLINE int diff --git a/ace/Select_Reactor_Base.cpp b/ace/Select_Reactor_Base.cpp index 3bf4e4ac8cf..f09e47e5f1d 100644 --- a/ace/Select_Reactor_Base.cpp +++ b/ace/Select_Reactor_Base.cpp @@ -282,8 +282,8 @@ ACE_Select_Reactor_Handler_Repository::unbind (ACE_HANDLE handle, { ACE_TRACE ("ACE_Select_Reactor_Handler_Repository::unbind"); - size_t index; - ACE_Event_Handler *eh = this->find (handle, &index); + size_t slot; + ACE_Event_Handler *eh = this->find (handle, &slot); if (eh == 0) return -1; @@ -317,10 +317,10 @@ ACE_Select_Reactor_Handler_Repository::unbind (ACE_HANDLE handle, && this->select_reactor_.wait_set_.ex_mask_.is_set (handle) == 0) #if defined (ACE_WIN32) { - ACE_SELECT_REACTOR_HANDLE (index) = ACE_INVALID_HANDLE; - ACE_SELECT_REACTOR_EVENT_HANDLER (this, index) = 0; + ACE_SELECT_REACTOR_HANDLE (slot) = ACE_INVALID_HANDLE; + ACE_SELECT_REACTOR_EVENT_HANDLER (this, slot) = 0; - if (this->max_handlep1_ == (int) index + 1) + if (this->max_handlep1_ == (int) slot + 1) { // We've deleted the last entry (i.e., i + 1 == the current // size of the array), so we need to figure out the last diff --git a/ace/Thread_Manager.cpp b/ace/Thread_Manager.cpp index 72d461b9a7c..337a378dbd2 100644 --- a/ace/Thread_Manager.cpp +++ b/ace/Thread_Manager.cpp @@ -1991,7 +1991,7 @@ ACE_Thread_Manager::cancel_task (ACE_Task_Base *task, // lock held. ACE_Thread_Descriptor * -ACE_Thread_Manager::find_task (ACE_Task_Base *task, int index) +ACE_Thread_Manager::find_task (ACE_Task_Base *task, int slot) { ACE_TRACE ("ACE_Thread_Manager::find_task"); @@ -2001,7 +2001,7 @@ ACE_Thread_Manager::find_task (ACE_Task_Base *task, int index) !iter.done (); iter.advance ()) { - if (i >= index) + if (i >= slot) break; if (task == iter.next ()->task_) diff --git a/ace/Thread_Manager.h b/ace/Thread_Manager.h index 2b43724a0bc..105a52e0c72 100644 --- a/ace/Thread_Manager.h +++ b/ace/Thread_Manager.h @@ -762,7 +762,7 @@ protected: // -1 if <h_id> is not in the table doesn't contain <h_id>. ACE_Thread_Descriptor *find_task (ACE_Task_Base *task, - int index = -1); + int slot = -1); // Locate the thread descriptor address of the list occupied by // <task>. Returns 0 if <task> is not in the table doesn't contain // <task>. diff --git a/ace/Timer_Heap_T.cpp b/ace/Timer_Heap_T.cpp index 7ab0fa8e030..f827eec1679 100644 --- a/ace/Timer_Heap_T.cpp +++ b/ace/Timer_Heap_T.cpp @@ -278,44 +278,44 @@ template <class TYPE, class FUNCTOR, class ACE_LOCK> void ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::copy (int index, ACE_Timer_Node_T<TYPE> *moved_node) { // Insert <moved_node> into its new location in the heap. - this->heap_[index] = moved_node; + this->heap_[slot] = moved_node; ACE_ASSERT (moved_node->get_timer_id () >= 0 && moved_node->get_timer_id () < (int) this->max_size_); // Update the corresponding slot in the parallel <timer_ids_> array. - this->timer_ids_[moved_node->get_timer_id ()] = index; + this->timer_ids_[moved_node->get_timer_id ()] = slot; } template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_Node_T<TYPE> * -ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::remove (size_t index) +ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::remove (size_t slot) { - ACE_Timer_Node_T<TYPE> *removed_node = this->heap_[index]; + ACE_Timer_Node_T<TYPE> *removed_node = this->heap_[slot]; // Return this timer id to the freelist. this->push_freelist (removed_node->get_timer_id ()); // Decrement the size of the heap by one since we're removing the - // "index"th node. + // "slot"th node. this->cur_size_--; // Only try to reheapify if we're not deleting the last entry. - if (index < this->cur_size_) + if (slot < this->cur_size_) { ACE_Timer_Node_T<TYPE> *moved_node = this->heap_[this->cur_size_]; // Move the end node to the location being removed and update // the corresponding slot in the parallel <timer_ids> array. - this->copy (index, moved_node); + this->copy (slot, moved_node); // If the <moved_node->time_value_> is great than or equal its // parent it needs be moved down the heap. - size_t parent = ACE_HEAP_PARENT (index); + size_t parent = ACE_HEAP_PARENT (slot); if (moved_node->get_timer_value () >= this->heap_[parent]->get_timer_value ()) - this->reheap_down (moved_node, index, ACE_HEAP_LCHILD (index)); + this->reheap_down (moved_node, slot, ACE_HEAP_LCHILD (slot)); else - this->reheap_up (moved_node, index, parent); + this->reheap_up (moved_node, slot, parent); } return removed_node; @@ -323,7 +323,7 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::remove (size_t index) template <class TYPE, class FUNCTOR, class ACE_LOCK> void ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::reheap_down (ACE_Timer_Node_T<TYPE> *moved_node, - size_t index, + size_t slot, size_t child) { // Restore the heap property after a deletion. @@ -339,8 +339,8 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::reheap_down (ACE_Timer_Node_T<TYPE> * // the <moved_node>. if (this->heap_[child]->get_timer_value () < moved_node->get_timer_value ()) { - this->copy (index, this->heap_[child]); - index = child; + this->copy (slot, this->heap_[child]); + slot = child; child = ACE_HEAP_LCHILD (child); } else @@ -348,25 +348,25 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::reheap_down (ACE_Timer_Node_T<TYPE> * break; } - this->copy (index, moved_node); + this->copy (slot, moved_node); } template <class TYPE, class FUNCTOR, class ACE_LOCK> void ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::reheap_up (ACE_Timer_Node_T<TYPE> *moved_node, - size_t index, + size_t slot, size_t parent) { // Restore the heap property after an insertion. - while (index > 0) + while (slot > 0) { // If the parent node is greater than the <moved_node> we need // to copy it down. if (moved_node->get_timer_value () < this->heap_[parent]->get_timer_value ()) { - this->copy (index, this->heap_[parent]); - index = parent; - parent = ACE_HEAP_PARENT (index); + this->copy (slot, this->heap_[parent]); + slot = parent; + parent = ACE_HEAP_PARENT (slot); } else break; @@ -374,7 +374,7 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::reheap_up (ACE_Timer_Node_T<TYPE> *mo // Insert the new node into its proper resting place in the heap and // update the corresponding slot in the parallel <timer_ids> array. - this->copy (index, moved_node); + this->copy (slot, moved_node); } template <class TYPE, class FUNCTOR, class ACE_LOCK> void diff --git a/ace/Timer_Heap_T.h b/ace/Timer_Heap_T.h index 784e57acfbc..b41863a00be 100644 --- a/ace/Timer_Heap_T.h +++ b/ace/Timer_Heap_T.h @@ -100,7 +100,8 @@ public: // just allocate the nodes as we need them. This can also take in a // upcall functor and freelist (if 0, then defaults will be created) - ACE_Timer_Heap_T (FUNCTOR *upcall_functor = 0, ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist = 0); + ACE_Timer_Heap_T (FUNCTOR *upcall_functor = 0, + ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist = 0); // Default constructor. <upcall_functor> is the instance of the // FUNCTOR to be used by the queue. If <upcall_functor> is 0, Timer // Heap will create a default FUNCTOR. <freelist> the freelist of @@ -176,8 +177,8 @@ protected: // internal freelist). private: - ACE_Timer_Node_T<TYPE> *remove (size_t index); - // Remove and return the <index>th <ACE_Timer_Node> and restore the + ACE_Timer_Node_T<TYPE> *remove (size_t slot); + // Remove and return the <slot>th <ACE_Timer_Node> and restore the // heap property. void insert (ACE_Timer_Node_T<TYPE> *new_node); @@ -189,18 +190,18 @@ private: // preallocated array of ACE_Timer_Nodes. void reheap_up (ACE_Timer_Node_T<TYPE> *new_node, - size_t index, + size_t slot, size_t parent); - // Restore the heap property, starting at <index>. + // Restore the heap property, starting at <slot>. void reheap_down (ACE_Timer_Node_T<TYPE> *moved_node, - size_t index, + size_t slot, size_t child); - // Restore the heap property, starting at <index>. + // Restore the heap property, starting at <slot>. - void copy (int index, ACE_Timer_Node_T<TYPE> *moved_node); - // Copy <moved_node> into the <index> slot of <heap_> and move - // <index> into the corresponding slot in the <timer_id_> array. + void copy (int slot, ACE_Timer_Node_T<TYPE> *moved_node); + // Copy <moved_node> into the <slot> slot of <heap_> and move + // <slot> into the corresponding slot in the <timer_id_> array. int timer_id (void); // Returns a timer id that uniquely identifies this timer. This id @@ -232,9 +233,9 @@ private: long *timer_ids_; // An array of "pointers" that allows each <ACE_Timer_Node> in the // <heap_> to be located in O(1) time. Basically, <timer_id_[i]> - // contains the index in the <heap_> array where an <ACE_Timer_Node> + // contains the slot in the <heap_> array where an <ACE_Timer_Node> // * with timer id <i> resides. Thus, the timer id passed back from - // <schedule> is really an index into the <timer_ids> array. The + // <schedule> is really an slot into the <timer_ids> array. The // <timer_ids_> array serves two purposes: negative values are // treated as "pointers" for the <freelist_>, whereas positive // values are treated as "pointers" into the <heap_> array. diff --git a/ace/WFMO_Reactor.cpp b/ace/WFMO_Reactor.cpp index 67733f38837..c8a77fd771c 100644 --- a/ace/WFMO_Reactor.cpp +++ b/ace/WFMO_Reactor.cpp @@ -269,15 +269,15 @@ ACE_WFMO_Reactor_Handler_Repository::unbind_i (ACE_HANDLE handle, } int -ACE_WFMO_Reactor_Handler_Repository::remove_handler_i (size_t index, +ACE_WFMO_Reactor_Handler_Repository::remove_handler_i (size_t slot, ACE_Reactor_Mask to_be_removed_masks) { // I/O entries - if (this->current_info_[index].io_entry_) + if (this->current_info_[slot].io_entry_) { // See if there are other events that the <Event_Handler> is // interested in - this->bit_ops (this->current_info_[index].network_events_, + this->bit_ops (this->current_info_[slot].network_events_, to_be_removed_masks, ACE_Reactor::CLR_MASK); @@ -286,9 +286,9 @@ ACE_WFMO_Reactor_Handler_Repository::remove_handler_i (size_t index, // events that the <event_handler> is interested in. I don't // think we can do anything about errors here, so I will not // check this. - ::WSAEventSelect ((SOCKET) this->current_info_[index].io_handle_, - this->current_handles_[index], - this->current_info_[index].network_events_); + ::WSAEventSelect ((SOCKET) this->current_info_[slot].io_handle_, + this->current_handles_[slot], + this->current_info_[slot].network_events_); } // Normal event entries. else @@ -304,12 +304,12 @@ ACE_WFMO_Reactor_Handler_Repository::remove_handler_i (size_t index, // If there are no more events that the <Event_Handler> is // interested in, or this is a non-I/O entry, schedule the // <Event_Handler> for removal - if (this->current_info_[index].network_events_ == 0) + if (this->current_info_[slot].network_events_ == 0) { // Mark to be deleted - this->current_info_[index].delete_entry_ = 1; + this->current_info_[slot].delete_entry_ = 1; // Remember the mask - this->current_info_[index].close_masks_ = to_be_removed_masks; + this->current_info_[slot].close_masks_ = to_be_removed_masks; // Increment the handle count this->handles_to_be_deleted_++; } @@ -323,8 +323,8 @@ ACE_WFMO_Reactor_Handler_Repository::remove_handler_i (size_t index, // if (ACE_BIT_ENABLED (to_be_removed_masks, ACE_Event_Handler::DONT_CALL) == 0) { - ACE_HANDLE handle = this->current_info_[index].io_handle_; - this->current_info_[index].event_handler_->handle_close (handle, + ACE_HANDLE handle = this->current_info_[slot].io_handle_; + this->current_info_[slot].event_handler_->handle_close (handle, to_be_removed_masks); } } @@ -333,15 +333,15 @@ ACE_WFMO_Reactor_Handler_Repository::remove_handler_i (size_t index, } int -ACE_WFMO_Reactor_Handler_Repository::remove_suspended_handler_i (size_t index, +ACE_WFMO_Reactor_Handler_Repository::remove_suspended_handler_i (size_t slot, ACE_Reactor_Mask to_be_removed_masks) { // I/O entries - if (this->current_suspended_info_[index].io_entry_) + if (this->current_suspended_info_[slot].io_entry_) { // See if there are other events that the <Event_Handler> is // interested in - this->bit_ops (this->current_suspended_info_[index].network_events_, + this->bit_ops (this->current_suspended_info_[slot].network_events_, to_be_removed_masks, ACE_Reactor::CLR_MASK); @@ -350,9 +350,9 @@ ACE_WFMO_Reactor_Handler_Repository::remove_suspended_handler_i (size_t index, // events that the <event_handler> is interested in. I don't // think we can do anything about errors here, so I will not // check this. - ::WSAEventSelect ((SOCKET) this->current_suspended_info_[index].io_handle_, - this->current_suspended_info_[index].event_handle_, - this->current_suspended_info_[index].network_events_); + ::WSAEventSelect ((SOCKET) this->current_suspended_info_[slot].io_handle_, + this->current_suspended_info_[slot].event_handle_, + this->current_suspended_info_[slot].network_events_); } // Normal event entries. else @@ -368,12 +368,12 @@ ACE_WFMO_Reactor_Handler_Repository::remove_suspended_handler_i (size_t index, // If there are no more events that the <Event_Handler> is // interested in, or this is a non-I/O entry, schedule the // <Event_Handler> for removal - if (this->current_suspended_info_[index].network_events_ == 0) + if (this->current_suspended_info_[slot].network_events_ == 0) { // Mark to be deleted - this->current_suspended_info_[index].delete_entry_ = 1; + this->current_suspended_info_[slot].delete_entry_ = 1; // Remember the mask - this->current_suspended_info_[index].close_masks_ = to_be_removed_masks; + this->current_suspended_info_[slot].close_masks_ = to_be_removed_masks; // Increment the handle count this->handles_to_be_deleted_++; } @@ -387,8 +387,8 @@ ACE_WFMO_Reactor_Handler_Repository::remove_suspended_handler_i (size_t index, // if (ACE_BIT_ENABLED (to_be_removed_masks, ACE_Event_Handler::DONT_CALL) == 0) { - ACE_HANDLE handle = this->current_suspended_info_[index].io_handle_; - this->current_suspended_info_[index].event_handler_->handle_close (handle, + ACE_HANDLE handle = this->current_suspended_info_[slot].io_handle_; + this->current_suspended_info_[slot].event_handler_->handle_close (handle, to_be_removed_masks); } } @@ -397,15 +397,15 @@ ACE_WFMO_Reactor_Handler_Repository::remove_suspended_handler_i (size_t index, } int -ACE_WFMO_Reactor_Handler_Repository::remove_to_be_added_handler_i (size_t index, +ACE_WFMO_Reactor_Handler_Repository::remove_to_be_added_handler_i (size_t slot, ACE_Reactor_Mask to_be_removed_masks) { // I/O entries - if (this->to_be_added_info_[index].io_entry_) + if (this->to_be_added_info_[slot].io_entry_) { // See if there are other events that the <Event_Handler> is // interested in - this->bit_ops (this->to_be_added_info_[index].network_events_, + this->bit_ops (this->to_be_added_info_[slot].network_events_, to_be_removed_masks, ACE_Reactor::CLR_MASK); @@ -414,9 +414,9 @@ ACE_WFMO_Reactor_Handler_Repository::remove_to_be_added_handler_i (size_t index, // events that the <event_handler> is interested in. I don't // think we can do anything about errors here, so I will not // check this. - ::WSAEventSelect ((SOCKET) this->to_be_added_info_[index].io_handle_, - this->to_be_added_info_[index].event_handle_, - this->to_be_added_info_[index].network_events_); + ::WSAEventSelect ((SOCKET) this->to_be_added_info_[slot].io_handle_, + this->to_be_added_info_[slot].event_handle_, + this->to_be_added_info_[slot].network_events_); } // Normal event entries. else @@ -432,12 +432,12 @@ ACE_WFMO_Reactor_Handler_Repository::remove_to_be_added_handler_i (size_t index, // If there are no more events that the <Event_Handler> is // interested in, or this is a non-I/O entry, schedule the // <Event_Handler> for removal - if (this->to_be_added_info_[index].network_events_ == 0) + if (this->to_be_added_info_[slot].network_events_ == 0) { // Mark to be deleted - this->to_be_added_info_[index].delete_entry_ = 1; + this->to_be_added_info_[slot].delete_entry_ = 1; // Remember the mask - this->to_be_added_info_[index].close_masks_ = to_be_removed_masks; + this->to_be_added_info_[slot].close_masks_ = to_be_removed_masks; // Increment the handle count this->handles_to_be_deleted_++; } @@ -451,8 +451,8 @@ ACE_WFMO_Reactor_Handler_Repository::remove_to_be_added_handler_i (size_t index, // if (ACE_BIT_ENABLED (to_be_removed_masks, ACE_Event_Handler::DONT_CALL) == 0) { - ACE_HANDLE handle = this->to_be_added_info_[index].io_handle_; - this->to_be_added_info_[index].event_handler_->handle_close (handle, + ACE_HANDLE handle = this->to_be_added_info_[slot].io_handle_; + this->to_be_added_info_[slot].event_handler_->handle_close (handle, to_be_removed_masks); } } @@ -645,11 +645,11 @@ ACE_WFMO_Reactor_Handler_Repository::make_changes_in_current_infos (void) // have been schedule for deletion if (this->handles_to_be_deleted_ > 0 || this->handles_to_be_suspended_ > 0) { - // This will help us in keeping track of the last valid index in the + // This will help us in keeping track of the last valid slot in the // handle arrays - int last_valid_index = this->max_handlep1_ - 1; + int last_valid_slot = this->max_handlep1_ - 1; - for (int i = last_valid_index; i >= 0; i--) + for (int i = last_valid_slot; i >= 0; i--) { // This stuff is necessary here, since we should not make // the upcall until all the internal data structures have @@ -706,7 +706,7 @@ ACE_WFMO_Reactor_Handler_Repository::make_changes_in_current_infos (void) // If so we need to clean up if (this->current_info_[i].delete_entry_ || this->current_info_[i].suspend_entry_) { - if (i == last_valid_index) + if (i == last_valid_slot) // If this is the last handle in the set, no need to swap // places. Simply remove it. { @@ -718,15 +718,15 @@ ACE_WFMO_Reactor_Handler_Repository::make_changes_in_current_infos (void) // Swap this handle with the last valid handle { // Struct copy - this->current_info_[i] = this->current_info_[last_valid_index]; - this->current_handles_[i] = this->current_handles_[last_valid_index]; + this->current_info_[i] = this->current_info_[last_valid_slot]; + this->current_handles_[i] = this->current_handles_[last_valid_slot]; // Reset the info in the last slot - this->current_info_[last_valid_index].reset (); - this->current_handles_[last_valid_index] = ACE_INVALID_HANDLE; + this->current_info_[last_valid_slot].reset (); + this->current_handles_[last_valid_slot] = ACE_INVALID_HANDLE; } - // Reset the last valid index and clean up the entry in the + // Reset the last valid slot and clean up the entry in the // <to_be_deleted_set_> - last_valid_index--; + last_valid_slot--; } // Now that all internal structures have been updated, make @@ -735,7 +735,7 @@ ACE_WFMO_Reactor_Handler_Repository::make_changes_in_current_infos (void) event_handler->handle_close (handle, masks); } // Reset <this->max_handlep1_> - this->max_handlep1_ = last_valid_index + 1; + this->max_handlep1_ = last_valid_slot + 1; } return 0; @@ -749,8 +749,8 @@ ACE_WFMO_Reactor_Handler_Repository::make_changes_in_suspension_infos (void) // Go through the <suspended_handle> array if (this->handles_to_be_deleted_ > 0 || this->handles_to_be_resumed_ > 0) { - int last_valid_index = this->suspended_handles_ - 1; - for (i = last_valid_index; i >= 0; i--) + int last_valid_slot = this->suspended_handles_ - 1; + for (i = last_valid_slot; i >= 0; i--) { // This stuff is necessary here, since we should not make // the upcall until all the internal data structures have @@ -807,17 +807,17 @@ ACE_WFMO_Reactor_Handler_Repository::make_changes_in_suspension_infos (void) this->current_suspended_info_[i].delete_entry_) { // Is this the last entry - if (i == last_valid_index) + if (i == last_valid_slot) // Reset the <suspended> arrays entries this->current_suspended_info_[i].reset (); else { // Struct copy - this->current_suspended_info_[i] = this->current_suspended_info_[last_valid_index]; - this->current_suspended_info_[last_valid_index].reset (); + this->current_suspended_info_[i] = this->current_suspended_info_[last_valid_slot]; + this->current_suspended_info_[last_valid_slot].reset (); } // Reduce the number of suspended handles - last_valid_index--; + last_valid_slot--; } // Now that all internal structures have been updated, make @@ -827,7 +827,7 @@ ACE_WFMO_Reactor_Handler_Repository::make_changes_in_suspension_infos (void) } // Reset <this->suspended_handles_> - this->suspended_handles_ = last_valid_index + 1; + this->suspended_handles_ = last_valid_slot + 1; } return 0; @@ -1498,10 +1498,10 @@ ACE_WFMO_Reactor::wait_for_multiple_events (int timeout, } DWORD -ACE_WFMO_Reactor::poll_remaining_handles (size_t index) +ACE_WFMO_Reactor::poll_remaining_handles (size_t slot) { - return ::WaitForMultipleObjects (this->handler_rep_.max_handlep1 () - index, - this->handler_rep_.handles () + index, + return ::WaitForMultipleObjects (this->handler_rep_.max_handlep1 () - slot, + this->handler_rep_.handles () + slot, FALSE, 0); } @@ -1563,15 +1563,15 @@ ACE_WFMO_Reactor::dispatch (int wait_status) } } -// Dispatches any active handles from <handles_[index]> to +// Dispatches any active handles from <handles_[slot]> to // <handles_[max_handlep1_]>, polling through our handle set looking // for active handles. int ACE_WFMO_Reactor::dispatch_handles (size_t wait_status) { - // dispatch_index is the absolute index. Only += is used to + // dispatch_slot is the absolute slot. Only += is used to // increment it. - size_t dispatch_index = 0; + size_t dispatch_slot = 0; // Cache this value, this is the absolute value. size_t max_handlep1 = this->handler_rep_.max_handlep1 (); @@ -1592,27 +1592,27 @@ ACE_WFMO_Reactor::dispatch_handles (size_t wait_status) #endif wait_status <= (WAIT_OBJECT_0 + nCount)); if (ok) - dispatch_index += wait_status - WAIT_OBJECT_0; + dispatch_slot += wait_status - WAIT_OBJECT_0; else // Otherwise, a handle was abandoned. - dispatch_index += wait_status - WAIT_ABANDONED_0; + dispatch_slot += wait_status - WAIT_ABANDONED_0; // Dispatch handler - if (this->dispatch_handler (dispatch_index, max_handlep1) == -1) + if (this->dispatch_handler (dispatch_slot, max_handlep1) == -1) return -1; - // Increment index - dispatch_index++; + // Increment slot + dispatch_slot++; // We're done. - if (dispatch_index >= max_handlep1) + if (dispatch_slot >= max_handlep1) return number_of_handlers_dispatched; // Readjust nCount - nCount = max_handlep1 - dispatch_index; + nCount = max_handlep1 - dispatch_slot; // Check the remaining handles - wait_status = this->poll_remaining_handles (dispatch_index); + wait_status = this->poll_remaining_handles (dispatch_slot); switch (wait_status) { case WAIT_FAILED: // Failure. @@ -1626,29 +1626,29 @@ ACE_WFMO_Reactor::dispatch_handles (size_t wait_status) } int -ACE_WFMO_Reactor::dispatch_handler (size_t index, +ACE_WFMO_Reactor::dispatch_handler (size_t slot, size_t max_handlep1) { // Check if there are window messages that need to be dispatched - if (index == max_handlep1) + if (slot == max_handlep1) return this->dispatch_window_messages (); else { // Dispatch the handler if it has not been scheduled for deletion. // Note that this is a very week test if there are multiple threads - // dispatching this index as no locks are held here. Generally, you + // dispatching this slot as no locks are held here. Generally, you // do not want to do something like deleting the this pointer in // handle_close() if you have registered multiple times and there is // more than one thread in WFMO_Reactor->handle_events(). - if (!this->handler_rep_.scheduled_for_deletion (index)) + if (!this->handler_rep_.scheduled_for_deletion (slot)) { - ACE_HANDLE event_handle = *(this->handler_rep_.handles () + index); + ACE_HANDLE event_handle = *(this->handler_rep_.handles () + slot); - if (this->handler_rep_.current_info ()[index].io_entry_) - return this->complex_dispatch_handler (index, event_handle); + if (this->handler_rep_.current_info ()[slot].io_entry_) + return this->complex_dispatch_handler (slot, event_handle); else - return this->simple_dispatch_handler (index, event_handle); + return this->simple_dispatch_handler (slot, event_handle); } else // The handle was scheduled for deletion, so we will skip it. @@ -1657,7 +1657,7 @@ ACE_WFMO_Reactor::dispatch_handler (size_t index, } int -ACE_WFMO_Reactor::simple_dispatch_handler (int index, +ACE_WFMO_Reactor::simple_dispatch_handler (int slot, ACE_HANDLE event_handle) { // This dispatch is used for non-I/O entires @@ -1665,7 +1665,7 @@ ACE_WFMO_Reactor::simple_dispatch_handler (int index, // Assign the ``signaled'' HANDLE so that callers can get it. siginfo_t sig (event_handle); - ACE_Event_Handler *eh = this->handler_rep_.current_info ()[index].event_handler_; + ACE_Event_Handler *eh = this->handler_rep_.current_info ()[slot].event_handler_; // Upcall if (eh->handle_signal (0, &sig) == -1) @@ -1675,13 +1675,13 @@ ACE_WFMO_Reactor::simple_dispatch_handler (int index, } int -ACE_WFMO_Reactor::complex_dispatch_handler (int index, +ACE_WFMO_Reactor::complex_dispatch_handler (int slot, ACE_HANDLE event_handle) { // This dispatch is used for I/O entires ACE_WFMO_Reactor_Handler_Repository::Current_Info ¤t_info = - this->handler_rep_.current_info ()[index]; + this->handler_rep_.current_info ()[slot]; // Upcall ACE_Reactor_Mask problems = this->upcall (current_info.event_handler_, diff --git a/ace/WFMO_Reactor.h b/ace/WFMO_Reactor.h index f27b2486441..38ceb25ca24 100644 --- a/ace/WFMO_Reactor.h +++ b/ace/WFMO_Reactor.h @@ -295,8 +295,8 @@ public: virtual int make_changes (void); // Make changes to the handle set - int scheduled_for_deletion (size_t index) const; - // Check to see if <index> has been scheduled for deletion + int scheduled_for_deletion (size_t slot) const; + // Check to see if <slot> has been scheduled for deletion int modify_network_events_i (ACE_HANDLE io_handle, ACE_Reactor_Mask new_masks, @@ -334,17 +334,17 @@ public: // Deletions in to_be_added_info_, or transfers to current_info_ or // current_suspended_info_ from to_be_added_info_ - int remove_handler_i (size_t index, + int remove_handler_i (size_t slot, ACE_Reactor_Mask mask); - // Removes the <ACE_Event_Handler> at <index> from the table. + // Removes the <ACE_Event_Handler> at <slot> from the table. - int remove_suspended_handler_i (size_t index, + int remove_suspended_handler_i (size_t slot, ACE_Reactor_Mask mask); - // Removes the <ACE_Event_Handler> at <index> from the table. + // Removes the <ACE_Event_Handler> at <slot> from the table. - int remove_to_be_added_handler_i (size_t index, + int remove_to_be_added_handler_i (size_t slot, ACE_Reactor_Mask to_be_removed_masks); - // Removes the <ACE_Event_Handler> at <index> from the table. + // Removes the <ACE_Event_Handler> at <slot> from the table. void dump (void) const; // Dump the state of an object. @@ -934,7 +934,7 @@ protected: int alertable); // Wait for timer and I/O events to occur. - virtual DWORD poll_remaining_handles (size_t index); + virtual DWORD poll_remaining_handles (size_t slot); // Check for activity on remaining handles. virtual int expire_timers (void); @@ -948,22 +948,22 @@ protected: // Protect against structured exceptions caused by user code when // dispatching handles - virtual int dispatch_handles (size_t index); - // Dispatches any active handles from handles_[<index>] to + virtual int dispatch_handles (size_t slot); + // Dispatches any active handles from handles_[<slot>] to // handles_[active_handles_] using <WaitForMultipleObjects> to poll // through our handle set looking for active handles. - virtual int dispatch_handler (size_t index, + virtual int dispatch_handler (size_t slot, size_t max_handlep1); // Dispatches a single handler. Returns 0 on success, -1 if the // handler was removed. - virtual int simple_dispatch_handler (int index, + virtual int simple_dispatch_handler (int slot, ACE_HANDLE event_handle); // Dispatches a single handler. Returns 0 on success, -1 if the // handler was removed. - virtual int complex_dispatch_handler (int index, + virtual int complex_dispatch_handler (int slot, ACE_HANDLE event_handle); // Dispatches a single handler. Returns 0 on success, -1 if the // handler was removed. diff --git a/ace/WFMO_Reactor.i b/ace/WFMO_Reactor.i index d0c51c64a5a..ec27a225fb6 100644 --- a/ace/WFMO_Reactor.i +++ b/ace/WFMO_Reactor.i @@ -355,12 +355,12 @@ ACE_WFMO_Reactor_Handler_Repository::max_handlep1 (void) const } ACE_INLINE int -ACE_WFMO_Reactor_Handler_Repository::scheduled_for_deletion (size_t index) const +ACE_WFMO_Reactor_Handler_Repository::scheduled_for_deletion (size_t slot) const { if (ACE_Thread::self () == this->wfmo_reactor_.owner_i ()) - return this->current_info_[index].delete_entry_ == 1; + return this->current_info_[slot].delete_entry_ == 1; else - return this->current_info_[index + 1].delete_entry_ == 1; + return this->current_info_[slot + 1].delete_entry_ == 1; } ACE_INLINE int |