Fix minor code styles issues
This commit is contained in:
parent
b0517b2f39
commit
f6e5f8937b
@ -146,7 +146,7 @@ static int gmio_stream_stdio_set_pos(void* cookie, const gmio_stream_pos_t* pos)
|
|||||||
|
|
||||||
gmio_stream_t gmio_stream_stdio(FILE* file)
|
gmio_stream_t gmio_stream_stdio(FILE* file)
|
||||||
{
|
{
|
||||||
gmio_stream_t stream = { 0 };
|
gmio_stream_t stream = gmio_stream_null();
|
||||||
stream.cookie = file;
|
stream.cookie = file;
|
||||||
stream.func_at_end = gmio_stream_stdio_at_end;
|
stream.func_at_end = gmio_stream_stdio_at_end;
|
||||||
stream.func_error = gmio_stream_stdio_error;
|
stream.func_error = gmio_stream_stdio_error;
|
||||||
|
@ -31,7 +31,7 @@ enum { GMIO_FIXED_BUFFER_SIZE = 512 };
|
|||||||
|
|
||||||
gmio_stl_format_t gmio_stl_get_format(gmio_stream_t *stream)
|
gmio_stl_format_t gmio_stl_get_format(gmio_stream_t *stream)
|
||||||
{
|
{
|
||||||
char fixed_buffer[GMIO_FIXED_BUFFER_SIZE];
|
char fixed_buffer[GMIO_FIXED_BUFFER_SIZE] = {0};
|
||||||
size_t read_size = 0;
|
size_t read_size = 0;
|
||||||
gmio_stream_pos_t stream_start_pos = gmio_stream_pos_null();
|
gmio_stream_pos_t stream_start_pos = gmio_stream_pos_null();
|
||||||
|
|
||||||
@ -43,7 +43,6 @@ gmio_stl_format_t gmio_stl_get_format(gmio_stream_t *stream)
|
|||||||
* First keep stream start position, it will be restored after read
|
* First keep stream start position, it will be restored after read
|
||||||
*/
|
*/
|
||||||
gmio_stream_get_pos(stream, &stream_start_pos);
|
gmio_stream_get_pos(stream, &stream_start_pos);
|
||||||
memset(fixed_buffer, 0, GMIO_FIXED_BUFFER_SIZE);
|
|
||||||
read_size = gmio_stream_read(stream, &fixed_buffer, 1, GMIO_FIXED_BUFFER_SIZE);
|
read_size = gmio_stream_read(stream, &fixed_buffer, 1, GMIO_FIXED_BUFFER_SIZE);
|
||||||
read_size = GMIO_MIN(read_size, GMIO_FIXED_BUFFER_SIZE);
|
read_size = GMIO_MIN(read_size, GMIO_FIXED_BUFFER_SIZE);
|
||||||
gmio_stream_set_pos(stream, &stream_start_pos);
|
gmio_stream_set_pos(stream, &stream_start_pos);
|
||||||
|
Loading…
Reference in New Issue
Block a user