diff options
author | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-09-14 06:45:34 +0000 |
---|---|---|
committer | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-09-14 06:45:34 +0000 |
commit | 7ccfb2eb5f9d91bdb4139cb420a3b5f8deb2f6e8 (patch) | |
tree | 29ccfd792bcd8109ef331d031b6f04d89b99b310 /block-vmdk.c | |
parent | 5d0c5750bb19212c8ecfb9660956611baf6aa861 (diff) |
Fix warnings that would be caused by gcc flag -Wwrite-strings
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5206 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'block-vmdk.c')
-rw-r--r-- | block-vmdk.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/block-vmdk.c b/block-vmdk.c index e85bd4298e..8d67c2f149 100644 --- a/block-vmdk.c +++ b/block-vmdk.c @@ -119,7 +119,7 @@ static uint32_t vmdk_read_cid(BlockDriverState *bs, int parent) BDRVVmdkState *s = bs->opaque; char desc[DESC_SIZE]; uint32_t cid; - char *p_name, *cid_str; + const char *p_name, *cid_str; size_t cid_str_size; /* the descriptor offset = 0x200 */ @@ -193,7 +193,7 @@ static int vmdk_snapshot_create(const char *filename, const char *backing_file) uint32_t gde_entries, gd_size; int64_t gd_offset, rgd_offset, capacity, gt_size; char p_desc[DESC_SIZE], s_desc[DESC_SIZE], hdr[HEADER_SIZE]; - char *desc_template = + static const char desc_template[] = "# Disk DescriptorFile\n" "version=1\n" "CID=%x\n" @@ -202,7 +202,7 @@ static int vmdk_snapshot_create(const char *filename, const char *backing_file) "parentFileNameHint=\"%s\"\n" "\n" "# Extent description\n" - "RW %lu SPARSE \"%s\"\n" + "RW %u SPARSE \"%s\"\n" "\n" "# The Disk Data Base \n" "#DDB\n" @@ -702,7 +702,7 @@ static int vmdk_create(const char *filename, int64_t total_size, int fd, i; VMDK4Header header; uint32_t tmp, magic, grains, gd_size, gt_size, gt_count; - char *desc_template = + static const char desc_template[] = "# Disk DescriptorFile\n" "version=1\n" "CID=%x\n" @@ -791,8 +791,9 @@ static int vmdk_create(const char *filename, int64_t total_size, real_filename = temp_str + 1; if ((temp_str = strrchr(real_filename, ':')) != NULL) real_filename = temp_str + 1; - snprintf(desc, sizeof(desc), desc_template, time(NULL), (unsigned long)total_size, - real_filename, (flags & BLOCK_FLAG_COMPAT6 ? 6 : 4), total_size / (63 * 16)); + snprintf(desc, sizeof(desc), desc_template, (unsigned int)time(NULL), + (unsigned long)total_size, real_filename, + (flags & BLOCK_FLAG_COMPAT6 ? 6 : 4), total_size / (63 * 16)); /* write the descriptor */ lseek(fd, le64_to_cpu(header.desc_offset) << 9, SEEK_SET); |