From: Uwe Hermann Date: Wed, 30 May 2012 20:15:29 +0000 (+0200) Subject: cli: Constify a few char *pointers. X-Git-Tag: sigrok-cli-0.3.1~1 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d2ee5eea2b984aaa90f2fe641725d7ab1ff9b239;p=sigrok-cli.git cli: Constify a few char *pointers. --- diff --git a/parsers.c b/parsers.c index 707bcdd..9aa1824 100644 --- a/parsers.c +++ b/parsers.c @@ -182,7 +182,7 @@ struct sr_dev *parse_devstring(const char *devstring) return dev; } -char *strcanon(char *str) +char *strcanon(const char *str) { int p0, p1; char *s; @@ -199,8 +199,7 @@ char *strcanon(char *str) return s; } - -int canon_cmp(char *str1, char *str2) +int canon_cmp(const char *str1, const char *str2) { int ret; char *s1, *s2; @@ -213,4 +212,3 @@ int canon_cmp(char *str1, char *str2) return ret; } - diff --git a/sigrok-cli.h b/sigrok-cli.h index 8c57ef3..75a2947 100644 --- a/sigrok-cli.h +++ b/sigrok-cli.h @@ -29,8 +29,8 @@ char **sr_parse_triggerstring(struct sr_dev *dev, const char *triggerstring); GHashTable *parse_generic_arg(const char *arg); struct sr_dev *parse_devstring(const char *devstring); uint64_t sr_parse_timestring(const char *timestring); -char *strcanon(char *str); -int canon_cmp(char *str1, char *str2); +char *strcanon(const char *str); +int canon_cmp(const char *str1, const char *str2); /* anykey.c */ void add_anykey(void);