uppsrc: Fixed all -Wall warnings (except logical parenthesis and misplaced else)

git-svn-id: svn://ultimatepp.org/upp/trunk@6902 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-02-10 18:12:17 +00:00
commit 33747551bf
29 changed files with 167 additions and 152 deletions

View file

@ -121,7 +121,7 @@ static int StrBool(char c)
}
DbfStream::Field::Field(const char *_name, char type, byte width, byte decimal)
: type(type), width(width), decimal(decimal), offset(0)
: offset(0), type(type), width(width), decimal(decimal)
{
if(_name) {
const char *p = reinterpret_cast<const char *>(memchr(_name, 0, 11));
@ -462,7 +462,7 @@ bool DbfStream::StreamHeader(bool full)
}
}
if(fpt.IsOpen() && fpt.IsLoading()) { // read FPT header
int nextfree = fpt.Get32be();
// int nextfree = fpt.Get32be();
fpt_block_size = fpt.Get32be();
if(fpt_block_size <= 0 || fpt_block_size >= 1 << 24)
fpt.Close(); // has_memo = false;
@ -958,7 +958,7 @@ Value DbfStream::GetItemMemo(int i, bool binary) const
if(pos >= fpt.GetSize())
return Value();
fpt.Seek(pos);
int fieldtype = fpt.Get32be();
// int fieldtype = fpt.Get32be();
int len = fpt.Get32be();
if(len > 0) {
StringBuffer outbuf(len);

View file

@ -145,7 +145,7 @@ compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
c_diff_ptr diff = (c_diff_ptr) losslsc->diff_private;
JDIMENSION MCU_col_num; /* index of current MCU within row */
JDIMENSION MCU_count; /* number of MCUs encoded */
JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
// JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
int comp, ci, yoffset, samp_row, samp_rows, samps_across;
jpeg_component_info *compptr;

View file

@ -493,7 +493,7 @@ encode_mcus_gather (j_compress_ptr cinfo, JDIFFIMAGE diff_buf,
for (sampn = 0; sampn < cinfo->data_units_in_MCU; sampn++) {
register int temp;
register int nbits;
c_derived_tbl *dctbl = entropy->cur_tbls[sampn];
// c_derived_tbl *dctbl = entropy->cur_tbls[sampn];
long * counts = entropy->cur_counts[sampn];
/* Encode the difference per section H.1.2.2 */

View file

@ -68,32 +68,32 @@ METHODDEF(void) process_data_buffer_main
METHODDEF(void)
start_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
{
my_main_ptr main = (my_main_ptr) cinfo->main;
my_main_ptr main_ = (my_main_ptr) cinfo->main;
/* Do nothing in raw-data mode. */
if (cinfo->raw_data_in)
return;
main->cur_iMCU_row = 0; /* initialize counters */
main->rowgroup_ctr = 0;
main->suspended = FALSE;
main->pass_mode = pass_mode; /* save mode for use by process_data */
main_->cur_iMCU_row = 0; /* initialize counters */
main_->rowgroup_ctr = 0;
main_->suspended = FALSE;
main_->pass_mode = pass_mode; /* save mode for use by process_data */
switch (pass_mode) {
case JBUF_PASS_THRU:
#ifdef FULL_MAIN_BUFFER_SUPPORTED
if (main->whole_image[0] != NULL)
if (main_->whole_image[0] != NULL)
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
#endif
main->pub.process_data = process_data_simple_main;
main_->pub.process_data = process_data_simple_main;
break;
#ifdef FULL_MAIN_BUFFER_SUPPORTED
case JBUF_SAVE_SOURCE:
case JBUF_CRANK_DEST:
case JBUF_SAVE_AND_PASS:
if (main->whole_image[0] == NULL)
if (main_->whole_image[0] == NULL)
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
main->pub.process_data = process_data_buffer_main;
main_->pub.process_data = process_data_buffer_main;
break;
#endif
default:
@ -114,47 +114,47 @@ process_data_simple_main (j_compress_ptr cinfo,
JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
JDIMENSION in_rows_avail)
{
my_main_ptr main = (my_main_ptr) cinfo->main;
my_main_ptr main_ = (my_main_ptr) cinfo->main;
unsigned data_unit = cinfo->data_unit;
while (main->cur_iMCU_row < cinfo->total_iMCU_rows) {
/* Read input data if we haven't filled the main buffer yet */
if (main->rowgroup_ctr < data_unit)
while (main_->cur_iMCU_row < cinfo->total_iMCU_rows) {
/* Read input data if we haven't filled the main_ buffer yet */
if (main_->rowgroup_ctr < data_unit)
(*cinfo->prep->pre_process_data) (cinfo,
input_buf, in_row_ctr, in_rows_avail,
main->buffer, &main->rowgroup_ctr,
main_->buffer, &main_->rowgroup_ctr,
(JDIMENSION) data_unit);
/* If we don't have a full iMCU row buffered, return to application for
* more data. Note that preprocessor will always pad to fill the iMCU row
* at the bottom of the image.
*/
if (main->rowgroup_ctr != data_unit)
if (main_->rowgroup_ctr != data_unit)
return;
/* Send the completed row to the compressor */
if (! (*cinfo->codec->compress_data) (cinfo, main->buffer)) {
if (! (*cinfo->codec->compress_data) (cinfo, main_->buffer)) {
/* If compressor did not consume the whole row, then we must need to
* suspend processing and return to the application. In this situation
* we pretend we didn't yet consume the last input row; otherwise, if
* it happened to be the last row of the image, the application would
* think we were done.
*/
if (! main->suspended) {
if (! main_->suspended) {
(*in_row_ctr)--;
main->suspended = TRUE;
main_->suspended = TRUE;
}
return;
}
/* We did finish the row. Undo our little suspension hack if a previous
* call suspended; then mark the main buffer empty.
* call suspended; then mark the main_ buffer empty.
*/
if (main->suspended) {
if (main_->suspended) {
(*in_row_ctr)++;
main->suspended = FALSE;
main_->suspended = FALSE;
}
main->rowgroup_ctr = 0;
main->cur_iMCU_row++;
main_->rowgroup_ctr = 0;
main_->cur_iMCU_row++;
}
}
@ -246,16 +246,16 @@ process_data_buffer_main (j_compress_ptr cinfo,
GLOBAL(void)
jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer)
{
my_main_ptr main;
my_main_ptr main_;
int ci;
jpeg_component_info *compptr;
int data_unit = cinfo->data_unit;
main = (my_main_ptr)
main_ = (my_main_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_main_controller));
cinfo->main = (struct jpeg_c_main_controller *) main;
main->pub.start_pass = start_pass_main;
cinfo->main = (struct jpeg_c_main_controller *) main_;
main_->pub.start_pass = start_pass_main;
/* We don't need to create a buffer in raw-data mode. */
if (cinfo->raw_data_in)
@ -270,7 +270,7 @@ jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer)
/* Note we pad the bottom to a multiple of the iMCU height */
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
main->whole_image[ci] = (*cinfo->mem->request_virt_sarray)
main_->whole_image[ci] = (*cinfo->mem->request_virt_sarray)
((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
compptr->width_in_data_units * data_unit,
(JDIMENSION) jround_up((long) compptr->height_in_data_units,
@ -282,12 +282,12 @@ jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer)
#endif
} else {
#ifdef FULL_MAIN_BUFFER_SUPPORTED
main->whole_image[0] = NULL; /* flag for no virtual arrays */
main_->whole_image[0] = NULL; /* flag for no virtual arrays */
#endif
/* Allocate a strip buffer for each component */
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
main->buffer[ci] = (*cinfo->mem->alloc_sarray)
main_->buffer[ci] = (*cinfo->mem->alloc_sarray)
((j_common_ptr) cinfo, JPOOL_IMAGE,
compptr->width_in_data_units * data_unit,
(JDIMENSION) (compptr->v_samp_factor * data_unit));

View file

@ -452,7 +452,7 @@ per_scan_setup (j_compress_ptr cinfo)
METHODDEF(void)
prepare_for_pass (j_compress_ptr cinfo)
{
j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec;
// j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec;
my_master_ptr master = (my_master_ptr) cinfo->master;
switch (master->pass_type) {

View file

@ -80,7 +80,8 @@ METHODDEF(void) start_pass
reset_predictor(cinfo, ci); \
restart = TRUE; \
} \
}
} \
(void)restart;
/*
@ -117,7 +118,8 @@ METHODDEF(void) start_pass
if (cinfo->restart_interval) { \
if (--pred->restart_rows_to_go[ci] == 0) \
reset_predictor(cinfo, ci); \
}
} \
(void)Rc;(void)Ra;
/*
@ -259,8 +261,8 @@ reset_predictor (j_compress_ptr cinfo, int ci)
METHODDEF(void)
start_pass (j_compress_ptr cinfo)
{
j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec;
c_pred_ptr pred = (c_pred_ptr) losslsc->pred_private;
// j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec;
// c_pred_ptr pred = (c_pred_ptr) losslsc->pred_private;
int ci;
/* Check that the restart interval is an integer multiple of the number

View file

@ -20,7 +20,7 @@ METHODDEF(void)
simple_downscale(j_compress_ptr cinfo,
JSAMPROW input_buf, JSAMPROW output_buf, JDIMENSION width)
{
j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec;
// j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec;
unsigned xindex;
for (xindex = 0; xindex < width; xindex++)

View file

@ -120,7 +120,7 @@ start_output_pass (j_decompress_ptr cinfo)
{
#ifdef BLOCK_SMOOTHING_SUPPORTED
j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec;
d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private;
// d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private;
/* If multipass, check to see whether to use block smoothing on this pass */
if (lossyd->coef_arrays != NULL) {

View file

@ -257,7 +257,7 @@ consume_data (j_decompress_ptr cinfo)
d_diff_ptr diff = (d_diff_ptr) losslsd->diff_private;
// JDIMENSION MCU_col_num; /* index of current MCU within row */
// JDIMENSION MCU_count; /* number of MCUs decoded */
JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
// JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
int comp, ci; //, yoffset, row, prev_row;
JSAMPARRAY buffer[MAX_COMPS_IN_SCAN];
jpeg_component_info *compptr;

View file

@ -159,7 +159,7 @@ alloc_funny_pointers (j_decompress_ptr cinfo)
* This is done only once, not once per pass.
*/
{
my_main_ptr main = (my_main_ptr) cinfo->main;
my_main_ptr main_ = (my_main_ptr) cinfo->main;
int ci, rgroup;
int M = cinfo->min_codec_data_unit;
jpeg_component_info *compptr;
@ -168,10 +168,10 @@ alloc_funny_pointers (j_decompress_ptr cinfo)
/* Get top-level space for component array pointers.
* We alloc both arrays with one call to save a few cycles.
*/
main->xbuffer[0] = (JSAMPIMAGE)
main_->xbuffer[0] = (JSAMPIMAGE)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
cinfo->num_components * 2 * SIZEOF(JSAMPARRAY));
main->xbuffer[1] = main->xbuffer[0] + cinfo->num_components;
main_->xbuffer[1] = main_->xbuffer[0] + cinfo->num_components;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
@ -184,9 +184,9 @@ alloc_funny_pointers (j_decompress_ptr cinfo)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
2 * (rgroup * (M + 4)) * SIZEOF(JSAMPROW));
xbuf += rgroup; /* want one row group at negative offsets */
main->xbuffer[0][ci] = xbuf;
main_->xbuffer[0][ci] = xbuf;
xbuf += rgroup * (M + 4);
main->xbuffer[1][ci] = xbuf;
main_->xbuffer[1][ci] = xbuf;
}
}
@ -200,7 +200,7 @@ make_funny_pointers (j_decompress_ptr cinfo)
* This will be repeated at the beginning of each pass.
*/
{
my_main_ptr main = (my_main_ptr) cinfo->main;
my_main_ptr main_ = (my_main_ptr) cinfo->main;
int ci, i, rgroup;
int M = cinfo->min_codec_data_unit;
jpeg_component_info *compptr;
@ -210,10 +210,10 @@ make_funny_pointers (j_decompress_ptr cinfo)
ci++, compptr++) {
rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) /
cinfo->min_codec_data_unit; /* height of a row group of component */
xbuf0 = main->xbuffer[0][ci];
xbuf1 = main->xbuffer[1][ci];
xbuf0 = main_->xbuffer[0][ci];
xbuf1 = main_->xbuffer[1][ci];
/* First copy the workspace pointers as-is */
buf = main->buffer[ci];
buf = main_->buffer[ci];
for (i = 0; i < rgroup * (M + 2); i++) {
xbuf0[i] = xbuf1[i] = buf[i];
}
@ -240,7 +240,7 @@ set_wraparound_pointers (j_decompress_ptr cinfo)
* This changes the pointer list state from top-of-image to the normal state.
*/
{
my_main_ptr main = (my_main_ptr) cinfo->main;
my_main_ptr main_ = (my_main_ptr) cinfo->main;
int ci, i, rgroup;
int M = cinfo->min_codec_data_unit;
jpeg_component_info *compptr;
@ -250,8 +250,8 @@ set_wraparound_pointers (j_decompress_ptr cinfo)
ci++, compptr++) {
rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) /
cinfo->min_codec_data_unit; /* height of a row group of component */
xbuf0 = main->xbuffer[0][ci];
xbuf1 = main->xbuffer[1][ci];
xbuf0 = main_->xbuffer[0][ci];
xbuf1 = main_->xbuffer[1][ci];
for (i = 0; i < rgroup; i++) {
xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i];
xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i];
@ -269,7 +269,7 @@ set_bottom_pointers (j_decompress_ptr cinfo)
* Also sets rowgroups_avail to indicate number of nondummy row groups in row.
*/
{
my_main_ptr main = (my_main_ptr) cinfo->main;
my_main_ptr main_ = (my_main_ptr) cinfo->main;
int ci, i, rgroup, iMCUheight, rows_left;
jpeg_component_info *compptr;
JSAMPARRAY xbuf;
@ -286,12 +286,12 @@ set_bottom_pointers (j_decompress_ptr cinfo)
* so we need only do it once.
*/
if (ci == 0) {
main->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1);
main_->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1);
}
/* Duplicate the last real sample row rgroup*2 times; this pads out the
* last partial rowgroup and ensures at least one full rowgroup of context.
*/
xbuf = main->xbuffer[main->whichptr][ci];
xbuf = main_->xbuffer[main_->whichptr][ci];
for (i = 0; i < rgroup * 2; i++) {
xbuf[rows_left + i] = xbuf[rows_left-1];
}
@ -306,27 +306,27 @@ set_bottom_pointers (j_decompress_ptr cinfo)
METHODDEF(void)
start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
{
my_main_ptr main = (my_main_ptr) cinfo->main;
my_main_ptr main_ = (my_main_ptr) cinfo->main;
switch (pass_mode) {
case JBUF_PASS_THRU:
if (cinfo->upsample->need_context_rows) {
main->pub.process_data = process_data_context_main;
main_->pub.process_data = process_data_context_main;
make_funny_pointers(cinfo); /* Create the xbuffer[] lists */
main->whichptr = 0; /* Read first iMCU row into xbuffer[0] */
main->context_state = CTX_PREPARE_FOR_IMCU;
main->iMCU_row_ctr = 0;
main_->whichptr = 0; /* Read first iMCU row into xbuffer[0] */
main_->context_state = CTX_PREPARE_FOR_IMCU;
main_->iMCU_row_ctr = 0;
} else {
/* Simple case with no context needed */
main->pub.process_data = process_data_simple_main;
main_->pub.process_data = process_data_simple_main;
}
main->buffer_full = FALSE; /* Mark buffer empty */
main->rowgroup_ctr = 0;
main_->buffer_full = FALSE; /* Mark buffer empty */
main_->rowgroup_ctr = 0;
break;
#ifdef QUANT_2PASS_SUPPORTED
case JBUF_CRANK_DEST:
/* For last pass of 2-pass quantization, just crank the postprocessor */
main->pub.process_data = process_data_crank_post;
main_->pub.process_data = process_data_crank_post;
break;
#endif
default:
@ -346,14 +346,14 @@ process_data_simple_main (j_decompress_ptr cinfo,
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
JDIMENSION out_rows_avail)
{
my_main_ptr main = (my_main_ptr) cinfo->main;
my_main_ptr main_ = (my_main_ptr) cinfo->main;
JDIMENSION rowgroups_avail;
/* Read input data if we haven't filled the main buffer yet */
if (! main->buffer_full) {
if (! (*cinfo->codec->decompress_data) (cinfo, main->buffer))
/* Read input data if we haven't filled the main_ buffer yet */
if (! main_->buffer_full) {
if (! (*cinfo->codec->decompress_data) (cinfo, main_->buffer))
return; /* suspension forced, can do nothing more */
main->buffer_full = TRUE; /* OK, we have an iMCU row to work with */
main_->buffer_full = TRUE; /* OK, we have an iMCU row to work with */
}
/* There are always min_codec_data_unit row groups in an iMCU row. */
@ -364,14 +364,14 @@ process_data_simple_main (j_decompress_ptr cinfo,
*/
/* Feed the postprocessor */
(*cinfo->post->post_process_data) (cinfo, main->buffer,
&main->rowgroup_ctr, rowgroups_avail,
(*cinfo->post->post_process_data) (cinfo, main_->buffer,
&main_->rowgroup_ctr, rowgroups_avail,
output_buf, out_row_ctr, out_rows_avail);
/* Has postprocessor consumed all the data yet? If so, mark buffer empty */
if (main->rowgroup_ctr >= rowgroups_avail) {
main->buffer_full = FALSE;
main->rowgroup_ctr = 0;
if (main_->rowgroup_ctr >= rowgroups_avail) {
main_->buffer_full = FALSE;
main_->rowgroup_ctr = 0;
}
}
@ -386,15 +386,15 @@ process_data_context_main (j_decompress_ptr cinfo,
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
JDIMENSION out_rows_avail)
{
my_main_ptr main = (my_main_ptr) cinfo->main;
my_main_ptr main_ = (my_main_ptr) cinfo->main;
/* Read input data if we haven't filled the main buffer yet */
if (! main->buffer_full) {
/* Read input data if we haven't filled the main_ buffer yet */
if (! main_->buffer_full) {
if (! (*cinfo->codec->decompress_data) (cinfo,
main->xbuffer[main->whichptr]))
main_->xbuffer[main_->whichptr]))
return; /* suspension forced, can do nothing more */
main->buffer_full = TRUE; /* OK, we have an iMCU row to work with */
main->iMCU_row_ctr++; /* count rows received */
main_->buffer_full = TRUE; /* OK, we have an iMCU row to work with */
main_->iMCU_row_ctr++; /* count rows received */
}
/* Postprocessor typically will not swallow all the input data it is handed
@ -402,47 +402,47 @@ process_data_context_main (j_decompress_ptr cinfo,
* to exit and restart. This switch lets us keep track of how far we got.
* Note that each case falls through to the next on successful completion.
*/
switch (main->context_state) {
switch (main_->context_state) {
case CTX_POSTPONED_ROW:
/* Call postprocessor using previously set pointers for postponed row */
(*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr],
&main->rowgroup_ctr, main->rowgroups_avail,
(*cinfo->post->post_process_data) (cinfo, main_->xbuffer[main_->whichptr],
&main_->rowgroup_ctr, main_->rowgroups_avail,
output_buf, out_row_ctr, out_rows_avail);
if (main->rowgroup_ctr < main->rowgroups_avail)
if (main_->rowgroup_ctr < main_->rowgroups_avail)
return; /* Need to suspend */
main->context_state = CTX_PREPARE_FOR_IMCU;
main_->context_state = CTX_PREPARE_FOR_IMCU;
if (*out_row_ctr >= out_rows_avail)
return; /* Postprocessor exactly filled output buf */
/*FALLTHROUGH*/
case CTX_PREPARE_FOR_IMCU:
/* Prepare to process first M-1 row groups of this iMCU row */
main->rowgroup_ctr = 0;
main->rowgroups_avail = (JDIMENSION) (cinfo->min_codec_data_unit - 1);
main_->rowgroup_ctr = 0;
main_->rowgroups_avail = (JDIMENSION) (cinfo->min_codec_data_unit - 1);
/* Check for bottom of image: if so, tweak pointers to "duplicate"
* the last sample row, and adjust rowgroups_avail to ignore padding rows.
*/
if (main->iMCU_row_ctr == cinfo->total_iMCU_rows)
if (main_->iMCU_row_ctr == cinfo->total_iMCU_rows)
set_bottom_pointers(cinfo);
main->context_state = CTX_PROCESS_IMCU;
main_->context_state = CTX_PROCESS_IMCU;
/*FALLTHROUGH*/
case CTX_PROCESS_IMCU:
/* Call postprocessor using previously set pointers */
(*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr],
&main->rowgroup_ctr, main->rowgroups_avail,
(*cinfo->post->post_process_data) (cinfo, main_->xbuffer[main_->whichptr],
&main_->rowgroup_ctr, main_->rowgroups_avail,
output_buf, out_row_ctr, out_rows_avail);
if (main->rowgroup_ctr < main->rowgroups_avail)
if (main_->rowgroup_ctr < main_->rowgroups_avail)
return; /* Need to suspend */
/* After the first iMCU, change wraparound pointers to normal state */
if (main->iMCU_row_ctr == 1)
if (main_->iMCU_row_ctr == 1)
set_wraparound_pointers(cinfo);
/* Prepare to load new iMCU row using other xbuffer list */
main->whichptr ^= 1; /* 0=>1 or 1=>0 */
main->buffer_full = FALSE;
main_->whichptr ^= 1; /* 0=>1 or 1=>0 */
main_->buffer_full = FALSE;
/* Still need to process last row group of this iMCU row, */
/* which is saved at index M+1 of the other xbuffer */
main->rowgroup_ctr = (JDIMENSION) (cinfo->min_codec_data_unit + 1);
main->rowgroups_avail = (JDIMENSION) (cinfo->min_codec_data_unit + 2);
main->context_state = CTX_POSTPONED_ROW;
main_->rowgroup_ctr = (JDIMENSION) (cinfo->min_codec_data_unit + 1);
main_->rowgroups_avail = (JDIMENSION) (cinfo->min_codec_data_unit + 2);
main_->context_state = CTX_POSTPONED_ROW;
}
}
@ -475,15 +475,15 @@ process_data_crank_post (j_decompress_ptr cinfo,
GLOBAL(void)
jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
{
my_main_ptr main;
my_main_ptr main_;
int ci, rgroup, ngroups;
jpeg_component_info *compptr;
main = (my_main_ptr)
main_ = (my_main_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_main_controller));
cinfo->main = (struct jpeg_d_main_controller *) main;
main->pub.start_pass = start_pass_main;
cinfo->main = (struct jpeg_d_main_controller *) main_;
main_->pub.start_pass = start_pass_main;
if (need_full_buffer) /* shouldn't happen */
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
@ -504,7 +504,7 @@ jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
ci++, compptr++) {
rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) /
cinfo->min_codec_data_unit; /* height of a row group of component */
main->buffer[ci] = (*cinfo->mem->alloc_sarray)
main_->buffer[ci] = (*cinfo->mem->alloc_sarray)
((j_common_ptr) cinfo, JPOOL_IMAGE,
compptr->width_in_data_units * compptr->codec_data_unit,
(JDIMENSION) (rgroup * ngroups));

View file

@ -85,7 +85,8 @@
Rb = GETJSAMPLE(prev_row[xindex]); \
Ra = (diff_buf[xindex] + PREDICTOR) & 0xFFFF; \
undiff_buf[xindex] = Ra; \
}
} \
(void)Rc;
/*

View file

@ -84,7 +84,7 @@ TIFFReadDirectory(TIFF* tif)
size_t fix;
uint16 dircount;
uint16 previous_tag = 0;
int diroutoforderwarning = 0, compressionknown = 0;
int diroutoforderwarning = 0;//, compressionknown = 0;
int haveunknowntags = 0;
tif->tif_diroff = tif->tif_nextdiroff;
@ -255,8 +255,8 @@ TIFFReadDirectory(TIFF* tif)
dp->tdir_type, dp->tdir_offset);
if (!TIFFSetField(tif, dp->tdir_tag, (uint16)v))
goto bad;
else
compressionknown = 1;
// else
// compressionknown = 1;
break;
/* XXX: workaround for broken TIFFs */
} else if (dp->tdir_type == TIFF_LONG) {

View file

@ -115,7 +115,7 @@ static int
_TIFFPrettyPrintField(TIFF* tif, FILE* fd, ttag_t tag,
uint32 value_count, void *raw_data)
{
TIFFDirectory *td = &tif->tif_dir;
// TIFFDirectory *td = &tif->tif_dir;
switch (tag)
{

View file

@ -114,6 +114,7 @@ extern "C" void _TIFFmemset(void* p, int v, tsize_t c) { memset(p, v,
extern "C" void _TIFFmemcpy(void* d, const tdata_t s, tsize_t c) { memcpy(d, s, c); }
extern "C" int _TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c) { return memcmp(p1, p2, c); }
/*
static void Blt2to4(byte *dest, const byte *src, unsigned count)
{
byte b;
@ -162,7 +163,7 @@ static void Blt2to4(byte *dest, const byte *src, unsigned count)
break;
}
}
*/
static void BltPack11(byte *dest, const byte *src, byte bit_shift, unsigned count)
{
if(bit_shift == 0)
@ -406,7 +407,7 @@ static void BltPack44(byte *dest, const byte *src, bool shift, unsigned count)
dest[c2] = (dest[c2] & 15) | (src[c2] & 0xF0);
}
}
/*
static void BltPack4(byte *dest, const byte *src, unsigned count)
{
#define BLT_PACK_4_4(o) dest[(o)] = src[4 * (o)]; dest[(o) + 1] = src[4 * (o) + 4]; \
@ -438,7 +439,7 @@ static void BltPack4(byte *dest, const byte *src, unsigned count)
if(count & 1)
dest[0] = src[0];
}
*/
static tsize_t ReadStream(thandle_t fd, tdata_t buf, tsize_t size)
{
Stream *stream = reinterpret_cast<Stream *>(fd);
@ -654,7 +655,7 @@ static void putContig1(TIFFRGBAImage *img, tif_uint32 *cp,
tif_int32 fromskew, tif_int32 toskew, byte *pp)
{
TIFRaster::Data *helper = (TIFRaster::Data *)img;
Size size = helper->size;
// Size size = helper->size;
int iw = toskew + w;
bool keep_y = (iw >= 0);
int x8 = x >> 3;
@ -674,7 +675,7 @@ static void putContig2(TIFFRGBAImage *img, tif_uint32 *cp,
tif_int32 fromskew, tif_int32 toskew, byte *pp)
{
TIFRaster::Data *helper = (TIFRaster::Data *)img;
Size size = helper->size;
// Size size = helper->size;
int iw = toskew + w;
bool keep_y = (iw >= 0);
int x4 = x >> 2;
@ -694,7 +695,7 @@ static void putContig4(TIFFRGBAImage *img, tif_uint32 *cp,
tif_int32 fromskew, tif_int32 toskew, byte *pp)
{
TIFRaster::Data *helper = (TIFRaster::Data *)img;
Size size = helper->size; //dest.GetSize();
// Size size = helper->size; //dest.GetSize();
int iw = toskew + w;
bool keep_y = (iw >= 0);
int x2 = x >> 1;
@ -715,7 +716,7 @@ static void putContig8(TIFFRGBAImage *img, tif_uint32 *cp,
tif_int32 fromskew, tif_int32 toskew, byte *pp)
{
TIFRaster::Data *helper = (TIFRaster::Data *)img;
Size size = helper->size;
// Size size = helper->size;
int iw = toskew + w;
bool keep_y = (iw >= 0);
// byte *dest = helper->dest.GetUpScan(y) + x;
@ -731,7 +732,7 @@ static void putContigRGB(TIFFRGBAImage *img, tif_uint32 *cp, tif_uint32 x, tif_u
tif_int32 fromskew, tif_int32 toskew, byte *pp)
{
TIFRaster::Data *helper = (TIFRaster::Data *)img;
Size size = helper->size;
// Size size = helper->size;
int iw = toskew + w;
int wh = w * h;
if(wh > helper->buffer.GetCount())
@ -747,7 +748,7 @@ static void putSeparate(TIFFRGBAImage *img, tif_uint32 *cp,
tif_int32 fromskew, tif_int32 toskew, byte *r, byte *g, byte *b, byte *a)
{
TIFRaster::Data *helper = (TIFRaster::Data *)img;
Size size = helper->size;
// Size size = helper->size;
int wh = w * h;
if(wh > helper->buffer.GetCount())
helper->buffer.SetCount(wh);
@ -813,7 +814,7 @@ void TIFRaster::Data::Warning(const char *fn, const char *fmt, va_list ap)
if(!memcmp(fn, "tiff@", 5) && IsDigit(fn[5])) {
int addr = stou(fn + 5);
if(addr != -1 && addr != 0) {
TIFRaster::Data& wrapper = *reinterpret_cast<TIFRaster::Data *>(addr);
// TIFRaster::Data& wrapper = *reinterpret_cast<TIFRaster::Data *>(addr);
LLOG("TIF warning: " << VFormat(fmt, ap));
// RLOG("TiffWrapper::Warning: " << wrapper.errors);
}
@ -825,7 +826,7 @@ void TIFRaster::Data::Error(const char *fn, const char *fmt, va_list ap)
if(!memcmp(fn, "tiff@", 5) && IsDigit(fn[5])) {
int addr = stou(fn + 5);
if(addr != -1 && addr != 0) {
Data& wrapper = *reinterpret_cast<Data *>(addr);
// Data& wrapper = *reinterpret_cast<Data *>(addr);
LLOG("TIF error: " << VFormat(fmt, ap));
// RLOG("TiffWrapper::Error: " << wrapper.errors);
}

View file

@ -40,7 +40,6 @@ void UnZip::ReadDir()
zip->Seek(offset);
for(int i = 0; i < entries; i++) {
int64 rof = zip->GetPos() - offset;
if(zip->Get32le() != 0x02014b50 && zip->IsEof())
return;
File& f = file.Add();
@ -99,7 +98,7 @@ bool UnZip::ReadFile(Stream& out, Gate2<int, int> progress)
zip->Seek(f.offset);
if(zip->Get32le() != 0x04034b50)
return false;
int ver = zip->Get16le();
zip->Get16le();
zip->Get16le(); // Skip header, use info from centrall dir
zip->Get16le();
zip->Get32le();
@ -110,7 +109,7 @@ bool UnZip::ReadFile(Stream& out, Gate2<int, int> progress)
dword extralen = zip->Get16le();
zip->SeekCur(filelen + extralen);
dword crc;
int l;
dword l;
if(f.method == 0) {
Buffer<byte> temp(65536);
int loaded;