preparatory patch for -Wwrite-strings #3

This commit is contained in:
Denis Vlasenko
2007-01-29 22:51:44 +00:00
parent b6aae0f381
commit 06c0a71d23
10 changed files with 42 additions and 44 deletions

View File

@@ -185,7 +185,7 @@ static void reread_partition_table(int leave);
static void delete_partition(int i);
static int get_partition(int warn, int max);
static void list_types(const struct systypes *sys);
static unsigned read_int(unsigned low, unsigned dflt, unsigned high, unsigned base, char *mesg);
static unsigned read_int(unsigned low, unsigned dflt, unsigned high, unsigned base, const char *mesg);
#endif
static const char *partition_type(unsigned char type);
static void fdisk_fatal(enum failure why) ATTRIBUTE_NORETURN;
@@ -1410,7 +1410,7 @@ get_boot(enum action what)
* There is no default if DFLT is not between LOW and HIGH.
*/
static unsigned
read_int(unsigned low, unsigned dflt, unsigned high, unsigned base, char *mesg)
read_int(unsigned low, unsigned dflt, unsigned high, unsigned base, const char *mesg)
{
unsigned i;
int default_ok = 1;

View File

@@ -630,7 +630,7 @@ xbsd_create_disklabel(void)
}
static int
edit_int(int def, char *mesg)
edit_int(int def, const char *mesg)
{
mesg = xasprintf("%s (%d): ", mesg, def);
do {
@@ -639,7 +639,7 @@ edit_int(int def, char *mesg)
} while (!isdigit(*line_ptr));
def = atoi(line_ptr);
ret:
free(mesg);
free((char*)mesg);
return def;
}
@@ -707,9 +707,9 @@ sync_disks(void)
static void
xbsd_write_bootstrap(void)
{
char *bootdir = BSD_LINUX_BOOTDIR;
char path[MAXPATHLEN];
char *dkbasename;
const char *bootdir = BSD_LINUX_BOOTDIR;
const char *dkbasename;
struct xbsd_disklabel dl;
char *d, *p, *e;
int sector;

View File

@@ -152,8 +152,8 @@ int ipcrm_main(int argc, char **argv)
(c == 'm') ? shmget(key, 0, 0) : semget(key, 0, 0));
if (id < 0) {
char *errmsg;
const char * const what = "key";
const char *errmsg;
const char *const what = "key";
error++;
switch (errno) {
@@ -183,8 +183,8 @@ int ipcrm_main(int argc, char **argv)
semctl(id, 0, IPC_RMID, arg));
if (result) {
char *errmsg;
const char * const what = iskey ? "key" : "id";
const char *errmsg;
const char *const what = iskey ? "key" : "id";
error++;
switch (errno) {

View File

@@ -64,7 +64,7 @@ enum {
* flags */
struct {
char *name;
const char *name;
long flags;
} static mount_options[] = {
// MS_FLAGS set a bit. ~MS_FLAGS disable that bit. 0 flags are NOPs.
@@ -122,7 +122,7 @@ struct {
#define VECTOR_SIZE(v) (sizeof(v) / sizeof((v)[0]))
/* Append mount options to string */
static void append_mount_options(char **oldopts, char *newopts)
static void append_mount_options(char **oldopts, const char *newopts)
{
if (*oldopts && **oldopts) {
/* do not insert options which are already there */
@@ -303,7 +303,7 @@ static int mount_it_now(struct mntent *mp, int vfsflags, char *filteropts)
fsname = 0;
if (!mp->mnt_type || !*mp->mnt_type) { /* bind mount */
mp->mnt_fsname = fsname = bb_simplify_path(mp->mnt_fsname);
mp->mnt_type = "bind";
mp->mnt_type = (char*)"bind";
}
mp->mnt_freq = mp->mnt_passno = 0;
@@ -1342,7 +1342,7 @@ prepare_kernel_data:
do_mount: /* perform actual mount */
mp->mnt_type = "nfs";
mp->mnt_type = (char*)"nfs";
retval = mount_it_now(mp, vfsflags, (char*)&data);
goto ret;
@@ -1428,7 +1428,7 @@ static int singlemount(struct mntent *mp, int ignore_busy)
// lock is required
vfsflags |= MS_MANDLOCK;
mp->mnt_type = "cifs";
mp->mnt_type = (char*)"cifs";
rc = mount_it_now(mp, vfsflags, filteropts);
if (ENABLE_FEATURE_CLEAN_UP) free(mp->mnt_fsname);
goto report_error;