Skip to content

Commit 30c4789

Browse files
author
jan.nijtmans
committed
(backport): Fix signature of some parse functions (should use Tcl_Size)
1 parent 2ef14d9 commit 30c4789

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

win/tkWinGDI.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Copyright © 1991-2018 Microsoft Corp.
77
* Copyright © 2009, Michael I. Schwartz.
88
* Copyright © 1998-2019 Harald Oehlmann, Elmicron GmbH
9-
* Copyright © 2021 Kevin Walzer/WordTech Communications LLC.
9+
* Copyright © 2021 Kevin Walzer.
1010
*
1111
* See the file "license.terms" for information on usage and redistribution of
1212
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -905,7 +905,7 @@ static Tcl_Size ParseArrow (
905905
static Tcl_Size ParseArrShp(
906906
TCL_UNUSED(void *),
907907
Tcl_Interp *interp,
908-
int objc,
908+
Tcl_Size objc,
909909
Tcl_Obj *const *objv,
910910
void *dstPtr)
911911
{
@@ -983,11 +983,11 @@ static Tcl_Size ParseCapStyle (
983983
static Tcl_Size ParseSmooth(
984984
TCL_UNUSED(void *),
985985
Tcl_Interp *interp,
986-
int objc,
986+
Tcl_Size objc,
987987
Tcl_Obj *const *objv,
988988
void *dstPtr)
989989
{
990-
int boolValue;
990+
bool boolValue;
991991
Tcl_Size index;
992992

993993
static const struct SmoothMethod {
@@ -1711,7 +1711,7 @@ static int GdiCharWidths(
17111711
}
17121712

17131713
{
1714-
int i;
1714+
unsigned char i;
17151715
char ind[2];
17161716
ind[1] = '\0';
17171717

@@ -1999,7 +1999,7 @@ static int GdiText(
19991999
Tcl_DStringInit(&ds);
20002000
wstring = Tcl_UtfToWCharDString(layout->chunks[i].start,
20012001
layout->chunks[i].numBytes, &ds);
2002-
retval = TextOutW(hDC, xi, yi, wstring, Tcl_DStringLength(&ds)/2);
2002+
retval = TextOutW(hDC, xi, yi, wstring, (int)Tcl_DStringLength(&ds)/2);
20032003
Tcl_DStringFree(&ds);
20042004
ya += fm.linespace;
20052005
nlseen = 0;
@@ -2051,7 +2051,7 @@ static int GdiTextPlain(
20512051
string = Tcl_GetStringFromObj(objv[4], &strlen);
20522052
Tcl_DStringInit(&ds);
20532053
wstring = Tcl_UtfToWCharDString(string, strlen, &ds);
2054-
retval = TextOutW(hDC, x0, y0, wstring, Tcl_DStringLength(&ds)/2);
2054+
retval = TextOutW(hDC, x0, y0, wstring, (int)Tcl_DStringLength(&ds)/2);
20552055
Tcl_DStringFree(&ds);
20562056
Tcl_SetObjResult(interp, Tcl_NewIntObj(retval));
20572057
return TCL_OK;
@@ -3624,7 +3624,7 @@ static HANDLE BitmapToDIB(
36243624

36253625
/* Calculate size of memory block required to store BITMAPINFO. */
36263626

3627-
dwLen = bi.biSize + DIBNumColors(&bi) * sizeof(RGBQUAD);
3627+
dwLen = (DWORD)(bi.biSize + DIBNumColors(&bi) * sizeof(RGBQUAD));
36283628

36293629
/* Get a DC. */
36303630

@@ -3678,7 +3678,7 @@ static HANDLE BitmapToDIB(
36783678

36793679
/* Realloc the buffer big enough to hold all the bits. */
36803680

3681-
dwLen = bi.biSize + DIBNumColors(&bi) * sizeof(RGBQUAD) + bi.biSizeImage;
3681+
dwLen = (DWORD)(bi.biSize + DIBNumColors(&bi) * sizeof(RGBQUAD) + bi.biSizeImage);
36823682

36833683
if ((h = GlobalReAlloc(hDIB, dwLen, 0)) != 0) {
36843684
hDIB = h;
@@ -3821,7 +3821,7 @@ static HPALETTE GetSystemPalette(void)
38213821
/* Set some important fields. */
38223822

38233823
lpLogPal->palVersion = 0x300;
3824-
lpLogPal->palNumEntries = nColors;
3824+
lpLogPal->palNumEntries = (WORD)nColors;
38253825

38263826
/* Copy the current system palette into our logical palette. */
38273827

0 commit comments

Comments
 (0)