/test/language/unclassified/test_overload01.c

http://github.com/tybor/Liberty · C · 921 lines · 718 code · 61 blank · 142 comment · 50 complexity · 807e5ed8d89ae891c83ded8537ab11dd MD5 · raw file

  1. #ifdef __cplusplus
  2. extern "C" {
  3. #endif
  4. /*
  5. ANSI C code generated by SmartEiffel The GNU Eiffel Compiler, Eiffel tools and libraries
  6. Release 2.4 (??? June ??th 2008) [????]
  7. Copyright (C), 1994-2002 - INRIA - LORIA - ESIAL UHP Nancy 1 - FRANCE
  8. Copyright (C), 2003-2005 - INRIA - LORIA - IUT Charlemagne Nancy 2 - FRANCE
  9. D.COLNET, P.RIBET, C.ADRIAN, V.CROIZIER F.MERIZEN - SmartEiffel@loria.fr
  10. http://SmartEiffel.loria.fr
  11. C Compiler options used: -pipe -Os
  12. */
  13. #ifdef __cplusplus
  14. }
  15. #endif
  16. #include "test_overload01.h"
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. /*
  21. -- ------------------------------------------------------------------------------------------------------------
  22. -- Copyright notice below. Please read.
  23. --
  24. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  25. -- Copyright(C) 2003-2005: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  26. --
  27. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  28. --
  29. -- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
  30. -- documentation files (the "Software"), to deal in the Software without restriction, including without
  31. -- limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  32. -- the Software, and to permit persons to whom the Software is furnished to do so, subject to the following
  33. -- conditions:
  34. --
  35. -- The above copyright notice and this permission notice shall be included in all copies or substantial
  36. -- portions of the Software.
  37. --
  38. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
  39. -- LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
  40. -- EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  41. -- AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
  42. -- OR OTHER DEALINGS IN THE SOFTWARE.
  43. --
  44. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  45. -- ------------------------------------------------------------------------------------------------------------
  46. */
  47. /*
  48. This file (SmartEiffel/sys/runtime/base.c) is included for _all_ modes of
  49. compilation (-boost, -no_check, ... -all_check).
  50. */
  51. /*
  52. Byte swapping function
  53. */
  54. void copy_swap_16(const uint16_t *src, uint16_t *dest, int count){
  55. while (count--) {
  56. *dest++ = (*src << 8) | (*src >> 8);
  57. src++;
  58. }
  59. }
  60. /*
  61. The wrapper for `malloc' (generated C code is supposed to use
  62. only `se_malloc' instead of direct `malloc').
  63. */
  64. void* se_malloc(size_t size) {
  65. void *result = malloc(size);
  66. if (result == NULL) {
  67. handle(SE_HANDLE_NO_MORE_MEMORY, NULL);
  68. #ifdef SE_EXCEPTIONS
  69. internal_exception_handler(No_more_memory);
  70. #elif !defined(SE_BOOST)
  71. error0("No more memory.", NULL);
  72. #else
  73. fprintf(SE_ERR,"No more memory (malloc failed).\n");
  74. exit(EXIT_FAILURE);
  75. #endif
  76. }
  77. return result;
  78. }
  79. /*
  80. The wrapper for `calloc' (generated C code is supposed to use
  81. only `se_calloc' instead of direct `calloc').
  82. */
  83. void* se_calloc(size_t nmemb, size_t size) {
  84. void *result = calloc(nmemb,size);
  85. if (result == NULL) {
  86. handle(SE_HANDLE_NO_MORE_MEMORY, NULL);
  87. #ifdef SE_EXCEPTIONS
  88. internal_exception_handler(No_more_memory);
  89. #elif !defined(SE_BOOST)
  90. error0("No more memory.", NULL);
  91. #else
  92. fprintf(SE_ERR,"No more memory (calloc failed).\n");
  93. exit(EXIT_FAILURE);
  94. #endif
  95. }
  96. return result;
  97. }
  98. /*
  99. The wrapper for `realloc' (generated C code is supposed to use
  100. only `se_realloc' instead of direct `realloc').
  101. */
  102. void* se_realloc(void* src, size_t size) {
  103. void *result = realloc(src, size);
  104. if (result == NULL) {
  105. handle(SE_HANDLE_NO_MORE_MEMORY, NULL);
  106. #ifdef SE_EXCEPTIONS
  107. internal_exception_handler(No_more_memory);
  108. #elif !defined(SE_BOOST)
  109. error0("No more memory.", NULL);
  110. #else
  111. fprintf(SE_ERR,"No more memory (realloc failed).\n");
  112. exit(EXIT_FAILURE);
  113. #endif
  114. }
  115. return result;
  116. }
  117. /* ---------------------------------------------------------------------- */
  118. void se_die (int code) {
  119. handle(SE_HANDLE_DIE_WITH_CODE, &code);
  120. exit(code);
  121. }
  122. /*
  123. Runtime hooks
  124. */
  125. static se_runtime_handler_t** handlers = NULL;
  126. int handlers_count=0;
  127. void register_handler(se_runtime_handler_t*handler) {
  128. int new_count = handlers_count + 1;
  129. handlers = (se_runtime_handler_t**)se_realloc(handlers, (new_count) * sizeof(void*));
  130. handlers[handlers_count] = handler;
  131. handlers_count = new_count;
  132. }
  133. void _handle(se_handler_action_t action, void*data) {
  134. int i;
  135. for (i = 0; i < handlers_count; i++) {
  136. handlers[i](action, data);
  137. /* *** Check type of this array. Function pointer may have different size from data pointer. (PH 17/07/08) */
  138. }
  139. }
  140. /*
  141. -- ------------------------------------------------------------------------------------------------------------
  142. -- Copyright notice below. Please read.
  143. --
  144. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  145. -- Copyright(C) 2003-2005: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  146. --
  147. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  148. --
  149. -- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
  150. -- documentation files (the "Software"), to deal in the Software without restriction, including without
  151. -- limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  152. -- the Software, and to permit persons to whom the Software is furnished to do so, subject to the following
  153. -- conditions:
  154. --
  155. -- The above copyright notice and this permission notice shall be included in all copies or substantial
  156. -- portions of the Software.
  157. --
  158. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
  159. -- LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
  160. -- EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  161. -- AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
  162. -- OR OTHER DEALINGS IN THE SOFTWARE.
  163. --
  164. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  165. -- ------------------------------------------------------------------------------------------------------------
  166. */
  167. #if defined __USE_POSIX || defined __unix__ || defined _POSIX_C_SOURCE
  168. /* macro read is used of read_stdin */
  169. void io_copy (char*source, char*target) {
  170. /* We use the low-level descriptor functions rather than stream-oriented functions.
  171. * This allows us to copy the file's permissions. */
  172. int src;
  173. int tgt;
  174. struct stat info;
  175. static char *buffer = NULL;
  176. static int bufsize = 0;
  177. int read_count, write_count, written;
  178. src=open (source, O_RDONLY);
  179. if (fstat (src, &info))
  180. return; /* Ooops */
  181. if (bufsize < info.st_blksize)
  182. buffer=se_realloc (buffer, info.st_blksize);
  183. tgt=creat (target, info.st_mode);
  184. do {
  185. read_count = read (src, buffer, info.st_blksize);
  186. write_count = 0; written = 0;
  187. while ((write_count < read_count) && (written >= 0))
  188. {
  189. written = write (tgt, buffer + write_count, read_count - write_count);
  190. write_count += written;
  191. }
  192. } while ((read_count > 0) && (written >= 0));
  193. close (src);
  194. close (tgt);
  195. }
  196. int io_same_physical_file(char*path1,char*path2) {
  197. struct stat info1, info2;
  198. if (stat(path1, &info1))
  199. return 0; /* oops */
  200. if (stat(path2, &info2))
  201. return 0; /* oops */
  202. return (info1.st_dev == info2.st_dev) && (info1.st_ino == info2.st_ino);
  203. }
  204. #else
  205. #define IO_COPY_BUFSIZE 4096
  206. int read_stdin(EIF_CHARACTER *buffer, int size) {
  207. int c;
  208. c = getc(stdin);
  209. if (c==EOF)
  210. return 0;
  211. *buffer = (EIF_CHARACTER)c;
  212. return 1;
  213. }
  214. void io_copy(char*source, char*target) {
  215. static char *buffer = NULL;
  216. int read_count;
  217. FILE*src=fopen(source, "rb");
  218. FILE*tgt=fopen(target, "wb");
  219. if(!buffer)
  220. buffer = (char*)se_malloc(IO_COPY_BUFSIZE);
  221. while ((read_count = fread(buffer, 1, IO_COPY_BUFSIZE, src)), read_count) {
  222. size_t dummy = fwrite(buffer, 1, read_count, tgt);
  223. }
  224. fclose(src);
  225. fclose(tgt);
  226. }
  227. int io_same_physical_file(char*path1,char*path2) {
  228. /* default implementation returns true only if the paths are the same */
  229. return !strcmp(path1, path2);
  230. }
  231. #endif
  232. int io_file_exists(char*source) {
  233. FILE*src=fopen(source, "rb");
  234. if (src!=NULL) {
  235. fclose(src);
  236. return 1;
  237. }
  238. else {
  239. return (errno != ENOENT);
  240. }
  241. }
  242. T53 M53={0};
  243. T7 M7={(void*)0,0,0};
  244. T49 M49={0,(void*)0,0};
  245. T25 M25={0,(void*)0};
  246. /*Aliased storage area or unicode storage.*/
  247. char*s26_0="";
  248. char*s26_212160365="require_check";
  249. char*s26_48390502="all_check";
  250. char*s26_1690381566="invariant_check";
  251. char*s26_1992063831="ensure_check";
  252. char*s26_1325941860="ERROR: \173""EIFFELTEST_TOOLS\175"".assert call ";
  253. char*s26_113001857=" in class ";
  254. char*s26_2167877="number ";
  255. char*s26_718083334="no_check or boost";
  256. char*s26_1075456615="Assertion level was ";
  257. char*s26_265093627="loop_check";
  258. char*s26_1682790378=" failed.\nRerun this test under the -sedb debugger to find out what is going wrong.\n";
  259. /*
  260. -- ------------------------------------------------------------------------------------------------------------
  261. -- Copyright notice below. Please read.
  262. --
  263. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  264. -- Copyright(C) 2003-2005: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  265. --
  266. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  267. --
  268. -- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
  269. -- documentation files (the "Software"), to deal in the Software without restriction, including without
  270. -- limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  271. -- the Software, and to permit persons to whom the Software is furnished to do so, subject to the following
  272. -- conditions:
  273. --
  274. -- The above copyright notice and this permission notice shall be included in all copies or substantial
  275. -- portions of the Software.
  276. --
  277. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
  278. -- LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
  279. -- EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  280. -- AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
  281. -- OR OTHER DEALINGS IN THE SOFTWARE.
  282. --
  283. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  284. -- ------------------------------------------------------------------------------------------------------------
  285. */
  286. void se_print_run_time_stack (void) {
  287. handle(SE_HANDLE_ENTER_PRINT_STACK, NULL);
  288. fprintf(SE_ERR,"Eiffel program crash at run time.\n");
  289. fprintf(SE_ERR,"No trace when using option \"-boost\"\n");
  290. handle(SE_HANDLE_EXIT_PRINT_STACK, NULL);
  291. }
  292. void se_signal_handler(int sig) {
  293. handle(SE_HANDLE_RUNTIME_ERROR, NULL);
  294. printf("Received signal %d.\n",sig);
  295. se_print_run_time_stack();
  296. exit(EXIT_FAILURE);
  297. }
  298. /*INTEGER_32*/void r2append_in(T2 C,T0* a1){
  299. T2 _val=0;
  300. T2 _i=0;
  301. T2 _idx=0;
  302. if((C)==(INT8_C(0))){
  303. r7extend(((T7*)a1),((T3)'0'));
  304. }
  305. else{
  306. if(((int32_t)(C))>(INT32_C(0))){
  307. _val=C;
  308. _i=((int32_t)((/*RF2*/(((T7*)a1))->_count/*3p*/)))+(INT32_C(1));
  309. }
  310. else{
  311. r7extend(((T7*)a1),((T3)'\055'));
  312. _i=((int32_t)((/*RF2*/(((T7*)a1))->_count/*3p*/)))+(INT32_C(1));
  313. _val=((int32_t)(C))%(INT32_C(10));
  314. if(((int32_t)(_val))<=(INT32_C(0))){
  315. r7extend(((T7*)a1),r2decimal_digit(-(_val)));
  316. _val=-(((int32_t)(C))/(INT32_C(10)));
  317. }
  318. else{
  319. r7extend(((T7*)a1),r2decimal_digit(((int32_t)(-(_val)))+(INT32_C(10))));
  320. _val=((int32_t)(-(((int32_t)(C))/(INT32_C(10)))))-(INT32_C(1));
  321. }
  322. }
  323. while(!((_val)==(INT8_C(0))))
  324. {
  325. r7extend(((T7*)a1),r2decimal_digit(((int32_t)(_val))%(INT32_C(10))));
  326. _val=((int32_t)(_val))/(INT32_C(10));
  327. }
  328. _idx=(/*RF2*/(((T7*)a1))->_count/*3p*/);
  329. while(!(((int32_t)(_i))>=(_idx)))
  330. {
  331. r7swap(((T7*)a1),_i,_idx);
  332. _idx=((int32_t)(_idx))-(INT32_C(1));
  333. _i=((int32_t)(_i))+(INT32_C(1));
  334. }
  335. }
  336. }/*--*/
  337. /*INTEGER_32*/T3 r2decimal_digit(T2 C){
  338. T3 R=0;
  339. R=((T3)(((int32_t)(C))+(INT32_C(48))));
  340. return R;
  341. }/*--*/
  342. /*INTEGER_32*/T2 r2max(T2 C,T2 a1){
  343. T2 R=0;
  344. if(((int32_t)(C))>=(a1)){
  345. R=C;
  346. }
  347. else{
  348. R=a1;
  349. }
  350. return R;
  351. }/*--*/
  352. /*NATIVE_ARRAY[CHARACTER]*/T9 r9realloc(T9 C,T2 a1,T2 a2){
  353. T9 R=(void*)0;
  354. R=((T9)(se_calloc(a2,sizeof(T3))));
  355. r9copy_from(R,C,((int32_t)(a1))-(INT32_C(1)));
  356. return R;
  357. }/*--*/
  358. /*NATIVE_ARRAY[CHARACTER]*/void r9copy_from(T9 C,T9 a1,T2 a2){
  359. T2 _i=0;
  360. _i=a2;
  361. while(!(((int32_t)(_i))<(INT32_C(0))))
  362. {
  363. (C)[_i]=((a1)[_i]);
  364. _i=((int32_t)(_i))-(INT32_C(1));
  365. }
  366. }/*--*/
  367. /*NATIVE_ARRAY[CHARACTER]*/void r9clear_all(T9 C,T2 a1){
  368. T3 _v=0;
  369. T2 _i=0;
  370. _i=a1;
  371. while(!(((int32_t)(_i))<(INT32_C(0))))
  372. {
  373. (C)[_i]=(_v);
  374. _i=((int32_t)(_i))-(INT32_C(1));
  375. }
  376. }/*--*/
  377. /*STRING*/void r7swap(T7* C,T2 a1,T2 a2){
  378. T3 _tmp=0;
  379. _tmp=r7item(C,a1);
  380. r7put(C,r7item(C,a2),a1);
  381. r7put(C,_tmp,a2);
  382. }/*--*/
  383. /*STRING*/T3 r7item(T7* C,T2 a1){
  384. T3 R=0;
  385. R=((/*RF2*/(C)->_storage/*3p*/))[((int32_t)(a1))-(INT32_C(1))];
  386. return R;
  387. }/*--*/
  388. /*STRING*/void r7copy(T7* C,T0* a1){
  389. T2 _c=0;
  390. _c=(/*RF2*/(((T7*)a1))->_count/*3p*/);
  391. if(((int32_t)(_c))>(INT32_C(0))){
  392. if(((int32_t)((/*RF2*/(C)->_capacity/*3p*/)))<(_c)){
  393. /*SFN*/(C->_storage/*3p*/)=((T9)(se_calloc(_c,sizeof(T3))));
  394. /*SFN*/(C->_capacity/*3p*/)=_c;
  395. }
  396. r9copy_from((/*RF2*/(C)->_storage/*3p*/),(/*RF2*/(((T7*)a1))->_storage/*3p*/),((int32_t)(_c))-(INT32_C(1)));
  397. }
  398. /*SFN*/(C->_count/*3p*/)=_c;
  399. }/*--*/
  400. /*STRING*/void r7put(T7* C,T3 a1,T2 a2){
  401. ((/*RF2*/(C)->_storage/*3p*/))[((int32_t)(a2))-(INT32_C(1))]=(a1);
  402. }/*--*/
  403. /*STRING*/void r7extend(T7* C,T3 a1){
  404. if(((/*RF2*/(C)->_count/*3p*/))==((/*RF2*/(C)->_capacity/*3p*/))){
  405. r7ensure_capacity(C,((int32_t)((/*RF2*/(C)->_count/*3p*/)))+(INT32_C(1)));
  406. }
  407. ((/*RF2*/(C)->_storage/*3p*/))[(/*RF2*/(C)->_count/*3p*/)]=(a1);
  408. /*SFN*/(C->_count/*3p*/)=((int32_t)((/*RF2*/(C)->_count/*3p*/)))+(INT32_C(1));
  409. }/*--*/
  410. /*STRING*/void r7ensure_capacity(T7* C,T2 a1){
  411. T2 _new_capacity=0;
  412. if(((NULL!=((void*)((/*RF2*/(C)->_storage/*3p*/)))))==(0)){
  413. _new_capacity=r2max(a1,INT32_C(32));
  414. /*SFN*/(C->_storage/*3p*/)=((T9)(se_calloc(_new_capacity,sizeof(T3))));
  415. /*SFN*/(C->_capacity/*3p*/)=_new_capacity;
  416. }
  417. else{
  418. if(((int32_t)((/*RF2*/(C)->_capacity/*3p*/)))<(a1)){
  419. _new_capacity=r2max(a1,(int32_t)(((uint32_t)((/*RF2*/(C)->_capacity/*3p*/)))*((uint32_t)(INT32_C(2)))));
  420. /*SFN*/(C->_storage/*3p*/)=r9realloc((/*RF2*/(C)->_storage/*3p*/),(/*RF2*/(C)->_capacity/*3p*/),_new_capacity);
  421. /*SFN*/(C->_capacity/*3p*/)=_new_capacity;
  422. }
  423. }
  424. }/*--*/
  425. /*COUNTER*/void r53increment(T53* C){
  426. /*SFN*/(C->_value/*p*/)=((int32_t)((/*RF2*/(C)->_value/*p*/)))+(INT32_C(1));
  427. }/*--*/
  428. T0*oBC13std_output=(void*)0;
  429. int fBC13std_output=0;
  430. /*STD_OUTPUT*/T0* r49std_output(void){
  431. /*[INTERNAL_C_LOCAL list*/
  432. T0* tmp0;
  433. /*INTERNAL_C_LOCAL list]*/
  434. if(fBC13std_output==0){fBC13std_output=1;{
  435. tmp0/*new*/=((T0*)se_malloc(sizeof(T49)))/*3p*/;
  436. *((T49*)tmp0/*new*/)=M49;
  437. r49make(((T49*)tmp0/*new*/));
  438. oBC13std_output=tmp0/*new*/;
  439. /*tmp0.unlock*/
  440. }}
  441. return oBC13std_output;
  442. }/*--*/
  443. /*STD_OUTPUT*/void r49filtered_flush(T49* C){
  444. if(((int32_t)((/*RF2*/(C)->_buffer_position/*3p*/)))>(INT32_C(0))){
  445. r49write_buffer(C);
  446. }
  447. io_flush((stdout));
  448. }/*--*/
  449. /*STD_OUTPUT*/void r49filtered_put_character(T49* C,T3 a1){
  450. if(((int32_t)((/*RF2*/(C)->_buffer_position/*3p*/)))>=(INT32_C(4096))){
  451. r49write_buffer(C);
  452. }
  453. ((/*RF2*/(C)->_buffer/*3p*/))[(/*RF2*/(C)->_buffer_position/*3p*/)]=(a1);
  454. /*SFN*/(C->_buffer_position/*3p*/)=((int32_t)((/*RF2*/(C)->_buffer_position/*3p*/)))+(INT32_C(1));
  455. if((a1)==(((T3)'\n'))){
  456. r49write_buffer(C);
  457. }
  458. }/*--*/
  459. /*STD_OUTPUT*/void r49se_atexit(void){
  460. r49filtered_flush((T49*)(r49std_output()));
  461. }/*--*/
  462. /*STD_OUTPUT*/void r49make(T49* C){
  463. /*SFN*/(C->_buffer/*3p*/)=((T9)(se_calloc(INT32_C(4096),sizeof(T3))));
  464. /*SFN*/(C->_capacity/*3p*/)=INT32_C(4096);
  465. }/*--*/
  466. /*STD_OUTPUT*/void r49write_buffer(T49* C){
  467. T2 _unused_result=0;
  468. if(((int32_t)((/*RF2*/(C)->_buffer_position/*3p*/)))>(INT32_C(0))){
  469. _unused_result=io_fwrite((/*RF2*/(C)->_buffer/*3p*/),(/*RF2*/(C)->_buffer_position/*3p*/),(stdout));
  470. /*SFN*/(C->_buffer_position/*3p*/)=INT32_C(0);
  471. }
  472. }/*--*/
  473. /*STD_OUTPUT*/void r49flush(T49* C){
  474. r49filtered_flush(C);
  475. }/*--*/
  476. /*STD_OUTPUT*/void r49put_string(T49* C,T0* a1){
  477. T2 _i=0;
  478. T2 _count=0;
  479. _i=INT32_C(1);
  480. _count=(/*RF2*/(((T7*)a1))->_count/*3p*/);
  481. while(!(((int32_t)(_i))>(_count)))
  482. {
  483. r49filtered_put_character(C,r7item(((T7*)a1),_i));
  484. _i=((int32_t)(_i))+(INT32_C(1));
  485. }
  486. }/*--*/
  487. /*TEST_OVERLOAD01*/void r25default_create(T25* C){
  488. /*SFN*/(C->_external_object/*2p*/)=r25cpp_new();
  489. r25set_value(C,INT32_C(25));
  490. r25label_assert(C,(void*)0,(T6)((r25value(C))==(INT8_C(25))));
  491. }/*--*/
  492. /*TEST_OVERLOAD01*/T0* r25std_output(void){
  493. /*[INTERNAL_C_LOCAL list*/
  494. T0* tmp0;
  495. /*INTERNAL_C_LOCAL list]*/
  496. if(fBC13std_output==0){fBC13std_output=1;{
  497. tmp0/*new*/=((T0*)se_malloc(sizeof(T49)))/*3p*/;
  498. *((T49*)tmp0/*new*/)=M49;
  499. r49make(((T49*)tmp0/*new*/));
  500. oBC13std_output=tmp0/*new*/;
  501. /*tmp0.unlock*/
  502. }}
  503. return oBC13std_output;
  504. }/*--*/
  505. T0*oBC26assert_counter=(void*)0;
  506. /*TEST_OVERLOAD01*/T0* r25assertion_flag(T25* C){
  507. /*[INTERNAL_C_LOCAL list*/
  508. T2 tmp0;
  509. /*INTERNAL_C_LOCAL list]*/
  510. T0* R=(void*)0;
  511. tmp0/*inspectExpression*/=(/*RF2*/(C)->_assertion_level/*2p*/);
  512. /*[inspect*/
  513. switch(tmp0/*inspectExpression*/){
  514. case 5:
  515. R=ms26_48390502;
  516. break;
  517. case 4:
  518. R=ms26_265093627;
  519. break;
  520. case 3:
  521. R=ms26_1690381566;
  522. break;
  523. case 2:
  524. R=ms26_1992063831;
  525. break;
  526. case 1:
  527. R=ms26_212160365;
  528. break;
  529. default:;
  530. R=ms26_718083334;
  531. }
  532. /*inspect]*/
  533. return R;
  534. }/*--*/
  535. /*TEST_OVERLOAD01*/void r25label_assert(T25* C,T0* a1,T6 a2){
  536. T0* _actual_label=(void*)0;
  537. r53increment(((T53*)oBC26assert_counter));
  538. if((a2)==(0)){
  539. if((a1)!=((void*)((void*)0))){
  540. _actual_label=a1;
  541. }
  542. else{
  543. _actual_label=ms26_0;
  544. r7copy(((T7*)_actual_label),ms26_2167877);
  545. r2append_in((/*RF2*/(((T53*)oBC26assert_counter))->_value/*p*/),_actual_label);
  546. }
  547. r49put_string((T49*)(r25std_output()),ms26_1325941860);
  548. r49put_string((T49*)(r25std_output()),_actual_label);
  549. r49put_string((T49*)(r25std_output()),ms26_113001857);
  550. r49put_string((T49*)(r25std_output()),(T0*)(g[25]));
  551. r49put_string((T49*)(r25std_output()),ms26_1682790378);
  552. r49put_string((T49*)(r25std_output()),ms26_1075456615);
  553. r49put_string((T49*)(r25std_output()),r25assertion_flag(C));
  554. r49filtered_put_character((T49*)(r25std_output()),((T3)'\056'));
  555. r49filtered_put_character((T49*)(r25std_output()),((T3)'\n'));
  556. }
  557. }/*--*/
  558. /*TEST_OVERLOAD01*/T2 r25value(T25* C){
  559. T2 R=0;
  560. R=r25cpp_value((/*RF2*/(C)->_external_object/*2p*/));
  561. return R;
  562. }/*--*/
  563. /* Extra external prototype for line 44 of /home/cyril/SmartEiffel/se/trunk/test_suite/language/unclassified/test_overload01.e:*/
  564. void cpp25cpp_set_value(T8 a1,T2 a2);
  565. /*TEST_OVERLOAD01*/void r25cpp_set_value(T8 a1,T2 a2){
  566. cpp25cpp_set_value(a1,a2);
  567. }/*--*/
  568. /* Extra external prototype for line 51 of /home/cyril/SmartEiffel/se/trunk/test_suite/language/unclassified/test_overload01.e:*/
  569. T8 cpp25cpp_new(void);
  570. /*TEST_OVERLOAD01*/T8 r25cpp_new(void){
  571. T8 R=(void*)0;
  572. R=cpp25cpp_new();
  573. return R;
  574. }/*--*/
  575. /* Extra external prototype for line 37 of /home/cyril/SmartEiffel/se/trunk/test_suite/language/unclassified/test_overload01.e:*/
  576. T2 cpp25cpp_value(T8 a1);
  577. /*TEST_OVERLOAD01*/T2 r25cpp_value(T8 a1){
  578. T2 R=0;
  579. R=cpp25cpp_value(a1);
  580. return R;
  581. }/*--*/
  582. /*TEST_OVERLOAD01*/void r25set_value(T25* C,T2 a1){
  583. r25cpp_set_value((/*RF2*/(C)->_external_object/*2p*/),a1);
  584. }/*--*/
  585. T0*ms26_718083334;
  586. T0*ms26_2167877;
  587. T0*ms26_1992063831;
  588. T0*ms26_1325941860;
  589. T0*ms26_0;
  590. T0*ms26_1690381566;
  591. T0*ms26_113001857;
  592. T0*ms26_265093627;
  593. T0*ms26_212160365;
  594. T0*ms26_48390502;
  595. T0*ms26_1682790378;
  596. T0*ms26_1075456615;
  597. T0*se_ms(int c,char*e){
  598. /* Allocate a Manifest STRING.*/
  599. T7*s=((T7*)se_malloc(sizeof(T7)));
  600. s->_count=c;
  601. s->_capacity=c+1;
  602. s->_storage=((T9)se_malloc(c+1));
  603. memcpy(s->_storage,e,c+1);
  604. return((T0*)s);}/*--*/
  605. T0*se_string(char*e){
  606. /* Allocate an Eiffel STRING by copying C char*e */
  607. int c=strlen(e);
  608. T7*s=((T7*)se_malloc(sizeof(T7)));
  609. s->_count=c;
  610. s->_capacity=c+1;
  611. s->_storage=((T9)se_malloc(c+1));
  612. memcpy(s->_storage,e,c+1);
  613. return((T0*)s);}/*--*/
  614. void se_msi1(void){
  615. ms26_718083334=se_ms(17,s26_718083334);
  616. ms26_2167877=se_ms(7,s26_2167877);
  617. ms26_1992063831=se_ms(12,s26_1992063831);
  618. ms26_1325941860=se_ms(38,s26_1325941860);
  619. ms26_0=se_ms(0,s26_0);
  620. ms26_1690381566=se_ms(15,s26_1690381566);
  621. ms26_113001857=se_ms(10,s26_113001857);
  622. ms26_265093627=se_ms(10,s26_265093627);
  623. ms26_212160365=se_ms(13,s26_212160365);
  624. ms26_48390502=se_ms(9,s26_48390502);
  625. ms26_1682790378=se_ms(83,s26_1682790378);
  626. ms26_1075456615=se_ms(20,s26_1075456615);
  627. }/*--*/
  628. T25*eiffel_root_object=(void*)0;
  629. int se_argc;
  630. char**se_argv;
  631. T7*g[164];
  632. void se_atexit(void){
  633. r49se_atexit();
  634. }/*--*/
  635. void initialize_eiffel_runtime(int argc,char*argv[]){
  636. /*[INTERNAL_C_LOCAL list*/
  637. T0* tmp0;
  638. /*INTERNAL_C_LOCAL list]*/
  639. se_argc=argc;
  640. se_argv=argv;
  641. atexit(se_atexit);
  642. g[25]=(T7*)se_string("TEST_OVERLOAD01");
  643. g[85]=(T7*)se_string("PROCEDURE");
  644. g[101]=(T7*)se_string("MEMORY");
  645. g[15]=(T7*)se_string("TUPLE 1");
  646. g[16]=(T7*)se_string("TUPLE 2");
  647. g[76]=(T7*)se_string("ROUTINE");
  648. g[17]=(T7*)se_string("TUPLE 3");
  649. g[18]=(T7*)se_string("TUPLE 4");
  650. g[19]=(T7*)se_string("TUPLE 5");
  651. g[20]=(T7*)se_string("TUPLE 6");
  652. g[21]=(T7*)se_string("TUPLE 7");
  653. g[22]=(T7*)se_string("TUPLE 8");
  654. g[23]=(T7*)se_string("TUPLE 9");
  655. g[14]=(T7*)se_string("TUPLE");
  656. g[24]=(T7*)se_string("TUPLE 10");
  657. g[8]=(T7*)se_string("POINTER");
  658. g[153]=(T7*)se_string("REFERENCE");
  659. g[75]=(T7*)se_string("FUNCTION");
  660. g[6]=(T7*)se_string("BOOLEAN");
  661. g[56]=(T7*)se_string("SAFE_EQUAL");
  662. g[13]=(T7*)se_string("ANY");
  663. g[122]=(T7*)se_string("WEAK_REFERENCE");
  664. g[38]=(T7*)se_string("PLATFORM");
  665. g[84]=(T7*)se_string("INTERNALS_HANDLER");
  666. g[105]=(T7*)se_string("NATIVE_ARRAY_INTERNALS");
  667. g[47]=(T7*)se_string("TYPED_INTERNALS");
  668. g[78]=(T7*)se_string("NATIVE_ARRAY_COLLECTOR");
  669. g[48]=(T7*)se_string("INTERNALS");
  670. g[74]=(T7*)se_string("COLLECTION");
  671. g[94]=(T7*)se_string("STACK");
  672. g[107]=(T7*)se_string("SIMPLE_DICTIONARY");
  673. g[108]=(T7*)se_string("DICTIONARY");
  674. g[92]=(T7*)se_string("FAST_ARRAY");
  675. g[77]=(T7*)se_string("ARRAY");
  676. g[106]=(T7*)se_string("HASHED_DICTIONARY");
  677. g[55]=(T7*)se_string("NATIVE_ARRAY");
  678. g[114]=(T7*)se_string("STRING_RECYCLING_ITEM");
  679. g[93]=(T7*)se_string("RECYCLING_POOL");
  680. g[100]=(T7*)se_string("STRING_RECYCLING_POOL");
  681. g[140]=(T7*)se_string("STRING_RECYCLING_ITEM_SORTER");
  682. g[121]=(T7*)se_string("ANY_HASHED_DICTIONARY_NODE");
  683. g[79]=(T7*)se_string("ARRAYED_COLLECTION");
  684. g[120]=(T7*)se_string("HASHED_DICTIONARY_NODE");
  685. g[109]=(T7*)se_string("HASH_TABLE_SIZE");
  686. g[130]=(T7*)se_string("DIRECTORY_NOTATION");
  687. g[54]=(T7*)se_string("FILTER");
  688. g[27]=(T7*)se_string("OUTPUT_STREAM");
  689. g[148]=(T7*)se_string("PATH_NAME");
  690. g[82]=(T7*)se_string("FILTER_INPUT_STREAM");
  691. g[40]=(T7*)se_string("TERMINAL_OUTPUT_STREAM");
  692. g[154]=(T7*)se_string("FILE_TOOLS");
  693. g[44]=(T7*)se_string("TERMINAL_INPUT_STREAM");
  694. g[43]=(T7*)se_string("TERMINAL_INPUT_OUTPUT_STREAM");
  695. g[71]=(T7*)se_string("FILTER_OUTPUT_STREAM");
  696. g[45]=(T7*)se_string("INPUT_STREAM");
  697. g[28]=(T7*)se_string("STREAM");
  698. g[66]=(T7*)se_string("FILE");
  699. g[65]=(T7*)se_string("TEXT_FILE_READ");
  700. g[126]=(T7*)se_string("TEXT_FILE_READ_WRITE");
  701. g[42]=(T7*)se_string("STD_INPUT_OUTPUT");
  702. g[39]=(T7*)se_string("STD_ERROR");
  703. g[124]=(T7*)se_string("TEXT_FILE_WRITE");
  704. g[50]=(T7*)se_string("STD_INPUT");
  705. g[49]=(T7*)se_string("STD_OUTPUT");
  706. g[46]=(T7*)se_string("INPUT_STREAM_TOOLS");
  707. g[32]=(T7*)se_string("OUTPUT_STREAM_TOOLS");
  708. g[41]=(T7*)se_string("REDIRECTION_TOOLS");
  709. g[147]=(T7*)se_string("BASIC_DIRECTORY");
  710. g[150]=(T7*)se_string("UNIXISH_PATH_NAME");
  711. g[31]=(T7*)se_string("FILTERABLE");
  712. g[129]=(T7*)se_string("PATH_JOINER");
  713. g[149]=(T7*)se_string("POSIX_PATH_NAME");
  714. g[128]=(T7*)se_string("PATH_NAME_NOTATION");
  715. g[157]=(T7*)se_string("MACINTOSH_DIRECTORY_NOTATION");
  716. g[158]=(T7*)se_string("OPENVMS_DIRECTORY_NOTATION");
  717. g[161]=(T7*)se_string("MICROSOFT_PATH_NAME");
  718. g[160]=(T7*)se_string("WINDOWS_DIRECTORY_NOTATION");
  719. g[127]=(T7*)se_string("UNIX_DIRECTORY_NOTATION");
  720. g[159]=(T7*)se_string("AMIGA_DIRECTORY_NOTATION");
  721. g[162]=(T7*)se_string("CYGWIN_DIRECTORY_NOTATION");
  722. g[156]=(T7*)se_string("UNICODE_STRING_HANDLER");
  723. g[73]=(T7*)se_string("ITERATOR");
  724. g[103]=(T7*)se_string("ITERATOR_ON_TRAVERSABLE");
  725. g[95]=(T7*)se_string("ITERATOR_ON_UNICODE_STRING");
  726. g[119]=(T7*)se_string("ITERATOR_ON_DICTIONARY_ITEMS");
  727. g[81]=(T7*)se_string("ITERATOR_ON_STRING");
  728. g[123]=(T7*)se_string("ITERATOR_ON_DICTIONARY_KEYS");
  729. g[141]=(T7*)se_string("ABSTRACT_SORTER");
  730. g[53]=(T7*)se_string("COUNTER");
  731. g[26]=(T7*)se_string("EIFFELTEST_TOOLS");
  732. g[104]=(T7*)se_string("MINI_PARSER_BUFFER");
  733. g[102]=(T7*)se_string("EVENTS_SET");
  734. g[69]=(T7*)se_string("EVENT_DESCRIPTOR");
  735. g[83]=(T7*)se_string("CAN_READ_DATA_FROM_STREAM");
  736. g[146]=(T7*)se_string("NETWORK_CONNECTION_OCCURRED");
  737. g[70]=(T7*)se_string("STREAM_EXCEPTION");
  738. g[72]=(T7*)se_string("CAN_WRITE_DATA_TO_STREAM");
  739. g[30]=(T7*)se_string("RECYCLABLE");
  740. g[29]=(T7*)se_string("DISPOSABLE");
  741. g[34]=(T7*)se_string("TRAVERSABLE");
  742. g[37]=(T7*)se_string("HASHABLE");
  743. g[35]=(T7*)se_string("STORABLE");
  744. g[36]=(T7*)se_string("COMPARABLE");
  745. g[12]=(T7*)se_string("REAL_EXTENDED");
  746. g[59]=(T7*)se_string("REAL_GENERAL");
  747. g[62]=(T7*)se_string("NATURAL_64");
  748. g[2]=(T7*)se_string("INTEGER_32");
  749. g[63]=(T7*)se_string("NUMBER");
  750. g[4]=(T7*)se_string("REAL_32");
  751. g[1]=(T7*)se_string("INTEGER_8");
  752. g[88]=(T7*)se_string("MUTABLE_BIG_INTEGER");
  753. g[11]=(T7*)se_string("INTEGER_64");
  754. g[80]=(T7*)se_string("NUMBER_TOOLS");
  755. g[51]=(T7*)se_string("INTEGER_GENERAL");
  756. g[5]=(T7*)se_string("REAL_64");
  757. g[57]=(T7*)se_string("NATURAL_16");
  758. g[52]=(T7*)se_string("NUMERIC");
  759. g[61]=(T7*)se_string("NATURAL_32");
  760. g[60]=(T7*)se_string("NATURAL_8");
  761. g[58]=(T7*)se_string("NATURAL_GENERAL");
  762. g[10]=(T7*)se_string("INTEGER_16");
  763. g[89]=(T7*)se_string("FRACTION_WITH_BIG_INTEGER_NUMBER");
  764. g[86]=(T7*)se_string("INTEGER_64_NUMBER");
  765. g[87]=(T7*)se_string("INTEGER_GENERAL_NUMBER");
  766. g[90]=(T7*)se_string("FRACTION_GENERAL_NUMBER");
  767. g[91]=(T7*)se_string("BIG_INTEGER_NUMBER");
  768. g[64]=(T7*)se_string("UNICODE_STRING");
  769. g[3]=(T7*)se_string("CHARACTER");
  770. g[7]=(T7*)se_string("STRING");
  771. g[33]=(T7*)se_string("STRING_HANDLER");
  772. g[163]=(T7*)se_string("TIME_FORMATTER");
  773. g[142]=(T7*)se_string("TIME");
  774. g[115]=(T7*)se_string("MICROSECOND_TIME");
  775. g[143]=(T7*)se_string("TIME_HANDLER");
  776. g[67]=(T7*)se_string("URL");
  777. g[135]=(T7*)se_string("ADDRESS");
  778. g[97]=(T7*)se_string("PROTOCOL");
  779. g[99]=(T7*)se_string("RESOURCE_LOCATOR");
  780. g[133]=(T7*)se_string("ACCESS");
  781. g[136]=(T7*)se_string("SOCKET_INPUT_OUTPUT_STREAM");
  782. g[96]=(T7*)se_string("PROTOCOLS");
  783. g[68]=(T7*)se_string("URL_VALIDITY");
  784. g[134]=(T7*)se_string("HOST");
  785. g[152]=(T7*)se_string("IP_ADDRESS");
  786. g[132]=(T7*)se_string("TCP_ACCESS");
  787. g[116]=(T7*)se_string("SOCKET_SERVER");
  788. g[151]=(T7*)se_string("CLIENT_SOCKET_INPUT_OUTPUT_STREAM");
  789. g[145]=(T7*)se_string("SERVER_SOCKET_INPUT_OUTPUT_STREAM");
  790. g[117]=(T7*)se_string("SOCKET_PLUG_IN");
  791. g[118]=(T7*)se_string("SOCKET_HANDLER");
  792. g[144]=(T7*)se_string("SOCKET");
  793. g[98]=(T7*)se_string("STREAM_PROTOCOL");
  794. g[138]=(T7*)se_string("HTTP_CLIENT_INPUT_STREAM");
  795. g[110]=(T7*)se_string("FILE_PROTOCOL");
  796. g[111]=(T7*)se_string("HTTP_PROTOCOL");
  797. g[112]=(T7*)se_string("TCP_PROTOCOL");
  798. g[137]=(T7*)se_string("HTTP_PROXY");
  799. g[139]=(T7*)se_string("HTTP_CLIENT_OUTPUT_STREAM");
  800. g[125]=(T7*)se_string("FILE_RESOURCE_LOCATOR");
  801. g[113]=(T7*)se_string("NETWORK_RESOURCE_VALIDITY");
  802. g[131]=(T7*)se_string("NETWORK_RESOURCE_LOCATOR");
  803. g[155]=(T7*)se_string("SYSTEM");
  804. g[9]=g[55];
  805. #ifdef SIGQUIT
  806. signal(SIGQUIT,se_signal_handler);
  807. #endif
  808. #ifdef SIGILL
  809. signal(SIGILL,se_signal_handler);
  810. #endif
  811. #ifdef SIGABRT
  812. signal(SIGABRT,se_signal_handler);
  813. #endif
  814. #ifdef SIGFPE
  815. signal(SIGFPE,se_signal_handler);
  816. #endif
  817. #ifdef SIGSEGV
  818. signal(SIGSEGV,se_signal_handler);
  819. #endif
  820. #ifdef SIGBUS
  821. signal(SIGBUS,se_signal_handler);
  822. #endif
  823. #ifdef SIGSYS
  824. signal(SIGSYS,se_signal_handler);
  825. #endif
  826. #ifdef SIGTRAP
  827. signal(SIGTRAP,se_signal_handler);
  828. #endif
  829. #ifdef SIGXCPU
  830. signal(SIGXCPU,se_signal_handler);
  831. #endif
  832. #ifdef SIGXFSZ
  833. signal(SIGXFSZ,se_signal_handler);
  834. #endif
  835. se_msi1();
  836. /*PCO*/
  837. tmp0/*new*/=((T0*)se_malloc(sizeof(T53)))/*p*/;
  838. *((T53*)tmp0/*new*/)=M53;
  839. oBC26assert_counter=tmp0/*new*/;
  840. /*tmp0.unlock*/
  841. /*reusing tmp0*/tmp0/*root*/=((T0*)se_malloc(sizeof(T25)))/*2p*/;
  842. *((T25*)tmp0/*root*/)=M25;
  843. eiffel_root_object=((T25*)tmp0/*root*/);
  844. /*tmp0.unlock*/
  845. }/*--*/
  846. int main(int argc,char*argv[]){
  847. /*[INTERNAL_C_LOCAL list*/
  848. T0* tmp0;
  849. /*INTERNAL_C_LOCAL list]*/
  850. initialize_eiffel_runtime(argc,argv);
  851. tmp0/*prof*/=((T0*)eiffel_root_object);
  852. r25default_create(((T25*)tmp0/*prof*/));
  853. handle(SE_HANDLE_NORMAL_EXIT, NULL);
  854. /*tmp0.unlock*/
  855. exit(0);
  856. return 0;
  857. }/*--*/
  858. #ifdef __cplusplus
  859. }
  860. #endif