GIFTranslator: Whitespace style fixes

Also remove break in last case.
This commit is contained in:
John Scipione
2014-03-06 16:50:30 -05:00
parent 9d41bc18bb
commit 2d612ef7ae
4 changed files with 147 additions and 140 deletions
+6 -4
View File
@@ -159,9 +159,10 @@ GIFLoad::ReadGIFHeader()
unsigned char gp[256 * 3]; unsigned char gp[256 * 3];
if (fInput->Read(gp, s * 3) < s * 3) if (fInput->Read(gp, s * 3) < s * 3)
return false; return false;
for (int x = 0; x < s; x++) {
for (int x = 0; x < s; x++)
fPalette->SetColor(x, gp[x * 3], gp[x * 3 + 1], gp[x * 3 + 2]); fPalette->SetColor(x, gp[x * 3], gp[x * 3 + 1], gp[x * 3 + 2]);
}
fPalette->backgroundindex = header[11]; fPalette->backgroundindex = header[11];
} else { } else {
// install BeOS system palette in case local palette isn't present // install BeOS system palette in case local palette isn't present
@@ -182,9 +183,10 @@ bool
GIFLoad::ReadGIFLoopBlock() GIFLoad::ReadGIFLoopBlock()
{ {
unsigned char length; unsigned char length;
if (fInput->Read(&length, 1) < 1) return false; if (fInput->Read(&length, 1) < 1)
fInput->Seek(length, SEEK_CUR); return false;
fInput->Seek(length, SEEK_CUR);
do { do {
if (fInput->Read(&length, 1) < 1) if (fInput->Read(&length, 1) < 1)
return false; return false;
+3 -1
View File
@@ -139,16 +139,18 @@ GIFSave::GIFSave(BBitmap* bitmap, BPositionIO* output,
case WEB_SAFE_PALETTE: case WEB_SAFE_PALETTE:
syslog(LOG_INFO, "web safe palette\n"); syslog(LOG_INFO, "web safe palette\n");
break; break;
case BEOS_SYSTEM_PALETTE: case BEOS_SYSTEM_PALETTE:
syslog(LOG_INFO, "BeOS system palette\n"); syslog(LOG_INFO, "BeOS system palette\n");
break; break;
case GREYSCALE_PALETTE: case GREYSCALE_PALETTE:
syslog(LOG_INFO, "greyscale palette\n"); syslog(LOG_INFO, "greyscale palette\n");
break; break;
case OPTIMAL_PALETTE: case OPTIMAL_PALETTE:
default: default:
syslog(LOG_INFO, "optimal palette\n"); syslog(LOG_INFO, "optimal palette\n");
break;
} }
} }
@@ -106,9 +106,12 @@ static const TranSetting sDefaultSettings[] = {
{ GIF_SETTING_TRANSPARENT_BLUE, TRAN_SETTING_INT32, 0 } { GIF_SETTING_TRANSPARENT_BLUE, TRAN_SETTING_INT32, 0 }
}; };
const uint32 kNumInputFormats = sizeof(sInputFormats) / sizeof(translation_format); const uint32 kNumInputFormats = sizeof(sInputFormats)
const uint32 kNumOutputFormats = sizeof(sOutputFormats) / sizeof(translation_format); / sizeof(translation_format);
const uint32 kNumDefaultSettings = sizeof(sDefaultSettings) / sizeof(TranSetting); const uint32 kNumOutputFormats = sizeof(sOutputFormats)
/ sizeof(translation_format);
const uint32 kNumDefaultSettings = sizeof(sDefaultSettings)
/ sizeof(TranSetting);
/*! Look at first few bytes in stream to determine type - throw it back /*! Look at first few bytes in stream to determine type - throw it back