2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 22:05:36 +00:00

Replace printf format "0x%x" with "%#x"

printf() has standard flag for adding "0x" prefix before hexadecimal integer.

MOD='[-+]\?[0-9]*.\?[0-9]*[lL]*'
git grep -l "0x%${MOD}x" | xargs -n1 sed -e "s/0x%\(${MOD}\)x/%#\1x/g" -i

Signed-off-by:    Konstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Konstantin Khlebnikov
2012-04-24 15:20:24 +04:00
committed by Pavel Emelyanov
parent f737cb441f
commit bef7092834
7 changed files with 55 additions and 55 deletions

16
files.c
View File

@@ -99,7 +99,7 @@ void show_saved_files(void)
list_for_each_entry(fd, &file_descs[i], hash) {
struct fdinfo_list_entry *le;
pr_info(" `- type %d ID 0x%x\n", fd->type, fd->id);
pr_info(" `- type %d ID %#x\n", fd->type, fd->id);
list_for_each_entry(le, &fd->fd_info_head, desc_list)
pr_info(" `- FD %d pid %d\n", le->fe.fd, le->pid);
}
@@ -192,7 +192,7 @@ static int open_remap_ghost(struct reg_file_info *rfi,
* issues with cross-device links.
*/
pr_info("Opening ghost file 0x%x for %s\n", rfe->remap_id, rfi->path);
pr_info("Opening ghost file %#x for %s\n", rfe->remap_id, rfi->path);
gf = xmalloc(sizeof(*gf));
if (!gf)
@@ -216,7 +216,7 @@ static int open_remap_ghost(struct reg_file_info *rfi,
}
if (fchown(gfd, gfe.uid, gfe.gid) < 0) {
pr_perror("Can't reset user/group on ghost 0x%x\n", rfe->remap_id);
pr_perror("Can't reset user/group on ghost %#x\n", rfe->remap_id);
return -1;
}
@@ -253,21 +253,21 @@ static int collect_remaps(void)
ret = -1;
if (!(rfe.remap_id & REMAP_GHOST)) {
pr_err("Non ghost remap not supported @0x%x\n",
pr_err("Non ghost remap not supported @%#x\n",
rfe.orig_id);
break;
}
fdesc = find_file_desc_raw(FDINFO_REG, rfe.orig_id);
if (fdesc == NULL) {
pr_err("Remap for non existing file 0x%x\n",
pr_err("Remap for non existing file %#x\n",
rfe.orig_id);
break;
}
rfe.remap_id &= ~REMAP_GHOST;
rfi = container_of(fdesc, struct reg_file_info, d);
pr_info("Configuring remap 0x%x -> 0x%x\n", rfi->rfe.id, rfe.remap_id);
pr_info("Configuring remap %#x -> %#x\n", rfi->rfe.id, rfe.remap_id);
ret = open_remap_ghost(rfi, &rfe);
if (ret < 0)
break;
@@ -312,7 +312,7 @@ int collect_reg_files(void)
rfi->remap_path = NULL;
rfi->path[len] = '\0';
pr_info("Collected [%s] ID 0x%x\n", rfi->path, rfi->rfe.id);
pr_info("Collected [%s] ID %#x\n", rfi->path, rfi->rfe.id);
file_desc_add(&rfi->d, FDINFO_REG, rfi->rfe.id,
&reg_desc_ops);
}
@@ -428,7 +428,7 @@ int open_reg_by_id(u32 id)
fd = find_file_desc_raw(FDINFO_REG, id);
if (fd == NULL) {
pr_perror("Can't find regfile for 0x%x\n", id);
pr_perror("Can't find regfile for %#x\n", id);
return -1;
}