From: Richard W.M. Jones <"Richard W.M. Jones "> Date: Sun, 18 May 2008 16:39:30 +0000 (+0100) Subject: Fix all 'unused variable' warnings. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=f29ccfd0f06ecbcda1ecbb7f7d7290714b6a80bc;p=virt-df.git Fix all 'unused variable' warnings. - However this fix requires bitmatch >= 1.0. - Documented requirements in README file. --- diff --git a/README b/README index 75f5d76..827f601 100644 --- a/README +++ b/README @@ -7,7 +7,7 @@ http://libvirt.org/ 'df' for virtual domains. -Building +Building from source ---------------------------------------------------------------------- ./configure # Checks that you have all the required bits. @@ -18,4 +18,19 @@ Building make install # Install in OCaml directory, and the binaries # in $prefix/bin. -Then have a look at the program 'virt-df.opt'. +Then have a look at the program 'virt-df/virt-df.opt'. + +Requirements (for building from source) +---------------------------------------------------------------------- + + ocaml >= 3.10.0 + extlib + libvirt >= 0.2.1 + ocaml-libvirt + xml-light + bitmatch >= 1.0 + +Optional: + + ocaml-gettext >= 0.3.0 + ocaml-csv diff --git a/lib/diskimage_fat.ml b/lib/diskimage_fat.ml index 7c2108e..d6ead26 100644 --- a/lib/diskimage_fat.ml +++ b/lib/diskimage_fat.ml @@ -82,14 +82,14 @@ and probe_superblock dev = root_directory_cluster : 32 : littleendian; _ : 16; (* FS information sector *) _ : 16; (* Backup of boot sector *) - pad : 12*8 : bitstring; (* Reserved *) + _ : 12*8 : bitstring; (* Reserved *) _ : 8; (* Physical drive number *) _ : 8; (* Reserved *) _ : 8; (* Extended boot signature *) serial : 32 : littleendian; (* Serial number. *) volume_label : 88 : string; (* Volume label. *) "FAT32 " : 64 : string; (* FAT32 identifier. *) - code : 420*8 : bitstring; (* Boot code. *) + _ : 420*8 : bitstring; (* Boot code. *) 0x55AA : 16 } -> (* End of bootsector magic. *) let blocksize = bytes_per_sector * sectors_per_cluster in diff --git a/lib/diskimage_linux_swap.ml b/lib/diskimage_linux_swap.ml index 072e4e6..22b8d5e 100644 --- a/lib/diskimage_linux_swap.ml +++ b/lib/diskimage_linux_swap.ml @@ -33,8 +33,7 @@ let rec probe dev = bitmatch bits with | { - (* Actually this isn't just padding. *) - padding : 8*0x1000 - 10*8 : bitstring; + _ : 8*0x1000 - 10*8 : bitstring; ("SWAP-SPACE"|"SWAPSPACE2") : 80 : string } -> diff --git a/lib/diskimage_linux_swsuspend.ml b/lib/diskimage_linux_swsuspend.ml index 93da753..f6b3a21 100644 --- a/lib/diskimage_linux_swsuspend.ml +++ b/lib/diskimage_linux_swsuspend.ml @@ -33,8 +33,7 @@ let rec probe dev = bitmatch bits with | { - (* Actually this isn't just padding. *) - padding : 8*0x1000 - 10*8 : bitstring; + _ : 8*0x1000 - 10*8 : bitstring; ("S1SUSPEND"|"S2SUSPEND") : 80 : string } -> diff --git a/lib/diskimage_lvm2.ml b/lib/diskimage_lvm2.ml index 0a9b74a..d4d766e 100644 --- a/lib/diskimage_lvm2.ml +++ b/lib/diskimage_lvm2.ml @@ -126,17 +126,17 @@ and read_pv_label dev = bitmatch bits with | { (* sector 0 *) - sector0 : sector_size_int*8 : bitstring; + _ : sector_size_int*8 : bitstring; (* sector 1 *) "LABELONE" : 64 : string; (* "LABELONE" *) _ : 128 : bitstring; (* Seems to contain something. *) "LVM2 001" : 64 : string; (* "LVM2 001" *) uuid : 256 : string; (* PV UUID *) - endsect : (sector_size_int-64)*8 : bitstring;(* to end of second sector *) + _ : (sector_size_int-64)*8 : bitstring;(* to end of second sector *) (* sectors 2-7 *) - sectors234567 : sector_size_int*8 * 6 : bitstring; + _ : sector_size_int*8 * 6 : bitstring; (* sector 8 *) _ : 320 : bitstring; (* start of sector 8 *) diff --git a/lib/diskimage_ntfs.ml b/lib/diskimage_ntfs.ml index 50ae581..0c4974c 100644 --- a/lib/diskimage_ntfs.ml +++ b/lib/diskimage_ntfs.ml @@ -101,7 +101,7 @@ and probe_superblock dev = _ : 24; volume_serial_number : 64 : littleendian; checksum : 32 : littleendian; (* Boot sector checksum. *) - code : 8 * 426 : bitstring; (* Boot code. *) + _ : 8 * 426 : bitstring; (* Boot code. *) 0x55AA : 16 } -> (* End of bootsector magic. *) let blocksize = bytes_per_sector * sectors_per_cluster in @@ -228,7 +228,7 @@ and parse_attrs attrs mft_record = | { attr_type : 32 : littleendian; attr_size : 32 : littleendian; 0 : 8; (* means attribute is resident *) - pad : 24*8 - 8 - 64 : bitstring; (* actually meaningful *) + _ : 24*8 - 8 - 64 : bitstring; (* actually meaningful *) attr : (Int32.to_int attr_size - 24) * 8 : bitstring; rest : -1 : bitstring } -> @@ -246,7 +246,7 @@ and parse_attrs attrs mft_record = highest_vcn : 64 : littleendian; (* size in clusters - 1 *) 0x40 : 16 : littleendian; (* mapping pairs offset *) 0 : 8; (* assume not compressed *) - pad : 40 : bitstring; (* padding *) + _ : 40 : bitstring; (* padding *) allocated_size : 64 : littleendian; (* allocate size on disk *) data_size : 64 : littleendian; (* byte size of the attribute *) initialized_size : 64 : littleendian; @@ -270,7 +270,7 @@ and parse_attrs attrs mft_record = *) | { attr_type : 32 : littleendian; attr_size : 32 : littleendian; - pad : (Int32.to_int attr_size - 8) * 8 : bitstring; + _ : (Int32.to_int attr_size - 8) * 8 : bitstring; rest : -1 : bitstring } -> if !debug then