diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-26 16:50:14 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-26 16:50:14 +0000 |
commit | c992cb2fdc11f1cac4bc5cbce26e8e2bb3b57da0 (patch) | |
tree | 697bdbf38a8a1f6b828a8bfbd08a478e19a82c6b /include/m_system_cpp.h | |
parent | f616294363c642d138f9dc0ef6eceae639e2434c (diff) |
- microkernel addded;
- version bumped to 0.92.2
git-svn-id: http://svn.miranda-ng.org/main/trunk@641 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include/m_system_cpp.h')
-rw-r--r-- | include/m_system_cpp.h | 106 |
1 files changed, 27 insertions, 79 deletions
diff --git a/include/m_system_cpp.h b/include/m_system_cpp.h index c0e448fec3..086eba0fc3 100644 --- a/include/m_system_cpp.h +++ b/include/m_system_cpp.h @@ -70,59 +70,31 @@ template<class T> struct LIST __inline int getCount(void) const { return count; }
__inline T** getArray(void) const { return items; }
- #if defined(_STATIC)
- __inline LIST(const LIST& x)
- { items = NULL;
- List_Copy((SortedList*)&x, (SortedList*)this, sizeof(T));
- }
-
- __inline LIST& operator=(const LIST& x)
- { destroy();
- List_Copy((SortedList*)&x, (SortedList*)this, sizeof(T));
- return *this;
- }
-
- __inline int getIndex(T* p) const
- { int idx;
- return ( !List_GetIndex((SortedList*)this, p, &idx)) ? -1 : idx;
- }
-
- __inline void destroy(void) { List_Destroy((SortedList*)this); }
-
- __inline T* find(T* p) { return (T*)List_Find((SortedList*)this, p); }
- __inline int indexOf(T* p) { return List_IndexOf((SortedList*)this, p); }
- __inline int insert(T* p, int idx) { return List_Insert((SortedList*)this, p, idx); }
- __inline int remove(int idx) { return List_Remove((SortedList*)this, idx); }
-
- __inline int insert(T* p) { return List_InsertPtr((SortedList*)this, p); }
- __inline int remove(T* p) { return List_RemovePtr((SortedList*)this, p); }
- #else
- __inline LIST(const LIST& x)
- { items = NULL;
- li.List_Copy((SortedList*)&x, (SortedList*)this, sizeof(T));
- }
-
- __inline LIST& operator=(const LIST& x)
- { destroy();
- li.List_Copy((SortedList*)&x, (SortedList*)this, sizeof(T));
- return *this;
- }
+ __inline LIST(const LIST& x)
+ { items = NULL;
+ List_Copy((SortedList*)&x, (SortedList*)this, sizeof(T));
+ }
+
+ __inline LIST& operator=(const LIST& x)
+ { destroy();
+ List_Copy((SortedList*)&x, (SortedList*)this, sizeof(T));
+ return *this;
+ }
- __inline int getIndex(T* p) const
- { int idx;
- return ( !li.List_GetIndex((SortedList*)this, p, &idx)) ? -1 : idx;
- }
+ __inline int getIndex(T* p) const
+ { int idx;
+ return ( !List_GetIndex((SortedList*)this, p, &idx)) ? -1 : idx;
+ }
- __inline void destroy(void) { li.List_Destroy((SortedList*)this); }
+ __inline void destroy(void) { List_Destroy((SortedList*)this); }
- __inline T* find(T* p) { return (T*)li.List_Find((SortedList*)this, p); }
- __inline int indexOf(T* p) { return li.List_IndexOf((SortedList*)this, p); }
- __inline int insert(T* p, int idx) { return li.List_Insert((SortedList*)this, p, idx); }
- __inline int remove(int idx) { return li.List_Remove((SortedList*)this, idx); }
+ __inline T* find(T* p) { return (T*)List_Find((SortedList*)this, p); }
+ __inline int indexOf(T* p) { return List_IndexOf((SortedList*)this, p); }
+ __inline int insert(T* p, int idx) { return List_Insert((SortedList*)this, p, idx); }
+ __inline int remove(int idx) { return List_Remove((SortedList*)this, idx); }
- __inline int insert(T* p) { return li.List_InsertPtr((SortedList*)this, p); }
- __inline int remove(T* p) { return li.List_RemovePtr((SortedList*)this, p); }
- #endif
+ __inline int insert(T* p) { return List_InsertPtr((SortedList*)this, p); }
+ __inline int remove(T* p) { return List_RemovePtr((SortedList*)this, p); }
protected:
T** items;
@@ -145,29 +117,18 @@ template<class T> struct OBJLIST : public LIST<T> __inline OBJLIST(const OBJLIST& x) :
LIST<T>(x.increment, x.sortFunc)
{ items = NULL;
- #if defined(_STATIC)
- List_ObjCopy((SortedList*)&x, (SortedList*)this, sizeof(T));
- #else
- li.List_ObjCopy((SortedList*)&x, (SortedList*)this, sizeof(T));
- #endif
+ List_ObjCopy((SortedList*)&x, (SortedList*)this, sizeof(T));
}
__inline OBJLIST& operator=(const OBJLIST& x)
{ destroy();
- #if defined(_STATIC)
- List_ObjCopy((SortedList*)&x, (SortedList*)this, sizeof(T));
- #else
- li.List_ObjCopy((SortedList*)&x, (SortedList*)this, sizeof(T));
- #endif
+ List_ObjCopy((SortedList*)&x, (SortedList*)this, sizeof(T));
return *this;
}
~OBJLIST()
{
- #if !defined(_STATIC)
- if (li.cbSize != 0)
- #endif
- destroy();
+ destroy();
}
__inline void destroy(void)
@@ -175,30 +136,17 @@ template<class T> struct OBJLIST : public LIST<T> for (int i=0; i < this->count; i++)
delete this->items[i];
- #if defined(_STATIC)
- List_Destroy((SortedList*)this);
- #else
- li.List_Destroy((SortedList*)this);
- #endif
+ List_Destroy((SortedList*)this);
}
__inline int remove(int idx) {
delete this->items[idx];
- #if defined(_STATIC)
- return List_Remove((SortedList*)this, idx);
- #else
- return li.List_Remove((SortedList*)this, idx);
- #endif
+ return List_Remove((SortedList*)this, idx);
}
__inline int remove(T* p)
{
- #if defined(_STATIC)
- if (li.List_RemovePtr((SortedList*)this, p) != -1)
- #else
- if (li.List_RemovePtr((SortedList*)this, p) != -1)
- #endif
- {
+ if (List_RemovePtr((SortedList*)this, p) != -1) {
delete p;
return 1;
}
|