remove some commented-out code in clutils

This commit is contained in:
Mark Pictor
2011-07-31 23:31:08 +02:00
committed by tpaviot
parent 89237b884c
commit 9324acc965
2 changed files with 1 additions and 65 deletions
-9
View File
@@ -63,13 +63,6 @@ void * memmove(void *__s1, const void *__s2, size_t __n);
}
#endif
//#ifdef __OBJECTCENTER__
//extern "C"
//{
//void * memmove(void *__s1, const void *__s2, size_t __n);
//}
//#endif
///////////////////////////////////////////////////////////////////////////////
//
// Create a new DirObj object.
@@ -332,8 +325,6 @@ const char* DirObj::ElimDot (const char* path) {
//
///////////////////////////////////////////////////////////////////////////////
//static boolean CollapsedDotDotSlash (const char* path, const char*& start) {
// Josh L, 5/2/95
static boolean CollapsedDotDotSlash (const char* path, const char* start) {
// fail if 'start' is at beginning of path (there is no path) or
// if no directory is before start (no '/' before '../')
+1 -56
View File
@@ -22,12 +22,7 @@
#ifndef HAVE_MEMMOVE
extern "C" {
//#ifdef __OSTORE__
//#include <memory.h>
//#else
extern void * memmove(void *, const void *, size_t);
/* extern char * memset(char *, int, int); */
//#endif
}
#endif
@@ -42,36 +37,16 @@ GenericNode::~GenericNode()
Remove();
}
//#ifdef __OSTORE__
//GenNodeArray::GenNodeArray (os_database *db, int defaultSize)
//#else
GenNodeArray::GenNodeArray (int defaultSize)
//#endif
{
_bufsize = defaultSize;
/*
#ifdef __OSTORE__
{
os_typespec tmp_ts("GenericNode*");
_buf = new (os_segment::of(this), &tmp_ts, _bufsize)
GenericNode*[_bufsize];
}
#else
*/
_buf = new GenericNode*[_bufsize];
//#endif
memset(_buf, 0, _bufsize*sizeof(GenericNode*));
_count = 0;
}
GenNodeArray::~GenNodeArray ()
{
// int i;
// this is dangerous because several things point at these nodes
// also whatever is derived from this thing might do this
// for(i = 0; i < _count; i++)
// delete _buf[i];
delete [] _buf;
}
@@ -98,27 +73,11 @@ GenNodeArray::Check (int index)
if (index >= _bufsize) {
int oldBufSize = _bufsize;
_bufsize = (index+1) * 2;
/*
#ifdef __OSTORE__
{
os_typespec tmp_ts("GenericNode*");
newbuf = new (os_segment::of(this), &tmp_ts, _bufsize)
GenericNode*[_bufsize];
}
#else
*/
newbuf = new GenericNode*[_bufsize];
//#endif
memset(newbuf, 0, _bufsize);
// memset(newbuf[oldBufSize], 0,
// (_bufsize - oldBufSize)*sizeof(GenericNode*) );
// bcopy(_buf, newbuf, _count*sizeof(GenericNode*));
// Josh L, 5/2/95
// memcpy(newbuf, _buf, _count*sizeof(GenericNode*));
// Dave memcpy is not working since memory areas overlap
memmove(newbuf, _buf, _count*sizeof(GenericNode*));
memmove(newbuf, _buf, _count*sizeof(GenericNode*));
delete [] _buf;
_buf = newbuf;
}
@@ -133,10 +92,6 @@ GenNodeArray::Insert (GenericNode* gn, int index)
if (index < _count) {
Check(_count+1);
spot = (const GenericNode**)&_buf[index];
// bcopy(spot, spot+1, (_count - index)*sizeof(GenericNode*));
// Josh L, 5/2/95
// memcpy(spot+1, spot, (_count - index)*sizeof(GenericNode*));
// Dave memcpy is not working since memory areas overlap
memmove(spot+1, spot, (_count - index)*sizeof(GenericNode*));
} else {
@@ -154,10 +109,6 @@ GenNodeArray::Remove (int index)
if (0 <= index && index < _count) {
--_count;
const GenericNode** spot = (const GenericNode**)&_buf[index];
// bcopy(spot+1, spot, (_count - index)*sizeof(GenericNode*));
// Josh L, 5/2/95
// memcpy(spot, spot+1, (_count - index)*sizeof(GenericNode*));
// Dave memcpy is not working since memory areas overlap
memmove(spot, spot+1, (_count - index)*sizeof(GenericNode*));
_buf[_count] = 0;
}
@@ -165,8 +116,6 @@ GenNodeArray::Remove (int index)
void GenNodeArray::ClearEntries ()
{
// if(debug_level >= PrintFunctionTrace)
// cout << "GenNodeArray::Clear()\n";
int i;
for(i = 0 ; i < _count; i++)
_buf[i] = 0;
@@ -175,8 +124,6 @@ void GenNodeArray::ClearEntries ()
void GenNodeArray::DeleteEntries()
{
// if(debug_level >= PrintFunctionTrace)
// cout << "GenNodeArray::DeleteEntries()\n";
int i;
for(i = 0 ; i < _count; i++)
delete (_buf[i]);
@@ -186,8 +133,6 @@ void GenNodeArray::DeleteEntries()
int GenNodeArray::Index (GenericNode* gn)
{
// if(debug_level >= PrintFunctionTrace)
// cout << "GenNodeArray::Index()\n";
for (int i = 0; i < _count; ++i) {
if (_buf[i] == gn) {
return i;