Commit 8d273810 authored by D-AIRY's avatar D-AIRY

Some linux-related changed

parent 1ba4ead2
......@@ -105,32 +105,17 @@ public:
void erase(UINT key)
{
/*if(key < 0)
{
_asm
{
int 3;
};
}*/
assert(key < this->Size);
if(key < this->Size)
{
(&this->Data[key])->~T();
if(key < this->Size - 1)
{
memcpy(&this->Data[key], &this->Data[key + 1], sizeof(T)* (this->Size - key - 1));
}
this->Size--;
}
else
if(key < this->Size)
{
(&this->Data[key])->~T();
if(key < this->Size - 1)
{
#ifndef WIN64
_asm
{
int 3;
};
#endif
memcpy(&this->Data[key], &this->Data[key + 1], sizeof(T)* (this->Size - key - 1));
}
this->Size--;
}
}
//inline Array & operator=(T* arr)
......
......@@ -8,7 +8,7 @@ See the license in LICENSE
#define SX_AssotiativeArray_H
//#include "DSbase.h"
#include <common/MemAlloc.h>
#include <common/Stack.h>
#include <common/stack.h>
#ifndef NULL
#define NULL 0
......@@ -455,6 +455,7 @@ public:
this->CurNode = this->nodes.pop();
this->first = &(this->CurNode->Key);
this->second = this->CurNode->Val;
//! @fixme Check this assignment!
this->CurNode = this->CurNode;
return(*this);
}
......@@ -616,7 +617,7 @@ public:
AssotiativeArray(const AssotiativeArray & a):RootNode(NULL), Size_(0),TmpNode(NULL)
{
for(AssotiativeArray<SX_KEYTYPE, SX_VALTYPE>::Iterator i = a.begin(); i; i++)
for(typename AssotiativeArray<SX_KEYTYPE, SX_VALTYPE>::Iterator i = a.begin(); i; i++)
{
(*this)[*(i.first)] = *(i.second);
}
......@@ -659,7 +660,7 @@ public:
AssotiativeArray & operator=(const AssotiativeArray & a)
{
for(AssotiativeArray<SX_KEYTYPE, SX_VALTYPE>::Iterator i = a.begin(); i; i++)
for(typename AssotiativeArray<SX_KEYTYPE, SX_VALTYPE>::Iterator i = a.begin(); i; i++)
{
this->operator[](*i.first) = *i.second;
}
......
......@@ -45,8 +45,13 @@ typedef void* SXWINDOW;
#ifdef _MSC_VER
# define strcasecmp _stricmp
#else
# define _aligned_malloc(size, align) memalign((align), (size))
# define _aligned_free(ptr) free(ptr)
# define __forceinline inline
#endif
#ifndef max
#define max(a, b) ((a) > (b) ? (a) : (b))
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment