summaryrefslogtreecommitdiffhomepage
path: root/FoundationEx
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-01-30 17:41:24 +0100
committerAki <please@ignore.pl>2022-01-30 17:41:24 +0100
commit51657e10769faa2617d546a06c42e4c62a19bb50 (patch)
tree688ad8b61ac02e50974684b9b7d3f886fb469e5f /FoundationEx
parentdb987e23d5dd33a5db8764743facbb906ac22b0f (diff)
downloadstarshatter-51657e10769faa2617d546a06c42e4c62a19bb50.zip
starshatter-51657e10769faa2617d546a06c42e4c62a19bb50.tar.gz
starshatter-51657e10769faa2617d546a06c42e4c62a19bb50.tar.bz2
Removed trailing whitespace all over the place
Diffstat (limited to 'FoundationEx')
-rw-r--r--FoundationEx/Dictionary.h10
-rw-r--r--FoundationEx/Dictionary.inl6
-rw-r--r--FoundationEx/List.inl6
-rw-r--r--FoundationEx/MemDebug.cpp32
-rw-r--r--FoundationEx/Text.cpp12
-rw-r--r--FoundationEx/Text.h16
-rw-r--r--FoundationEx/ThreadSync.h4
7 files changed, 43 insertions, 43 deletions
diff --git a/FoundationEx/Dictionary.h b/FoundationEx/Dictionary.h
index cfbaab9..0e0c057 100644
--- a/FoundationEx/Dictionary.h
+++ b/FoundationEx/Dictionary.h
@@ -54,7 +54,7 @@ template <class T> class Dictionary
public:
Dictionary();
~Dictionary();
-
+
T& operator[](const Text& key);
void insert(const Text& key, const T& val);
@@ -64,18 +64,18 @@ public:
int size() const { return items; }
int isEmpty() const { return !items; }
-
+
int contains(const Text& key) const;
T find(const Text& key, T defval) const;
-
+
private:
void init();
int items;
-
+
typedef DictionaryCell<T>* PTR;
PTR table[256];
-
+
friend class DictionaryIter<T>;
};
diff --git a/FoundationEx/Dictionary.inl b/FoundationEx/Dictionary.inl
index 1f32b9a..d419cf0 100644
--- a/FoundationEx/Dictionary.inl
+++ b/FoundationEx/Dictionary.inl
@@ -96,7 +96,7 @@ T& Dictionary<T>::operator[](const Text& key)
#endif
table[idx] = cell;
-
+
return cell->value;
}
else { // search for key
@@ -178,7 +178,7 @@ int Dictionary<T>::contains(const Text& key) const
if (cell->key == key)
return 1;
}
-
+
return 0;
}
@@ -259,7 +259,7 @@ void DictionaryIter<T>::forth()
chain++;
if (chain < CHAINS)
- here = dict->table[chain];
+ here = dict->table[chain];
else
here = 0;
}
diff --git a/FoundationEx/List.inl b/FoundationEx/List.inl
index 7f552c4..c4fe66c 100644
--- a/FoundationEx/List.inl
+++ b/FoundationEx/List.inl
@@ -161,7 +161,7 @@ void List<T>::resize(int newsize)
for (; i < extent; i++)
v[i] = 0;
- delete [] array;
+ delete [] array;
array = v;
}
}
@@ -196,7 +196,7 @@ void List<T>::insert(const T* item, int index)
{
if (item && index >= 0 && index <= items) {
if (items+1 > extent) resize(items+1);
-
+
// slide right:
for (int i = items; i > index; i--)
array[i] = array[i-1];
@@ -235,7 +235,7 @@ T* List<T>::remove(const T* val)
return removeIndex(i);
}
}
-
+
return 0;
}
diff --git a/FoundationEx/MemDebug.cpp b/FoundationEx/MemDebug.cpp
index 060df5a..3c71b2c 100644
--- a/FoundationEx/MemDebug.cpp
+++ b/FoundationEx/MemDebug.cpp
@@ -68,12 +68,12 @@ static HANDLE mem_log_file = 0;
#ifndef _DEBUG
void* __cdecl operator new(unsigned int s, const char*, int)
-{
+{
return ::operator new(s);
}
void __cdecl operator delete(void* p, const char*, int)
-{
+{
::operator delete(p);
}
@@ -95,7 +95,7 @@ void* __cdecl operator new[](unsigned int s, const char*, int)
}
void* __cdecl operator new(unsigned int s, const char*, int)
-{
+{
return ::operator new(s);
}
@@ -105,7 +105,7 @@ void __cdecl operator delete[](void* p, const char*, int)
}
void __cdecl operator delete(void* p, const char*, int)
-{
+{
::operator delete(p);
}
@@ -152,7 +152,7 @@ static void heapdump()
char report[256];
hinfo._pentry = NULL;
- while ((heapstatus = _heapwalk( &hinfo )) == _HEAPOK) {
+ while ((heapstatus = _heapwalk( &hinfo )) == _HEAPOK) {
sprintf_s(report, "%6s block at %Fp of size %4.4X\n",
( hinfo._useflag == _USEDENTRY ? "USED" : "FREE" ),
hinfo._pentry, hinfo._size);
@@ -198,7 +198,7 @@ Memory::OpenLog(const char* filename)
filename = "memdbg.txt";
mem_log_file = CreateFile(filename, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0);
-
+
if (mem_log_file) {
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
_CrtSetReportFile(_CRT_WARN, mem_log_file);
@@ -229,7 +229,7 @@ Memory::CloseLog()
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDOUT);
}
-#endif
+#endif
}
// +--------------------------------------------------------------------+
@@ -245,7 +245,7 @@ Memory::Check()
_asm { int 3 }
exit(1111);
}
-#endif
+#endif
}
// +--------------------------------------------------------------------+
@@ -263,9 +263,9 @@ Memory::Checkpoint()
_CrtMemCheckpoint(&mem_chk_p2);
_CrtMemDifference(&s, &mem_chk_p1, &mem_chk_p2);
_CrtMemDumpStatistics(&s);
-
+
memcpy(&mem_chk_p1, &mem_chk_p2, sizeof(mem_chk_p1));
-#endif
+#endif
}
// +--------------------------------------------------------------------+
@@ -282,7 +282,7 @@ Memory::Stats()
_CrtMemState s;
_CrtMemCheckpoint(&s);
_CrtMemDumpStatistics(&s);
-#endif
+#endif
}
// +--------------------------------------------------------------------+
@@ -294,7 +294,7 @@ Memory::DumpLeaks()
_RPT0(_CRT_WARN, "\n\nMemory Dump Leaks:\n"
"--------------------------------------------------\n");
_CrtDumpMemoryLeaks();
-#endif
+#endif
}
// +--------------------------------------------------------------------+
@@ -304,17 +304,17 @@ Memory::SetLevel(LEVEL l)
{
#ifdef _DEBUG
mem_chk_level = l;
-
+
_CrtSetDbgFlag(0);
-
+
switch (mem_chk_level) {
case MAXIMAL: CrtSetDebugField(_CRTDBG_CHECK_ALWAYS_DF);
case PERIODIC: CrtSetDebugField(_CRTDBG_DELAY_FREE_MEM_DF);
case LEAKS: CrtSetDebugField(_CRTDBG_LEAK_CHECK_DF);
- case OFF:
+ case OFF:
default: break;
}
-#endif
+#endif
}
#endif
diff --git a/FoundationEx/Text.cpp b/FoundationEx/Text.cpp
index a845ca0..8a58dc4 100644
--- a/FoundationEx/Text.cpp
+++ b/FoundationEx/Text.cpp
@@ -48,7 +48,7 @@
TextRep TextRep::nullrep;
-TextRep::TextRep()
+TextRep::TextRep()
: ref(1234567), data(0), length(0), hash(0), sensitive(true)
{
#ifdef MEM_DEBUG
@@ -172,7 +172,7 @@ TextRep::dohash()
unsigned hv = (unsigned)length; // Mix in the string length.
unsigned i = length*sizeof(char)/sizeof(unsigned);
const unsigned* p = (const unsigned*)data;
-
+
while (i--)
mash(hv, *p++); // XOR in the characters.
@@ -181,7 +181,7 @@ TextRep::dohash()
if (i) {
unsigned h = 0;
const char* c = (const char*)p;
- while (i--)
+ while (i--)
h = ((h << 8*sizeof(char)) | *c++);
mash(hv, h);
}
@@ -547,7 +547,7 @@ Text::operator()(int start, int len) const
if (start + len > rep->length)
len = rep->length - start;
-#ifdef MEM_DEBUG
+#ifdef MEM_DEBUG
char* buf = new(__FILE__,__LINE__) char[len+1];
#else
char* buf = new char[len+1];
@@ -685,7 +685,7 @@ Text::toLower()
*p = tolower((unsigned char)*p);
p++;
}
-
+
rep->dohash();
}
@@ -699,7 +699,7 @@ Text::toUpper()
*p = toupper((unsigned char)*p);
p++;
}
-
+
rep->dohash();
}
diff --git a/FoundationEx/Text.h b/FoundationEx/Text.h
index 170eafe..9366812 100644
--- a/FoundationEx/Text.h
+++ b/FoundationEx/Text.h
@@ -58,7 +58,7 @@ private:
TextRep(const char* s, int len);
TextRep(char c, int len);
TextRep(const TextRep* rep);
-
+
void addref();
long deref();
@@ -69,7 +69,7 @@ private:
int length;
unsigned hash;
bool sensitive;
-
+
static ThreadSync sync;
static TextRep nullrep;
};
@@ -96,16 +96,16 @@ public:
// comparison
int compare(const char* s) const;
int compare(const Text& s) const;
-
+
// assignment
Text& operator=(const char* s);
Text& operator=(const Text& s);
-
+
// catenation
Text& append(char c);
Text& append(const char* s);
Text& append(const Text& s);
-
+
Text operator+(char c);
Text operator+(const char* s);
Text operator+(const Text& s);
@@ -119,7 +119,7 @@ public:
char operator()(int index) const;
char& operator[](int index);
char& operator()(int index);
-
+
Text operator()(int start, int len) const;
// access
@@ -128,7 +128,7 @@ public:
const char* data() const { return sym; }
operator const char* () const { return sym; }
-
+
bool contains(char c) const;
bool contains(const char* s) const;
@@ -136,7 +136,7 @@ public:
int indexOf(char c) const;
int indexOf(const char* s) const;
-
+
// mutation
void toLower();
void toUpper();
diff --git a/FoundationEx/ThreadSync.h b/FoundationEx/ThreadSync.h
index cfe7a4e..e31d05a 100644
--- a/FoundationEx/ThreadSync.h
+++ b/FoundationEx/ThreadSync.h
@@ -51,7 +51,7 @@ class ThreadSync
public:
ThreadSync() { ::InitializeCriticalSection(&sync); }
~ThreadSync() { ::DeleteCriticalSection(&sync); }
-
+
void acquire() { ::EnterCriticalSection(&sync); }
void release() { ::LeaveCriticalSection(&sync); }
@@ -60,7 +60,7 @@ public:
public:
ThreadSync() { }
~ThreadSync() { }
-
+
void acquire() { }
void release() { }