summaryrefslogtreecommitdiff
path: root/riscos
diff options
context:
space:
mode:
Diffstat (limited to 'riscos')
-rw-r--r--riscos/font.c20
-rw-r--r--riscos/save_draw.c9
2 files changed, 14 insertions, 15 deletions
diff --git a/riscos/font.c b/riscos/font.c
index 4be4cb6b6..aa6c14307 100644
--- a/riscos/font.c
+++ b/riscos/font.c
@@ -456,7 +456,7 @@ unsigned long nsfont_width(struct font_data *font, const char *text,
NULL,
NULL, 0,
NULL, &width, NULL, NULL);
- free(loc_text);
+ free((void *)loc_text);
break;
}
default:
@@ -491,7 +491,7 @@ void nsfont_position_in_string(struct font_data *font, const char *text,
{
os_error *error;
font_scan_block block;
- char *split;
+ const char *split;
int x_out;
assert(font != NULL && text != NULL);
@@ -537,7 +537,7 @@ void nsfont_position_in_string(struct font_data *font, const char *text,
&block, NULL, 0,
&split, &x_out, NULL, NULL);
split = &text[back_mapP[split - loc_text]];
- free(loc_text); free(back_mapP);
+ free((void *)loc_text); free((void *)back_mapP);
break;
}
default:
@@ -572,7 +572,7 @@ char *nsfont_split(struct font_data *font, const char *text,
{
os_error *error;
font_scan_block block;
- char *split;
+ const char *split;
assert(font != NULL && text != NULL);
@@ -623,7 +623,7 @@ char *nsfont_split(struct font_data *font, const char *text,
&split,
used_width, NULL, NULL);
split = &text[back_mapP[split - loc_text]];
- free(loc_text); free(back_mapP);
+ free((void *)loc_text); free((void *)back_mapP);
break;
}
default:
@@ -687,7 +687,7 @@ void nsfont_paint(struct font_data *data, const char *text,
error = xfont_paint((font_f)data->handle, loc_text,
flags, xpos, ypos, NULL,
trfm, 0);
- free(loc_text);
+ free((void *)loc_text);
break;
}
default:
@@ -770,7 +770,7 @@ void nsfont_txtenum(struct font_data *font, const char *text,
*rolength = length;
*rofontname = fontname;
*consumed = length;
- *width = rowidth / 800;
+ *width = (unsigned int)rowidth / 800;
break;
}
case FONTTYPE_STANDARD_LATIN1: {
@@ -787,15 +787,15 @@ void nsfont_txtenum(struct font_data *font, const char *text,
0x7fffffff, 0x7fffffff,
NULL,
NULL, 0,
- NULL, &width, NULL, NULL);
+ NULL, &rowidth, NULL, NULL);
if (error != NULL) {
- free(*rotext); *rotext = NULL;
+ free((void *)*rotext); *rotext = NULL;
return;
}
*rolength = strlen(*rotext);
*rofontname = font_table[font->id];
*consumed = length;
- *width = rowidth / 800;
+ *width = (unsigned int)rowidth / 800;
break;
}
default:
diff --git a/riscos/save_draw.c b/riscos/save_draw.c
index 0708c9214..baba7ffa4 100644
--- a/riscos/save_draw.c
+++ b/riscos/save_draw.c
@@ -95,7 +95,7 @@ bool save_as_draw(struct content *c, const char *path)
box = c->data.html.layout->children;
current_width = c->available_width;
- if ((diagram = drawbuf_claim(sizeof(drawfile_diagram_base), DrawBuf_eHeader)) == NULL)
+ if ((diagram = (drawfile_diagram_base *)drawbuf_claim(sizeof(drawfile_diagram_base), DrawBuf_eHeader)) == NULL)
goto draw_save_error;
/* write the Draw diagram */
@@ -273,7 +273,7 @@ static bool drawbuf_save_file(const char *drawfilename)
if (oDrawBuf.numFonts > 0) {
drawfile_object *dro;
- if ((dro = drawbuf_claim(8, DrawBuf_eFontTable)) == NULL)
+ if ((dro = (drawfile_object *)drawbuf_claim(8, DrawBuf_eFontTable)) == NULL)
goto file_save_error;
dro->type = drawfile_TYPE_FONT_TABLE;
@@ -347,7 +347,7 @@ bool add_options(void)
drawfile_object *dro;
drawfile_options *dfo;
- if ((dro = drawbuf_claim(8 + sizeof(drawfile_options), DrawBuf_eBody)) == NULL)
+ if ((dro = (drawfile_object *)drawbuf_claim(8 + sizeof(drawfile_options), DrawBuf_eBody)) == NULL)
return false;
dro->type = drawfile_TYPE_OPTIONS;
@@ -825,7 +825,6 @@ static bool add_text(struct box *box, unsigned long cbc, long x, long y)
&rotext,
&rolength,
&consumed);
- LOG(("txtenum <%.*s> (%d bytes), returned width %d, font name <%s>, RISC OS text <%.*s>, consumed %d\n", txt_len, txt, txt_len, width, rofontname, rolength, rotext, consumed));
/* Error happened ? */
if (rotext == NULL)
return false;
@@ -859,7 +858,7 @@ static bool add_text(struct box *box, unsigned long cbc, long x, long y)
dt->text[rolength++] = 0;
} while (rolength % 4);
- free(rotext);
+ free((void *)rotext);
/* Go to next chunk : */
x += width * 512;