From 9504d99506e522fc7ccdf39c42a5fd6c01295cfa Mon Sep 17 00:00:00 2001 From: John Scipione Date: Mon, 3 Mar 2014 19:30:14 -0500 Subject: [PATCH] GIFTranslator: rename cs and size to codeSize --- src/add-ons/translators/gif/GIFLoad.cpp | 24 +++++++++++------------- src/add-ons/translators/gif/GIFLoad.h | 2 +- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/add-ons/translators/gif/GIFLoad.cpp b/src/add-ons/translators/gif/GIFLoad.cpp index 9979e7d4a9..ff3d4563db 100644 --- a/src/add-ons/translators/gif/GIFLoad.cpp +++ b/src/add-ons/translators/gif/GIFLoad.cpp @@ -336,27 +336,25 @@ bool GIFLoad::ReadGIFImageData() { unsigned char newEntry[ENTRY_COUNT]; + unsigned char codeSize; + fInput->Read(&codeSize, 1); - unsigned char cs; - fInput->Read(&cs, 1); - if (cs == fPalette->size_in_bits) { - if (!InitFrame(fPalette->size_in_bits)) - return false; - } else if (cs > fPalette->size_in_bits) { + if (codeSize > fPalette->size_in_bits) { if (debug) { syslog(LOG_ERR, "GIFLoad::ReadGIFImageData() - " "Code_size should be %d, not %d, allowing it\n", - fCodeSize, cs); + fCodeSize, codeSize); } - if (!InitFrame(cs)) + if (!InitFrame(codeSize)) return false; - } else if (cs < fPalette->size_in_bits) { + } else if (codeSize < fPalette->size_in_bits) { if (debug) { syslog(LOG_ERR, "GIFLoad::ReadGIFImageData() - " - "Code_size should be %d, not %d\n", fCodeSize, cs); + "Code_size should be %d, not %d\n", fCodeSize, codeSize); } return false; - } + } else if (!InitFrame(fPalette->size_in_bits)) + return false; if (debug) syslog(LOG_INFO, "GIFLoad::ReadGIFImageData() - Starting LZW\n"); @@ -507,9 +505,9 @@ GIFLoad::ResetTable() bool -GIFLoad::InitFrame(int size) +GIFLoad::InitFrame(int codeSize) { - fCodeSize = size; + fCodeSize = codeSize; if (fCodeSize == 1) fCodeSize++; diff --git a/src/add-ons/translators/gif/GIFLoad.h b/src/add-ons/translators/gif/GIFLoad.h index 636bb3fe3a..0afb4df564 100644 --- a/src/add-ons/translators/gif/GIFLoad.h +++ b/src/add-ons/translators/gif/GIFLoad.h @@ -57,7 +57,7 @@ private: bool ReadGIFCommentBlock(); bool ReadGIFUnknownBlock(unsigned char c); - bool InitFrame(int size); + bool InitFrame(int codeSize); short NextCode(); void ResetTable();