Icon-O-Matic: Remove some dead code.
This caused -Wformat-overflow (but only if -ftree-vrp was enabled, which at present we disable it universally.)
This commit is contained in:
@@ -84,7 +84,7 @@ ColorPickerView::AttachedToWindow()
|
|||||||
fColorSlider->SetExplicitMaxSize(
|
fColorSlider->SetExplicitMaxSize(
|
||||||
BSize(B_SIZE_UNSET, B_SIZE_UNLIMITED));
|
BSize(B_SIZE_UNSET, B_SIZE_UNLIMITED));
|
||||||
fColorPreview->SetExplicitMinSize(BSize(B_SIZE_UNSET, 70));
|
fColorPreview->SetExplicitMinSize(BSize(B_SIZE_UNSET, 70));
|
||||||
|
|
||||||
const char* title[] = { "H", "S", "V", "R", "G", "B" };
|
const char* title[] = { "H", "S", "V", "R", "G", "B" };
|
||||||
|
|
||||||
int32 selectedRadioButton = _NumForMode(fSelectedColorMode);
|
int32 selectedRadioButton = _NumForMode(fSelectedColorMode);
|
||||||
@@ -160,7 +160,7 @@ ColorPickerView::AttachedToWindow()
|
|||||||
.Add(new BSpaceLayoutItem(separatorSize, separatorSize,
|
.Add(new BSpaceLayoutItem(separatorSize, separatorSize,
|
||||||
separatorSize, separatorAlignment),
|
separatorSize, separatorAlignment),
|
||||||
0, 7, 3)
|
0, 7, 3)
|
||||||
|
|
||||||
.AddGroup(B_HORIZONTAL, 0.0f, 0, 8, 2)
|
.AddGroup(B_HORIZONTAL, 0.0f, 0, 8, 2)
|
||||||
.Add(fHexTextControl->CreateLabelLayoutItem())
|
.Add(fHexTextControl->CreateLabelLayoutItem())
|
||||||
.Add(fHexTextControl->CreateTextViewLayoutItem())
|
.Add(fHexTextControl->CreateTextViewLayoutItem())
|
||||||
@@ -256,47 +256,39 @@ ColorPickerView::MessageReceived(BMessage *message)
|
|||||||
int nr = message->what - MSG_TEXTCONTROL;
|
int nr = message->what - MSG_TEXTCONTROL;
|
||||||
int value = atoi(fTextControl[nr]->Text());
|
int value = atoi(fTextControl[nr]->Text());
|
||||||
|
|
||||||
char string[4];
|
|
||||||
|
|
||||||
switch (nr) {
|
switch (nr) {
|
||||||
case 0: {
|
case 0: {
|
||||||
value %= 360;
|
value %= 360;
|
||||||
sprintf(string, "%d", value);
|
|
||||||
h = (float)value / 60;
|
h = (float)value / 60;
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case 1: {
|
case 1: {
|
||||||
value = min_c(value, 100);
|
value = min_c(value, 100);
|
||||||
sprintf(string, "%d", value);
|
|
||||||
s = (float)value / 100;
|
s = (float)value / 100;
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case 2: {
|
case 2: {
|
||||||
value = min_c(value, 100);
|
value = min_c(value, 100);
|
||||||
sprintf(string, "%d", value);
|
|
||||||
v = (float)value / 100;
|
v = (float)value / 100;
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case 3: {
|
case 3: {
|
||||||
value = min_c(value, 255);
|
value = min_c(value, 255);
|
||||||
sprintf(string, "%d", value);
|
|
||||||
r = (float)value / 255;
|
r = (float)value / 255;
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case 4: {
|
case 4: {
|
||||||
value = min_c(value, 255);
|
value = min_c(value, 255);
|
||||||
sprintf(string, "%d", value);
|
|
||||||
g = (float)value / 255;
|
g = (float)value / 255;
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case 5: {
|
case 5: {
|
||||||
value = min_c(value, 255);
|
value = min_c(value, 255);
|
||||||
sprintf(string, "%d", value);
|
|
||||||
b = (float)value / 255;
|
b = (float)value / 255;
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nr<3) { // hsv-mode
|
if (nr < 3) { // hsv-mode
|
||||||
HSV_to_RGB(h, s, v, r, g, b);
|
HSV_to_RGB(h, s, v, r, g, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user