From e5a05f1c0e1bb7e7388d4fedb584d8ec71be6628 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Thu, 28 Apr 2016 19:07:06 +0100 Subject: Fix Amiga build following recent API change --- amiga/font_diskfont.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'amiga/font_diskfont.c') diff --git a/amiga/font_diskfont.c b/amiga/font_diskfont.c index 91bec20d3..a64674ba2 100644 --- a/amiga/font_diskfont.c +++ b/amiga/font_diskfont.c @@ -111,21 +111,21 @@ static size_t ami_font_bm_convert_local_to_utf8_offset(const char *utf8string, s } -static bool amiga_bm_nsfont_width(const plot_font_style_t *fstyle, +static nserror amiga_bm_nsfont_width(const plot_font_style_t *fstyle, const char *string, size_t length, int *width) { char *localtext = NULL; - if((glob == NULL) || (glob->rp == NULL)) return false; + if((glob == NULL) || (glob->rp == NULL)) return NSERROR_INVALID; *width = length; struct TextFont *bmfont = ami_font_bm_open(glob->rp, fstyle); - if(bmfont == NULL) return false; + if(bmfont == NULL) return NSERROR_INVALID; if(utf8_to_local_encoding(string, length, &localtext) != NSERROR_OK) { ami_font_bm_close(bmfont); - return false; + return NSERROR_INVALID; } *width = TextLength(glob->rp, localtext, (UWORD)strlen(localtext)); @@ -133,7 +133,7 @@ static bool amiga_bm_nsfont_width(const plot_font_style_t *fstyle, ami_font_bm_close(bmfont); - return true; + return NSERROR_OK; } /** @@ -148,7 +148,7 @@ static bool amiga_bm_nsfont_width(const plot_font_style_t *fstyle, * \return true on success, false on error and error reported */ -static bool amiga_bm_nsfont_position_in_string(const plot_font_style_t *fstyle, +static nserror amiga_bm_nsfont_position_in_string(const plot_font_style_t *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x) { @@ -157,14 +157,14 @@ static bool amiga_bm_nsfont_position_in_string(const plot_font_style_t *fstyle, char *localtext = NULL; UWORD co = 0; - if((glob == NULL) || (glob->rp == NULL)) return false; + if((glob == NULL) || (glob->rp == NULL)) return NSERROR_INVALID; bmfont = ami_font_bm_open(glob->rp, fstyle); - if(bmfont == NULL) return false; + if(bmfont == NULL) return NSERROR_INVALID; if(utf8_to_local_encoding(string, length, &localtext) != NSERROR_OK) { ami_font_bm_close(bmfont); - return false; + return NSERROR_INVALID; } co = TextFit(glob->rp, localtext, (UWORD)strlen(localtext), @@ -175,7 +175,7 @@ static bool amiga_bm_nsfont_position_in_string(const plot_font_style_t *fstyle, free(localtext); ami_font_bm_close(bmfont); - return true; + return NSERROR_OK; } @@ -202,7 +202,7 @@ static bool amiga_bm_nsfont_position_in_string(const plot_font_style_t *fstyle, * Returning char_offset == length means no split possible */ -static bool amiga_bm_nsfont_split(const plot_font_style_t *fstyle, +static nserror amiga_bm_nsfont_split(const plot_font_style_t *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x) { @@ -211,14 +211,14 @@ static bool amiga_bm_nsfont_split(const plot_font_style_t *fstyle, char *charp; char *localtext; - if((glob == NULL) || (glob->rp == NULL)) return false; + if((glob == NULL) || (glob->rp == NULL)) return NSERROR_INVALID; struct TextFont *bmfont = ami_font_bm_open(glob->rp, fstyle); - if(bmfont == NULL) return false; + if(bmfont == NULL) return NSERROR_INVALID; if(utf8_to_local_encoding(string, length, &localtext) != NSERROR_OK) { ami_font_bm_close(bmfont); - return false; + return NSERROR_INVALID; } offset = TextFit(glob->rp, localtext, (UWORD)strlen(localtext), @@ -253,7 +253,7 @@ static bool amiga_bm_nsfont_split(const plot_font_style_t *fstyle, free(localtext); ami_font_bm_close(bmfont); - return true; + return NSERROR_OK; } static ULONG amiga_bm_nsfont_text(struct RastPort *rp, const char *string, ULONG length, -- cgit v1.2.3