diff options
author | rlar <rlar> | 2016-02-29 19:41:04 +0100 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2016-02-29 20:16:03 -0500 |
commit | d2c0374297b7dd687a89227f3e77ff3f244da94b (patch) | |
tree | 00f90edde731eb4fcee9212fee9220d848a739ba /src | |
parent | 0f276adbb23542471bc30a2479e5fcdd5f475d72 (diff) |
add (int) casts to some strlen() invocations to prevent warnings
Diffstat (limited to 'src')
-rw-r--r-- | src/buf.c | 2 | ||||
-rw-r--r-- | src/misc.c | 2 | ||||
-rw-r--r-- | src/scan.l | 4 | ||||
-rw-r--r-- | src/scanopt.c | 6 | ||||
-rw-r--r-- | src/tables.c | 4 |
5 files changed, 9 insertions, 9 deletions
@@ -143,7 +143,7 @@ struct Buf *buf_strnappend (struct Buf *buf, const char *str, int n) /* Appends characters in str to buf. */ struct Buf *buf_strappend (struct Buf *buf, const char *str) { - return buf_strnappend (buf, str, strlen (str)); + return buf_strnappend (buf, str, (int) strlen (str)); } /* appends "#define str def\n" */ @@ -138,7 +138,7 @@ static void action_m4_define (const char *defname, const char * value) /* Append "new_text" to the running buffer. */ void add_action (const char *new_text) { - int len = strlen (new_text); + int len = (int) strlen (new_text); while (len + action_index >= action_size - 10 /* slop */ ) { int new_size = action_size * 2; @@ -272,8 +272,8 @@ M4QEND "]]" buf_strnappend(&top_buf, yytext, yyleng); } - {M4QSTART} buf_strnappend(&top_buf, escaped_qstart, strlen(escaped_qstart)); - {M4QEND} buf_strnappend(&top_buf, escaped_qend, strlen(escaped_qend)); + {M4QSTART} buf_strnappend(&top_buf, escaped_qstart, (int) strlen(escaped_qstart)); + {M4QEND} buf_strnappend(&top_buf, escaped_qend, (int) strlen(escaped_qend)); [^{}\r\n] { buf_strnappend(&top_buf, yytext, yyleng); diff --git a/src/scanopt.c b/src/scanopt.c index f173997..d829d0f 100644 --- a/src/scanopt.c +++ b/src/scanopt.c @@ -178,7 +178,7 @@ scanopt_t *scanopt_init (const optspec_t *options, int argc, char **argv, int fl pname = (const unsigned char *)(opt->opt_fmt + 1); s->has_short = 1; } - aux->printlen = strlen (opt->opt_fmt); + aux->printlen = (int) strlen (opt->opt_fmt); aux->namelen = 0; for (p = pname + 1; *p; p++) { @@ -359,7 +359,7 @@ int scanopt_usage (scanopt_t *scanner, FILE *fp, const char *usage) maxlen[0] = len; /* It's much easier to calculate length for description column! */ - len = strlen (DESC (s, ue->idx)); + len = (int) strlen (DESC (s, ue->idx)); if (len > maxlen[1]) maxlen[1] = len; } @@ -738,7 +738,7 @@ int scanopt (scanopt_t *svoid, char **arg, int *optindex) arglen = 0; } else - arglen = strlen (optarg); + arglen = (int) strlen (optarg); } /* At this point, we have a long or short option matched at opt_offset into diff --git a/src/tables.c b/src/tables.c index ae2ad9c..ff89b4d 100644 --- a/src/tables.c +++ b/src/tables.c @@ -158,12 +158,12 @@ int yytbl_hdr_fwrite (struct yytbl_writer *wr, const struct yytbl_hdr *th) flex_die (_("th_ssize|th_flags write failed")); bwritten += 6; - sz = strlen (th->th_version) + 1; + sz = (int) strlen (th->th_version) + 1; if ((rv = yytbl_writen (wr, th->th_version, sz)) != sz) flex_die (_("th_version writen failed")); bwritten += rv; - sz = strlen (th->th_name) + 1; + sz = (int) strlen (th->th_name) + 1; if ((rv = yytbl_writen (wr, th->th_name, sz)) != sz) flex_die (_("th_name writen failed")); bwritten += rv; |