mirror of
https://github.com/siemens-mobile-hacks/sieelf.git
synced 2026-11-25 22:27:29 +00:00
41 lines
788 B
C
41 lines
788 B
C
#include "include.h"
|
|
|
|
extern void _C_LOG(const char *str);
|
|
|
|
//pure virtual function may show error
|
|
void __pure_virtual_called(void)
|
|
{
|
|
MsgBoxError(2, (int)"ABSTRACT VIRTUAL FUNCTION CALLED!");
|
|
};
|
|
|
|
typedef void (*tf)(void *);
|
|
|
|
//vec=new TObject[1024];
|
|
void * __data_vec_new(int u1 ,int count ,int size, tf constructor)
|
|
{
|
|
char * p,*q;
|
|
p=(char*)malloc(size*count+4);
|
|
*((int*)p)=count;
|
|
p+=4;
|
|
q=p;
|
|
for(int i=0;i<count;i++)
|
|
{
|
|
constructor(q);
|
|
q+=size;
|
|
};
|
|
return p;
|
|
};
|
|
|
|
//vec=new TObject[1024];
|
|
//delete vec
|
|
void __data_vec_delete(char * vector, int u1, int size, tf destructor)
|
|
{
|
|
int count=*((int*)(vector-4));
|
|
char * s=vector-4;
|
|
for(int i=0;i<count;i++)
|
|
{
|
|
destructor(vector);
|
|
vector+=size;
|
|
};
|
|
mfree(s);
|
|
};
|