Skip to content

Commit

Permalink
Cast tb_hize_t to tb_size_t
Browse files Browse the repository at this point in the history
  • Loading branch information
A2va committed Nov 26, 2024
1 parent 70bae3c commit 1f1c9a0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/tbox/stream/impl/stream/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
// the buffer stream type
typedef struct __tb_stream_buffer_t
{
// the data
// the buffer
tb_buffer_ref_t buffer;

// the head
tb_size_t head;

// the data is referenced?
// the buffer is referenced?
tb_bool_t bref;

}tb_stream_buffer_t;
Expand Down Expand Up @@ -85,7 +85,7 @@ static tb_void_t tb_stream_buffer_exit(tb_stream_ref_t stream)
// clear head
stream_buffer->head = 0;

// exit data
// exit buffer
if (stream_buffer->buffer && !stream_buffer->bref) tb_buffer_exit(stream_buffer->buffer);
stream_buffer->buffer = tb_null;
}
Expand Down Expand Up @@ -140,7 +140,7 @@ static tb_bool_t tb_stream_buffer_seek(tb_stream_ref_t stream, tb_hize_t offset)
tb_assert_and_check_return_val(stream_buffer && offset <= tb_buffer_size(stream_buffer->buffer), tb_false);

// seek
stream_buffer->head = offset;
stream_buffer->head = (tb_size_t)offset;

// ok
return tb_true;
Expand Down Expand Up @@ -233,7 +233,7 @@ tb_stream_ref_t tb_stream_init_from_buffer(tb_buffer_ref_t buffer)
stream = tb_stream_init_buffer();
tb_assert_and_check_break(stream);

// set data and size
// set buffer and size
if (!tb_stream_ctrl(stream, TB_STREAM_CTRL_BUFF_SET_BUFFER, buffer)) break;

// ok
Expand Down

0 comments on commit 1f1c9a0

Please sign in to comment.