From 5d49018bb233fd398461fe7ca18c63b69b0b2f67 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Mon, 4 Mar 2019 15:07:16 +0300 Subject: [PATCH] refactoring --- src/jpeg/encoder.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/jpeg/encoder.c b/src/jpeg/encoder.c index 6db9767..7e8c296 100644 --- a/src/jpeg/encoder.c +++ b/src/jpeg/encoder.c @@ -123,7 +123,7 @@ static void _jpeg_set_dest_picture(j_compress_ptr jpeg, unsigned char *picture, ))); } - dest = (struct _mjpg_destination_mgr *) jpeg->dest; + dest = (struct _mjpg_destination_mgr *)jpeg->dest; dest->mgr.init_destination = _jpeg_init_destination; dest->mgr.empty_output_buffer = _jpeg_empty_output_buffer; dest->mgr.term_destination = _jpeg_term_destination; @@ -257,7 +257,7 @@ static void _jpeg_write_scanlines_rgb24( #define JPEG_OUTPUT_BUFFER_SIZE 4096 static void _jpeg_init_destination(j_compress_ptr jpeg) { - struct _mjpg_destination_mgr *dest = (struct _mjpg_destination_mgr *) jpeg->dest; + struct _mjpg_destination_mgr *dest = (struct _mjpg_destination_mgr *)jpeg->dest; // Allocate the output buffer - it will be released when done with image assert((dest->buffer = (JOCTET *)(*jpeg->mem->alloc_small)( @@ -271,7 +271,7 @@ static void _jpeg_init_destination(j_compress_ptr jpeg) { static boolean _jpeg_empty_output_buffer(j_compress_ptr jpeg) { // Called whenever local jpeg buffer fills up - struct _mjpg_destination_mgr *dest = (struct _mjpg_destination_mgr *) jpeg->dest; + struct _mjpg_destination_mgr *dest = (struct _mjpg_destination_mgr *)jpeg->dest; memcpy(dest->outbuffer_cursor, dest->buffer, JPEG_OUTPUT_BUFFER_SIZE); dest->outbuffer_cursor += JPEG_OUTPUT_BUFFER_SIZE; @@ -287,7 +287,7 @@ static void _jpeg_term_destination(j_compress_ptr jpeg) { // Called by jpeg_finish_compress after all data has been written. // Usually needs to flush buffer - struct _mjpg_destination_mgr *dest = (struct _mjpg_destination_mgr *) jpeg->dest; + struct _mjpg_destination_mgr *dest = (struct _mjpg_destination_mgr *)jpeg->dest; size_t data_count = JPEG_OUTPUT_BUFFER_SIZE - dest->mgr.free_in_buffer; // Write any data remaining in the buffer