Changes in uspace/srv/hid/rfb/rfb.c [1569a9b:d6ff08a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/rfb/rfb.c
r1569a9b rd6ff08a0 418 418 } 419 419 420 static s ize_t rfb_tile_encode_raw(rfb_t *rfb, cpixel_ctx_t *cpixel,420 static ssize_t rfb_tile_encode_raw(rfb_t *rfb, cpixel_ctx_t *cpixel, 421 421 rfb_rectangle_t *tile, void *buf) 422 422 { 423 s ize_t size = tile->width * tile->height * cpixel->size;423 ssize_t size = tile->width * tile->height * cpixel->size; 424 424 if (buf == NULL) 425 425 return size; … … 435 435 } 436 436 437 static int rfb_tile_encode_solid(rfb_t *rfb, cpixel_ctx_t *cpixel,438 rfb_rectangle_t *tile, void *buf , size_t *size)437 static ssize_t rfb_tile_encode_solid(rfb_t *rfb, cpixel_ctx_t *cpixel, 438 rfb_rectangle_t *tile, void *buf) 439 439 { 440 440 /* Check if it is single color */ … … 443 443 for (uint16_t x = tile->x; x < tile->x + tile->width; x++) { 444 444 if (pixelmap_get_pixel(&rfb->framebuffer, x, y) != the_color) 445 return EINVAL;445 return -1; 446 446 } 447 447 } … … 450 450 if (buf) 451 451 cpixel_encode(rfb, cpixel, buf, the_color); 452 *size = cpixel->size; 453 return EOK; 452 return cpixel->size; 454 453 } 455 454 … … 475 474 476 475 uint8_t tile_enctype = RFB_TILE_ENCODING_SOLID; 477 size_t tile_size; 478 int rc = rfb_tile_encode_solid(rfb, &cpixel, &tile, buf, 479 &tile_size); 480 if (rc != EOK) { 476 ssize_t tile_size = rfb_tile_encode_solid(rfb, &cpixel, &tile, buf); 477 if (tile_size < 0) { 481 478 tile_size = rfb_tile_encode_raw(rfb, &cpixel, &tile, buf); 482 479 tile_enctype = RFB_TILE_ENCODING_RAW; … … 601 598 int rc = tcp_conn_send(conn, "RFB 003.008\n", 12); 602 599 if (rc != EOK) { 603 log_msg(LOG_DEFAULT, LVL_WARN, "Failed sending server version: %s", 604 str_error(rc)); 600 log_msg(LOG_DEFAULT, LVL_WARN, "Failed sending server version %d", rc); 605 601 return; 606 602 } … … 609 605 rc = recv_chars(conn, client_version, 12); 610 606 if (rc != EOK) { 611 log_msg(LOG_DEFAULT, LVL_WARN, "Failed receiving client version: %s", 612 str_error(rc)); 607 log_msg(LOG_DEFAULT, LVL_WARN, "Failed receiving client version: %d", rc); 613 608 return; 614 609 } … … 628 623 if (rc != EOK) { 629 624 log_msg(LOG_DEFAULT, LVL_WARN, 630 "Failed sending security handshake: % s", str_error(rc));625 "Failed sending security handshake: %d", rc); 631 626 return; 632 627 } … … 635 630 rc = recv_char(conn, &selected_sec_type); 636 631 if (rc != EOK) { 637 log_msg(LOG_DEFAULT, LVL_WARN, "Failed receiving security type: %s", 638 str_error(rc)); 632 log_msg(LOG_DEFAULT, LVL_WARN, "Failed receiving security type: %d", rc); 639 633 return; 640 634 } … … 647 641 rc = tcp_conn_send(conn, &security_result, sizeof(uint32_t)); 648 642 if (rc != EOK) { 649 log_msg(LOG_DEFAULT, LVL_WARN, "Failed sending security result: %s", 650 str_error(rc)); 643 log_msg(LOG_DEFAULT, LVL_WARN, "Failed sending security result: %d", rc); 651 644 return; 652 645 } … … 656 649 rc = recv_char(conn, &shared_flag); 657 650 if (rc != EOK) { 658 log_msg(LOG_DEFAULT, LVL_WARN, "Failed receiving client init: %s", 659 str_error(rc)); 651 log_msg(LOG_DEFAULT, LVL_WARN, "Failed receiving client init: %d", rc); 660 652 return; 661 653 } … … 680 672 rc = tcp_conn_send(conn, server_init, msg_length); 681 673 if (rc != EOK) { 682 log_msg(LOG_DEFAULT, LVL_WARN, "Failed sending server init: %s", 683 str_error(rc)); 674 log_msg(LOG_DEFAULT, LVL_WARN, "Failed sending server init: %d", rc); 684 675 return; 685 676 }
Note:
See TracChangeset
for help on using the changeset viewer.