mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +03:00
gcc: use apropriate type for reading and printing values
This commit is contained in:
parent
d48266b7fb
commit
55a8b1bd37
@ -689,7 +689,7 @@ static int _scan_list(struct cmd_context *cmd, struct dev_filter *f,
|
|||||||
dev_name(devl->dev),
|
dev_name(devl->dev),
|
||||||
(int)MAJOR(devl->dev->dev),
|
(int)MAJOR(devl->dev->dev),
|
||||||
(int)MINOR(devl->dev->dev),
|
(int)MINOR(devl->dev->dev),
|
||||||
devl->dev->bcache_fd, bb);
|
devl->dev->bcache_fd, (void *)bb);
|
||||||
|
|
||||||
ret = _process_block(cmd, f, devl->dev, bb, 0, 0, &is_lvm_device);
|
ret = _process_block(cmd, f, devl->dev, bb, 0, 0, &is_lvm_device);
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ struct volume_group *alloc_vg(const char *pool_name, struct cmd_context *cmd,
|
|||||||
dm_list_init(&vg->removed_historical_lvs);
|
dm_list_init(&vg->removed_historical_lvs);
|
||||||
dm_list_init(&vg->removed_pvs);
|
dm_list_init(&vg->removed_pvs);
|
||||||
|
|
||||||
log_debug_mem("Allocated VG %s at %p.", vg->name ? : "<no name>", vg);
|
log_debug_mem("Allocated VG %s at %p.", vg->name ? : "<no name>", (void *)vg);
|
||||||
|
|
||||||
return vg;
|
return vg;
|
||||||
}
|
}
|
||||||
@ -79,7 +79,7 @@ static void _free_vg(struct volume_group *vg)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_debug_mem("Freeing VG %s at %p.", vg->name ? : "<no name>", vg);
|
log_debug_mem("Freeing VG %s at %p.", vg->name ? : "<no name>", (void *)vg);
|
||||||
|
|
||||||
dm_hash_destroy(vg->hostnames);
|
dm_hash_destroy(vg->hostnames);
|
||||||
dm_pool_destroy(vg->vgmem);
|
dm_pool_destroy(vg->vgmem);
|
||||||
|
@ -232,7 +232,7 @@ static int _maps_line(const struct dm_config_node *cn, lvmlock_t lock,
|
|||||||
const char *line, size_t *mstats)
|
const char *line, size_t *mstats)
|
||||||
{
|
{
|
||||||
const struct dm_config_value *cv;
|
const struct dm_config_value *cv;
|
||||||
long from, to;
|
unsigned long from, to;
|
||||||
int pos;
|
int pos;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
char fr, fw, fx, fp;
|
char fr, fw, fx, fp;
|
||||||
|
@ -204,7 +204,7 @@ static int _get_proc_number(const char *file, const char *name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (getline(&line, &len, fl) != -1) {
|
while (getline(&line, &len, fl) != -1) {
|
||||||
if (sscanf(line, "%d %255s\n", &num, &nm[0]) == 2) {
|
if (sscanf(line, "%u %255s\n", &num, &nm[0]) == 2) {
|
||||||
if (!strcmp(name, nm)) {
|
if (!strcmp(name, nm)) {
|
||||||
if (number) {
|
if (number) {
|
||||||
*number = num;
|
*number = num;
|
||||||
|
@ -510,7 +510,7 @@ int unmangle_string(const char *str, const char *str_name, size_t len,
|
|||||||
int strict = mode != DM_STRING_MANGLING_NONE;
|
int strict = mode != DM_STRING_MANGLING_NONE;
|
||||||
char str_rest[DM_NAME_LEN];
|
char str_rest[DM_NAME_LEN];
|
||||||
size_t i, j;
|
size_t i, j;
|
||||||
int code;
|
unsigned int code;
|
||||||
int r = 0;
|
int r = 0;
|
||||||
|
|
||||||
if (!str || !buf)
|
if (!str || !buf)
|
||||||
|
@ -403,7 +403,7 @@ static int _stats_bound(const struct dm_stats *dms)
|
|||||||
if (dms->bind_major > 0 || dms->bind_name || dms->bind_uuid)
|
if (dms->bind_major > 0 || dms->bind_name || dms->bind_uuid)
|
||||||
return 1;
|
return 1;
|
||||||
/* %p format specifier expects a void pointer. */
|
/* %p format specifier expects a void pointer. */
|
||||||
log_error("Stats handle at %p is not bound.", dms);
|
log_error("Stats handle at %p is not bound.", (const void *)dms);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ void dm_pools_check_leaks(void)
|
|||||||
p->orig_pool,
|
p->orig_pool,
|
||||||
p->name, p->stats.bytes);
|
p->name, p->stats.bytes);
|
||||||
#else
|
#else
|
||||||
log_error(" [%p] %s", p, p->name);
|
log_error(" [%p] %s", (void *)p, p->name);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&_dm_pools_mutex);
|
pthread_mutex_unlock(&_dm_pools_mutex);
|
||||||
|
Loading…
Reference in New Issue
Block a user