diff --git a/amiga/font_diskfont.c b/amiga/font_diskfont.c index f48f0f465..e1a62447d 100644 --- a/amiga/font_diskfont.c +++ b/amiga/font_diskfont.c @@ -94,11 +94,11 @@ static void ami_font_bm_close(struct TextFont *bmfont) CloseFont(bmfont); } -static size_t ami_font_bm_convert_local_to_utf8_offset(const char *utf8string, int length, size_t offset) +static size_t ami_font_bm_convert_local_to_utf8_offset(const char *utf8string, size_t length, UWORD offset) { size_t chr = 0; - for(size_t i = 0; i < offset; i++) { + for(UWORD i = 0; i < offset; i++) { chr = utf8_next(utf8string, length, chr); } @@ -123,7 +123,7 @@ static bool amiga_bm_nsfont_width(const plot_font_style_t *fstyle, return false; } - *width = TextLength(glob->rp, localtext, strlen(localtext)); + *width = (int)TextLength(glob->rp, localtext, (UWORD)strlen(localtext)); free(localtext); ami_font_bm_close(bmfont); @@ -150,7 +150,7 @@ static bool amiga_bm_nsfont_position_in_string(const plot_font_style_t *fstyle, struct TextExtent extent; struct TextFont *bmfont; char *localtext = NULL; - size_t co = 0; + UWORD co = 0; if((glob == NULL) || (glob->rp == NULL)) return false; @@ -162,7 +162,7 @@ static bool amiga_bm_nsfont_position_in_string(const plot_font_style_t *fstyle, return false; } - co = TextFit(glob->rp, localtext, strlen(localtext), + co = TextFit(glob->rp, localtext, (UWORD)strlen(localtext), &extent, NULL, 1, x, 32767); *char_offset = ami_font_bm_convert_local_to_utf8_offset(string, length, co); *actual_x = extent.te_Extent.MaxX; @@ -202,7 +202,7 @@ static bool amiga_bm_nsfont_split(const plot_font_style_t *fstyle, int x, size_t *char_offset, int *actual_x) { struct TextExtent extent; - size_t co, offset; + UWORD co, offset; char *charp; char *localtext; @@ -216,7 +216,7 @@ static bool amiga_bm_nsfont_split(const plot_font_style_t *fstyle, return false; } - offset = TextFit(glob->rp, localtext, strlen(localtext), + offset = TextFit(glob->rp, localtext, (UWORD)strlen(localtext), &extent, NULL, 1, x, 32767); co = offset; @@ -237,8 +237,8 @@ static bool amiga_bm_nsfont_split(const plot_font_style_t *fstyle, } } - if((co > 0) && (co <= strlen(localtext))) { - *actual_x = TextLength(glob->rp, localtext, co); + if((co > 0) && (co < strlen(localtext))) { + *actual_x = (int)TextLength(glob->rp, localtext, co); *char_offset = ami_font_bm_convert_local_to_utf8_offset(string, length, co); } else { *actual_x = x; @@ -263,7 +263,7 @@ static ULONG amiga_bm_nsfont_text(struct RastPort *rp, const char *string, ULONG if(bmfont == NULL) return 0; if(utf8_to_local_encoding(string, length, &localtext) == NSERROR_OK) { Move(rp, dx, dy); - Text(rp, localtext, strlen(localtext)); + Text(rp, localtext, (UWORD)strlen(localtext)); free(localtext); } diff --git a/amiga/gui.c b/amiga/gui.c index 4490438c6..837063639 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -4996,7 +4996,7 @@ static void gui_window_set_status(struct gui_window *g, const char *text) if(utf8text == NULL) return; GetAttr(GA_Width, g->shared->objects[GID_STATUS], (ULONG *)&size); - chars = TextFit(&scrn->RastPort, utf8text, strlen(utf8text), + chars = TextFit(&scrn->RastPort, utf8text, (UWORD)strlen(utf8text), &textex, NULL, 1, size - 4, scrn->RastPort.TxHeight); utf8text[chars] = 0;