Changeset a7b1071 in mainline
- Timestamp:
- 2009-04-03T19:48:10Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7a2c479
- Parents:
- c8bf88d
- Location:
- kernel/generic/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/kconsole.c
rc8bf88d ra7b1071 510 510 prev = offset; 511 511 } 512 *end = offset;512 *end = prev; 513 513 514 514 return found_start; -
kernel/generic/src/lib/string.c
rc8bf88d ra7b1071 459 459 int str_cmp(const char *s1, const char *s2) 460 460 { 461 wchar_t c1 ;462 wchar_t c2 ;461 wchar_t c1 = 0; 462 wchar_t c2 = 0; 463 463 464 464 size_t off1 = 0; 465 465 size_t off2 = 0; 466 467 while ((c1 = str_decode(s1, &off1, STR_NO_LIMIT) != 0) 468 && (c2 = str_decode(s2, &off2, STR_NO_LIMIT) != 0)) { 469 470 if (off1 != off2) 471 break; 472 466 467 while (true) { 468 c1 = str_decode(s1, &off1, STR_NO_LIMIT); 469 c2 = str_decode(s2, &off2, STR_NO_LIMIT); 470 473 471 if (c1 < c2) 474 472 return -1; … … 476 474 if (c1 > c2) 477 475 return 1; 478 } 479 480 if ((off1 == off2) && (c1 == c2)) 481 return 0; 482 483 if ((c1 == 0) || (off1 < off2)) 484 return -1; 485 486 return 1; 476 477 if (c1 == 0 || c2 == 0) 478 break; 479 } 480 481 return 0; 487 482 } 488 483 … … 510 505 511 506 count_t len = 0; 512 513 while ((len < max_len) 514 && ((c1 = str_decode(s1, &off1, STR_NO_LIMIT)) != 0) 515 && ((c2 = str_decode(s2, &off2, STR_NO_LIMIT)) != 0)) { 516 517 if (off1 != off2) 507 508 while (true) { 509 if (len >= max_len) 518 510 break; 519 511 512 c1 = str_decode(s1, &off1, STR_NO_LIMIT); 513 c2 = str_decode(s2, &off2, STR_NO_LIMIT); 514 520 515 if (c1 < c2) 521 516 return -1; 522 517 523 518 if (c1 > c2) 524 519 return 1; 525 526 len++; 527 } 528 529 if ((off1 == off2) && (len == max_len) && (c1 == c2)) 530 return 0; 531 532 if ((c1 == 0) || (off1 < off2)) 533 return -1; 534 535 return 1; 520 521 if (c1 == 0 || c2 == 0) 522 break; 523 524 ++len; 525 } 526 527 return 0; 528 536 529 } 537 530 … … 559 552 size_t dst_off = 0; 560 553 561 while ((ch = str_decode(src, &str_off, STR_NO_LIMIT) != 0)) {554 while ((ch = str_decode(src, &str_off, STR_NO_LIMIT)) != 0) { 562 555 if (chr_encode(ch, dst, &dst_off, size) != EOK) 563 556 break; … … 617 610 size_t off = 0; 618 611 619 while ((acc = str_decode(str, &off, STR_NO_LIMIT) != 0)) {612 while ((acc = str_decode(str, &off, STR_NO_LIMIT)) != 0) { 620 613 if (acc == ch) 621 614 return (str + off);
Note:
See TracChangeset
for help on using the changeset viewer.