Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: core/fxcodec/lgif/fx_gif.cpp

Issue 2034253003: Fix more code which has shadow variables (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments and style fix Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fxcodec/jbig2/JBig2_GrrdProc.cpp ('k') | core/fxcrt/fx_basic_coords.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/fxcodec/lgif/fx_gif.h" 7 #include "core/fxcodec/lgif/fx_gif.h"
8 8
9 #include "core/fxcodec/lbmp/fx_bmp.h" 9 #include "core/fxcodec/lbmp/fx_bmp.h"
10 10
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 } 327 }
328 } 328 }
329 } 329 }
330 src_offset = 0; 330 src_offset = 0;
331 src_bit_offset = 0; 331 src_bit_offset = 0;
332 src_bit_num = 0; 332 src_bit_num = 0;
333 return TRUE; 333 return TRUE;
334 } 334 }
335 FX_BOOL CGifLZWEncoder::LookUpInTable(const uint8_t* buf, 335 FX_BOOL CGifLZWEncoder::LookUpInTable(const uint8_t* buf,
336 uint32_t& offset, 336 uint32_t& offset,
337 uint8_t& bit_offset) { 337 uint8_t& out_bit_offset) {
338 for (uint16_t i = table_cur; i < index_num; i++) { 338 for (uint16_t i = table_cur; i < index_num; i++) {
339 if (code_table[i].prefix == code_table[index_num].prefix && 339 if (code_table[i].prefix == code_table[index_num].prefix &&
340 code_table[i].suffix == code_table[index_num].suffix) { 340 code_table[i].suffix == code_table[index_num].suffix) {
341 code_table[index_num].prefix = i; 341 code_table[index_num].prefix = i;
342 code_table[index_num].suffix = 342 code_table[index_num].suffix =
343 gif_cut_buf(buf, offset, src_bit_cut, bit_offset, src_bit_num); 343 gif_cut_buf(buf, offset, src_bit_cut, out_bit_offset, src_bit_num);
344 table_cur = i; 344 table_cur = i;
345 return TRUE; 345 return TRUE;
346 } 346 }
347 } 347 }
348 table_cur = code_end + 1; 348 table_cur = code_end + 1;
349 return FALSE; 349 return FALSE;
350 } 350 }
351 void CGifLZWEncoder::Finish(uint8_t*& dst_buf, 351 void CGifLZWEncoder::Finish(uint8_t*& dst_buf,
352 uint32_t& dst_len, 352 uint32_t& dst_len,
353 uint32_t& offset) { 353 uint32_t& offset) {
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
1220 gif_ptr->cur_offset = cur_offset; 1220 gif_ptr->cur_offset = cur_offset;
1221 res = FALSE; 1221 res = FALSE;
1222 } 1222 }
1223 dst_len = gif_ptr->cur_offset; 1223 dst_len = gif_ptr->cur_offset;
1224 dst_buf[dst_len - 1] = GIF_SIG_TRAILER; 1224 dst_buf[dst_len - 1] = GIF_SIG_TRAILER;
1225 if (res) { 1225 if (res) {
1226 gif_ptr->frames++; 1226 gif_ptr->frames++;
1227 } 1227 }
1228 return res; 1228 return res;
1229 } 1229 }
OLDNEW
« no previous file with comments | « core/fxcodec/jbig2/JBig2_GrrdProc.cpp ('k') | core/fxcrt/fx_basic_coords.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698