-static void jpeg_buffer_src(j_decompress_ptr cinfo, void *buffer, int bufsize)
-{
- my_src_ptr src;
-
- /* The source object and input buffer are made permanent so that a series
- * of JPEG images can be read from the same file by calling jpeg_stdio_src
- * only before the first one. (If we discarded the buffer at the end of
- * one image, we'd likely lose the start of the next one.)
- * This makes it unsafe to use this manager and a different source
- * manager serially with the same JPEG object. Caveat programmer.
- */
- if (cinfo->src == NULL) { /* first time for this JPEG object? */
- cinfo->src = (struct jpeg_source_mgr *)
- (*cinfo->mem->alloc_small)((j_common_ptr) cinfo, JPOOL_PERMANENT,
- sizeof(my_source_mgr));
- src = (my_src_ptr) cinfo->src;
- src->buffer = (JOCTET *)
- (*cinfo->mem->alloc_small)((j_common_ptr) cinfo, JPOOL_PERMANENT,
- INPUT_BUF_SIZE * sizeof(JOCTET));
- }
-
- src = (my_src_ptr) cinfo->src;
- src->pub.init_source = my_init_source;
- src->pub.fill_input_buffer = my_fill_input_buffer;
- src->pub.skip_input_data = my_skip_input_data;
- src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
- src->pub.term_source = my_term_source;
- src->src_buffer = (JOCTET *) buffer;
- src->src_size = bufsize;
- src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */
- src->pub.next_input_byte = NULL; /* until buffer loaded */
+static void jpeg_buffer_src( j_decompress_ptr cinfo, void* buffer, int bufsize ){
+ my_src_ptr src;
+
+ /* The source object and input buffer are made permanent so that a series
+ * of JPEG images can be read from the same file by calling jpeg_stdio_src
+ * only before the first one. (If we discarded the buffer at the end of
+ * one image, we'd likely lose the start of the next one.)
+ * This makes it unsafe to use this manager and a different source
+ * manager serially with the same JPEG object. Caveat programmer.
+ */
+ if ( cinfo->src == NULL ) { /* first time for this JPEG object? */
+ cinfo->src = (struct jpeg_source_mgr *)
+ ( *cinfo->mem->alloc_small )( (j_common_ptr) cinfo, JPOOL_PERMANENT,
+ sizeof( my_source_mgr ) );
+ src = (my_src_ptr) cinfo->src;
+ src->buffer = (JOCTET *)
+ ( *cinfo->mem->alloc_small )( (j_common_ptr) cinfo, JPOOL_PERMANENT,
+ INPUT_BUF_SIZE * sizeof( JOCTET ) );
+ }
+
+ src = (my_src_ptr) cinfo->src;
+ src->pub.init_source = my_init_source;
+ src->pub.fill_input_buffer = my_fill_input_buffer;
+ src->pub.skip_input_data = my_skip_input_data;
+ src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
+ src->pub.term_source = my_term_source;
+ src->src_buffer = (JOCTET *)buffer;
+ src->src_size = bufsize;
+ src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */
+ src->pub.next_input_byte = NULL; /* until buffer loaded */