From f09e17c3c564e8310125a10c03397cbf473ff643 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Wed, 1 Jul 2020 18:03:10 +0200 Subject: Remove $Id$ tags, update URL's, and more - remove obsolete svn '$Id$' tags from all source files - update .fl files and generated files accordingly - replace 'http://www.fltk.org' URL's with 'https://...' - replace bug report URL 'str.php' with 'bugs.php' - remove trailing whitespace - fix other whitespace errors flagged by Git - add and/or fix missing or wrong standard headers - convert tabs to spaces in all source files The only relevant code changes are in the fluid/ folder where some .fl files and other source files were used to generate the '$Id' headers and footers. --- src/Fl_Tree_Item_Array.cxx | 54 +++++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 30 deletions(-) (limited to 'src/Fl_Tree_Item_Array.cxx') diff --git a/src/Fl_Tree_Item_Array.cxx b/src/Fl_Tree_Item_Array.cxx index 0503a8000..dca358288 100644 --- a/src/Fl_Tree_Item_Array.cxx +++ b/src/Fl_Tree_Item_Array.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// #include #include @@ -20,18 +18,18 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// http://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /// Constructor; creates an empty array. /// /// The optional 'chunksize' can be specified to optimize /// memory allocation for potentially large arrays. Default chunksize is 10. -/// +/// Fl_Tree_Item_Array::Fl_Tree_Item_Array(int new_chunksize) { _items = 0; _total = 0; @@ -54,11 +52,11 @@ Fl_Tree_Item_Array::Fl_Tree_Item_Array(const Fl_Tree_Item_Array* o) { _flags = o->_flags; for ( int t=0; t_total; t++ ) { if ( _flags & MANAGE_ITEM ) { - _items[t] = new Fl_Tree_Item(o->_items[t]); // make new copy of item + _items[t] = new Fl_Tree_Item(o->_items[t]); // make new copy of item ++_total; - _items[t]->update_prev_next(t); // update uses _total's current value + _items[t]->update_prev_next(t); // update uses _total's current value } else { - _items[t] = o->_items[t]; // copy ptr only + _items[t] = o->_items[t]; // copy ptr only ++_total; } } @@ -75,7 +73,7 @@ void Fl_Tree_Item_Array::clear() { if ( _flags & MANAGE_ITEM ) { delete _items[t]; - _items[t] = 0; + _items[t] = 0; } } free((void*)_items); _items = 0; @@ -89,13 +87,13 @@ void Fl_Tree_Item_Array::clear() { // Does NOT change total. // void Fl_Tree_Item_Array::enlarge(int count) { - int newtotal = _total + count; // new total - if ( newtotal >= _size ) { // more than we have allocated? + int newtotal = _total + count; // new total + if ( newtotal >= _size ) { // more than we have allocated? if ( (newtotal/150) > _chunksize ) _chunksize *= 10; // Increase size of array int newsize = _size + _chunksize; Fl_Tree_Item **newitems = (Fl_Tree_Item**)malloc(newsize * sizeof(Fl_Tree_Item*)); - if ( _items ) { + if ( _items ) { // Copy old array -> new, delete old memmove(newitems, _items, _size * sizeof(Fl_Tree_Item*)); free((void*)_items); _items = 0; @@ -119,15 +117,15 @@ void Fl_Tree_Item_Array::insert(int pos, Fl_Tree_Item *new_item) { pos = _total; enlarge(1); // printf("*** POS=%d TOTAL-1=%d NITEMS=%d\n", pos, _total-1, (_total-pos)); - if ( pos <= (_total - 1) ) { // need to move memory around? + if ( pos <= (_total - 1) ) { // need to move memory around? int nitems = _total - pos; memmove(&_items[pos+1], &_items[pos], sizeof(Fl_Tree_Item*) * nitems); - } + } _items[pos] = new_item; _total++; if ( _flags & MANAGE_ITEM ) { - _items[pos]->update_prev_next(pos); // adjust item's prev/next and its neighbors + _items[pos]->update_prev_next(pos); // adjust item's prev/next and its neighbors } } @@ -147,12 +145,12 @@ void Fl_Tree_Item_Array::add(Fl_Tree_Item *val) { /// and the new item will take it's place, and stitched into the linked list. /// void Fl_Tree_Item_Array::replace(int index, Fl_Tree_Item *newitem) { - if ( _items[index] ) { // delete if non-zero + if ( _items[index] ) { // delete if non-zero if ( _flags & MANAGE_ITEM ) // Destroy old item delete _items[index]; } - _items[index] = newitem; // install new item + _items[index] = newitem; // install new item if ( _flags & MANAGE_ITEM ) { // Restitch into linked list @@ -165,21 +163,21 @@ void Fl_Tree_Item_Array::replace(int index, Fl_Tree_Item *newitem) { /// The item will be delete'd (if non-NULL), so its destructor will be called. /// void Fl_Tree_Item_Array::remove(int index) { - if ( _items[index] ) { // delete if non-zero + if ( _items[index] ) { // delete if non-zero if ( _flags & MANAGE_ITEM ) delete _items[index]; } _items[index] = 0; _total--; - for ( int i=index; i<_total; i++ ) { // reshuffle the array + for ( int i=index; i<_total; i++ ) { // reshuffle the array _items[i] = _items[i+1]; } if ( _flags & MANAGE_ITEM ) { - if ( index < _total ) { // removed item not last? - _items[index]->update_prev_next(index); // update next item's prev/next and neighbors - } else if ( ((index-1) >= 0) && // removed item IS last? - ((index-1) < _total)) { + if ( index < _total ) { // removed item not last? + _items[index]->update_prev_next(index); // update next item's prev/next and neighbors + } else if ( ((index-1) >= 0) && // removed item IS last? + ((index-1) < _total)) { _items[index-1]->update_prev_next(index-1);// update prev item's prev/next and neighbors } } @@ -234,8 +232,8 @@ int Fl_Tree_Item_Array::move(int to, int from) { // Move to new position _items[to] = item; // Update all children - for ( int r=0; r<_total; r++ ) // XXX: excessive to do all children, - _items[r]->update_prev_next(r); // XXX: but avoids weird boundary issues + for ( int r=0; r<_total; r++ ) // XXX: excessive to do all children, + _items[r]->update_prev_next(r); // XXX: but avoids weird boundary issues return 0; } @@ -282,7 +280,3 @@ int Fl_Tree_Item_Array::reparent(Fl_Tree_Item *item, Fl_Tree_Item* newparent, in _items[pos]->update_prev_next(pos); // find new siblings return 0; } - -// -// End of "$Id$". -// -- cgit v1.2.3