Changes in uspace/srv/hid/rfb/rfb.c [b7fd2a0:1569a9b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/rfb/rfb.c
rb7fd2a0 r1569a9b 62 62 63 63 /** Receive one character (with buffering) */ 64 static errno_t recv_char(tcp_conn_t *conn, char *c)64 static int recv_char(tcp_conn_t *conn, char *c) 65 65 { 66 66 size_t nrecv; 67 errno_t rc;67 int rc; 68 68 69 69 if (rbuf_out == rbuf_in) { … … 83 83 84 84 /** Receive count characters (with buffering) */ 85 static errno_t recv_chars(tcp_conn_t *conn, char *c, size_t count)85 static int recv_chars(tcp_conn_t *conn, char *c, size_t count) 86 86 { 87 87 for (size_t i = 0; i < count; i++) { 88 errno_t rc = recv_char(conn, c);88 int rc = recv_char(conn, c); 89 89 if (rc != EOK) 90 90 return rc; … … 94 94 } 95 95 96 static errno_t recv_skip_chars(tcp_conn_t *conn, size_t count)96 static int recv_skip_chars(tcp_conn_t *conn, size_t count) 97 97 { 98 98 for (size_t i = 0; i < count; i++) { 99 99 char c; 100 errno_t rc = recv_char(conn, &c);100 int rc = recv_char(conn, &c); 101 101 if (rc != EOK) 102 102 return rc; … … 173 173 } 174 174 175 errno_t rfb_init(rfb_t *rfb, uint16_t width, uint16_t height, const char *name)175 int rfb_init(rfb_t *rfb, uint16_t width, uint16_t height, const char *name) 176 176 { 177 177 memset(rfb, 0, sizeof(rfb_t)); … … 196 196 } 197 197 198 errno_t rfb_set_size(rfb_t *rfb, uint16_t width, uint16_t height)198 int rfb_set_size(rfb_t *rfb, uint16_t width, uint16_t height) 199 199 { 200 200 size_t new_size = width * height * sizeof(pixel_t); … … 216 216 } 217 217 218 static errno_t recv_message(tcp_conn_t *conn, char type, void *buf, size_t size)218 static int recv_message(tcp_conn_t *conn, char type, void *buf, size_t size) 219 219 { 220 220 memcpy(buf, &type, 1); … … 435 435 } 436 436 437 static errno_t rfb_tile_encode_solid(rfb_t *rfb, cpixel_ctx_t *cpixel,437 static int rfb_tile_encode_solid(rfb_t *rfb, cpixel_ctx_t *cpixel, 438 438 rfb_rectangle_t *tile, void *buf, size_t *size) 439 439 { … … 476 476 uint8_t tile_enctype = RFB_TILE_ENCODING_SOLID; 477 477 size_t tile_size; 478 errno_t rc = rfb_tile_encode_solid(rfb, &cpixel, &tile, buf,478 int rc = rfb_tile_encode_solid(rfb, &cpixel, &tile, buf, 479 479 &tile_size); 480 480 if (rc != EOK) { … … 492 492 } 493 493 494 static errno_t rfb_send_framebuffer_update(rfb_t *rfb, tcp_conn_t *conn,494 static int rfb_send_framebuffer_update(rfb_t *rfb, tcp_conn_t *conn, 495 495 bool incremental) 496 496 { … … 556 556 557 557 if (!rfb->pixel_format.true_color) { 558 errno_t rc = tcp_conn_send(conn, send_palette, send_palette_size);558 int rc = tcp_conn_send(conn, send_palette, send_palette_size); 559 559 if (rc != EOK) { 560 560 free(buf); … … 563 563 } 564 564 565 errno_t rc = tcp_conn_send(conn, buf, buf_size);565 int rc = tcp_conn_send(conn, buf, buf_size); 566 566 free(buf); 567 567 … … 569 569 } 570 570 571 static errno_t rfb_set_pixel_format(rfb_t *rfb, rfb_pixel_format_t *pixel_format)571 static int rfb_set_pixel_format(rfb_t *rfb, rfb_pixel_format_t *pixel_format) 572 572 { 573 573 rfb->pixel_format = *pixel_format; … … 599 599 { 600 600 /* Version handshake */ 601 errno_t rc = tcp_conn_send(conn, "RFB 003.008\n", 12);601 int rc = tcp_conn_send(conn, "RFB 003.008\n", 12); 602 602 if (rc != EOK) { 603 603 log_msg(LOG_DEFAULT, LVL_WARN, "Failed sending server version: %s", … … 759 759 } 760 760 761 errno_t rfb_listen(rfb_t *rfb, uint16_t port)761 int rfb_listen(rfb_t *rfb, uint16_t port) 762 762 { 763 763 tcp_t *tcp = NULL; 764 764 tcp_listener_t *lst = NULL; 765 765 inet_ep_t ep; 766 errno_t rc;766 int rc; 767 767 768 768 rc = tcp_create(&tcp);
Note:
See TracChangeset
for help on using the changeset viewer.