app_server: Fix invalid cast of int32 to size_t array.
Make ServerFont::GetBoundingBoxesForStrings() use size_t.
This commit is contained in:
@@ -394,7 +394,7 @@ determine_bounds_draw_shape(void* _state, const BShape& shape, bool fill)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
determine_bounds_draw_string(void* _state, const char* string, size_t _length,
|
determine_bounds_draw_string(void* _state, const char* string, size_t length,
|
||||||
float deltaSpace, float deltaNonSpace)
|
float deltaSpace, float deltaNonSpace)
|
||||||
{
|
{
|
||||||
TRACE_BB("%p string '%s'\n", _state, string);
|
TRACE_BB("%p string '%s'\n", _state, string);
|
||||||
@@ -405,7 +405,6 @@ determine_bounds_draw_string(void* _state, const char* string, size_t _length,
|
|||||||
|
|
||||||
escapement_delta delta = { deltaSpace, deltaNonSpace };
|
escapement_delta delta = { deltaSpace, deltaNonSpace };
|
||||||
BRect rect;
|
BRect rect;
|
||||||
int32 length = _length;
|
|
||||||
font.GetBoundingBoxesForStrings((char**)&string, &length, 1, &rect,
|
font.GetBoundingBoxesForStrings((char**)&string, &length, 1, &rect,
|
||||||
B_SCREEN_METRIC, &delta);
|
B_SCREEN_METRIC, &delta);
|
||||||
|
|
||||||
|
|||||||
@@ -2563,8 +2563,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
for(int32 i = 0; i < numStrings; i++) {
|
for(int32 i = 0; i < numStrings; i++) {
|
||||||
// This version of ReadString allocates the strings, we free
|
// This version of ReadString allocates the strings, we free
|
||||||
// them below
|
// them below
|
||||||
// TODO: this does not work on 64-bit (size_t != int32)
|
link.ReadString(&stringArray[i], &lengthArray[i]);
|
||||||
link.ReadString(&stringArray[i], (size_t*)&lengthArray[i]);
|
|
||||||
link.Read<escapement_delta>(&deltaArray[i]);
|
link.Read<escapement_delta>(&deltaArray[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1017,7 +1017,7 @@ ServerFont::GetBoundingBoxes(const char* string, int32 numBytes,
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
ServerFont::GetBoundingBoxesForStrings(char *charArray[], int32 lengthArray[],
|
ServerFont::GetBoundingBoxesForStrings(char *charArray[], size_t lengthArray[],
|
||||||
int32 numStrings, BRect rectArray[], font_metric_mode mode,
|
int32 numStrings, BRect rectArray[], font_metric_mode mode,
|
||||||
escapement_delta deltaArray[])
|
escapement_delta deltaArray[])
|
||||||
{
|
{
|
||||||
@@ -1028,7 +1028,7 @@ ServerFont::GetBoundingBoxesForStrings(char *charArray[], int32 lengthArray[],
|
|||||||
Transformable transform(EmbeddedTransformation());
|
Transformable transform(EmbeddedTransformation());
|
||||||
|
|
||||||
for (int32 i = 0; i < numStrings; i++) {
|
for (int32 i = 0; i < numStrings; i++) {
|
||||||
int32 numBytes = lengthArray[i];
|
size_t numBytes = lengthArray[i];
|
||||||
const char* string = charArray[i];
|
const char* string = charArray[i];
|
||||||
escapement_delta delta = deltaArray[i];
|
escapement_delta delta = deltaArray[i];
|
||||||
|
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ class ServerFont {
|
|||||||
bool asString);
|
bool asString);
|
||||||
|
|
||||||
status_t GetBoundingBoxesForStrings(char *charArray[],
|
status_t GetBoundingBoxesForStrings(char *charArray[],
|
||||||
int32 lengthArray[], int32 numStrings,
|
size_t lengthArray[], int32 numStrings,
|
||||||
BRect rectArray[], font_metric_mode mode,
|
BRect rectArray[], font_metric_mode mode,
|
||||||
escapement_delta deltaArray[]);
|
escapement_delta deltaArray[]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user