From 33ef87cd9e55f3e271113c0212736478b8c6802c Mon Sep 17 00:00:00 2001 From: John Scipione Date: Wed, 5 Mar 2014 20:25:13 -0500 Subject: [PATCH] GIFTranslator: style fixes --- src/add-ons/translators/gif/GIFSave.cpp | 5 ++++- src/add-ons/translators/gif/GIFView.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/add-ons/translators/gif/GIFSave.cpp b/src/add-ons/translators/gif/GIFSave.cpp index 572f11596a..7d14502590 100644 --- a/src/add-ons/translators/gif/GIFSave.cpp +++ b/src/add-ons/translators/gif/GIFSave.cpp @@ -351,12 +351,15 @@ GIFSave::ResetHashtable() int GIFSave::CheckHashtable(int s, unsigned char c) { - if (s == -1) return c; + if (s == -1) + return c; + int hashindex = HASH(s, c); int nextindex; while ((nextindex = code_value[hashindex]) != -1) { if (prefix_code[nextindex] == s && append_char[nextindex] == c) return nextindex; + hashindex = (hashindex + HASHSTEP) % HASHSIZE; } diff --git a/src/add-ons/translators/gif/GIFView.cpp b/src/add-ons/translators/gif/GIFView.cpp index 11909e73e6..55d9c2db83 100644 --- a/src/add-ons/translators/gif/GIFView.cpp +++ b/src/add-ons/translators/gif/GIFView.cpp @@ -400,7 +400,7 @@ GIFView::MessageReceived(BMessage* message) } case GV_TRANSPARENT_RED: - { + { int32 value = CheckInput(fTransparentRedTC); fSettings->SetGetInt32(GIF_SETTING_TRANSPARENT_RED, &value); break; @@ -428,7 +428,9 @@ GIFView::MessageReceived(BMessage* message) } -int GIFView::CheckInput(BTextControl* control) { +int +GIFView::CheckInput(BTextControl* control) +{ int value = atoi(control->Text()); if (value < 0 || value > 255) { value = (value < 0) ? 0 : 255;