sdk: Fixed many warnings and related problems
[sdk] / compiler / bootstrap / ecere / bootstrap / memory.c
1 /* Code generated from eC source file: memory.ec */
2 #if defined(__GNUC__)
3 typedef long long int64;
4 typedef unsigned long long uint64;
5 #ifndef _WIN32
6 #define __declspec(x)
7 #endif
8 #elif defined(__TINYC__)
9 #include <stdarg.h>
10 #define __builtin_va_list va_list
11 #define __builtin_va_start va_start
12 #define __builtin_va_end va_end
13 #ifdef _WIN32
14 #define strcasecmp stricmp
15 #define strncasecmp strnicmp
16 #define __declspec(x) __attribute__((x))
17 #else
18 #define __declspec(x)
19 #endif
20 typedef long long int64;
21 typedef unsigned long long uint64;
22 #else
23 typedef __int64 int64;
24 typedef unsigned __int64 uint64;
25 #endif
26 #ifdef __BIG_ENDIAN__
27 #define __ENDIAN_PAD(x) (8 - (x))
28 #else
29 #define __ENDIAN_PAD(x) 0
30 #endif
31 #include <stdint.h>
32 #include <sys/types.h>
33 struct __ecereNameSpace__ecere__com__Instance;
34
35 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
36
37 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
38
39 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
40
41 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
42
43 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
44
45 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
46
47 struct __ecereNameSpace__ecere__sys__BTNode;
48
49 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
50
51 struct __ecereNameSpace__ecere__sys__BinaryTree
52 {
53 struct __ecereNameSpace__ecere__sys__BTNode * root;
54 int count;
55 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
56 void (*  FreeKey)(void *  key);
57 } __attribute__ ((gcc_struct));
58
59 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
60
61 struct __ecereNameSpace__ecere__sys__OldList
62 {
63 void *  first;
64 void *  last;
65 int count;
66 unsigned int offset;
67 unsigned int circ;
68 } __attribute__ ((gcc_struct));
69
70 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
71
72 struct __ecereNameSpace__ecere__com__Class
73 {
74 struct __ecereNameSpace__ecere__com__Class * prev;
75 struct __ecereNameSpace__ecere__com__Class * next;
76 const char *  name;
77 int offset;
78 int structSize;
79 int (* *  _vTbl)();
80 int vTblSize;
81 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
82 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
83 int offsetClass;
84 int sizeClass;
85 struct __ecereNameSpace__ecere__com__Class * base;
86 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
87 struct __ecereNameSpace__ecere__sys__BinaryTree members;
88 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
89 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
90 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
91 struct __ecereNameSpace__ecere__sys__OldList derivatives;
92 int memberID;
93 int startMemberID;
94 int type;
95 struct __ecereNameSpace__ecere__com__Instance * module;
96 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
97 const char *  dataTypeString;
98 struct __ecereNameSpace__ecere__com__Instance * dataType;
99 int typeSize;
100 int defaultAlignment;
101 void (*  Initialize)();
102 int memberOffset;
103 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
104 const char *  designerClass;
105 unsigned int noExpansion;
106 const char *  defaultProperty;
107 unsigned int comRedefinition;
108 int count;
109 int isRemote;
110 unsigned int internalDecl;
111 void *  data;
112 unsigned int computeSize;
113 int structAlignment;
114 int destructionWatchOffset;
115 unsigned int fixed;
116 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
117 int inheritanceAccess;
118 const char *  fullName;
119 void *  symbol;
120 struct __ecereNameSpace__ecere__sys__OldList conversions;
121 struct __ecereNameSpace__ecere__sys__OldList templateParams;
122 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
123 struct __ecereNameSpace__ecere__com__Class * templateClass;
124 struct __ecereNameSpace__ecere__sys__OldList templatized;
125 int numParams;
126 unsigned int isInstanceClass;
127 unsigned int byValueSystemClass;
128 } __attribute__ ((gcc_struct));
129
130 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
131
132 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
133
134 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
135
136 struct __ecereNameSpace__ecere__com__Property
137 {
138 struct __ecereNameSpace__ecere__com__Property * prev;
139 struct __ecereNameSpace__ecere__com__Property * next;
140 const char *  name;
141 unsigned int isProperty;
142 int memberAccess;
143 int id;
144 struct __ecereNameSpace__ecere__com__Class * _class;
145 const char *  dataTypeString;
146 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
147 struct __ecereNameSpace__ecere__com__Instance * dataType;
148 void (*  Set)(void * , int);
149 int (*  Get)(void * );
150 unsigned int (*  IsSet)(void * );
151 void *  data;
152 void *  symbol;
153 int vid;
154 unsigned int conversion;
155 unsigned int watcherOffset;
156 const char *  category;
157 unsigned int compiled;
158 unsigned int selfWatchable;
159 unsigned int isWatchable;
160 } __attribute__ ((gcc_struct));
161
162 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
163
164 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
165
166 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
167
168 extern void __ecereNameSpace__ecere__com__eInstance_StopWatching(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property, struct __ecereNameSpace__ecere__com__Instance * object);
169
170 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
171
172 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
173
174 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
175
176 struct __ecereNameSpace__ecere__com__Instance
177 {
178 int (* *  _vTbl)();
179 struct __ecereNameSpace__ecere__com__Class * _class;
180 int _refCount;
181 } __attribute__ ((gcc_struct));
182
183 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
184
185 struct __ecereNameSpace__ecere__com__DataMember
186 {
187 struct __ecereNameSpace__ecere__com__DataMember * prev;
188 struct __ecereNameSpace__ecere__com__DataMember * next;
189 const char *  name;
190 unsigned int isProperty;
191 int memberAccess;
192 int id;
193 struct __ecereNameSpace__ecere__com__Class * _class;
194 const char *  dataTypeString;
195 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
196 struct __ecereNameSpace__ecere__com__Instance * dataType;
197 int type;
198 int offset;
199 int memberID;
200 struct __ecereNameSpace__ecere__sys__OldList members;
201 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
202 int memberOffset;
203 int structAlignment;
204 } __attribute__ ((gcc_struct));
205
206 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
207
208 struct __ecereNameSpace__ecere__com__Method
209 {
210 const char *  name;
211 struct __ecereNameSpace__ecere__com__Method * parent;
212 struct __ecereNameSpace__ecere__com__Method * left;
213 struct __ecereNameSpace__ecere__com__Method * right;
214 int depth;
215 int (*  function)();
216 int vid;
217 int type;
218 struct __ecereNameSpace__ecere__com__Class * _class;
219 void *  symbol;
220 const char *  dataTypeString;
221 struct __ecereNameSpace__ecere__com__Instance * dataType;
222 int memberAccess;
223 } __attribute__ ((gcc_struct));
224
225 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
226
227 struct __ecereNameSpace__ecere__com__SerialBuffer
228 {
229 unsigned char *  _buffer;
230 unsigned int count;
231 unsigned int _size;
232 unsigned int pos;
233 } __attribute__ ((gcc_struct));
234
235 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
236
237 struct __ecereNameSpace__ecere__com__DataValue
238 {
239 union
240 {
241 char c;
242 unsigned char uc;
243 short s;
244 unsigned short us;
245 int i;
246 unsigned int ui;
247 void *  p;
248 float f;
249 double d;
250 long long i64;
251 uint64 ui64;
252 } __attribute__ ((gcc_struct)) __anon1;
253 } __attribute__ ((gcc_struct));
254
255 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
256
257 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
258 {
259 union
260 {
261 struct
262 {
263 const char *  dataTypeString;
264 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
265 } __attribute__ ((gcc_struct)) __anon1;
266 struct __ecereNameSpace__ecere__com__DataValue expression;
267 struct
268 {
269 const char *  memberString;
270 union
271 {
272 struct __ecereNameSpace__ecere__com__DataMember * member;
273 struct __ecereNameSpace__ecere__com__Property * prop;
274 struct __ecereNameSpace__ecere__com__Method * method;
275 } __attribute__ ((gcc_struct)) __anon1;
276 } __attribute__ ((gcc_struct)) __anon2;
277 } __attribute__ ((gcc_struct)) __anon1;
278 } __attribute__ ((gcc_struct));
279
280 extern void *  memmove(void * , const void * , size_t size);
281
282 void __ecereNameSpace__ecere__sys__MoveBytes(void * dest, const void * source, unsigned int count)
283 {
284 memmove(dest, source, count);
285 }
286
287 extern void *  memcpy(void * , const void * , size_t size);
288
289 void __ecereNameSpace__ecere__sys__CopyBytes(void * dest, const void * source, unsigned int count)
290 {
291 memcpy(dest, source, count);
292 }
293
294 void __ecereNameSpace__ecere__sys__CopyBytesBy2(void * dest, const void * source, unsigned int count)
295 {
296 memcpy(dest, source, count << 1);
297 }
298
299 void __ecereNameSpace__ecere__sys__CopyBytesBy4(void * dest, const void * source, unsigned int count)
300 {
301 memcpy(dest, source, count << 2);
302 }
303
304 extern void *  memset(void *  area, int value, size_t count);
305
306 void __ecereNameSpace__ecere__sys__FillBytes(void * area, unsigned char value, unsigned int count)
307 {
308 memset(area, value, count);
309 }
310
311 void __ecereNameSpace__ecere__sys__FillBytesBy2(void * area, unsigned short value, unsigned int count)
312 {
313 unsigned short * dest = area;
314 int c;
315
316 for(c = 0; c < count; c++)
317 dest[c] = value;
318 }
319
320 void __ecereNameSpace__ecere__sys__FillBytesBy4(void * area, unsigned int value, unsigned int count)
321 {
322 unsigned int * dest = area;
323 int c;
324
325 for(c = 0; c < count; c++)
326 dest[c] = value;
327 }
328
329 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
330
331 struct __ecereNameSpace__ecere__com__GlobalFunction;
332
333 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_RegisterFunction(const char *  name, const char *  type, void *  func, struct __ecereNameSpace__ecere__com__Instance * module, int declMode);
334
335 void __ecereRegisterModule_memory(struct __ecereNameSpace__ecere__com__Instance * module)
336 {
337 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
338
339 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::MoveBytes", "void ecere::sys::MoveBytes(void * dest, const void * source, uint count)", __ecereNameSpace__ecere__sys__MoveBytes, module, 1);
340 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::CopyBytes", "void ecere::sys::CopyBytes(void * dest, const void * source, uint count)", __ecereNameSpace__ecere__sys__CopyBytes, module, 1);
341 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::CopyBytesBy2", "void ecere::sys::CopyBytesBy2(void * dest, const void * source, uint count)", __ecereNameSpace__ecere__sys__CopyBytesBy2, module, 1);
342 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::CopyBytesBy4", "void ecere::sys::CopyBytesBy4(void * dest, const void * source, uint count)", __ecereNameSpace__ecere__sys__CopyBytesBy4, module, 1);
343 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::FillBytes", "void ecere::sys::FillBytes(void * area, byte value, uint count)", __ecereNameSpace__ecere__sys__FillBytes, module, 1);
344 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::FillBytesBy2", "void ecere::sys::FillBytesBy2(void * area, uint16 value, uint count)", __ecereNameSpace__ecere__sys__FillBytesBy2, module, 1);
345 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::FillBytesBy4", "void ecere::sys::FillBytesBy4(void * area, uint value, uint count)", __ecereNameSpace__ecere__sys__FillBytesBy4, module, 1);
346 }
347
348 void __ecereUnregisterModule_memory(struct __ecereNameSpace__ecere__com__Instance * module)
349 {
350
351 }
352