Mercurial > MadButterfly
changeset 492:e95598916dfb Android_Skia
Make path data constant.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Thu, 26 Nov 2009 14:49:39 +0800 |
parents | 4291f16f3a09 |
children | 1b6228092a57 |
files | include/mb_shapes.h src/shape_path.c |
diffstat | 2 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/include/mb_shapes.h Mon Nov 23 18:52:30 2009 +0800 +++ b/include/mb_shapes.h Thu Nov 26 14:49:39 2009 +0800 @@ -65,7 +65,7 @@ /*! \defgroup shape_path Shape of Path * @{ */ -extern shape_t *rdman_shape_path_new(redraw_man_t *rdman, char *data); +extern shape_t *rdman_shape_path_new(redraw_man_t *rdman, const char *data); extern shape_t *rdman_shape_path_new_from_binary(redraw_man_t *rdman, char *commands, co_aix *pnts,
--- a/src/shape_path.c Mon Nov 23 18:52:30 2009 +0800 +++ b/src/shape_path.c Thu Nov 26 14:49:39 2009 +0800 @@ -385,9 +385,9 @@ * * \todo Notify programmers that syntax or value error of path data. */ -static int sh_path_cmd_arg_cnt(char *data, int *cmd_cntp, int *pnt_cntp, +static int sh_path_cmd_arg_cnt(const char *data, int *cmd_cntp, int *pnt_cntp, int *float_arg_cntp) { - char *p, *old; + const char *p, *old; int cmd_cnt, pnt_cnt, float_arg_cnt; int i; @@ -564,8 +564,8 @@ #define TO_ABSX islower(cmd)? x + atof(old): atof(old) #define TO_ABSY islower(cmd)? y + atof(old): atof(old) -static int sh_path_cmd_arg_fill(char *data, sh_path_t *path) { - char *p, *old; +static int sh_path_cmd_arg_fill(const char *data, sh_path_t *path) { + const char *p, *old; char *cmds; char cmd; co_aix *pnts; @@ -738,7 +738,7 @@ /*! \brief Create a path from value of 'data' of SVG path. */ -shape_t *rdman_shape_path_new(redraw_man_t *rdman, char *data) { +shape_t *rdman_shape_path_new(redraw_man_t *rdman, const char *data) { sh_path_t *path; int cmd_cnt, pnt_cnt, float_arg_cnt; int msz;