summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Oprala2013-09-23 15:39:31 +0200
committerKarel Zak2013-11-08 13:51:19 +0100
commitcb986008310b702558c27f8ff4d0724446f7a9fd (patch)
tree7ec7018dff276e4f5c5d296cc8c8021ad1285102
parenthexdump: minor formatting improvements in display() (diff)
downloadkernel-qcow2-util-linux-cb986008310b702558c27f8ff4d0724446f7a9fd.tar.gz
kernel-qcow2-util-linux-cb986008310b702558c27f8ff4d0724446f7a9fd.tar.xz
kernel-qcow2-util-linux-cb986008310b702558c27f8ff4d0724446f7a9fd.zip
hexdump: get rid of redundant typecasts
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
-rw-r--r--text-utils/conv.c4
-rw-r--r--text-utils/parse.c16
2 files changed, 10 insertions, 10 deletions
diff --git a/text-utils/conv.c b/text-utils/conv.c
index abb62d06d..e17acc4fe 100644
--- a/text-utils/conv.c
+++ b/text-utils/conv.c
@@ -76,7 +76,7 @@ conv_c(PR *pr, u_char *p)
*pr->cchar = 'c';
printf(pr->fmt, *p);
} else {
- xasprintf(&buf, "%03o", (int)*p);
+ xasprintf(&buf, "%03o", *p);
str = buf;
strpr: *pr->cchar = 's';
printf(pr->fmt, str);
@@ -106,6 +106,6 @@ conv_u(PR *pr, u_char *p)
printf(pr->fmt, *p);
} else {
*pr->cchar = 'x';
- printf(pr->fmt, (int)*p);
+ printf(pr->fmt, *p);
}
}
diff --git a/text-utils/parse.c b/text-utils/parse.c
index 810528b22..3098db4db 100644
--- a/text-utils/parse.c
+++ b/text-utils/parse.c
@@ -82,7 +82,7 @@ void addfile(char *name)
void add(const char *fmt)
{
- const unsigned char *p, *savep;
+ const char *p, *savep;
FS *tfs;
FU *tfu;
@@ -93,7 +93,7 @@ void add(const char *fmt)
list_add_tail(&tfs->fslist, &fshead);
/* Take the format string and break it up into format units. */
- p = (unsigned char *)fmt;
+ p = fmt;
while (TRUE) {
/* Skip leading white space. */
while (isspace(*p) && ++p)
@@ -117,7 +117,7 @@ void add(const char *fmt)
if (!isspace(*p) && *p != '/')
badfmt(fmt);
/* may overwrite either white space or slash */
- tfu->reps = atoi((char *)savep);
+ tfu->reps = atoi(savep);
tfu->flags = F_SETREP;
/* skip trailing white space */
while (isspace(*++p))
@@ -136,7 +136,7 @@ void add(const char *fmt)
;
if (!isspace(*p))
badfmt(fmt);
- tfu->bcnt = atoi((char *)savep);
+ tfu->bcnt = atoi(savep);
/* skip trailing white space */
while (isspace(*++p))
;
@@ -151,7 +151,7 @@ void add(const char *fmt)
badfmt(fmt);
}
tfu->fmt = xmalloc(p - savep + 1);
- xstrncpy(tfu->fmt, (char *)savep, p - savep + 1);
+ xstrncpy(tfu->fmt, savep, p - savep + 1);
escape(tfu->fmt);
++p;
}
@@ -163,7 +163,7 @@ int block_size(FS *fs)
{
FU *fu;
int bcnt, prec, cursize = 0;
- unsigned char *fmt;
+ char *fmt;
struct list_head *p;
/* figure out the data block size needed for each format unit */
@@ -174,7 +174,7 @@ int block_size(FS *fs)
continue;
}
bcnt = prec = 0;
- fmt = (unsigned char *)fu->fmt;
+ fmt = fu->fmt;
while (*fmt) {
if (*fmt != '%') {
++fmt;
@@ -187,7 +187,7 @@ int block_size(FS *fs)
while (strchr(spec + 1, *++fmt))
;
if (*fmt == '.' && isdigit(*++fmt)) {
- prec = atoi((char *)fmt);
+ prec = atoi(fmt);
while (isdigit(*++fmt))
;
}