Interface Kit: Add casts to int32 following previous commit.
This commit is contained in:
@@ -43,8 +43,8 @@
|
|||||||
int32
|
int32
|
||||||
BLayoutUtils::AddSizesInt32(int32 a, int32 b)
|
BLayoutUtils::AddSizesInt32(int32 a, int32 b)
|
||||||
{
|
{
|
||||||
if (a >= B_SIZE_UNLIMITED - b)
|
if (a >= (int32)B_SIZE_UNLIMITED - b)
|
||||||
return B_SIZE_UNLIMITED;
|
return (int32)B_SIZE_UNLIMITED;
|
||||||
return a + b;
|
return a + b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public:
|
|||||||
void InitFromSizes(int32* sizes)
|
void InitFromSizes(int32* sizes)
|
||||||
{
|
{
|
||||||
fLocations[0] = 0;
|
fLocations[0] = 0;
|
||||||
for (int32 i = 0; i < fCount; i++)
|
for (int32 i = 0; i < fCount; i++)
|
||||||
fLocations[i + 1] = fLocations[i] + sizes[i] + fSpacing;
|
fLocations[i + 1] = fLocations[i] + sizes[i] + fSpacing;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,7 +168,7 @@ ComplexLayouter::ComplexLayouter(int32 elementCount, float spacing)
|
|||||||
fSums(new(nothrow) SumItem[elementCount + 1]),
|
fSums(new(nothrow) SumItem[elementCount + 1]),
|
||||||
fSumBackups(new(nothrow) SumItemBackup[elementCount + 1]),
|
fSumBackups(new(nothrow) SumItemBackup[elementCount + 1]),
|
||||||
fOptimizer(new(nothrow) LayoutOptimizer(elementCount)),
|
fOptimizer(new(nothrow) LayoutOptimizer(elementCount)),
|
||||||
fUnlimited(B_SIZE_UNLIMITED / (elementCount == 0 ? 1 : elementCount)),
|
fUnlimited((int32)B_SIZE_UNLIMITED / (elementCount == 0 ? 1 : elementCount)),
|
||||||
fMinMaxValid(false),
|
fMinMaxValid(false),
|
||||||
fOptimizerConstraintsAdded(false)
|
fOptimizerConstraintsAdded(false)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -44,23 +44,23 @@ public:
|
|||||||
ElementInfo()
|
ElementInfo()
|
||||||
: index(0),
|
: index(0),
|
||||||
min(0),
|
min(0),
|
||||||
max(B_SIZE_UNLIMITED),
|
max((int32)B_SIZE_UNLIMITED),
|
||||||
preferred(0),
|
preferred(0),
|
||||||
weight(1),
|
weight(1),
|
||||||
tempWeight(0)
|
tempWeight(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
ElementInfo(int index)
|
ElementInfo(int index)
|
||||||
: index(index),
|
: index(index),
|
||||||
min(0),
|
min(0),
|
||||||
max(B_SIZE_UNLIMITED),
|
max((int32)B_SIZE_UNLIMITED),
|
||||||
preferred(0),
|
preferred(0),
|
||||||
weight(1),
|
weight(1),
|
||||||
tempWeight(0)
|
tempWeight(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Assign(const ElementInfo& info)
|
void Assign(const ElementInfo& info)
|
||||||
{
|
{
|
||||||
min = info.min;
|
min = info.min;
|
||||||
@@ -89,7 +89,7 @@ public:
|
|||||||
{
|
{
|
||||||
delete[] fElements;
|
delete[] fElements;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual float ElementLocation(int32 element)
|
virtual float ElementLocation(int32 element)
|
||||||
{
|
{
|
||||||
if (element < 0 || element >= fElementCount) {
|
if (element < 0 || element >= fElementCount) {
|
||||||
@@ -117,7 +117,7 @@ SimpleLayouter::SimpleLayouter(int32 elementCount, float spacing)
|
|||||||
: fElementCount(elementCount),
|
: fElementCount(elementCount),
|
||||||
fSpacing((int32)spacing),
|
fSpacing((int32)spacing),
|
||||||
fMin(0),
|
fMin(0),
|
||||||
fMax(B_SIZE_UNLIMITED),
|
fMax((int32)B_SIZE_UNLIMITED),
|
||||||
fPreferred(0),
|
fPreferred(0),
|
||||||
fMinMaxValid(false),
|
fMinMaxValid(false),
|
||||||
fLayoutInfo(NULL)
|
fLayoutInfo(NULL)
|
||||||
@@ -150,7 +150,7 @@ SimpleLayouter::AddConstraints(int32 element, int32 length,
|
|||||||
int32 min = (int32)_min + 1;
|
int32 min = (int32)_min + 1;
|
||||||
int32 max = (int32)_max + 1;
|
int32 max = (int32)_max + 1;
|
||||||
// int32 preferred = (int32)_preferred + 1;
|
// int32 preferred = (int32)_preferred + 1;
|
||||||
|
|
||||||
ElementInfo& info = fElements[element];
|
ElementInfo& info = fElements[element];
|
||||||
info.min = max_c(info.min, min);
|
info.min = max_c(info.min, min);
|
||||||
info.max = min_c(info.max, max);
|
info.max = min_c(info.max, max);
|
||||||
@@ -209,7 +209,7 @@ SimpleLayouter::Layout(LayoutInfo* layoutInfo, float _size)
|
|||||||
int32 size = int32(_size + 1);
|
int32 size = int32(_size + 1);
|
||||||
|
|
||||||
fLayoutInfo = (MyLayoutInfo*)layoutInfo;
|
fLayoutInfo = (MyLayoutInfo*)layoutInfo;
|
||||||
|
|
||||||
_ValidateMinMax();
|
_ValidateMinMax();
|
||||||
|
|
||||||
if (fElementCount == 0)
|
if (fElementCount == 0)
|
||||||
@@ -284,7 +284,7 @@ SimpleLayouter::_CalculateSumWeight(BList& elementInfos)
|
|||||||
if (elementInfos.IsEmpty())
|
if (elementInfos.IsEmpty())
|
||||||
return 0;
|
return 0;
|
||||||
int32 count = elementInfos.CountItems();
|
int32 count = elementInfos.CountItems();
|
||||||
|
|
||||||
// sum up the floating point weight, so we get a scale
|
// sum up the floating point weight, so we get a scale
|
||||||
double scale = 0;
|
double scale = 0;
|
||||||
for (int32 i = 0; i < count; i++) {
|
for (int32 i = 0; i < count; i++) {
|
||||||
@@ -316,11 +316,11 @@ SimpleLayouter::_CalculateSumWeight(BList& elementInfos)
|
|||||||
weight += info->tempWeight;
|
weight += info->tempWeight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return weight;
|
return weight;
|
||||||
}
|
}
|
||||||
|
|
||||||
// _ValidateMinMax
|
// _ValidateMinMax
|
||||||
void
|
void
|
||||||
SimpleLayouter::_ValidateMinMax()
|
SimpleLayouter::_ValidateMinMax()
|
||||||
{
|
{
|
||||||
@@ -331,11 +331,11 @@ SimpleLayouter::_ValidateMinMax()
|
|||||||
|
|
||||||
if (fElementCount == 0) {
|
if (fElementCount == 0) {
|
||||||
fMin = 0;
|
fMin = 0;
|
||||||
fMax = B_SIZE_UNLIMITED;
|
fMax = (int32)B_SIZE_UNLIMITED;
|
||||||
fPreferred = 0;
|
fPreferred = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int spacing = (fElementCount - 1) * fSpacing;
|
int spacing = (fElementCount - 1) * fSpacing;
|
||||||
fMin = spacing;
|
fMin = spacing;
|
||||||
fMax = spacing;
|
fMax = spacing;
|
||||||
|
|||||||
Reference in New Issue
Block a user