Skip to content

Commit

Permalink
Similar to r277901, fix more -Wcast-qual warnings in libkern's strtoq(),
Browse files Browse the repository at this point in the history
strtoul() and strtouq(), by using __DECONST.  No functional change.

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@277903 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
  • Loading branch information
dim committed Jan 29, 2015
1 parent 5f75f0b commit b774d18
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sys/libkern/strtoq.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,6 @@ strtoq(const char *nptr, char **endptr, int base)
} else if (neg)
acc = -acc;
if (endptr != 0)
*((const char **)endptr) = any ? s - 1 : nptr;
*endptr = __DECONST(char *, any ? s - 1 : nptr);
return (acc);
}
2 changes: 1 addition & 1 deletion sys/libkern/strtoul.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ strtoul(nptr, endptr, base)
} else if (neg)
acc = -acc;
if (endptr != 0)
*((const char **)endptr) = any ? s - 1 : nptr;
*endptr = __DECONST(char *, any ? s - 1 : nptr);
return (acc);
}
2 changes: 1 addition & 1 deletion sys/libkern/strtouq.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ strtouq(const char *nptr, char **endptr, int base)
} else if (neg)
acc = -acc;
if (endptr != 0)
*((const char **)endptr) = any ? s - 1 : nptr;
*endptr = __DECONST(char *, any ? s - 1 : nptr);
return (acc);
}

0 comments on commit b774d18

Please sign in to comment.