diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 8dd42ede23..a157b22861 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,26 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2001-12-15 12:11 UTC+0100 Viktor Szakats + + * include/hbinkey.ch + * source/compiler/cmdcheck.c + * source/compiler/harbour.c + * source/compiler/hbpcode.c + (I couldn't complete this one, since it's far too messy) + * source/debug/dbgtmenu.prg + * source/debug/dbgtmitm.prg + * source/debug/dbgtobj.prg + * source/debug/dbgtwin.prg + * source/debug/dbgwa.prg + * source/debug/debugger.prg + * source/rtl/perfuncs.prg + * source/rtl/persist.prg + * source/rtl/profiler.prg + * source/rtl/gtsln/gtsln.c + * source/rtl/gtstd/gtstd.c + ! Basic cleanups "s_" prefix, tabs, = -> := + 2001-12-15 11:37 UTC+0100 Viktor Szakats * source/rtl/isprint.c diff --git a/harbour/include/hbinkey.ch b/harbour/include/hbinkey.ch index 9aad7819e0..c92e6a0463 100644 --- a/harbour/include/hbinkey.ch +++ b/harbour/include/hbinkey.ch @@ -55,178 +55,178 @@ #ifndef HB_HBINKEY_CH_ #define HB_HBINKEY_CH_ -#define HB_INKEY_NONE 256 -#define HB_INKEY_ALT 384 -#define HB_INKEY_CTRL 512 -#define HB_INKEY_SHIFT 640 -#define HB_INKEY_ENHANCED 768 +#define HB_INKEY_NONE 256 +#define HB_INKEY_ALT 384 +#define HB_INKEY_CTRL 512 +#define HB_INKEY_SHIFT 640 +#define HB_INKEY_ENHANCED 768 -#define HB_K_ALT_A 414 -#define HB_K_ALT_B 432 -#define HB_K_ALT_C 430 -#define HB_K_ALT_D 416 -#define HB_K_ALT_E 402 -#define HB_K_ALT_F 417 -#define HB_K_ALT_G 418 -#define HB_K_ALT_H 419 -#define HB_K_ALT_I 407 -#define HB_K_ALT_J 420 -#define HB_K_ALT_K 421 -#define HB_K_ALT_L 422 -#define HB_K_ALT_M 434 -#define HB_K_ALT_N 433 -#define HB_K_ALT_O 408 -#define HB_K_ALT_P 409 -#define HB_K_ALT_Q 400 -#define HB_K_ALT_R 403 -#define HB_K_ALT_S 415 -#define HB_K_ALT_T 404 -#define HB_K_ALT_U 406 -#define HB_K_ALT_V 431 -#define HB_K_ALT_W 401 -#define HB_K_ALT_X 429 -#define HB_K_ALT_Y 405 -#define HB_K_ALT_Z 428 +#define HB_K_ALT_A 414 +#define HB_K_ALT_B 432 +#define HB_K_ALT_C 430 +#define HB_K_ALT_D 416 +#define HB_K_ALT_E 402 +#define HB_K_ALT_F 417 +#define HB_K_ALT_G 418 +#define HB_K_ALT_H 419 +#define HB_K_ALT_I 407 +#define HB_K_ALT_J 420 +#define HB_K_ALT_K 421 +#define HB_K_ALT_L 422 +#define HB_K_ALT_M 434 +#define HB_K_ALT_N 433 +#define HB_K_ALT_O 408 +#define HB_K_ALT_P 409 +#define HB_K_ALT_Q 400 +#define HB_K_ALT_R 403 +#define HB_K_ALT_S 415 +#define HB_K_ALT_T 404 +#define HB_K_ALT_U 406 +#define HB_K_ALT_V 431 +#define HB_K_ALT_W 401 +#define HB_K_ALT_X 429 +#define HB_K_ALT_Y 405 +#define HB_K_ALT_Z 428 -#define HB_K_CTRL_A 1 -#define HB_K_CTRL_B 2 -#define HB_K_CTRL_C 3 -#define HB_K_CTRL_D 4 -#define HB_K_CTRL_E 5 -#define HB_K_CTRL_F 6 -#define HB_K_CTRL_G 7 -#define HB_K_CTRL_H 8 -#define HB_K_CTRL_I 9 -#define HB_K_CTRL_J 10 -#define HB_K_CTRL_K 11 -#define HB_K_CTRL_L 12 -#define HB_K_CTRL_M 13 -#define HB_K_CTRL_N 14 -#define HB_K_CTRL_O 15 -#define HB_K_CTRL_P 16 -#define HB_K_CTRL_Q 17 -#define HB_K_CTRL_R 18 -#define HB_K_CTRL_S 19 -#define HB_K_CTRL_T 20 -#define HB_K_CTRL_U 21 -#define HB_K_CTRL_V 22 -#define HB_K_CTRL_W 23 -#define HB_K_CTRL_X 24 -#define HB_K_CTRL_Y 25 -#define HB_K_CTRL_Z 26 -#define HB_K_CTRL_LEFT_SQUARE 27 -#define HB_K_CTRL_BACK_SLASH 28 -#define HB_K_CTRL_RIGHT_SQUARE 29 -#define HB_K_CTRL_HAT 30 -#define HB_K_CTRL_UNDERSCORE 31 +#define HB_K_CTRL_A 1 +#define HB_K_CTRL_B 2 +#define HB_K_CTRL_C 3 +#define HB_K_CTRL_D 4 +#define HB_K_CTRL_E 5 +#define HB_K_CTRL_F 6 +#define HB_K_CTRL_G 7 +#define HB_K_CTRL_H 8 +#define HB_K_CTRL_I 9 +#define HB_K_CTRL_J 10 +#define HB_K_CTRL_K 11 +#define HB_K_CTRL_L 12 +#define HB_K_CTRL_M 13 +#define HB_K_CTRL_N 14 +#define HB_K_CTRL_O 15 +#define HB_K_CTRL_P 16 +#define HB_K_CTRL_Q 17 +#define HB_K_CTRL_R 18 +#define HB_K_CTRL_S 19 +#define HB_K_CTRL_T 20 +#define HB_K_CTRL_U 21 +#define HB_K_CTRL_V 22 +#define HB_K_CTRL_W 23 +#define HB_K_CTRL_X 24 +#define HB_K_CTRL_Y 25 +#define HB_K_CTRL_Z 26 +#define HB_K_CTRL_LEFT_SQUARE 27 +#define HB_K_CTRL_BACK_SLASH 28 +#define HB_K_CTRL_RIGHT_SQUARE 29 +#define HB_K_CTRL_HAT 30 +#define HB_K_CTRL_UNDERSCORE 31 -#define HB_K_SPACE 32 +#define HB_K_SPACE 32 -#define HB_K_ALT_1 386 -#define HB_K_ALT_2 387 -#define HB_K_ALT_3 388 -#define HB_K_ALT_4 389 -#define HB_K_ALT_5 390 -#define HB_K_ALT_6 391 -#define HB_K_ALT_7 392 -#define HB_K_ALT_8 393 -#define HB_K_ALT_9 394 -#define HB_K_ALT_0 395 -#define HB_K_ALT_EQUAL 397 +#define HB_K_ALT_1 386 +#define HB_K_ALT_2 387 +#define HB_K_ALT_3 388 +#define HB_K_ALT_4 389 +#define HB_K_ALT_5 390 +#define HB_K_ALT_6 391 +#define HB_K_ALT_7 392 +#define HB_K_ALT_8 393 +#define HB_K_ALT_9 394 +#define HB_K_ALT_0 395 +#define HB_K_ALT_EQUAL 397 -#define HB_K_CTRL_1 514 -#define HB_K_CTRL_2 515 -#define HB_K_CTRL_3 516 -#define HB_K_CTRL_4 517 -#define HB_K_CTRL_5 518 -#define HB_K_CTRL_6 519 -#define HB_K_CTRL_7 520 -#define HB_K_CTRL_8 521 -#define HB_K_CTRL_9 522 -#define HB_K_CTRL_0 523 -#define HB_K_CTRL_COLON 551 -#define HB_K_CTRL_SEMI_COLON 551 -#define HB_K_CTRL_COMMA 563 -#define HB_K_CTRL_PERIOD 564 -#define HB_K_CTRL_SLASH 565 +#define HB_K_CTRL_1 514 +#define HB_K_CTRL_2 515 +#define HB_K_CTRL_3 516 +#define HB_K_CTRL_4 517 +#define HB_K_CTRL_5 518 +#define HB_K_CTRL_6 519 +#define HB_K_CTRL_7 520 +#define HB_K_CTRL_8 521 +#define HB_K_CTRL_9 522 +#define HB_K_CTRL_0 523 +#define HB_K_CTRL_COLON 551 +#define HB_K_CTRL_SEMI_COLON 551 +#define HB_K_CTRL_COMMA 563 +#define HB_K_CTRL_PERIOD 564 +#define HB_K_CTRL_SLASH 565 -#define HB_K_CTRL_MINUS 524 -#define HB_K_CTRL_EQUALS 525 -#define HB_K_CTRL_PLUS 525 -#define HB_K_CTRL_LEFT_CURLY 538 -#define HB_K_CTRL_RIGHT_CURLY 539 +#define HB_K_CTRL_MINUS 524 +#define HB_K_CTRL_EQUALS 525 +#define HB_K_CTRL_PLUS 525 +#define HB_K_CTRL_LEFT_CURLY 538 +#define HB_K_CTRL_RIGHT_CURLY 539 -#define HB_K_BACKSPACE 8 -#define HB_K_ALT_BACKSPACE 398 -#define HB_K_CTRL_BACKSPACE 127 -#define HB_K_SHIFT_BACKSPACE +#define HB_K_BACKSPACE 8 +#define HB_K_ALT_BACKSPACE 398 +#define HB_K_CTRL_BACKSPACE 127 +#define HB_K_SHIFT_BACKSPACE #define HB_K_ENTER 13 #define HB_K_ALT_ENTER 412 #define HB_K_CTRL_ENTER 10 #define HB_K_SHIFT_ENTER 668 -#define HB_K_ESC 27 -#define HB_K_ALT_ESC 385 -#define HB_K_CTRL_ESC 513 -#define HB_K_SHIFT_ESC 641 +#define HB_K_ESC 27 +#define HB_K_ALT_ESC 385 +#define HB_K_CTRL_ESC 513 +#define HB_K_SHIFT_ESC 641 -#define HB_K_TAB 9 -#define HB_K_ALT_TAB 399 -#define HB_K_CTRL_TAB 527 -#define HB_K_SHIFT_TAB 655 +#define HB_K_TAB 9 +#define HB_K_ALT_TAB 399 +#define HB_K_CTRL_TAB 527 +#define HB_K_SHIFT_TAB 655 -#define HB_K_F1 315 -#define HB_K_F2 316 -#define HB_K_F3 317 -#define HB_K_F4 318 -#define HB_K_F5 319 -#define HB_K_F6 320 -#define HB_K_F7 321 -#define HB_K_F8 322 -#define HB_K_F9 323 -#define HB_K_F10 324 -#define HB_K_F11 343 -#define HB_K_F12 344 +#define HB_K_F1 315 +#define HB_K_F2 316 +#define HB_K_F3 317 +#define HB_K_F4 318 +#define HB_K_F5 319 +#define HB_K_F6 320 +#define HB_K_F7 321 +#define HB_K_F8 322 +#define HB_K_F9 323 +#define HB_K_F10 324 +#define HB_K_F11 343 +#define HB_K_F12 344 -#define HB_K_ALT_F1 443 -#define HB_K_ALT_F2 444 -#define HB_K_ALT_F3 445 -#define HB_K_ALT_F4 446 -#define HB_K_ALT_F5 447 -#define HB_K_ALT_F6 448 -#define HB_K_ALT_F7 449 -#define HB_K_ALT_F8 450 -#define HB_K_ALT_F9 451 -#define HB_K_ALT_F10 452 -#define HB_K_ALT_F11 471 -#define HB_K_ALT_F12 472 +#define HB_K_ALT_F1 443 +#define HB_K_ALT_F2 444 +#define HB_K_ALT_F3 445 +#define HB_K_ALT_F4 446 +#define HB_K_ALT_F5 447 +#define HB_K_ALT_F6 448 +#define HB_K_ALT_F7 449 +#define HB_K_ALT_F8 450 +#define HB_K_ALT_F9 451 +#define HB_K_ALT_F10 452 +#define HB_K_ALT_F11 471 +#define HB_K_ALT_F12 472 -#define HB_K_CTRL_F1 571 -#define HB_K_CTRL_F2 572 -#define HB_K_CTRL_F3 573 -#define HB_K_CTRL_F4 574 -#define HB_K_CTRL_F5 575 -#define HB_K_CTRL_F6 576 -#define HB_K_CTRL_F7 577 -#define HB_K_CTRL_F8 578 -#define HB_K_CTRL_F9 579 -#define HB_K_CTRL_F10 580 -#define HB_K_CTRL_F11 599 -#define HB_K_CTRL_F12 600 +#define HB_K_CTRL_F1 571 +#define HB_K_CTRL_F2 572 +#define HB_K_CTRL_F3 573 +#define HB_K_CTRL_F4 574 +#define HB_K_CTRL_F5 575 +#define HB_K_CTRL_F6 576 +#define HB_K_CTRL_F7 577 +#define HB_K_CTRL_F8 578 +#define HB_K_CTRL_F9 579 +#define HB_K_CTRL_F10 580 +#define HB_K_CTRL_F11 599 +#define HB_K_CTRL_F12 600 -#define HB_K_SHIFT_F1 699 -#define HB_K_SHIFT_F2 700 -#define HB_K_SHIFT_F3 701 -#define HB_K_SHIFT_F4 702 -#define HB_K_SHIFT_F5 703 -#define HB_K_SHIFT_F6 704 -#define HB_K_SHIFT_F7 705 -#define HB_K_SHIFT_F8 706 -#define HB_K_SHIFT_F9 707 -#define HB_K_SHIFT_F10 708 -#define HB_K_SHIFT_F11 727 -#define HB_K_SHIFT_F12 728 +#define HB_K_SHIFT_F1 699 +#define HB_K_SHIFT_F2 700 +#define HB_K_SHIFT_F3 701 +#define HB_K_SHIFT_F4 702 +#define HB_K_SHIFT_F5 703 +#define HB_K_SHIFT_F6 704 +#define HB_K_SHIFT_F7 705 +#define HB_K_SHIFT_F8 706 +#define HB_K_SHIFT_F9 707 +#define HB_K_SHIFT_F10 708 +#define HB_K_SHIFT_F11 727 +#define HB_K_SHIFT_F12 728 #define HB_KP_MINUS 330 #define HB_KP_ALT_MINUS 458 @@ -253,96 +253,96 @@ #define HB_KP_CTRL_ENTER 1308 #define HB_KP_SHIFT_ENTER 1436 -#define HB_KP_HOME 327 -#define HB_KP_UP 328 -#define HB_KP_PG_UP 329 -#define HB_KP_LEFT 331 -#define HB_KP_5 332 -#define HB_KP_RIGHT 333 -#define HB_KP_END 335 -#define HB_KP_DOWN 336 -#define HB_KP_PG_DN 337 -#define HB_KP_INS 338 -#define HB_KP_DEL 339 +#define HB_KP_HOME 327 +#define HB_KP_UP 328 +#define HB_KP_PG_UP 329 +#define HB_KP_LEFT 331 +#define HB_KP_5 332 +#define HB_KP_RIGHT 333 +#define HB_KP_END 335 +#define HB_KP_DOWN 336 +#define HB_KP_PG_DN 337 +#define HB_KP_INS 338 +#define HB_KP_DEL 339 -#define HB_KP_ALT_HOME 455 -#define HB_KP_ALT_UP 456 -#define HB_KP_ALT_PG_UP 457 -#define HB_KP_ALT_LEFT 459 -#define HB_KP_ALT_5 460 -#define HB_KP_ALT_RIGHT 461 -#define HB_KP_ALT_END 463 -#define HB_KP_ALT_DOWN 463 -#define HB_KP_ALT_PG_DN 465 -#define HB_KP_ALT_INS 466 -#define HB_KP_ALT_DEL 467 +#define HB_KP_ALT_HOME 455 +#define HB_KP_ALT_UP 456 +#define HB_KP_ALT_PG_UP 457 +#define HB_KP_ALT_LEFT 459 +#define HB_KP_ALT_5 460 +#define HB_KP_ALT_RIGHT 461 +#define HB_KP_ALT_END 463 +#define HB_KP_ALT_DOWN 463 +#define HB_KP_ALT_PG_DN 465 +#define HB_KP_ALT_INS 466 +#define HB_KP_ALT_DEL 467 -#define HB_KP_CTRL_HOME 583 -#define HB_KP_CTRL_UP 584 -#define HB_KP_CTRL_PG_UP 585 -#define HB_KP_CTRL_LEFT 587 -#define HB_KP_CTRL_5 588 -#define HB_KP_CTRL_RIGHT 589 -#define HB_KP_CTRL_END 591 -#define HB_KP_CTRL_DOWN 592 -#define HB_KP_CTRL_PG_DN 593 -#define HB_KP_CTRL_INS 594 -#define HB_KP_CTRL_DEL 595 +#define HB_KP_CTRL_HOME 583 +#define HB_KP_CTRL_UP 584 +#define HB_KP_CTRL_PG_UP 585 +#define HB_KP_CTRL_LEFT 587 +#define HB_KP_CTRL_5 588 +#define HB_KP_CTRL_RIGHT 589 +#define HB_KP_CTRL_END 591 +#define HB_KP_CTRL_DOWN 592 +#define HB_KP_CTRL_PG_DN 593 +#define HB_KP_CTRL_INS 594 +#define HB_KP_CTRL_DEL 595 -#define HB_KP_SHIFT_HOME 711 -#define HB_KP_SHIFT_UP 712 -#define HB_KP_SHIFT_PG_UP 713 -#define HB_KP_SHIFT_LEFT 715 -#define HB_KP_SHIFT_5 716 -#define HB_KP_SHIFT_RIGHT 717 -#define HB_KP_SHIFT_END 719 -#define HB_KP_SHIFT_DOWN 720 -#define HB_KP_SHIFT_PG_DN 721 -#define HB_KP_SHIFT_INS 722 -#define HB_KP_SHIFT_DEL 723 +#define HB_KP_SHIFT_HOME 711 +#define HB_KP_SHIFT_UP 712 +#define HB_KP_SHIFT_PG_UP 713 +#define HB_KP_SHIFT_LEFT 715 +#define HB_KP_SHIFT_5 716 +#define HB_KP_SHIFT_RIGHT 717 +#define HB_KP_SHIFT_END 719 +#define HB_KP_SHIFT_DOWN 720 +#define HB_KP_SHIFT_PG_DN 721 +#define HB_KP_SHIFT_INS 722 +#define HB_KP_SHIFT_DEL 723 -#define HB_K_HOME 1095 -#define HB_K_UP 1096 -#define HB_K_PG_UP 1097 -#define HB_K_LEFT 1099 -#define HB_K_RIGHT 1101 -#define HB_K_END 1103 -#define HB_K_DOWN 1104 -#define HB_K_PG_DN 1105 -#define HB_K_INS 1106 -#define HB_K_DEL 1107 +#define HB_K_HOME 1095 +#define HB_K_UP 1096 +#define HB_K_PG_UP 1097 +#define HB_K_LEFT 1099 +#define HB_K_RIGHT 1101 +#define HB_K_END 1103 +#define HB_K_DOWN 1104 +#define HB_K_PG_DN 1105 +#define HB_K_INS 1106 +#define HB_K_DEL 1107 -#define HB_K_ALT_HOME 1223 -#define HB_K_ALT_UP 1224 -#define HB_K_ALT_PG_UP 1225 -#define HB_K_ALT_LEFT 1227 -#define HB_K_ALT_RIGHT 1229 -#define HB_K_ALT_END 1231 -#define HB_K_ALT_DOWN 1231 -#define HB_K_ALT_PG_DN 1233 -#define HB_K_ALT_INS 1234 -#define HB_K_ALT_DEL 1235 +#define HB_K_ALT_HOME 1223 +#define HB_K_ALT_UP 1224 +#define HB_K_ALT_PG_UP 1225 +#define HB_K_ALT_LEFT 1227 +#define HB_K_ALT_RIGHT 1229 +#define HB_K_ALT_END 1231 +#define HB_K_ALT_DOWN 1231 +#define HB_K_ALT_PG_DN 1233 +#define HB_K_ALT_INS 1234 +#define HB_K_ALT_DEL 1235 -#define HB_K_CTRL_HOME 1351 -#define HB_K_CTRL_UP 1352 -#define HB_K_CTRL_PG_UP 1353 -#define HB_K_CTRL_LEFT 1355 -#define HB_K_CTRL_RIGHT 1357 -#define HB_K_CTRL_END 1359 -#define HB_K_CTRL_DOWN 1360 -#define HB_K_CTRL_PG_DN 1361 -#define HB_K_CTRL_INS 1362 -#define HB_K_CTRL_DEL 1363 +#define HB_K_CTRL_HOME 1351 +#define HB_K_CTRL_UP 1352 +#define HB_K_CTRL_PG_UP 1353 +#define HB_K_CTRL_LEFT 1355 +#define HB_K_CTRL_RIGHT 1357 +#define HB_K_CTRL_END 1359 +#define HB_K_CTRL_DOWN 1360 +#define HB_K_CTRL_PG_DN 1361 +#define HB_K_CTRL_INS 1362 +#define HB_K_CTRL_DEL 1363 -#define HB_K_SHIFT_HOME 1479 -#define HB_K_SHIFT_UP 1480 -#define HB_K_SHIFT_PG_UP 1481 -#define HB_K_SHIFT_LEFT 1483 -#define HB_K_SHIFT_RIGHT 1485 -#define HB_K_SHIFT_END 1487 -#define HB_K_SHIFT_DOWN 1488 -#define HB_K_SHIFT_PG_DN 1489 -#define HB_K_SHIFT_INS 1490 -#define HB_K_SHIFT_DEL 1491 +#define HB_K_SHIFT_HOME 1479 +#define HB_K_SHIFT_UP 1480 +#define HB_K_SHIFT_PG_UP 1481 +#define HB_K_SHIFT_LEFT 1483 +#define HB_K_SHIFT_RIGHT 1485 +#define HB_K_SHIFT_END 1487 +#define HB_K_SHIFT_DOWN 1488 +#define HB_K_SHIFT_PG_DN 1489 +#define HB_K_SHIFT_INS 1490 +#define HB_K_SHIFT_DEL 1491 #endif /* HB_HBINKEY_CH_ */ diff --git a/harbour/source/compiler/cmdcheck.c b/harbour/source/compiler/cmdcheck.c index 12f1d91f5f..e35e1bfa3b 100644 --- a/harbour/source/compiler/cmdcheck.c +++ b/harbour/source/compiler/cmdcheck.c @@ -610,7 +610,7 @@ void hb_compChkEnvironVar( char * szSwitch ) break; case 'c': - /* clear all flags - minimal set of features */ + /* clear all flags - minimal set of features */ hb_comp_Supported = 0; break; diff --git a/harbour/source/compiler/harbour.c b/harbour/source/compiler/harbour.c index 5c607c7e3d..38d797292d 100644 --- a/harbour/source/compiler/harbour.c +++ b/harbour/source/compiler/harbour.c @@ -224,10 +224,8 @@ int main( int argc, char * argv[] ) hb_compIdentifierOpen(); /* Load standard Declarations. */ - if ( hb_comp_iWarnings >= 3 ) - { - hb_compDeclaredInit(); - } + if( hb_comp_iWarnings >= 3 ) + hb_compDeclaredInit(); /* Process all files passed via the command line. */ diff --git a/harbour/source/compiler/hbpcode.c b/harbour/source/compiler/hbpcode.c index 7d93ea7ac0..8c9b9360ee 100644 --- a/harbour/source/compiler/hbpcode.c +++ b/harbour/source/compiler/hbpcode.c @@ -282,9 +282,9 @@ void hb_compStrongType( int iSize ) if( pDeclared ) { if( hb_comp_cCastType == ' ' ) - { + { /* No casting - do nothing. */ - } + } else if( toupper( hb_comp_cCastType ) == 'S' ) { PCOMCLASS pClass = hb_compClassFind( hb_comp_szFromClass ); @@ -317,13 +317,13 @@ void hb_compStrongType( int iSize ) /* Variant as SubType. */ if( ( pFunc->pStack[ pFunc->iStackIndex ] == '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cSubType1 = ( pFunc->pStack[ pFunc->iStackIndex ] -= VT_OFFSET_VARIANT ); - } + } else - { + { cType1 = pFunc->pStack[ pFunc->iStackIndex ]; - } + } if( cSubType1 ) { @@ -380,14 +380,14 @@ void hb_compStrongType( int iSize ) wVar = pFunc->pCode[ ulPos + 1 ]; if( pFunc->iStackIndex < ( wVar + 2 ) ) - { - /* - printf( "\nNeeded %i values, found %i!\n", wVar + 1, pFunc->iStackIndex - 1 ); - */ - pFunc->iStackIndex = 1; + { + /* + printf( "\nNeeded %i values, found %i!\n", wVar + 1, pFunc->iStackIndex - 1 ); + */ + pFunc->iStackIndex = 1; pFunc->pStack[ 0 ] = ' '; break; - } + } if( pFunc->iStackFunctions > 0 && pFunc->pStackFunctions[ --pFunc->iStackFunctions ] ) { @@ -407,10 +407,10 @@ void hb_compStrongType( int iSize ) break; } - /* + /* printf( "\nOptionals: %i\n", iOptionals ); printf( "\nExec Function: %s, wVar: %i Parameters: %i Optionals: %i\n", pFunc->pStackFunctions[ pFunc->iStackFunctions ]->szName, wVar, hb_comp_iParamCount, iOptionals ); - */ + */ /* Now, check the types. */ if( wVar >= ( hb_comp_iParamCount - iOptionals ) && wVar <= hb_comp_iParamCount ) @@ -422,31 +422,31 @@ void hb_compStrongType( int iSize ) { BOOL bByRef = FALSE; - cParamType = pFunc->pStack[ iParamBase + iOffset ]; + cParamType = pFunc->pStack[ iParamBase + iOffset ]; if( ( cParamType == '-' + VT_OFFSET_VARIANT ) || cParamType >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cParamType -= VT_OFFSET_VARIANT; - } + } cFormalType = hb_comp_cParamTypes[ iOffset ]; if( cFormalType == ( ' ' + VT_OFFSET_OPTIONAL ) || cFormalType >= ( 'A' + VT_OFFSET_OPTIONAL ) ) - { + { cFormalType -= VT_OFFSET_OPTIONAL; - } + } if( cFormalType == ' ' + VT_OFFSET_BYREF || cFormalType >= ( 'A' + VT_OFFSET_BYREF ) ) - { + { bByRef = TRUE; cFormalType -= VT_OFFSET_BYREF; - } + } /* --- */ if( cFormalType == ' ' && ! bByRef ) - { + { /* Declared is Variant, accept anything. */ - } + } else if( cFormalType == 'S' && cParamType == 'S' && pFunc->iStackClasses ) { PCOMCLASS hb_comp_pFormalClass = pFunc->pStackFunctions[ pFunc->iStackFunctions ]->pParamClasses[ iOffset ]; @@ -492,17 +492,17 @@ void hb_compStrongType( int iSize ) } if( bByRef ) - { + { sprintf( ( char * ) szType2, "@%c", cFormalType ); - } + } else if( islower( cFormalType ) ) - { + { sprintf( ( char * ) szType2, "ARRAY OF %c", toupper( cFormalType ) ); - } - else - { + } + else + { sprintf( ( char * ) szType2, "%c", cFormalType ); - } + } } sprintf( ( char * ) szType1, "%s #%i", pFunc->pStackFunctions[ pFunc->iStackFunctions ]->szName, iOffset + 1 ); @@ -525,34 +525,36 @@ void hb_compStrongType( int iSize ) else { sprintf( ( char * ) szType1, "%s got %i", pFunc->pStackFunctions[ pFunc->iStackFunctions ]->szName, wVar ); - if( iOptionals ) - { + + if( iOptionals ) + { sprintf( ( char * ) szType2, "%i-%i", hb_comp_iParamCount - iOptionals, hb_comp_iParamCount ); - } - else - { + } + else + { sprintf( ( char * ) szType2, "%i", hb_comp_iParamCount - iOptionals ); - } + } hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_PARAM_COUNT, ( char * ) szType1, ( char * ) szType2 ); } } - else - { - /* + else + { + /* printf( "\nExec Non Declared Function - Stack: %i Functions: %i\n", pFunc->iStackIndex, pFunc->iStackFunctions ); - */ - } + */ + } - #if 0 - { - int i; - for ( i = 0; i < pFunc->iStackIndex; i++ ) - { - printf( "\nStack: %i Type: %c", i, pFunc->pStack[ i ] ); - } - } - printf( "\Removing %i parameters\n", wVar ); - #endif + #if 0 + { + int i; + for ( i = 0; i < pFunc->iStackIndex; i++ ) + { + printf( "\nStack: %i Type: %c", i, pFunc->pStack[ i ] ); + } + } + printf( "\Removing %i parameters\n", wVar ); + + #endif /* Removing all the parameters. Return type already pushed just prior to parameters */ pFunc->iStackIndex -= wVar; @@ -561,25 +563,25 @@ void hb_compStrongType( int iSize ) pFunc->iStackIndex--; if( pFunc->pCode[ ulPos ] == HB_P_DO || pFunc->pCode[ ulPos ] == HB_P_DOSHORT ) - { + { /* No return value. */ pFunc->iStackIndex--; - /* + /* printf( "\nNo Type for Procedure. - Stack: %i\n", pFunc->iStackIndex ); - */ - } + */ + } else - { - #if 0 - /* Declared result already on stack. */ - cType = pFunc->pStack[ pFunc->iStackIndex - 1 ]; - if( ( cType == '-' + VT_OFFSET_VARIANT ) || cType >= ( 'A' + VT_OFFSET_VARIANT ) ) - { - cType -= VT_OFFSET_VARIANT; - } - printf( "\nType of Function \'%c\' - Stack: %i\n", cType, pFunc->iStackIndex ); - #endif - } + { + #if 0 + /* Declared result already on stack. */ + cType = pFunc->pStack[ pFunc->iStackIndex - 1 ]; + if( ( cType == '-' + VT_OFFSET_VARIANT ) || cType >= ( 'A' + VT_OFFSET_VARIANT ) ) + { + cType -= VT_OFFSET_VARIANT; + } + printf( "\nType of Function \'%c\' - Stack: %i\n", cType, pFunc->iStackIndex ); + #endif + } break; case HB_P_MESSAGE : @@ -592,30 +594,30 @@ void hb_compStrongType( int iSize ) { cSubType1 -= VT_OFFSET_VARIANT; if( cSubType1 == 'S' ) - { + { sprintf( ( char * ) szType1, "AnyType.SubType[Object]" ); - } + } else if( cSubType1 == 's' ) - { + { sprintf( ( char * ) szType1, "AnyType.SubType[ARRAY OF Object]" ); - } + } else if( islower( cSubType1 ) ) - { + { sprintf( ( char * ) szType1, "AnyType.SubType[ARRAY OF %c]", cSubType1 ); - } + } else if( cSubType1 == '-' ) - { + { strcpy( ( char * ) szType1, "AnyType.SubType[NIL]" ); - } + } else - { + { sprintf( ( char * ) szType1, "AnyType.SubType[%c]", cSubType1 ); - } + } } else - { + { sprintf( ( char * ) szType1, "%c", cSubType1 ); - } + } if( cSubType1 == 'O' ) ;/* The Object is not declared. */ @@ -643,19 +645,19 @@ void hb_compStrongType( int iSize ) else /* The method is not declared. */ { if( pFunc->iStackFunctions < 8 ) - { + { pFunc->pStackFunctions[ pFunc->iStackFunctions++ ] = NULL; - } + } } } else if( cSubType1 == ' ' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_OPERAND_SUSPECT, "O", NULL ); - } + } else - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_OPERAND_TYPE, ( char * ) szType1, "O" ); - } + } /* Result will be pushed by HB_P_SEND*/ break; @@ -675,9 +677,9 @@ void hb_compStrongType( int iSize ) cType = pFunc->pStack[ pFunc->iStackIndex - ( wVar + 1 ) ]; if( ( cType == '-' + VT_OFFSET_VARIANT ) || cType >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cType -= VT_OFFSET_VARIANT; - } + } if( cType == 'S' && pFunc->iStackFunctions > 0 && pFunc->pStackFunctions[ pFunc->iStackFunctions - 1 ] ) { @@ -866,15 +868,15 @@ void hb_compStrongType( int iSize ) { pFunc->pStack[ pFunc->iStackIndex - 1 ] = pFunc->pStackFunctions[ pFunc->iStackFunctions ]->cType; - /* + /* printf( "\nDeclared Method!!! Stack: %i Type: %c\n", pFunc->iStackIndex, pFunc->pStack[ pFunc->iStackIndex - 1 ] ); - */ + */ if( toupper( pFunc->pStack[ pFunc->iStackIndex - 1 ] ) == 'S' && pFunc->iStackClasses < 8 ) { /* - printf( "\nNested CLASS!!! Stack: %i Type: %c Class: %s\n", pFunc->iStackIndex, pFunc->pStack[ pFunc->iStackIndex - 1 ], pFunc->pStackFunctions[ pFunc->iStackFunctions ]->pClass->szName ); - */ + printf( "\nNested CLASS!!! Stack: %i Type: %c Class: %s\n", pFunc->iStackIndex, pFunc->pStack[ pFunc->iStackIndex - 1 ], pFunc->pStackFunctions[ pFunc->iStackFunctions ]->pClass->szName ); + */ pFunc->pStackClasses[ pFunc->iStackClasses++ ] = pFunc->pStackFunctions[ pFunc->iStackFunctions ]->pClass; } } @@ -888,53 +890,53 @@ void hb_compStrongType( int iSize ) case HB_P_DEC : case HB_P_INC : if( ( pFunc->pStack[ pFunc->iStackIndex - 1 ] == '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex - 1 ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cSubType1 = ( pFunc->pStack[ pFunc->iStackIndex - 1 ] -= VT_OFFSET_VARIANT ); - } + } if( cSubType1 && cSubType1 == '-' ) - { + { strcpy( ( char * ) szType1, "AnyType.SubType[NIL]" ); - } + } else if( cSubType1 ) - { + { sprintf( ( char * ) szType1, "AnyType.SubType[%c]", pFunc->pStack[ pFunc->iStackIndex - 1 ] ); - } + } else if( pFunc->pStack[ pFunc->iStackIndex - 1 ] == '-' ) - { + { strcpy( ( char * ) szType1, "NIL" ); - } + } else - { + { sprintf( ( char * ) szType1, "%c", pFunc->pStack[ pFunc->iStackIndex - 1 ] ); - } + } if( pFunc->pStack[ pFunc->iStackIndex - 1 ] == 'N' ) - { - /* Ok. */ - } + { + /* Ok. */ + } else if( pFunc->pStack[ pFunc->iStackIndex - 1 ] == ' ' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_OPERAND_SUSPECT, "N", NULL ); - } + } else - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_OPERAND_TYPE, ( char * ) szType1, "N" ); - } + } break; case HB_P_JUMPNEAR : case HB_P_JUMP : case HB_P_JUMPFAR : - /* Restoring Stack depth. */ - if( s_iCondIndex ) - { - pFunc->iStackIndex = s_aiPreCondStack[ --s_iCondIndex ]; - } - /* - printf( "\nAfter Cond: %i\n", pFunc->iStackIndex ); - */ - break; + /* Restoring Stack depth. */ + if( s_iCondIndex ) + { + pFunc->iStackIndex = s_aiPreCondStack[ --s_iCondIndex ]; + } + /* + printf( "\nAfter Cond: %i\n", pFunc->iStackIndex ); + */ + break; case HB_P_JUMPFALSENEAR : case HB_P_JUMPFALSE : @@ -948,51 +950,51 @@ void hb_compStrongType( int iSize ) pFunc->iStackIndex--; - /* - printf( "\nBefore Cond: %i\n", pFunc->iStackIndex ); - */ - - /* Saving Stack depth befor Jump. */ - /* TODO: Remove Hard coded limitation. */ - if( s_iCondIndex < 16 ) - { - s_aiPreCondStack[ s_iCondIndex++ ] = pFunc->iStackIndex; - } + /* + printf( "\nBefore Cond: %i\n", pFunc->iStackIndex ); + */ + + /* Saving Stack depth befor Jump. */ + /* TODO: Remove Hard coded limitation. */ + if( s_iCondIndex < 16 ) + { + s_aiPreCondStack[ s_iCondIndex++ ] = pFunc->iStackIndex; + } if( ( pFunc->pStack[ pFunc->iStackIndex ] == '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cSubType1 = ( pFunc->pStack[ pFunc->iStackIndex ] -= VT_OFFSET_VARIANT ); - } + } if( cSubType1 && cSubType1 == '-' ) - { + { strcpy( ( char * ) szType1, "AnyType.SubType[NIL]" ); - } + } else if( cSubType1 ) - { + { sprintf( ( char * ) szType1, "AnyType.SubType[%c]", pFunc->pStack[ pFunc->iStackIndex ] ); - } + } else if( pFunc->pStack[ pFunc->iStackIndex ] == '-' ) - { + { strcpy( ( char * ) szType1, "NIL" ); - } + } else - { + { sprintf( ( char * ) szType1, "%c", pFunc->pStack[ pFunc->iStackIndex ] ); - } + } if( pFunc->pStack[ pFunc->iStackIndex ] == 'L' ) - { - /* Ok. */ - } + { + /* Ok. */ + } else if( pFunc->pStack[ pFunc->iStackIndex ] == ' ' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_OPERAND_SUSPECT, "L", NULL ); - } + } else - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_OPERAND_TYPE, ( char * ) szType1, "L" ); - } + } break; case HB_P_INSTRING : @@ -1003,53 +1005,53 @@ void hb_compStrongType( int iSize ) pFunc->iStackIndex--; if( ( pFunc->pStack[ pFunc->iStackIndex - 1 ] == '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex - 1 ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cSubType1 = ( pFunc->pStack[ pFunc->iStackIndex - 1 ] -= VT_OFFSET_VARIANT ); - } + } if( ( pFunc->pStack[ pFunc->iStackIndex ] == '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cSubType2 = ( pFunc->pStack[ pFunc->iStackIndex ] -= VT_OFFSET_VARIANT ); - } + } if( cSubType1 && cSubType1 == '-' ) - { + { strcpy( ( char * ) szType1, "AnyType.SubType[NIL]" ); - } + } else if( cSubType1 ) - { + { sprintf( ( char * ) szType1, "AnyType.SubType[%c]", pFunc->pStack[ pFunc->iStackIndex - 1 ] ); - } + } else if( pFunc->pStack[ pFunc->iStackIndex - 1 ] == '-' ) - { + { strcpy( ( char * ) szType1, "NIL"); - } + } else - { + { sprintf( ( char * ) szType1, "%c", pFunc->pStack[ pFunc->iStackIndex - 1 ] ); - } + } if( cSubType2 && cSubType2 == '-' ) - { + { strcpy( ( char * ) szType2, "AnyType.SubType[NIL]" ); - } + } else if( cSubType2 ) - { + { sprintf( ( char * ) szType2, "AnyType.SubType[%c]", pFunc->pStack[ pFunc->iStackIndex ] ); - } + } else if( pFunc->pStack[ pFunc->iStackIndex ] == '-' ) - { + { strcpy( ( char * ) szType2, "NIL" ); - } + } else - { + { sprintf( ( char * ) szType2, "%c", pFunc->pStack[ pFunc->iStackIndex ] ); - } + } if( pFunc->pStack[ pFunc->iStackIndex ] == ' ' && pFunc->pStack[ pFunc->iStackIndex - 1 ] == ' ' ) - { - /* Ok. */ - } + { + /* Ok. */ + } else if( pFunc->pStack[ pFunc->iStackIndex ] == 'C' && pFunc->pStack[ pFunc->iStackIndex - 1 ] == 'C' ) { /* Override the last item with the new result type */ @@ -1099,58 +1101,58 @@ void hb_compStrongType( int iSize ) /*printf( "\nTop: %c Bottom: %c Typ-SubType: %c Bottom->SubType: %c\n", pFunc->pStack[ pFunc->iStackIndex], pFunc->pStack[ pFunc->iStackIndex - 1 ], pFunc->pStack[ pFunc->iStackIndex] - 100, pFunc->pStack[ pFunc->iStackIndex - 1 ] - 100 );*/ if( ( pFunc->pStack[ pFunc->iStackIndex - 1 ] == '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex - 1 ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cSubType1 = pFunc->pStack[ pFunc->iStackIndex - 1 ] - VT_OFFSET_VARIANT; - } + } if( ( pFunc->pStack[ pFunc->iStackIndex ] == '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cSubType2 = pFunc->pStack[ pFunc->iStackIndex ] - VT_OFFSET_VARIANT; - } + } if( cSubType1 && cSubType1 == '-' ) - { + { strcpy( ( char * ) szType1, "AnyType.SubType[NIL]" ); - } + } else if( cSubType1 ) - { + { sprintf( ( char * ) szType1, "AnyType.SubType[%c]", cSubType1 ); - } + } else if( pFunc->pStack[ pFunc->iStackIndex - 1 ] == '-' ) - { + { strcpy( ( char * ) szType1, "NIL"); - } + } else - { + { sprintf( ( char * ) szType1, "%c", pFunc->pStack[ pFunc->iStackIndex - 1 ] ); - } + } if( cSubType2 && cSubType2 == '-' ) - { + { strcpy( ( char * ) szType2, "AnyType.SubType[NIL]" ); - } + } else if( cSubType2 ) - { + { sprintf( ( char * ) szType2, "AnyType.SubType[%c]", cSubType2 ); - } + } else if( pFunc->pStack[ pFunc->iStackIndex ] == '-' ) - { + { strcpy( ( char * ) szType2, "NIL" ); - } + } else - { + { sprintf( ( char * ) szType2, "%c", pFunc->pStack[ pFunc->iStackIndex ] ); - } + } - if( ! cSubType1 ) - { + if( ! cSubType1 ) + { cSubType1 = pFunc->pStack[ pFunc->iStackIndex - 1 ]; - } + } - if( ! cSubType2 ) - { + if( ! cSubType2 ) + { cSubType2 = pFunc->pStack[ pFunc->iStackIndex ]; - } + } if( cSubType1 == ' ' && cSubType2 == ' ' ) { @@ -1203,149 +1205,150 @@ void hb_compStrongType( int iSize ) break; case HB_P_FORTEST : - if( pFunc->iStackIndex < 3 ) + + if( pFunc->iStackIndex < 3 ) /* TODO Error Message after finalizing all possible pcodes. */ break; pFunc->iStackIndex--; - /* --- */ + /* --- */ if( ( pFunc->pStack[ pFunc->iStackIndex - 2 ] == '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex - 2 ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cSubType0 = pFunc->pStack[ pFunc->iStackIndex - 2 ] - VT_OFFSET_VARIANT; - } + } if( ( pFunc->pStack[ pFunc->iStackIndex - 1 ] == '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex - 1 ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cSubType1 = pFunc->pStack[ pFunc->iStackIndex - 1 ] - VT_OFFSET_VARIANT; - } + } if( ( pFunc->pStack[ pFunc->iStackIndex ] == '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cSubType2 = pFunc->pStack[ pFunc->iStackIndex ] - VT_OFFSET_VARIANT; - } + } - /* --- */ + /* --- */ if( cSubType0 && cSubType0 == '-' ) - { + { strcpy( ( char * ) szType0, "AnyType.SubType[NIL]" ); - } + } else if( cSubType0 ) - { + { sprintf( ( char * ) szType0, "AnyType.SubType[%c]", cSubType0 ); - } + } else if( pFunc->pStack[ pFunc->iStackIndex - 2 ] == '-' ) - { + { strcpy( ( char * ) szType0, "NIL"); - } + } else - { + { sprintf( ( char * ) szType0, "%c", pFunc->pStack[ pFunc->iStackIndex - 2 ] ); - } + } - /* --- */ + /* --- */ if( cSubType1 && cSubType1 == '-' ) - { + { strcpy( ( char * ) szType1, "AnyType.SubType[NIL]" ); - } + } else if( cSubType1 ) - { + { sprintf( ( char * ) szType1, "AnyType.SubType[%c]", cSubType1 ); - } + } else if( pFunc->pStack[ pFunc->iStackIndex - 1 ] == '-' ) - { + { strcpy( ( char * ) szType1, "NIL"); - } + } else - { + { sprintf( ( char * ) szType1, "%c", pFunc->pStack[ pFunc->iStackIndex - 1 ] ); - } + } - /* --- */ + /* --- */ if( cSubType2 && cSubType2 == '-' ) - { + { strcpy( ( char * ) szType2, "AnyType.SubType[NIL]" ); - } + } else if( cSubType2 ) - { + { sprintf( ( char * ) szType2, "AnyType.SubType[%c]", cSubType2 ); - } + } else if( pFunc->pStack[ pFunc->iStackIndex ] == '-' ) - { + { strcpy( ( char * ) szType2, "NIL" ); - } + } else - { + { sprintf( ( char * ) szType2, "%c", pFunc->pStack[ pFunc->iStackIndex ] ); - } + } - /* --- */ + /* --- */ - if( ! cSubType0 ) - { + if( ! cSubType0 ) + { cSubType0 = pFunc->pStack[ pFunc->iStackIndex - 2 ]; - } + } - if( ! cSubType1 ) - { + if( ! cSubType1 ) + { cSubType1 = pFunc->pStack[ pFunc->iStackIndex - 1 ]; - } + } - if( ! cSubType2 ) - { + if( ! cSubType2 ) + { cSubType2 = pFunc->pStack[ pFunc->iStackIndex ]; - } + } - /* --- */ + /* --- */ - if( cSubType0 == 'N' ) - { - /* Ok. */ - } - else if ( cSubType0 == ' ' ) - { + if( cSubType0 == 'N' ) + { + /* Ok. */ + } + else if ( cSubType0 == ' ' ) + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_OPERAND_SUSPECT, "UnKnown", "N" ); - } - else - { + } + else + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_OPERAND_TYPE, ( char * ) szType0, "N" ); - } + } - /* --- */ + /* --- */ - if( cSubType1 == 'N' ) - { - /* Ok. */ - } - else if ( cSubType1 == ' ' ) - { + if( cSubType1 == 'N' ) + { + /* Ok. */ + } + else if ( cSubType1 == ' ' ) + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_OPERAND_SUSPECT, "UnKnown", "N" ); - } - else - { + } + else + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_OPERAND_TYPE, ( char * ) szType1, "N" ); - } + } - /* --- */ + /* --- */ - if( cSubType2 == 'N' ) - { - /* Ok. */ - } - else if ( cSubType2 == ' ' ) - { + if( cSubType2 == 'N' ) + { + /* Ok. */ + } + else if ( cSubType2 == ' ' ) + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_OPERAND_SUSPECT, "UnKnown", "N" ); - } - else - { + } + else + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_OPERAND_TYPE, ( char * ) szType2, "N" ); - } + } - /* Remove Step. */ + /* Remove Step. */ pFunc->iStackIndex--; /* Override the last item with Logical */ @@ -1364,48 +1367,48 @@ void hb_compStrongType( int iSize ) pFunc->iStackIndex--; if( ( pFunc->pStack[ pFunc->iStackIndex - 1 ] == '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex - 1 ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cSubType1 = ( pFunc->pStack[ pFunc->iStackIndex - 1 ] -= VT_OFFSET_VARIANT ); - } + } if( ( pFunc->pStack[ pFunc->iStackIndex ] == '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cSubType2 = ( pFunc->pStack[ pFunc->iStackIndex ] -= VT_OFFSET_VARIANT ); - } + } if( cSubType1 && cSubType1 == '-' ) - { + { sprintf( ( char * ) szType1, "AnyType.SubType[NIL]" ); - } + } else if( cSubType1 ) - { + { sprintf( ( char * ) szType1, "AnyType.SubType[%c]", pFunc->pStack[ pFunc->iStackIndex - 1 ] ); - } + } else if( pFunc->pStack[ pFunc->iStackIndex - 1 ] == '-' ) - { + { strcpy( ( char * ) szType1, "NIL" ); - } + } else - { + { sprintf( ( char * ) szType1, "%c", pFunc->pStack[ pFunc->iStackIndex - 1 ] ); - } + } if( cSubType2 && cSubType2 == '-' ) - { + { strcpy( ( char * ) szType2, "AnyType.SubType[NIL]" ); - } + } else if( cSubType2 ) - { + { sprintf( ( char * ) szType2, "AnyType.SubType[%c]", pFunc->pStack[ pFunc->iStackIndex ] ); - } + } else if( pFunc->pStack[ pFunc->iStackIndex ] == '-' ) - { + { strcpy( ( char * ) szType2, "NIL" ); - } + } else - { + { sprintf( ( char * ) szType2, "%c", pFunc->pStack[ pFunc->iStackIndex ] ); - } + } if( pFunc->pStack[ pFunc->iStackIndex ] == '-' || pFunc->pStack[ pFunc->iStackIndex - 1 ] == '-' ) { @@ -1547,26 +1550,26 @@ void hb_compStrongType( int iSize ) break; if( ( pFunc->pStack[ pFunc->iStackIndex - 1 ] == '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex - 1 ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cSubType1 = ( pFunc->pStack[ pFunc->iStackIndex - 1 ] -= VT_OFFSET_VARIANT ); - } + } if( cSubType1 && cSubType1 == '-' ) - { + { strcpy( ( char * ) szType1, "AnyType.SubType[NIL]" ); - } + } else if( cSubType1 ) - { + { sprintf( ( char * ) szType1, "AnyType.SubType[%c]", pFunc->pStack[ pFunc->iStackIndex - 1 ] ); - } + } else if( pFunc->pStack[ pFunc->iStackIndex - 1 ] == '-' ) - { + { strcpy( ( char * ) szType1, "NIL" ); - } + } else - { + { sprintf( ( char * ) szType1, "%c", pFunc->pStack[ pFunc->iStackIndex - 1 ] ); - } + } if( pFunc->pStack[ pFunc->iStackIndex - 1 ] == ' ' ) { @@ -1593,48 +1596,48 @@ void hb_compStrongType( int iSize ) pFunc->iStackIndex--; if( ( pFunc->pStack[ pFunc->iStackIndex - 1 ] == '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex - 1 ] >= 'A' + VT_OFFSET_VARIANT ) - { + { cSubType1 = ( pFunc->pStack[ pFunc->iStackIndex - 1 ] -= VT_OFFSET_VARIANT ); - } + } if( ( pFunc->pStack[ pFunc->iStackIndex ] == '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cSubType2 = ( pFunc->pStack[ pFunc->iStackIndex ] -= VT_OFFSET_VARIANT ); - } + } if( cSubType1 && cSubType1 == '-' ) - { + { sprintf( ( char * ) szType1, "AnyType.SubType[NIL]" ); - } + } else if( cSubType1 ) - { + { sprintf( ( char * ) szType1, "AnyType.SubType[%c]", pFunc->pStack[ pFunc->iStackIndex - 1 ] ); - } + } else if( pFunc->pStack[ pFunc->iStackIndex - 1 ] == '-' ) - { + { strcpy( ( char * ) szType1, "NIL"); - } + } else - { + { sprintf( ( char * ) szType1, "%c", pFunc->pStack[ pFunc->iStackIndex - 1 ] ); - } + } if( cSubType2 && cSubType2 == '-' ) - { + { strcpy( ( char * ) szType2, "AnyType.SubType[NIL]" ); - } + } else if( cSubType2 ) - { + { sprintf( ( char * ) szType2, "AnyType.SubType[%c]", pFunc->pStack[ pFunc->iStackIndex ] ); - } + } else if( pFunc->pStack[ pFunc->iStackIndex ] == '-' ) - { + { strcpy( ( char * ) szType2, "NIL" ); - } + } else - { + { sprintf( ( char * ) szType2, "%c", pFunc->pStack[ pFunc->iStackIndex ] ); - } + } if( ( pFunc->pStack[ pFunc->iStackIndex ] == ' ' && pFunc->pStack[ pFunc->iStackIndex - 1 ] == ' ' ) || ( pFunc->pStack[ pFunc->iStackIndex ] == 'L' && pFunc->pStack[ pFunc->iStackIndex - 1 ] == 'L' ) ) @@ -1745,9 +1748,9 @@ void hb_compStrongType( int iSize ) case HB_P_MPUSHSYM : /* In Private or Public statement can't be a declared function */ if( ( hb_comp_iVarScope == VS_PRIVATE || hb_comp_iVarScope == VS_PUBLIC ) ) - { + { pFunc->pStack[ pFunc->iStackIndex++ ] = ' '; - } + } else { if( pFunc->pCode[ ulPos ] == HB_P_PUSHSYMNEAR ) @@ -1770,21 +1773,21 @@ void hb_compStrongType( int iSize ) pFunc->pStack[ pFunc->iStackIndex++ ] = pDeclared->cType; if( toupper( pDeclared->cType ) == 'S' && pFunc->iStackClasses < 8 ) - { + { pFunc->pStackClasses[ pFunc->iStackClasses++ ] = pDeclared->pClass; - } + } } else - { + { pFunc->pStack[ pFunc->iStackIndex++ ] = ' '; - } + } /* Storing, will be checked by HB_P_FUNCTION, OK to store NULL */ /* TODO don't use hard coded size */ if( pFunc->iStackFunctions < 8 ) - { + { pFunc->pStackFunctions[ pFunc->iStackFunctions++ ] = pDeclared; - } + } /* QUESTION: Add other "safe" functions, or remove adaptive type checking support for memvars? */ if( strcmp( pSym->szName, "QOUT" ) == 1 ) @@ -1796,26 +1799,26 @@ void hb_compStrongType( int iSize ) while ( pVar ) { if( pVar->cType == ( '-' + VT_OFFSET_VARIANT ) || pVar->cType >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { pVar->cType = ' '; - } + } pVar = pVar->pNext; } } - /* - printf( "\nPushed: %s() Type: %c Stack: %i\n", pSym->szName, pFunc->pStack[ pFunc->iStackIndex - 1], pFunc->iStackIndex - 1 ); - */ + /* + printf( "\nPushed: %s() Type: %c Stack: %i\n", pSym->szName, pFunc->pStack[ pFunc->iStackIndex - 1], pFunc->iStackIndex - 1 ); + */ } else { /* Storing, will be checked by FUNCTION, OK to store NULL */ /* TODO don't use hard coded size */ if( pFunc->iStackFunctions < 8 ) - { + { pFunc->pStackFunctions[ pFunc->iStackFunctions++ ] = NULL; - } + } pFunc->pStack[ pFunc->iStackIndex++ ] = ' '; } @@ -1832,13 +1835,13 @@ void hb_compStrongType( int iSize ) case HB_P_PUSHLOCALREF : case HB_P_PUSHLOCAL : if( pFunc->pCode[ ulPos ] == HB_P_PUSHLOCALNEAR ) - { + { wVar = ( signed char ) pFunc->pCode[ ulPos + 1 ]; - } + } else - { + { wVar = * ( ( SHORT * ) &( pFunc->pCode )[ ulPos + 1 ] ); - } + } /* we are accesing variables within a codeblock */ if( wVar < 0 ) @@ -1865,9 +1868,9 @@ void hb_compStrongType( int iSize ) } } else - { + { pVar = hb_compVariableFind( pFunc->pLocals, wVar ); - } + } if( pVar ) { @@ -1908,7 +1911,7 @@ void hb_compStrongType( int iSize ) pFunc->pStack[ pFunc->iStackIndex++ ] = pVar->cType; } else - { + { /* printf( "\nCould not find Local %i in: $s\n", wVar, pFunc->szName ); */ @@ -1917,7 +1920,7 @@ void hb_compStrongType( int iSize ) pFunc->pStack[ pFunc->iStackIndex++ ] = '@'; else pFunc->pStack[ pFunc->iStackIndex++ ] = ' '; - } + } break; case HB_P_PUSHSTATICREF : @@ -1926,9 +1929,9 @@ void hb_compStrongType( int iSize ) wVar = pFunc->pCode[ ulPos + 1 ] + pFunc->pCode[ ulPos + 2 ] * 256; while( pTmp->pNext && pTmp->pNext->iStaticsBase < wVar ) - { + { pTmp = pTmp->pNext; - } + } pVar = hb_compVariableFind( pTmp->pStatics, wVar - pTmp->iStaticsBase ); @@ -1974,7 +1977,7 @@ void hb_compStrongType( int iSize ) } } else - { + { if( pFunc->pCode[ ulPos ] == HB_P_PUSHSTATICREF ) { pFunc->pStack[ pFunc->iStackIndex - 1 ] = '@'; @@ -1983,7 +1986,7 @@ void hb_compStrongType( int iSize ) { pFunc->pStack[ pFunc->iStackIndex - 1 ] = ' '; } - } + } break; case HB_P_PUSHVARIABLE : @@ -2024,19 +2027,19 @@ void hb_compStrongType( int iSize ) if( pFunc->pCode[ ulPos ] == HB_P_PUSHMEMVAR && pSym->szName ) { if( pFunc->pMemvars ) - { + { wVar = hb_compVariableGetPos( pFunc->pMemvars, pSym->szName ); - } + } if( wVar ) - { + { pVar = hb_compVariableFind( pFunc->pMemvars, wVar ); - } + } if( ! pVar ) - { + { pVar = hb_compPrivateFind( pSym->szName ); - } + } if( ( ! pVar ) && hb_comp_functions.pFirst->pMemvars ) { @@ -2057,26 +2060,26 @@ void hb_compStrongType( int iSize ) /*printf( "\nPushed: %s Type: %c SubType: %c\n", pVar->szName, pVar->cType, pVar->cType - 100 );*/ if( pFunc->pCode[ ulPos ] == HB_P_PUSHMEMVARREF ) - { + { pVar->iUsed |= VU_INITIALIZED; - } + } else if( ! ( pVar->iUsed & VU_INITIALIZED ) ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_NOT_INITIALIZED, pVar->szName, NULL ); - } + } if( cType == ( '-' + VT_OFFSET_VARIANT ) || cType >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cType -= VT_OFFSET_VARIANT; - } + } /* Mark as used */ pVar->iUsed |= VU_USED; if( pFunc->pCode[ ulPos ] == HB_P_PUSHMEMVARREF ) - { + { pFunc->pStack[ pFunc->iStackIndex - 1 ] = pVar->cType + VT_OFFSET_BYREF; - } + } else if( toupper( cType ) == 'S' && pFunc->iStackClasses < 8 ) { /* Object of declared class */ @@ -2084,9 +2087,9 @@ void hb_compStrongType( int iSize ) pFunc->pStack[ pFunc->iStackIndex++ ] = pVar->cType; } else - { + { pFunc->pStack[ pFunc->iStackIndex - 1 ] = pVar->cType; - } + } } else { @@ -2095,14 +2098,14 @@ void hb_compStrongType( int iSize ) /*printf( "\nPushed Symbol: %s Type: %c SubType: %c\n", pSym->szName, pSym->cType, pSym->cType - 100 );*/ if( cType == ( '-' + VT_OFFSET_VARIANT ) || cType >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cType -= VT_OFFSET_VARIANT; - } + } if( pFunc->pCode[ ulPos ] == HB_P_PUSHMEMVARREF ) - { + { pFunc->pStack[ pFunc->iStackIndex - 1 ] = pSym->cType + VT_OFFSET_BYREF; - } + } else if( toupper( cType ) == 'S' && pFunc->iStackClasses < 8 ) { /* Object of declared class */ @@ -2144,11 +2147,11 @@ void hb_compStrongType( int iSize ) /* TODO Error Message after finalizing all possible pcodes. */ if( pFunc->iStackIndex < wVar ) - { + { pFunc->iStackIndex = 1; pFunc->pStack[ 0 ] = 'A'; break; - } + } /* Pop the Elements. */ pFunc->iStackIndex -= wVar; @@ -2170,9 +2173,9 @@ void hb_compStrongType( int iSize ) /*printf( "\n Base Type: %c\n", cType );*/ if( cType == ( '-' + VT_OFFSET_VARIANT ) || cType >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cType -= VT_OFFSET_VARIANT; - } + } if( cType == ' ' ) { @@ -2181,24 +2184,24 @@ void hb_compStrongType( int iSize ) pFunc->pStack[ pFunc->iStackIndex - 1 ] = ' '; } else if( cType == 'A' ) - { + { /* Variant Array Element - Type unknown. */ pFunc->pStack[ pFunc->iStackIndex - 1 ] = ' '; - } + } else if( cType == 'a' ) - { + { /* Variant Array Element - Type unknown. */ pFunc->pStack[ pFunc->iStackIndex - 1 ] = ' '; - } + } else if( islower( cType ) ) - { + { /* Now we have the declared array element on the stack.*/ pFunc->pStack[ pFunc->iStackIndex - 1 ] = toupper( cType ); - } + } else - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_NOT_ARRAY, NULL, NULL ); - } + } break; case HB_P_ARRAYPOP : @@ -2408,33 +2411,33 @@ void hb_compStrongType( int iSize ) if( pVar->cType == ' ' || pVar->cType == ( '-' + VT_OFFSET_VARIANT ) || pVar->cType >= ( 'A' + VT_OFFSET_VARIANT ) ) { if( pFunc->pStack[ pFunc->iStackIndex ] == ' ' ) - { + { pVar->cType = ' '; - } + } else if( pFunc->pStack[ pFunc->iStackIndex ] == ( '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { pVar->cType = pFunc->pStack[ pFunc->iStackIndex ]; - } + } else - { + { pVar->cType = pFunc->pStack[ pFunc->iStackIndex ] + VT_OFFSET_VARIANT; - } + } /* Will need the Class Handle. */ cType = pVar->cType; if( cType == ( '-' + VT_OFFSET_VARIANT ) || cType >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cType -= VT_OFFSET_VARIANT; - } + } if( toupper( cType ) == 'S' && pFunc->iStackClasses ) - { + { pVar->pClass = pFunc->pStackClasses[ pFunc->iStackClasses - 1 ]; - } + } else - { + { pVar->pClass = NULL; - } + } /* printf( "\nSymbol: %s Variable: %s Assigned Type: \'%c\' SubType: %c #%i Stack: %i\n", pSym->szName, pVar->szName, pVar->cType, pVar->cType - 100, wVar, pFunc->iStackIndex ); @@ -2487,68 +2490,68 @@ void hb_compStrongType( int iSize ) } if( pFunc->pStack[ pFunc->iStackIndex ] == ( '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { pFunc->pStack[ pFunc->iStackIndex ] -= VT_OFFSET_VARIANT; - } + } if( pFunc->pStack[ pFunc->iStackIndex ] == '-' ) - { + { /* NIL allowed into all types */ - } + } else if( pVar->cType == 'a' && islower( pFunc->pStack[ pFunc->iStackIndex ] ) ) - { + { /* Array Of ANYTYPE may accept any Array */ - } + } else if( islower( pVar->cType ) && pFunc->pStack[ pFunc->iStackIndex ] == ' ' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ARRAY_ASSIGN_SUSPECT, ( char * ) szType, NULL ); - } + } else if( islower( pVar->cType ) && pFunc->pStack[ pFunc->iStackIndex ] == 'A' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ARRAY_ASSIGN_SUSPECT, ( char * ) szType, NULL ); - } + } else if( islower( pVar->cType ) && pVar->cType != pFunc->pStack[ pFunc->iStackIndex ] ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ARRAY_ASSIGN_TYPE, ( char * ) szType, NULL ); - } + } else if( pVar->cType != ' ' && pFunc->pStack[ pFunc->iStackIndex ] == ' ' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ASSIGN_SUSPECT, pVar->szName, ( char * ) szType ); - } + } else if( pVar->cType == 'S' && pFunc->pStack[ pFunc->iStackIndex ] == 'O' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ASSIGN_SUSPECT, pVar->szName, ( char * ) szType ); - } + } else if( pVar->cType == 's' && pFunc->pStack[ pFunc->iStackIndex ] == 'o' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ARRAY_ASSIGN_SUSPECT, pVar->szName, ( char * ) szType ); - } + } else if( pVar->cType == 'S' && pFunc->pStack[ pFunc->iStackIndex ] == 'S' ) { if( pFunc->iStackClasses && pVar->pClass == pFunc->pStackClasses[ pFunc->iStackClasses - 1 ] ) - { + { /* Same class */ - } + } else - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ASSIGN_TYPE, pVar->szName, ( char * ) szType ); - } + } } else if( pVar->cType == 's' && pFunc->pStack[ pFunc->iStackIndex ] == 's' ) { if( pFunc->iStackClasses && pVar->pClass == pFunc->pStackClasses[ pFunc->iStackClasses - 1 ] ) - { + { /* Same class */ - } + } else - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ARRAY_ASSIGN_TYPE, pVar->szName, ( char * ) szType ); - } + } } else if( isupper( pVar->cType ) && pVar->cType != pFunc->pStack[ pFunc->iStackIndex ] ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ASSIGN_TYPE, pVar->szName, ( char * ) szType ); - } + } } } else @@ -2557,92 +2560,92 @@ void hb_compStrongType( int iSize ) if( pSym->cType == ' ' || pSym->cType == ( '-' + VT_OFFSET_VARIANT ) || pSym->cType >= ( 'A' + VT_OFFSET_VARIANT ) ) { if( pFunc->pStack[ pFunc->iStackIndex ] == ' ' ) - { + { pSym->cType = ' '; - } + } else if( pFunc->pStack[ pFunc->iStackIndex ] == ( '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { pSym->cType = pFunc->pStack[ pFunc->iStackIndex ]; - } + } else - { + { pSym->cType = pFunc->pStack[ pFunc->iStackIndex ] + VT_OFFSET_VARIANT; - } + } /* Will need the Class Handle. */ if( toupper( pFunc->pStack[ pFunc->iStackIndex ] ) == 'S' && pFunc->iStackClasses ) - { + { pSym->pClass = pFunc->pStackClasses[ pFunc->iStackClasses - 1 ]; - } + } } else { char szType[2]; if( pSym->cType == 'S' ) - { + { sprintf( ( char * ) szType, "%s", pSym->pClass->szName ); - } + } else if( pSym->cType == 's' ) - { + { sprintf( ( char * ) szType, "ARRAY OF %s", pSym->pClass->szName ); - } + } else if( islower( pSym->cType ) ) - { + { sprintf( ( char * ) szType, "ARRAY OF %c", toupper( pSym->cType ) ); - } + } else - { + { sprintf( ( char * ) szType, "%c", pSym->cType ); - } + } if( pFunc->pStack[ pFunc->iStackIndex ] == ( '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { pFunc->pStack[ pFunc->iStackIndex ] -= VT_OFFSET_VARIANT; - } + } if( pFunc->pStack[ pFunc->iStackIndex ] == '-' ) - { + { /* NIL allowed into all types */ - } + } else if( pSym->cType == 'a' && islower( pFunc->pStack[ pFunc->iStackIndex ] ) ) - { + { /* Array Of ANYTYPE may accept any Array */ - } + } else if( islower( pSym->cType ) && pFunc->pStack[ pFunc->iStackIndex ] == ' ' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ARRAY_ASSIGN_SUSPECT, ( char * ) szType, NULL ); - } + } else if( islower( pSym->cType ) && pFunc->pStack[ pFunc->iStackIndex ] == 'A' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ARRAY_ASSIGN_SUSPECT, ( char * ) szType, NULL ); - } + } else if( islower( pSym->cType ) && pSym->cType != pFunc->pStack[ pFunc->iStackIndex ] ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ARRAY_ASSIGN_TYPE, ( char * ) szType, NULL ); - } + } else if( pSym->cType != ' ' && pFunc->pStack[ pFunc->iStackIndex ] == ' ' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ASSIGN_SUSPECT, pSym->szName, ( char * ) szType ); - } + } else if( pSym->cType == 'S' && pFunc->pStack[ pFunc->iStackIndex ] == 'O' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ASSIGN_SUSPECT, pSym->szName, ( char * ) szType ); - } + } else if( pSym->cType == 's' && pFunc->pStack[ pFunc->iStackIndex ] == 'o' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ARRAY_ASSIGN_SUSPECT, pSym->szName, ( char * ) szType ); - } + } else if( pSym->cType == 'S' && pFunc->pStack[ pFunc->iStackIndex ] == 'S' ) { if( pFunc->iStackClasses && pSym->pClass == pFunc->pStackClasses[ pFunc->iStackClasses - 1 ] ) - { + { /* Same class */ - } + } else - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ASSIGN_TYPE, pSym->szName, ( char * ) szType ); - } + } } else if( pSym->cType == 's' && pFunc->pStack[ pFunc->iStackIndex ] == 's' ) { @@ -2667,21 +2670,21 @@ void hb_compStrongType( int iSize ) case HB_P_POPLOCAL : /* TODO Error Message after finalizing all possible pcodes. */ if( pFunc->iStackIndex < 1 ) - { + { printf( "Oops - Stack: %i\n", pFunc->iStackIndex ); break; - } + } pFunc->iStackIndex--; if( pFunc->pCode[ ulPos ] == HB_P_POPLOCAL ) - { + { wVar = * ( ( SHORT * ) &( pFunc->pCode )[ ulPos + 1 ] ); - } + } else - { + { wVar = ( SHORT ) pFunc->pCode[ ulPos + 1 ]; - } + } /* we are accesing variables within a codeblock */ if( wVar < 0 ) @@ -2708,9 +2711,9 @@ void hb_compStrongType( int iSize ) } } else - { + { pVar = hb_compVariableFind( pFunc->pLocals, wVar ); - } + } if( pVar ) { @@ -2720,32 +2723,32 @@ void hb_compStrongType( int iSize ) if( pVar->cType == ' ' || pVar->cType == ( '-' + VT_OFFSET_VARIANT ) || pVar->cType >= ( 'A' + VT_OFFSET_VARIANT ) ) { if( pFunc->pStack[ pFunc->iStackIndex ] == ' ' ) - { + { pVar->cType = ' '; - } + } else if( pFunc->pStack[ pFunc->iStackIndex ] == ( '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { pVar->cType = pFunc->pStack[ pFunc->iStackIndex ]; - } + } else - { + { pVar->cType = pFunc->pStack[ pFunc->iStackIndex ] + VT_OFFSET_VARIANT; - } + } cType = pVar->cType; if( cType == ( '-' + VT_OFFSET_VARIANT ) || cType >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cType -= VT_OFFSET_VARIANT; - } + } if( toupper( cType ) == 'S' && pFunc->iStackClasses ) - { + { pVar->pClass = pFunc->pStackClasses[ pFunc->iStackClasses - 1 ]; - } + } else - { + { pVar->pClass = NULL; - } + } } else { @@ -2793,52 +2796,52 @@ void hb_compStrongType( int iSize ) } if( pFunc->pStack[ pFunc->iStackIndex ] == ( '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { pFunc->pStack[ pFunc->iStackIndex ] -= VT_OFFSET_VARIANT; - } + } if( pFunc->pStack[ pFunc->iStackIndex ] == '-' ) - { + { /* NIL allowed into all types */ - } + } else if( pVar->cType == 'a' && islower( pFunc->pStack[ pFunc->iStackIndex ] ) ) - { + { /* Array Of ANYTYPE may accept any Array */ - } + } else if( islower( pVar->cType ) && pFunc->pStack[ pFunc->iStackIndex ] == ' ' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ARRAY_ASSIGN_SUSPECT, ( char * ) szType, NULL ); - } + } else if( islower( pVar->cType ) && pFunc->pStack[ pFunc->iStackIndex ] == 'A' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ARRAY_ASSIGN_SUSPECT, ( char * ) szType, NULL ); - } + } else if( islower( pVar->cType ) && pVar->cType != pFunc->pStack[ pFunc->iStackIndex ] ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ARRAY_ASSIGN_TYPE, ( char * ) szType, NULL ); - } + } else if( pVar->cType != ' ' && pFunc->pStack[ pFunc->iStackIndex ] == ' ' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ASSIGN_SUSPECT, pVar->szName, ( char * ) szType ); - } + } else if( pVar->cType == 'S' && pFunc->pStack[ pFunc->iStackIndex ] == 'O' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ASSIGN_SUSPECT, pVar->szName, ( char * ) szType ); - } + } else if( pVar->cType == 's' && pFunc->pStack[ pFunc->iStackIndex ] == 'o' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ARRAY_ASSIGN_SUSPECT, pVar->szName, ( char * ) szType ); - } + } else if( pVar->cType == 'S' && pFunc->pStack[ pFunc->iStackIndex ] == 'S' ) { if( pFunc->iStackClasses && pVar->pClass == pFunc->pStackClasses[ pFunc->iStackClasses - 1 ] ) - { + { /* Same class */ - } + } else - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ASSIGN_TYPE, pVar->szName, ( char * ) szType ); - } + } } else if( pVar->cType == 's' && pFunc->pStack[ pFunc->iStackIndex ] == 's' ) { @@ -2881,31 +2884,31 @@ void hb_compStrongType( int iSize ) if( pVar->cType == ' ' || pVar->cType == ( '-' + VT_OFFSET_VARIANT ) || pVar->cType >= ( 'A' + VT_OFFSET_VARIANT ) ) { if( pFunc->pStack[ pFunc->iStackIndex ] == ' ' ) - { + { pVar->cType = ' '; - } + } else if( pFunc->pStack[ pFunc->iStackIndex ] == ( '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { pVar->cType = pFunc->pStack[ pFunc->iStackIndex ]; - } + } else - { + { pVar->cType = pFunc->pStack[ pFunc->iStackIndex ] + VT_OFFSET_VARIANT; - } + } cType = pVar->cType; if( cType == ( '-' + VT_OFFSET_VARIANT ) || cType >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { cType -= VT_OFFSET_VARIANT; - } + } if( toupper( cType ) == 'S' && pFunc->iStackClasses ) - { + { pVar->pClass = pFunc->pStackClasses[ pFunc->iStackClasses - 1 ]; - } + } else - { + { pVar->pClass = NULL; - } + } /* printf( "\nStack: %c Asc: %i, Var: %c Asc: %i\n", pFunc->pStack[ pFunc->iStackIndex ], pFunc->pStack[ pFunc->iStackIndex ], pVar->cType, pVar->cType ); @@ -2956,76 +2959,76 @@ void hb_compStrongType( int iSize ) } if( pFunc->pStack[ pFunc->iStackIndex ] == ( '-' + VT_OFFSET_VARIANT ) || pFunc->pStack[ pFunc->iStackIndex ] >= ( 'A' + VT_OFFSET_VARIANT ) ) - { + { pFunc->pStack[ pFunc->iStackIndex ] -= VT_OFFSET_VARIANT; - } + } if( pFunc->pStack[ pFunc->iStackIndex ] == '-' ) - { + { /* NIL allowed into all types */ - } + } else if( pVar->cType == 'a' && islower( pFunc->pStack[ pFunc->iStackIndex ] ) ) - { + { /* Array Of ANYTYPE may accept any Array */ - } + } else if( islower( pVar->cType ) && pFunc->pStack[ pFunc->iStackIndex ] == ' ' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ARRAY_ASSIGN_SUSPECT, ( char * ) szType, NULL ); - } + } else if( islower( pVar->cType ) && pFunc->pStack[ pFunc->iStackIndex ] == 'A' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ARRAY_ASSIGN_SUSPECT, ( char * ) szType, NULL ); - } + } else if( islower( pVar->cType ) && pVar->cType != pFunc->pStack[ pFunc->iStackIndex ] ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ARRAY_ASSIGN_TYPE, ( char * ) szType, NULL ); - } + } else if( pVar->cType != ' ' && pFunc->pStack[ pFunc->iStackIndex ] == ' ' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ASSIGN_SUSPECT, pVar->szName, ( char * ) szType ); - } + } else if( pVar->cType == 'S' && pFunc->pStack[ pFunc->iStackIndex ] == 'O' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ASSIGN_SUSPECT, pVar->szName, ( char * ) szType ); - } + } else if( pVar->cType == 's' && pFunc->pStack[ pFunc->iStackIndex ] == 'o' ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ARRAY_ASSIGN_SUSPECT, pVar->szName, ( char * ) szType ); - } + } else if( pVar->cType == 'S' && pFunc->pStack[ pFunc->iStackIndex ] == 'S' ) { if( pFunc->iStackClasses && pVar->pClass == pFunc->pStackClasses[ pFunc->iStackClasses - 1 ] ) - { + { /* Same class */ - } + } else - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ASSIGN_TYPE, pVar->szName, ( char * ) szType ); - } + } } else if( pVar->cType == 's' && pFunc->pStack[ pFunc->iStackIndex ] == 's' ) { if( pFunc->iStackClasses && pVar->pClass == pFunc->pStackClasses[ pFunc->iStackClasses - 1 ] ) - { + { /* Same class */ - } + } else - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ARRAY_ASSIGN_TYPE, pVar->szName, ( char * ) szType ); - } + } } else if( isupper( pVar->cType ) && pVar->cType != pFunc->pStack[ pFunc->iStackIndex ] ) - { + { hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_ASSIGN_TYPE, pVar->szName, ( char * ) szType ); - } + } } } /* Resetting */ if( toupper( pFunc->pStack[ pFunc->iStackIndex ] ) == 'S' && pFunc->iStackClasses ) - { + { --pFunc->iStackClasses; - } + } break; /* Macros Undefined Types */ diff --git a/harbour/source/debug/dbgtmenu.prg b/harbour/source/debug/dbgtmenu.prg index 6b25d79845..ab02da8e84 100644 --- a/harbour/source/debug/dbgtmenu.prg +++ b/harbour/source/debug/dbgtmenu.prg @@ -346,7 +346,7 @@ METHOD LoadColors() CLASS TDbMenu ::cClrHilite := aColors[ 10 ] ::cClrHotFocus := aColors[ 11 ] - for n = 1 to Len( ::aItems ) + for n := 1 to Len( ::aItems ) if ValType( ::aItems[ n ]:bAction ) == "O" ::aItems[ n ]:bAction:LoadColors() endif @@ -365,7 +365,7 @@ METHOD Refresh() CLASS TDbMenu SetPos( 0, 0 ) endif - for n = 1 to Len( ::aItems ) + for n := 1 to Len( ::aItems ) ::aItems[ n ]:Display( ::cClrPopup, ::cClrHotKey ) next @@ -399,12 +399,12 @@ METHOD ProcessKey( nKey ) CLASS TDbMenu endif endif else - oPopup = ::aItems[ ::nOpenPopup ]:bAction + oPopup := ::aItems[ ::nOpenPopup ]:bAction if ( nPopup := oPopup:GetItemOrdByCoors( MRow(), MCol() ) ) == 0 ::Close() else oPopup:DeHilite() - oPopup:nOpenPopup = nPopup + oPopup:nOpenPopup := nPopup oPopup:aItems[ nPopup ]:Display( ::cClrHilite, ::cClrHotFocus ) ::EvalAction() endif diff --git a/harbour/source/debug/dbgtmitm.prg b/harbour/source/debug/dbgtmitm.prg index a73579241f..d996ae27eb 100644 --- a/harbour/source/debug/dbgtmitm.prg +++ b/harbour/source/debug/dbgtmitm.prg @@ -91,6 +91,6 @@ METHOD Display( cClrText, cClrHotKey ) CLASS TDbMenuItem ( nAt := At( "~", ::cPrompt ) ) - 1,; SubStr( ::cPrompt, nAt + 1, 1 ), cClrHotKey ) - DispOutAt( ::nRow, ::nCol, If( ::lChecked, Chr( 251 ), "" ), cClrText ) + DispOutAt( ::nRow, ::nCol, iif( ::lChecked, Chr( 251 ), "" ), cClrText ) return Self diff --git a/harbour/source/debug/dbgtobj.prg b/harbour/source/debug/dbgtobj.prg index 86822ecec9..d73f7b71c8 100644 --- a/harbour/source/debug/dbgtobj.prg +++ b/harbour/source/debug/dbgtobj.prg @@ -133,12 +133,12 @@ Local owndsets ::arrayindex := iif( nSkip > 0, Min( ::arrayindex+nSkip, Len(::arrayreference)),; Max( 1, ::arrayindex + nSkip ) ), ::arrayindex - nPos } oBrwSets:AddColumn( ocol:= TBColumnNew("", { || ::ArrayReference[::arrayindex,1]} )) - nMaxElem = maxelem(::AllNames) + nMaxElem := maxelem(::AllNames) ocol:width := nMaxElem ocol:ColorBlock := { || { iif( ::Arrayindex == oBrwSets:Cargo, 2, 1 ), 2 } } oBrwSets:Freeze:=1 - oBrwSets:AddColumn( ocol:=TBColumnNew( "", { || If( ValType( ; + oBrwSets:AddColumn( ocol:=TBColumnNew( "", { || iif( ValType( ; ::ArrayReference[ ::ArrayIndex, 2 ] ) == "C" .and. ; ::ArrayReference[ ::ArrayIndex, 2 ] == "Method",; "Method", PadR( ValToStr( __ObjSendMsg( ::TheObj, ::ArrayReference[ ::arrayindex ,1] ) ),; @@ -198,13 +198,13 @@ method SetsKeyPressed( nKey, oBrwSets, nSets, oWnd ,cName,LenArr,aArray) class t case nKey == K_PGUP oBrwSets:PageUp() - oBrwSets:Cargo = ::ArrayIndex + oBrwSets:Cargo := ::ArrayIndex oBrwSets:RefreshCurrent() oBrwSets:ForceStable() case nKey == K_PGDN oBrwSets:PageDown() - oBrwSets:Cargo = ::ArrayIndex + oBrwSets:Cargo := ::ArrayIndex oBrwSets:RefreshCurrent() oBrwSets:ForceStable() @@ -293,7 +293,7 @@ METHOD doGet(oBro,pItem,nSet) class tdbgObject column := oBro:getColumn( oBro:colPos ) // create a corresponding GET - cValue = PadR( ValToStr( pitem[nSet,2] ), column:Width ) + cValue := PadR( ValToStr( pitem[nSet,2] ), column:Width ) @ row(),col() GET cValue // get := Getnew( Row(),col(), column:block,,, oBro:colorSpec ) diff --git a/harbour/source/debug/dbgtwin.prg b/harbour/source/debug/dbgtwin.prg index a9dad920be..6b1d0dc226 100644 --- a/harbour/source/debug/dbgtwin.prg +++ b/harbour/source/debug/dbgtwin.prg @@ -109,7 +109,7 @@ METHOD Hide() CLASS TDbWindow RestScreen( ::nTop, ::nLeft, ::nBottom + iif( ::lShadow, 1, 0 ),; ::nRight + iif( ::lShadow, 2, 0 ), ::cBackImage ) ::cBackImage := nil - ::lVisible = .f. + ::lVisible := .f. return nil @@ -176,7 +176,7 @@ METHOD Refresh() CLASS TDbWindow DispBegin() - @ ::nTop, ::nLeft, ::nBottom, ::nRight BOX If( ::lFocused, B_DOUBLE, B_SINGLE ) ; + @ ::nTop, ::nLeft, ::nBottom, ::nRight BOX iif( ::lFocused, B_DOUBLE, B_SINGLE ) ; COLOR ::cColor DispOutAt( ::nTop, ::nLeft + 1, "[" + Chr( 254 ) + "]", ::cColor ) @@ -207,7 +207,7 @@ METHOD Show( lFocused ) CLASS TDbWindow hb_Shadow( ::nTop, ::nLeft, ::nBottom, ::nRight ) endif - ::lVisible = .t. + ::lVisible := .t. return nil @@ -233,7 +233,7 @@ METHOD ShowModal() CLASS TDbWindow case nKey == K_LBUTTONDOWN if MRow() == ::nTop .and. MCol() >= ::nLeft + 1 .and. ; MCol() <= ::nLeft + 3 - lExit = .t. + lExit := .t. endif endcase end diff --git a/harbour/source/debug/dbgwa.prg b/harbour/source/debug/dbgwa.prg index dfa94d1823..3846f393e0 100644 --- a/harbour/source/debug/dbgwa.prg +++ b/harbour/source/debug/dbgwa.prg @@ -62,7 +62,7 @@ function __dbgShowWorkAreas( oDebugger ) n2 := 1 n3 := 1 - cColor := If( __Dbg():lMonoDisplay, "N/W, W/N, W+/W, W+/N",; + cColor := iif( __Dbg():lMonoDisplay, "N/W, W/N, W+/W, W+/N",; "N/W, N/BG, R/W, R/BG" ) do while !Empty( Alias( n1 ) ) diff --git a/harbour/source/debug/debugger.prg b/harbour/source/debug/debugger.prg index dcd90d5369..02ac174836 100644 --- a/harbour/source/debug/debugger.prg +++ b/harbour/source/debug/debugger.prg @@ -1,4 +1,3 @@ - /* * $Id$ */ @@ -101,7 +100,7 @@ procedure __dbgEntry( uParam1, uParam2, uParam3 ) // debugger entry point do case case ValType( uParam1 ) == "C" // called from hvm.c hb_vmModuleName() - cModuleName = uParam1 + cModuleName := uParam1 if ! s_lExit if s_oDebugger == nil s_oDebugger := TDebugger():New() @@ -124,8 +123,8 @@ procedure __dbgEntry( uParam1, uParam2, uParam3 ) // debugger entry point endif if ProcName( 1 ) == "(_INITSTATICS)" - nStaticsBase = uParam1 - cStaticName = uParam2 + nStaticsBase := uParam1 + cStaticName := uParam2 if AScan( __DbgStatics, { | a | a[ 1 ] == nStaticsBase } ) == 0 AAdd( __DbgStatics, { nStaticsBase, { cStaticName } } ) else @@ -137,23 +136,23 @@ procedure __dbgEntry( uParam1, uParam2, uParam3 ) // debugger entry point if s_oDebugger != nil if PCount() == 3 // called from hvm.c hb_vmLocalName() and hb_vmStaticName() if uParam3 == 1 // in-function static variable - cStaticName = uParam2 - nStaticIndex = uParam1 + cStaticName := uParam2 + nStaticIndex := uParam1 if s_oDebugger:lShowStatics if ( nAt := AScan( s_oDebugger:aVars,; // Is there another var with this name ? { | aVar | aVar[ 1 ] == cStaticName } ) ) != 0 - s_oDebugger:aVars[ nAt ] = { cStaticName, nStaticIndex, "Static" } + s_oDebugger:aVars[ nAt ] := { cStaticName, nStaticIndex, "Static" } else AAdd( s_oDebugger:aVars, { cStaticName, nStaticIndex, "Static" } ) endif endif else // local variable - cLocalName = uParam2 - nLocalIndex = uParam1 + cLocalName := uParam2 + nLocalIndex := uParam1 if s_oDebugger:lShowLocals if ( nAt := AScan( s_oDebugger:aVars,; // Is there another var with this name ? { | aVar | aVar[ 1 ] == cLocalName } ) ) != 0 - s_oDebugger:aVars[ nAt ] = { cLocalName, nLocalIndex, "Local", ProcName( 1 ) } + s_oDebugger:aVars[ nAt ] := { cLocalName, nLocalIndex, "Local", ProcName( 1 ) } else AAdd( s_oDebugger:aVars, { cLocalName, nLocalIndex, "Local", ProcName( 1 ) } ) endif @@ -169,7 +168,7 @@ procedure __dbgEntry( uParam1, uParam2, uParam3 ) // debugger entry point if s_oDebugger:nTraceLevel < Len( s_oDebugger:aCallStack ) return else - s_oDebugger:lTrace = .f. + s_oDebugger:lTrace := .f. endif endif if s_oDebugger:lGo @@ -231,7 +230,7 @@ CLASS TDebugger METHOD BarDisplay() METHOD BuildCommandWindow() - METHOD ClrModal() INLINE If( ::lMonoDisplay, "N/W, W+/W, W/N, W+/N",; + METHOD ClrModal() INLINE iif( ::lMonoDisplay, "N/W, W+/W, W/N, W+/N",; "N/W, R/W, N/BG, R/BG" ) METHOD CodeWindowProcessKey( nKey ) @@ -278,12 +277,12 @@ CLASS TDebugger /* METHOD Sort() INLINE ASort( ::aVars,,, {|x,y| x[1] < y[1] } ),; ::lSortVars := .t.,; - If( ::oBrwVars != nil, ::oBrwVars:RefreshAll(), nil ),; - If( ::oWndVars != nil .and. ::oWndVars:lVisible, ::oBrwVars:ForceStable(),)*/ + iif( ::oBrwVars != nil, ::oBrwVars:RefreshAll(), nil ),; + iif( ::oWndVars != nil .and. ::oWndVars:lVisible, ::oBrwVars:ForceStable(),)*/ METHOD Sort() INLINE ASort( ::aVars,,, {|x,y| x[1] < y[1] } ),; ::lSortVars := .t.,; - If( ::oBrwVars != nil, ::oBrwVars:RefreshAll(), nil ),; - If( ::oWndVars != nil .and. ::oWndVars:lVisible, iif(!::lGo,::oBrwVars:ForceStable(),),) + iif( ::oBrwVars != nil, ::oBrwVars:RefreshAll(), nil ),; + iif( ::oWndVars != nil .and. ::oWndVars:lVisible, iif(!::lGo,::oBrwVars:ForceStable(),),) METHOD Speed() INLINE ; ::nSpeed := ::InputBox( "Step delay (in tenths of a second)",; @@ -337,10 +336,10 @@ METHOD New() CLASS TDebugger SetPos( ::oWndCode:Cargo[1],::oWndCode:Cargo[2] ) } ::oWndCode:bLostFocus := { || ::oWndCode:Cargo[1] := Row(), ::oWndCode:Cargo[2] := Col(), ; SetCursor( SC_NONE ) } - ::oWndCode:bPainted = { || ::oBrwText:SetColor( __DbgColors()[ 2 ] + "," + ; - __DbgColors()[ 5 ] + "," + __DbgColors()[ 3 ] + "," + ; - __DbgColors()[ 6 ] ),; - If( ::oBrwText != nil, ::oBrwText:RefreshWindow(), nil ) } + ::oWndCode:bPainted := { || ::oBrwText:SetColor( __DbgColors()[ 2 ] + "," + ; + __DbgColors()[ 5 ] + "," + __DbgColors()[ 3 ] + "," + ; + __DbgColors()[ 6 ] ),; + iif( ::oBrwText != nil, ::oBrwText:RefreshWindow(), nil ) } AAdd( ::aWindows, ::oWndCode ) @@ -381,7 +380,7 @@ METHOD All() CLASS TDebugger ::lShowPublics := ::lShowPrivates := ::lShowStatics := ; ::lShowLocals := ::lAll := ! ::lAll - If( ::lAll, ::ShowVars(), ::HideVars() ) + iif( ::lAll, ::ShowVars(), ::HideVars() ) return nil @@ -427,7 +426,7 @@ METHOD BuildCommandWindow() CLASS TDebugger oGet:ColorDisp( Replicate( __DbgColors()[ 2 ] + ",", 5 ) ),; hb_ClrArea( ::oWndCommand:nTop + 1, ::oWndCommand:nLeft + 1,; ::oWndCommand:nBottom - 2, ::oWndCommand:nRight - 1,; - If( ::lMonoDisplay, 15, HB_ColorToN( __DbgColors()[ 2 ] ) ) ) } + iif( ::lMonoDisplay, 15, HB_ColorToN( __DbgColors()[ 2 ] ) ) ) } AAdd( ::aWindows, ::oWndCommand ) ::aLastCommands := {} @@ -519,7 +518,7 @@ METHOD Colors() CLASS TDebugger ::oPullDown:Refresh() ::BarDisplay() - for n = 1 to Len( ::aWindows ) + for n := 1 to Len( ::aWindows ) ::aWindows[ n ]:LoadColors() ::aWindows[ n ]:Refresh() next @@ -611,7 +610,7 @@ METHOD EditColor( nColor, oBrwColors ) CLASS TDebugger SetCursor( SC_NORMAL ) @ Row(), Col() GET cColor COLOR SubStr( ::ClrModal(), 5 ) ; - VALID If( Type( cColor ) != "C", ( Alert( "Must be string" ), .f. ), .t. ) + VALID iif( Type( cColor ) != "C", ( Alert( "Must be string" ), .f. ), .t. ) READ SetCursor( SC_NONE ) @@ -620,7 +619,7 @@ METHOD EditColor( nColor, oBrwColors ) CLASS TDebugger Set( _SET_EXIT, lPrevExit ) if LastKey() != K_ESC - ::aColors[ nColor ] = &cColor + ::aColors[ nColor ] := &cColor endif oBrwColors:RefreshCurrent() @@ -668,11 +667,11 @@ METHOD EditVar( nVar ) CLASS TDebugger while ProcName( nProcLevel ) != ::aVars[ nVar ][ 4 ] nProcLevel++ end - uVarValue = __vmVarLGet( nProcLevel, ::aVars[ nVar ][ 2 ] ) + uVarValue := __vmVarLGet( nProcLevel, ::aVars[ nVar ][ 2 ] ) endif if ::aVars[ nVar ][ 3 ] == "Static" - uVarValue = __vmVarSGet( ::aVars[ nVar ][ 2 ] ) + uVarValue := __vmVarSGet( ::aVars[ nVar ][ 2 ] ) endif uVarValue := ::InputBox( cVarName, ValToStr( uVarValue ) ) @@ -680,17 +679,17 @@ METHOD EditVar( nVar ) CLASS TDebugger if LastKey() != K_ESC do case case uVarValue == "{ ... }" - cVarType = ::aVars[ nVar ][ 3 ] + cVarType := ::aVars[ nVar ][ 3 ] do case case cVarType == "Local" - aArray = __vmVarLGet( nProcLevel, ::aVars[ nVar ][ 2 ] ) + aArray := __vmVarLGet( nProcLevel, ::aVars[ nVar ][ 2 ] ) case cVarType == "Static" - aArray = __vmVarSGet( ::aVars[ nVar ][ 2 ] ) + aArray := __vmVarSGet( ::aVars[ nVar ][ 2 ] ) otherwise - aArray = ::aVars[ nVar ][ 2 ] + aArray := ::aVars[ nVar ][ 2 ] endcase if Len( aArray ) > 0 @@ -753,7 +752,7 @@ METHOD HandleEvent() CLASS TDebugger Inkey( ::nSpeed / 10 ) endif if NextKey() == K_ALT_D - ::lAnimate = .f. + ::lAnimate := .f. endif KEYBOARD Chr( 255 ) // Forces a Step(). Only 0-255 range is supported endif @@ -891,7 +890,7 @@ METHOD MonoDisplay() CLASS TDebugger ::BarDisplay() - for n = 1 to Len( ::aWindows ) + for n := 1 to Len( ::aWindows ) ::aWindows[ n ]:LoadColors() ::aWindows[ n ]:Refresh() next @@ -1007,9 +1006,9 @@ METHOD ShowCallStack() CLASS TDebugger ocol:ColorBlock := { || { iif( n == ::oBrwStack:Cargo, 2, 1 ), 3 } } ocol:Defcolor := { 2,1 } - ::oWndStack:bPainted = { || ::oBrwStack:ColorSpec := __DbgColors()[ 2 ] + "," + ; - __DbgColors()[ 5 ] + "," + __DbgColors()[ 4 ],; - ::oBrwStack:RefreshAll(), ::oBrwStack:ForceStable() } + ::oWndStack:bPainted := { || ::oBrwStack:ColorSpec := __DbgColors()[ 2 ] + "," + ; + __DbgColors()[ 5 ] + "," + __DbgColors()[ 4 ],; + ::oBrwStack:RefreshAll(), ::oBrwStack:ForceStable() } ::oBrwStack:ForceStable() ::oWndStack:Show( .f. ) endif @@ -1021,19 +1020,19 @@ METHOD LoadSettings() CLASS TDebugger local cInfo := MemoRead( ::cSettingsFileName ) local n, cLine, nColor - for n = 1 to MLCount( cInfo ) - cLine = MemoLine( cInfo, 120, n ) + for n := 1 to MLCount( cInfo ) + cLine := MemoLine( cInfo, 120, n ) do case case Upper( SubStr( cLine, 1, 14 ) ) == "OPTIONS COLORS" - cLine = SubStr( cLine, At( "{", cLine ) + 1 ) - nColor = 1 + cLine := SubStr( cLine, At( "{", cLine ) + 1 ) + nColor := 1 while nColor < 12 if At( ",", cLine ) != 0 - ::aColors[ nColor ] = ; + ::aColors[ nColor ] := ; StrTran( SubStr( cLine, 1, At( ",", cLine ) - 1 ), '"', "" ) - cLine = SubStr( cLine, At( ",", cLine ) + 1 ) + cLine := SubStr( cLine, At( ",", cLine ) + 1 ) else - ::aColors[ nColor ] = ; + ::aColors[ nColor ] := ; StrTran( SubStr( cLine, 1, At( "}", cLine ) - 1 ), '"', "" ) endif nColor++ @@ -1070,10 +1069,10 @@ METHOD LoadVars() CLASS TDebugger // updates monitored variables if ::lShowStatics if Type( "__DbgStatics" ) == "A" - for n = 1 to Len( __DbgStatics ) - for m = 1 to Len( __DbgStatics[ n ][ 2 ] ) - cStaticName = __DbgStatics[ n ][ 2 ][ m ] - nStaticIndex = __DbgStatics[ n ][ 1 ] + m + for n := 1 to Len( __DbgStatics ) + for m := 1 to Len( __DbgStatics[ n ][ 2 ] ) + cStaticName := __DbgStatics[ n ][ 2 ][ m ] + nStaticIndex := __DbgStatics[ n ][ 1 ] + m AAdd( ::aVars, { cStaticName, nStaticIndex, "Static" } ) next next @@ -1081,7 +1080,7 @@ METHOD LoadVars() CLASS TDebugger // updates monitored variables endif if ::lShowLocals - for n = 1 to Len( ::aCallStack[ 1 ][ 2 ] ) + for n := 1 to Len( ::aCallStack[ 1 ][ 2 ] ) AAdd( ::aVars, ::aCallStack[ 1 ][ 2 ][ n ] ) next endif @@ -1109,10 +1108,10 @@ METHOD ShowVars() CLASS TDebugger ::LoadVars() ::oWndVars := TDbWindow():New( 1, 0, Min( 7, Len( ::aVars ) + 2 ),; - MaxCol() - If( ::oWndStack != nil, ::oWndStack:nWidth(), 0 ),; - "Monitor:" + If( ::lShowLocals, " Local", "" ) + ; - If( ::lShowStatics, " Static", "" ) + If( ::lShowPrivates, " Private", "" ) + ; - If( ::lShowPublics, " Public", "" ) ) + MaxCol() - iif( ::oWndStack != nil, ::oWndStack:nWidth(), 0 ),; + "Monitor:" + iif( ::lShowLocals, " Local", "" ) + ; + iif( ::lShowStatics, " Static", "" ) + iif( ::lShowPrivates, " Private", "" ) + ; + iif( ::lShowPublics, " Public", "" ) ) ::oWndCode:nTop += ::oWndVars:nBottom ::oBrwText:Resize( ::oBrwText:nTop + ::oWndVars:nBottom ) @@ -1121,9 +1120,9 @@ METHOD ShowVars() CLASS TDebugger ::oWndVars:Show( .f. ) AAdd( ::aWindows, ::oWndVars ) - ::oWndVars:bLButtonDown = { | nMRow, nMCol | ::WndVarsLButtonDown( nMRow, nMCol ) } - ::oWndVars:bLDblClick = { | nMRow, nMCol | ::EditVar( n ) } - ::oWndVars:bPainted := { || if(Len( ::aVars ) > 0, ( ::obrwVars:ForceStable(),RefreshVarsS(::oBrwVars) ),) } + ::oWndVars:bLButtonDown := { | nMRow, nMCol | ::WndVarsLButtonDown( nMRow, nMCol ) } + ::oWndVars:bLDblClick := { | nMRow, nMCol | ::EditVar( n ) } + ::oWndVars:bPainted := { || if(Len( ::aVars ) > 0, ( ::obrwVars:ForceStable(),RefreshVarsS(::oBrwVars) ),) } ::oBrwVars := TBrowseNew( 2, 1, ::oWndVars:nBottom - 1, MaxCol() - iif( ::oWndStack != nil,; ::oWndStack:nWidth(), 0 ) - 1 ) @@ -1144,7 +1143,7 @@ METHOD ShowVars() CLASS TDebugger nWidth := ::oWndVars:nWidth() - 1 ::oBrwVars:AddColumn( oCol:=TBColumnNew( "", { || AllTrim( Str( ::oBrwVars:Cargo[1] -1 ) ) + ") " + ; - If( Len( ::aVars ) > 0, PadR( GetVarInfo( ::aVars[ ::oBrwVars:Cargo[1] ] ),; + iif( Len( ::aVars ) > 0, PadR( GetVarInfo( ::aVars[ ::oBrwVars:Cargo[1] ] ),; ::oWndVars:nWidth() - 5 ), "" ) } ) ) aadd(::oBrwVars:Cargo[2],::avars) oCol:DefColor:={2,1} @@ -1154,29 +1153,29 @@ METHOD ShowVars() CLASS TDebugger else ::LoadVars() - ::oWndVars:cCaption = "Monitor:" + ; - If( ::lShowLocals, " Local", "" ) + ; - If( ::lShowStatics, " Static", "" ) + If( ::lShowPrivates, " Private", "" ) + ; - If( ::lShowPublics, " Public", "" ) + ::oWndVars:cCaption := "Monitor:" + ; + iif( ::lShowLocals, " Local", "" ) + ; + iif( ::lShowStatics, " Static", "" ) + iif( ::lShowPrivates, " Private", "" ) + ; + iif( ::lShowPublics, " Public", "" ) if Len( ::aVars ) == 0 if ::oWndVars:nBottom - ::oWndVars:nTop > 1 - ::oWndVars:nBottom = ::oWndVars:nTop + 1 - lRepaint = .t. + ::oWndVars:nBottom := ::oWndVars:nTop + 1 + lRepaint := .t. endif endif if Len( ::aVars ) > ::oWndVars:nBottom - ::oWndVars:nTop - 1 - ::oWndVars:nBottom = ::oWndVars:nTop + Min( Len( ::aVars ) + 1, 7 ) - ::oBrwVars:nBottom = ::oWndVars:nBottom - 1 - lRepaint = .t. + ::oWndVars:nBottom := ::oWndVars:nTop + Min( Len( ::aVars ) + 1, 7 ) + ::oBrwVars:nBottom := ::oWndVars:nBottom - 1 + lRepaint := .t. endif if ! ::oWndVars:lVisible - ::oWndCode:nTop = ::oWndVars:nBottom + 1 + ::oWndCode:nTop := ::oWndVars:nBottom + 1 ::oBrwText:Resize( ::oWndVars:nBottom + 2 ) ::oWndVars:Show() else if lRepaint - ::oWndCode:nTop = ::oWndVars:nBottom + 1 + ::oWndCode:nTop := ::oWndVars:nBottom + 1 ::oWndCode:Refresh() ::oBrwText:Resize( ::oWndVars:nBottom + 2 ) endif @@ -1226,7 +1225,7 @@ METHOD ShowCode( cModuleName ) CLASS TDebugger ASize( ::aCallStack, Len( ::aCallStack ) + 1 ) AIns( ::aCallStack, 1 ) - ::aCallStack[ 1 ] = { cFunction, {} } // function name and locals array + ::aCallStack[ 1 ] := { cFunction, {} } // function name and locals array if !::lGo if ::oWndStack != nil ::oBrwStack:RefreshAll() @@ -1288,7 +1287,7 @@ return nil METHOD HideVars() CLASS TDebugger ::oWndVars:Hide() - ::oWndCode:nTop = 1 + ::oWndCode:nTop := 1 ::oWndCode:SetFocus( .t. ) ::oBrwText:Resize( 2 ) @@ -1325,13 +1324,13 @@ METHOD InputBox( cMsg, uValue, bValid ) CLASS TDebugger do case case cType == "C" - uTemp = AllTrim( uTemp ) + uTemp := AllTrim( uTemp ) case cType == "D" - uTemp = CToD( uTemp ) + uTemp := CToD( uTemp ) case cType == "N" - uTemp = Val( uTemp ) + uTemp := Val( uTemp ) endcase @@ -1360,7 +1359,7 @@ return nil METHOD Local() CLASS TDebugger - ::lShowLocals = ! ::lShowLocals + ::lShowLocals := ! ::lShowLocals if ::lShowPublics .or. ::lShowPrivates .or. ::lShowStatics .or. ::lShowLocals ::ShowVars() @@ -1372,7 +1371,7 @@ return nil METHOD Private() CLASS TDebugger - ::lShowPrivates = ! ::lShowPrivates + ::lShowPrivates := ! ::lShowPrivates if ::lShowPublics .or. ::lShowPrivates .or. ::lShowStatics .or. ::lShowLocals ::ShowVars() @@ -1384,7 +1383,7 @@ return nil METHOD Public() CLASS TDebugger - ::lShowPublics = ! ::lShowPublics + ::lShowPublics := ! ::lShowPublics if ::lShowPublics .or. ::lShowPrivates .or. ::lShowStatics .or. ::lShowLocals ::ShowVars() @@ -1409,7 +1408,7 @@ METHOD RestoreSettings() CLASS TDebugger local n - ::cSettingsFileName = ::InputBox( "File name", ::cSettingsFileName ) + ::cSettingsFileName := ::InputBox( "File name", ::cSettingsFileName ) if LastKey() != K_ESC ::LoadSettings() @@ -1418,7 +1417,7 @@ METHOD RestoreSettings() CLASS TDebugger ::oPullDown:Refresh() ::BarDisplay() - for n = 1 to Len( ::aWindows ) + for n := 1 to Len( ::aWindows ) ::aWindows[ n ]:LoadColors() ::aWindows[ n ]:Refresh() next @@ -1443,7 +1442,7 @@ METHOD SaveSettings() CLASS TDebugger local cInfo := "", n, oWnd - ::cSettingsFileName = ::InputBox( "File name", ::cSettingsFileName ) + ::cSettingsFileName := ::InputBox( "File name", ::cSettingsFileName ) if LastKey() != K_ESC @@ -1452,7 +1451,7 @@ METHOD SaveSettings() CLASS TDebugger endif cInfo += "Options Colors {" - for n = 1 to Len( ::aColors ) + for n := 1 to Len( ::aColors ) cInfo += '"' + ::aColors[ n ] + '"' if n < Len( ::aColors ) cInfo += "," @@ -1468,8 +1467,8 @@ METHOD SaveSettings() CLASS TDebugger cInfo += "Run Speed " + AllTrim( Str( ::nSpeed ) ) + Chr( 13 ) + Chr( 10 ) endif - for n = 1 to Len( ::aWindows ) - oWnd = ::aWindows[ n ] + for n := 1 to Len( ::aWindows ) + oWnd := ::aWindows[ n ] cInfo += "Window Size " + AllTrim( Str( oWnd:nBottom - oWnd:nTop + 1 ) ) + " " cInfo += AllTrim( Str( oWnd:nRight - oWnd:nLeft + 1 ) ) + Chr( 13 ) + Chr( 10 ) cInfo += "Window Move " + AllTrim( Str( oWnd:nTop ) ) + " " @@ -1488,7 +1487,7 @@ return nil METHOD Static() CLASS TDebugger - ::lShowStatics = ! ::lShowStatics + ::lShowStatics := ! ::lShowStatics if ::lShowPublics .or. ::lShowPrivates .or. ::lShowStatics .or. ::lShowLocals ::ShowVars() @@ -1752,7 +1751,7 @@ return nil function __DbgColors() -return If( ! s_oDebugger:lMonoDisplay, s_oDebugger:aColors,; +return iif( ! s_oDebugger:lMonoDisplay, s_oDebugger:aColors,; { "W+/N", "W+/N", "N/W", "N/W", "N/W", "N/W", "W+/N",; "N/W", "W+/W", "W/N", "W+/N" } ) diff --git a/harbour/source/rtl/gtsln/gtsln.c b/harbour/source/rtl/gtsln/gtsln.c index 327232c958..8cd5269b6f 100644 --- a/harbour/source/rtl/gtsln/gtsln.c +++ b/harbour/source/rtl/gtsln/gtsln.c @@ -64,16 +64,16 @@ #define SLSMG_BUILD_CHAR( ch, color ) ( ( ( SLsmg_Char_Type ) ( unsigned char )( ch ) ) | ( ( color ) << 8 ) ) #if SLANG_VERSION < 10308 - #define SLSMG_DIAMOND_CHAR 0x04 - #define SLSMG_DEGREE_CHAR 0xF8 - #define SLSMG_PLMINUS_CHAR 0xF1 - #define SLSMG_BULLET_CHAR 0xF9 - #define SLSMG_LARROW_CHAR 0x1B - #define SLSMG_RARROW_CHAR 0x1A - #define SLSMG_DARROW_CHAR 0x19 - #define SLSMG_UARROW_CHAR 0x18 - #define SLSMG_BOARD_CHAR 0xB2 - #define SLSMG_BLOCK_CHAR 0xDB + #define SLSMG_DIAMOND_CHAR 0x04 + #define SLSMG_DEGREE_CHAR 0xF8 + #define SLSMG_PLMINUS_CHAR 0xF1 + #define SLSMG_BULLET_CHAR 0xF9 + #define SLSMG_LARROW_CHAR 0x1B + #define SLSMG_RARROW_CHAR 0x1A + #define SLSMG_DARROW_CHAR 0x19 + #define SLSMG_UARROW_CHAR 0x18 + #define SLSMG_BOARD_CHAR 0xB2 + #define SLSMG_BLOCK_CHAR 0xDB /* #define SLSMG_BOARD_CHAR 'h' #define SLSMG_BLOCK_CHAR '0' diff --git a/harbour/source/rtl/gtstd/gtstd.c b/harbour/source/rtl/gtstd/gtstd.c index 6dd8832348..f637116053 100644 --- a/harbour/source/rtl/gtstd/gtstd.c +++ b/harbour/source/rtl/gtstd/gtstd.c @@ -61,10 +61,10 @@ #include /* read() function requires it */ #include #else -#if defined(_MSC_VER) - #include - #include -#endif + #if defined(_MSC_VER) + #include + #include + #endif #endif /* Add time function for BEL flood throttling.. */ @@ -192,16 +192,16 @@ int hb_gt_ReadKey( HB_inkey_enum eventmask ) ch = 0; #else -#if defined(_MSC_VER) - if( s_bStdinConsole ) - { - if( _kbhit() ) ch = _getch(); - } - else - { - if(! _eof(0) ) _read(0, &ch, 1); - } -#endif + #if defined(_MSC_VER) + if( s_bStdinConsole ) + { + if( _kbhit() ) ch = _getch(); + } + else + { + if(! _eof(0) ) _read(0, &ch, 1); + } + #endif #endif @@ -330,16 +330,14 @@ void hb_gt_SetPos( SHORT iRow, SHORT iCol, SHORT iMethod ) } else if( s_iCol > iCol ) { - szBuffer[0] = HB_CHAR_BS; - while( s_iCol-- > iCol ) - out_stdout( szBuffer, 1 ); + szBuffer[0] = HB_CHAR_BS; + while( s_iCol-- > iCol ) + out_stdout( szBuffer, 1 ); } s_iRow = iRow; s_iCol = iCol; - - } - + } } SHORT hb_gt_Col( void ) @@ -476,7 +474,7 @@ void hb_gt_Scroll( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, out_newline(); s_iCol = 0; - } + } } } diff --git a/harbour/source/rtl/perfuncs.prg b/harbour/source/rtl/perfuncs.prg index ff61502299..438721530e 100644 --- a/harbour/source/rtl/perfuncs.prg +++ b/harbour/source/rtl/perfuncs.prg @@ -50,15 +50,15 @@ * */ -static aObjects +static s_aObjects function HB_SetObject( oSelf, bConstructor ) - if aObjects == nil - aObjects = {} - AAdd( aObjects, oSelf ) + if s_aObjects == nil + s_aObjects := {} + AAdd( s_aObjects, oSelf ) else - AAdd( aObjects, oSelf := Eval( bConstructor ) ) + AAdd( s_aObjects, oSelf := Eval( bConstructor ) ) endif return oSelf @@ -67,12 +67,12 @@ function HB_EndObject() local oSelf - if Len( aObjects ) > 1 - ASize( aObjects, Len( aObjects ) - 1 ) - oSelf = ATail( aObjects ) + if Len( s_aObjects ) > 1 + ASize( s_aObjects, Len( s_aObjects ) - 1 ) + oSelf := ATail( s_aObjects ) else - oSelf = aObjects[ 1 ] - aObjects = nil + oSelf := s_aObjects[ 1 ] + s_aObjects := nil endif return oSelf diff --git a/harbour/source/rtl/persist.prg b/harbour/source/rtl/persist.prg index 1708787b81..fc24f82caa 100644 --- a/harbour/source/rtl/persist.prg +++ b/harbour/source/rtl/persist.prg @@ -85,12 +85,12 @@ METHOD LoadFromText( cObjectText ) CLASS HBPersistent end while nLine <= nLines - cLine = MemoLine( cObjectText,, nLine ) + cLine := MemoLine( cObjectText,, nLine ) do case case Upper( LTrim( __StrToken( cLine, 1 ) ) ) == "OBJECT" if lStart - lStart = .f. + lStart := .f. else endif @@ -100,9 +100,9 @@ METHOD LoadFromText( cObjectText ) CLASS HBPersistent endif case Left( cToken := LTrim( __StrToken( cLine, 1, "=" ) ), 2 ) == "::" - M->oSelf = Self - cLine = StrTran( cLine, "::", "oSelf:" ) - cLine = StrTran( cLine, "=", ":=" ) + M->oSelf := Self + cLine := StrTran( cLine, "::", "oSelf:" ) + cLine := StrTran( cLine, "=", ":=" ) &( cLine ) endcase @@ -122,18 +122,18 @@ METHOD SaveToText( cObjectName ) CLASS HBPersistent DEFAULT cObjectName TO "o" + ::ClassName() nIndent += 3 - cObject := If( nIndent > 0, HB_OsNewLine(), "" ) + Space( nIndent ) + ; - "OBJECT " + If( nIndent != 0, "::", "" ) + cObjectName + " AS " + ; + cObject := iif( nIndent > 0, HB_OsNewLine(), "" ) + Space( nIndent ) + ; + "OBJECT " + iif( nIndent != 0, "::", "" ) + cObjectName + " AS " + ; ::ClassName() + HB_OsNewLine() - aProperties = __ClsGetProperties( ::ClassH ) + aProperties := __ClsGetProperties( ::ClassH ) - for n = 1 to Len( aProperties ) - uValue = __objSendMsg( Self, aProperties[ n ] ) + for n := 1 to Len( aProperties ) + uValue := __objSendMsg( Self, aProperties[ n ] ) if ! uValue == __objSendMsg( oNew, aProperties[ n ] ) - cType = ValType( uValue ) + cType := ValType( uValue ) do case case cType == "A" @@ -176,9 +176,9 @@ static function ArrayToText( aArray, cName, nIndent ) " LEN " + AllTrim( Str( Len( aArray ) ) ) + HB_OsNewLine() local n, uValue, cType - for n = 1 to Len( aArray ) - uValue = aArray[ n ] - cType = ValType( uValue ) + for n := 1 to Len( aArray ) + uValue := aArray[ n ] + cType := ValType( uValue ) do case case cType == "A" @@ -214,16 +214,16 @@ static function ValToText( uValue ) do case case cType == "C" - cText = '"' + uValue + '"' + cText := '"' + uValue + '"' case cType == "N" - cText = AllTrim( Str( uValue ) ) + cText := AllTrim( Str( uValue ) ) case cType == "D" - cText = 'HB_STOD( "' + DToS( uValue ) + '" )' + cText := 'HB_STOD( "' + DToS( uValue ) + '" )' otherwise - cText = HB_ValToStr( uValue ) + cText := HB_ValToStr( uValue ) endcase return cText diff --git a/harbour/source/rtl/profiler.prg b/harbour/source/rtl/profiler.prg index 915f190c29..976fb6b198 100644 --- a/harbour/source/rtl/profiler.prg +++ b/harbour/source/rtl/profiler.prg @@ -147,7 +147,7 @@ Local n @ 3, 0 Say " Total Ticks: " + str( oProfile:totalTicks() ) @ 4, 0 Say "Total Seconds: " + str( oProfile:totalSeconds() ) -Return( NIL ) +Return NIL Static Function DrawScreen( cTitle ) @@ -155,57 +155,57 @@ Static Function DrawScreen( cTitle ) @ 0, 0 Say padr( cTitle, maxcol() + 1 ) Color "n/w" -Return( NIL ) +Return NIL Function DoNothingForTwoSeconds() inkey( 2 ) -Return( NIL ) +Return NIL Function CallMe500Times() -Return( NIL ) +Return NIL Static Function Browser( oBrowse ) Local lBrowsing := .T. Local nKey Do While lBrowsing - + oBrowse:forceStable() - + nKey := inkey( 0 ) - + Do Case - - Case nKey == K_ESC - lBrowsing := .F. - - Case nKey == K_DOWN - oBrowse:down() - - Case nKey == K_UP - oBrowse:up() - - Case nKey == K_LEFT - oBrowse:left() - - Case nKey == K_RIGHT - oBrowse:right() - - Case nKey == K_PGDN - oBrowse:pageDown() - - Case nKey == K_PGUP - oBrowse:pageUp() - - // And so on.... (not really necessary for this test) - + + Case nKey == K_ESC + lBrowsing := .F. + + Case nKey == K_DOWN + oBrowse:down() + + Case nKey == K_UP + oBrowse:up() + + Case nKey == K_LEFT + oBrowse:left() + + Case nKey == K_RIGHT + oBrowse:right() + + Case nKey == K_PGDN + oBrowse:pageDown() + + Case nKey == K_PGUP + oBrowse:pageUp() + + // And so on.... (not really necessary for this test) + EndCase EndDo -Return( NIL ) +Return NIL #endif @@ -237,27 +237,27 @@ Method init( cName, aInfo ) Class HBProfileEntity ::nCalls := aInfo[ 1 ] ::nTicks := aInfo[ 2 ] -Return( self ) +Return self ///// Access nSeconds Class HBProfileEntity -Return( HB_Clocks2Secs( ::nTicks ) ) +Return HB_Clocks2Secs( ::nTicks ) ///// Access nMeanTicks Class HBProfileEntity -Return( if( ::nCalls == 0, 0, ::nTicks / ::nCalls ) ) +Return iif( ::nCalls == 0, 0, ::nTicks / ::nCalls ) ///// Access nMeanSeconds Class HBProfileEntity -Return( if( ::nCalls == 0, 0, ::nSeconds / ::nCalls ) ) +Return iif( ::nCalls == 0, 0, ::nSeconds / ::nCalls ) ///// Method describe Class HBProfileEntity -Return( "Base Entity" ) +Return "Base Entity" //////////////////////////////////////////////////////////////////////////// // Class: HBProfileFunction @@ -273,7 +273,7 @@ End Class ///// Method describe Class HBProfileFunction -Return( "Function" ) +Return "Function" //////////////////////////////////////////////////////////////////////////// // Class: HBProfileMethod @@ -289,7 +289,7 @@ End Class ///// Method describe Class HBProfileMethod -Return( "Method" ) +Return "Method" //////////////////////////////////////////////////////////////////////////// // Class: HBProfile @@ -327,7 +327,7 @@ Local lProfile := __setProfiler( .F. ) __setProfiler( lProfile ) -Return( self ) +Return self ///// @@ -335,13 +335,13 @@ Method reset Class HBProfile ::aProfile := {} -Return( self ) +Return self ///// Method ignoreSymbol( cSymbol ) Class HBProfile Local cProfPrefix := "HBPROFILE" -Return( ( left( cSymbol, len( cProfPrefix ) ) == cProfPrefix ) .Or. ( cSymbol == "__SETPROFILER" ) ) +Return ( left( cSymbol, len( cProfPrefix ) ) == cProfPrefix ) .Or. ( cSymbol == "__SETPROFILER" ) ///// @@ -410,7 +410,7 @@ Local n __setProfiler( lProfile ) -Return( self ) +Return self ///// @@ -421,7 +421,7 @@ Local lProfile := __setProfiler( .F. ) __setProfiler( lProfile ) -Return( self ) +Return self ///// @@ -432,7 +432,7 @@ Local lProfile := __setProfiler( .F. ) __setProfiler( lProfile ) -Return( self ) +Return self ///// @@ -443,7 +443,7 @@ Local lProfile := __setProfiler( .F. ) __setProfiler( lProfile ) -Return( self ) +Return self ///// @@ -454,7 +454,7 @@ Local lProfile := __setProfiler( .F. ) __setProfiler( lProfile ) -Return( self ) +Return self ///// @@ -465,7 +465,7 @@ Local lProfile := __setProfiler( .F. ) __setProfiler( lProfile ) -Return( self ) +Return self ///// @@ -477,7 +477,7 @@ Local nCalls := 0 __setProfiler( lProfile ) -Return( nCalls ) +Return nCalls ///// @@ -489,7 +489,7 @@ Local nTicks := 0 __setProfiler( lProfile ) -Return( nTicks ) +Return nTicks ///// @@ -501,7 +501,7 @@ Local nSeconds := 0 __setProfiler( lProfile ) -Return( nSeconds ) +Return nSeconds //////////////////////////////////////////////////////////////////////////// // Class: HBProfileReport @@ -534,7 +534,7 @@ Local lProfile := __setProfiler( .F. ) __setProfiler( lProfile ) -Return( self ) +Return self ///// @@ -542,13 +542,13 @@ Method writeLines( aLines ) Class HBProfileReport aeval( aLines, {|c| qout( c ) } ) -Return( self ) +Return self ///// Method header Class HBProfileReport -Return( { "Name Type Calls Ticks Seconds",; - "=================================== ========== ======== =========== ===========" } ) +Return { "Name Type Calls Ticks Seconds",; + "=================================== ========== ======== =========== ===========" } ///// @@ -556,16 +556,16 @@ Method emitHeader Class HBProfileReport ::writeLines( ::header() ) -Return( self ) +Return self ///// Method line( oEntity ) Class HBProfileReport -Return( { padr( oEntity:cName, 35 ) + " " + ; - padr( oEntity:describe(), 8 ) + " " + ; - padl( oEntity:nCalls, 10 ) + " " + ; - padl( oEntity:nTicks, 11 ) + " " + ; - str( oEntity:nSeconds, 11, 2 ) } ) +Return { padr( oEntity:cName, 35 ) + " " + ; + padr( oEntity:describe(), 8 ) + " " + ; + padl( oEntity:nCalls, 10 ) + " " + ; + padl( oEntity:nTicks, 11 ) + " " + ; + str( oEntity:nSeconds, 11, 2 ) } ///// @@ -573,7 +573,7 @@ Method emitLine( oEntity ) Class HBProfileReport ::writeLines( ::line( oEntity ) ) -Return( self ) +Return self ///// @@ -582,11 +582,11 @@ Local lProfile := __setProfiler( .F. ) Default bFilter To {|| .T. } - ::emitHeader():oProfile:forEach( {|o| if( eval( bFilter, o ), ::emitLine( o ), NIL ) } ) + ::emitHeader():oProfile:forEach( {|o| iif( eval( bFilter, o ), ::emitLine( o ), NIL ) } ) __setProfiler( lProfile ) -Return( self ) +Return self //////////////////////////////////////////////////////////////////////////// // Class: HBProfileReportToFile @@ -613,7 +613,7 @@ Method writeLines( aLines ) Class HBProfileReportToFile aeval( aLines, {|c| fwrite( ::hFile, c + HB_OSNewLine() ) } ) EndIf -Return( self ) +Return self ///// @@ -631,7 +631,7 @@ Local lProfile := __setProfiler( .F. ) __setProfiler( lProfile ) -Return( self ) +Return self //////////////////////////////////////////////////////////////////////////// // Class: HBProfileReportToArray @@ -656,7 +656,7 @@ Method writeLines( aLines ) Class HBProfileReportToArray aeval( aLines, {|c| aadd( ::aReport, c ) } ) -Return( self ) +Return self ///// @@ -665,7 +665,7 @@ Method generate( bFilter ) Class HBProfileReportToArray ::aReport := {} ::super:generate( bFilter ) -Return( ::aReport ) +Return ::aReport //////////////////////////////////////////////////////////////////////////// // Class: HBProfileReportToString @@ -685,7 +685,7 @@ Local cReport := "" aeval( ::super:generate( bFilter ), {|c| cReport += c + HB_OSNewLine() } ) -Return( cReport ) +Return cReport //////////////////////////////////////////////////////////////////////////// // Class: HBProfileReportToTBrowse @@ -714,7 +714,7 @@ Method emitHeader Class HBProfileReportToTBrowse // No header required. -Return( self ) +Return self ///// @@ -723,7 +723,7 @@ Method emitLine( oEntity ) Class HBProfileReportToTBrowse // Don't "emit" anything, simply add the entity to the array. aadd( ::aReport, oEntity ) -Return( self ) +Return self ///// @@ -743,7 +743,7 @@ Local oBrowse oBrowse:goTopBlock := {|| ::nEntity := 1 } oBrowse:goBottomBlock := {|| ::nEntity := len( ::aReport ) } oBrowse:skipBlock := {|nSkip, nPos| nPos := ::nEntity, ; - ::nEntity := if( nSkip > 0, ; + ::nEntity := iif( nSkip > 0, ; min( len( ::aReport ), ::nEntity + nSkip ), ; max( 1, ::nEntity + nSkip ) ), ::nEntity - nPos } @@ -751,7 +751,7 @@ Local oBrowse __setProfiler( lProfile ) -Return( oBrowse ) +Return oBrowse ///// @@ -765,12 +765,12 @@ Method addColumns( oBrowse ) Class HBProfileReportToTBrowse oBrowse:addColumn( tbcolumnnew( "Mean;Ticks", {|| str( ::currentEntity():nMeanTicks, 11, 2 ) } ) ) oBrowse:addColumn( tbcolumnnew( "Mean;Seconds", {|| str( ::currentEntity():nMeanSeconds, 11, 2 ) } ) ) -Return( self ) +Return self ///// Method currentEntity Class HBProfileReportToTBrowse -Return( ::aReport[ ::nEntity ] ) +Return ::aReport[ ::nEntity ] /* * profiler.prg ends here.