Skip to content

Commit 9324acc

Browse files
mpictortpaviot
authored andcommitted
remove some commented-out code in clutils
1 parent 89237b8 commit 9324acc

File tree

2 files changed

+1
-65
lines changed

2 files changed

+1
-65
lines changed

src/clutils/dirobj.cc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,6 @@ void * memmove(void *__s1, const void *__s2, size_t __n);
6363
}
6464
#endif
6565

66-
//#ifdef __OBJECTCENTER__
67-
//extern "C"
68-
//{
69-
//void * memmove(void *__s1, const void *__s2, size_t __n);
70-
//}
71-
//#endif
72-
7366
///////////////////////////////////////////////////////////////////////////////
7467
//
7568
// Create a new DirObj object.
@@ -332,8 +325,6 @@ const char* DirObj::ElimDot (const char* path) {
332325
//
333326
///////////////////////////////////////////////////////////////////////////////
334327

335-
//static boolean CollapsedDotDotSlash (const char* path, const char*& start) {
336-
// Josh L, 5/2/95
337328
static boolean CollapsedDotDotSlash (const char* path, const char* start) {
338329
// fail if 'start' is at beginning of path (there is no path) or
339330
// if no directory is before start (no '/' before '../')

src/clutils/gennodearray.cc

Lines changed: 1 addition & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,7 @@
2222

2323
#ifndef HAVE_MEMMOVE
2424
extern "C" {
25-
//#ifdef __OSTORE__
26-
//#include <memory.h>
27-
//#else
2825
extern void * memmove(void *, const void *, size_t);
29-
/* extern char * memset(char *, int, int); */
30-
//#endif
3126
}
3227
#endif
3328

@@ -42,36 +37,16 @@ GenericNode::~GenericNode()
4237
Remove();
4338
}
4439

45-
//#ifdef __OSTORE__
46-
//GenNodeArray::GenNodeArray (os_database *db, int defaultSize)
47-
//#else
4840
GenNodeArray::GenNodeArray (int defaultSize)
49-
//#endif
5041
{
5142
_bufsize = defaultSize;
52-
/*
53-
#ifdef __OSTORE__
54-
{
55-
os_typespec tmp_ts("GenericNode*");
56-
_buf = new (os_segment::of(this), &tmp_ts, _bufsize)
57-
GenericNode*[_bufsize];
58-
}
59-
#else
60-
*/
6143
_buf = new GenericNode*[_bufsize];
62-
//#endif
6344
memset(_buf, 0, _bufsize*sizeof(GenericNode*));
6445
_count = 0;
6546
}
6647

6748
GenNodeArray::~GenNodeArray ()
6849
{
69-
70-
// int i;
71-
// this is dangerous because several things point at these nodes
72-
// also whatever is derived from this thing might do this
73-
// for(i = 0; i < _count; i++)
74-
// delete _buf[i];
7550
delete [] _buf;
7651
}
7752

@@ -98,27 +73,11 @@ GenNodeArray::Check (int index)
9873
if (index >= _bufsize) {
9974
int oldBufSize = _bufsize;
10075
_bufsize = (index+1) * 2;
101-
/*
102-
#ifdef __OSTORE__
103-
{
104-
os_typespec tmp_ts("GenericNode*");
105-
newbuf = new (os_segment::of(this), &tmp_ts, _bufsize)
106-
GenericNode*[_bufsize];
107-
}
108-
#else
109-
*/
11076
newbuf = new GenericNode*[_bufsize];
111-
//#endif
11277

11378

11479
memset(newbuf, 0, _bufsize);
115-
// memset(newbuf[oldBufSize], 0,
116-
// (_bufsize - oldBufSize)*sizeof(GenericNode*) );
117-
// bcopy(_buf, newbuf, _count*sizeof(GenericNode*));
118-
// Josh L, 5/2/95
119-
// memcpy(newbuf, _buf, _count*sizeof(GenericNode*));
120-
// Dave memcpy is not working since memory areas overlap
121-
memmove(newbuf, _buf, _count*sizeof(GenericNode*));
80+
memmove(newbuf, _buf, _count*sizeof(GenericNode*));
12281
delete [] _buf;
12382
_buf = newbuf;
12483
}
@@ -133,10 +92,6 @@ GenNodeArray::Insert (GenericNode* gn, int index)
13392
if (index < _count) {
13493
Check(_count+1);
13594
spot = (const GenericNode**)&_buf[index];
136-
// bcopy(spot, spot+1, (_count - index)*sizeof(GenericNode*));
137-
// Josh L, 5/2/95
138-
// memcpy(spot+1, spot, (_count - index)*sizeof(GenericNode*));
139-
// Dave memcpy is not working since memory areas overlap
14095
memmove(spot+1, spot, (_count - index)*sizeof(GenericNode*));
14196

14297
} else {
@@ -154,19 +109,13 @@ GenNodeArray::Remove (int index)
154109
if (0 <= index && index < _count) {
155110
--_count;
156111
const GenericNode** spot = (const GenericNode**)&_buf[index];
157-
// bcopy(spot+1, spot, (_count - index)*sizeof(GenericNode*));
158-
// Josh L, 5/2/95
159-
// memcpy(spot, spot+1, (_count - index)*sizeof(GenericNode*));
160-
// Dave memcpy is not working since memory areas overlap
161112
memmove(spot, spot+1, (_count - index)*sizeof(GenericNode*));
162113
_buf[_count] = 0;
163114
}
164115
}
165116

166117
void GenNodeArray::ClearEntries ()
167118
{
168-
// if(debug_level >= PrintFunctionTrace)
169-
// cout << "GenNodeArray::Clear()\n";
170119
int i;
171120
for(i = 0 ; i < _count; i++)
172121
_buf[i] = 0;
@@ -175,8 +124,6 @@ void GenNodeArray::ClearEntries ()
175124

176125
void GenNodeArray::DeleteEntries()
177126
{
178-
// if(debug_level >= PrintFunctionTrace)
179-
// cout << "GenNodeArray::DeleteEntries()\n";
180127
int i;
181128
for(i = 0 ; i < _count; i++)
182129
delete (_buf[i]);
@@ -186,8 +133,6 @@ void GenNodeArray::DeleteEntries()
186133

187134
int GenNodeArray::Index (GenericNode* gn)
188135
{
189-
// if(debug_level >= PrintFunctionTrace)
190-
// cout << "GenNodeArray::Index()\n";
191136
for (int i = 0; i < _count; ++i) {
192137
if (_buf[i] == gn) {
193138
return i;

0 commit comments

Comments
 (0)