Changes by: antona
Update of /cvsroot/linux-ntfs/linux-ntfs/libntfs
In directory usw-pr-cvs1:/tmp/cvs-serv31580/libntfs
Modified Files:
Makefile.am Makefile.in disk_io.c mft.c unistr.c volume.c
Log Message:
Fix all compiler warnings that came up with -Wall. Enabled -Wall for ./configure --enable-debug everywhere. Fix a few bugs in mkntfs that came up in the warnings (just error code paths, nothing major).
Index: Makefile.am
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/Makefile.am,v
retrieving revision 1.10
retrieving revision 1.11
diff -U2 -r1.10 -r1.11
--- Makefile.am 14 Apr 2002 14:08:29 -0000 1.10
+++ Makefile.am 15 Apr 2002 20:04:26 -0000 1.11
@@ -7,9 +7,9 @@
# - If the interface is the same as the previous version, change to C:R+1:A
-LTVERSION = 3:0:0
+LTVERSION = 4:0:0
# Need this to enable 64-bit (device) file access functions and parameters.
if DEBUG
-AM_CFLAGS = -D_FILE_OFFSET_BITS=64 -g -DDEBUG
+AM_CFLAGS = -D_FILE_OFFSET_BITS=64 -g -DDEBUG -Wall
else
AM_CFLAGS = -D_FILE_OFFSET_BITS=64
Index: Makefile.in
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/Makefile.in,v
retrieving revision 1.14
retrieving revision 1.15
diff -U2 -r1.14 -r1.15
--- Makefile.in 14 Apr 2002 14:08:29 -0000 1.14
+++ Makefile.in 15 Apr 2002 20:04:26 -0000 1.15
@@ -96,6 +96,6 @@
all_libraries = @all_libraries@
-LTVERSION = 3:0:0
-@DEBUG_TRUE@AM_CFLAGS = @DEBUG_TRUE@-D_FILE_OFFSET_BITS=64 -g -DDEBUG
+LTVERSION = 4:0:0
+@DEBUG_TRUE@AM_CFLAGS = @DEBUG_TRUE@-D_FILE_OFFSET_BITS=64 -g -DDEBUG -Wall
@DEBUG_FALSE@AM_CFLAGS = @DEBUG_FALSE@-D_FILE_OFFSET_BITS=64
Index: disk_io.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/disk_io.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -U2 -r1.19 -r1.20
--- disk_io.c 15 Apr 2002 18:39:37 -0000 1.19
+++ disk_io.c 15 Apr 2002 20:04:27 -0000 1.20
@@ -30,4 +30,5 @@
#include "types.h"
#include "disk_io.h"
+#include "mst.h"
#include "debug.h"
@@ -162,5 +163,5 @@
__s64 br, i;
- if (!b || count < 0 || pos < 0 || bksize & bksize - 1 ||
+ if (!b || count < 0 || pos < 0 || bksize & (bksize - 1) ||
bksize % NTFS_SECTOR_SIZE) {
errno = EINVAL;
@@ -214,5 +215,5 @@
char retry;
- if (!b || count < 0 || pos < 0 || bksize & bksize - 1 ||
+ if (!b || count < 0 || pos < 0 || bksize & (bksize - 1) ||
bksize % NTFS_SECTOR_SIZE) {
errno = EINVAL;
Index: mft.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/mft.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -U2 -r1.18 -r1.19
--- mft.c 15 Apr 2002 19:02:40 -0000 1.18
+++ mft.c 15 Apr 2002 20:04:27 -0000 1.19
@@ -22,4 +22,5 @@
*/
+#include <stdlib.h>
#include <errno.h>
@@ -28,4 +29,5 @@
#include "debug.h"
#include "bitmap.h"
+#include "attrib.h"
/**
@@ -73,5 +75,5 @@
}
/* Offset within the cluster of the first mft record to read. */
- ofs = m << vol->mft_record_size_bits & vol->cluster_size - 1;
+ ofs = (m << vol->mft_record_size_bits) & (vol->cluster_size - 1);
br = ntfs_mst_pread(vol->fd, (lcn << vol->cluster_size_bits) + ofs,
count, vol->mft_record_size, b);
@@ -129,5 +131,5 @@
}
/* Offset within the cluster of the first mft record to write. */
- ofs = m << vol->mft_record_size_bits & vol->cluster_size - 1;
+ ofs = (m << vol->mft_record_size_bits) & (vol->cluster_size - 1);
bw = ntfs_mst_pwrite(vol->fd, (lcn << vol->cluster_size_bits) + ofs,
count, vol->mft_record_size, b);
Index: unistr.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/unistr.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -U2 -r1.8 -r1.9
--- unistr.c 14 Apr 2002 14:08:30 -0000 1.8
+++ unistr.c 15 Apr 2002 20:04:27 -0000 1.9
@@ -23,4 +23,5 @@
#include <stdio.h>
+#include <stdlib.h>
#include "types.h"
@@ -108,5 +109,5 @@
#ifdef DEBUG
- if (!name1 || !name2 || ic && !upcase && upcase_len) {
+ if (!name1 || !name2 || (ic && !upcase && upcase_len)) {
Dputs("ntfs_collate_names received NULL pointer!");
exit(1);
Index: volume.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/volume.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -U2 -r1.24 -r1.25
--- volume.c 15 Apr 2002 19:02:41 -0000 1.24
+++ volume.c 15 Apr 2002 20:04:28 -0000 1.25
@@ -106,5 +106,5 @@
__s64 l;
ssize_t br;
- __u8 sectors_per_cluster, bits;
+ __u8 sectors_per_cluster;
__s8 c;
MFT_REF mref;
@@ -163,5 +163,5 @@
Dprintf("NumberOfSectors = %Li\n", sle64_to_cpu(bs->number_of_sectors));
Dprintf("SectorsPerCluster = 0x%x\n", sectors_per_cluster);
- if (sectors_per_cluster & sectors_per_cluster - 1) {
+ if (sectors_per_cluster & (sectors_per_cluster - 1)) {
Dprintf("Error: %s is not a valid NTFS partition! "
"sectors_per_cluster is not a power of 2.\n",
@@ -171,5 +171,5 @@
}
vol->number_of_clusters = sle64_to_cpu(bs->number_of_sectors) >>
- ffs(sectors_per_cluster) - 1;
+ (ffs(sectors_per_cluster) - 1);
vol->mft_lcn = sle64_to_cpu(bs->mft_lcn);
@@ -187,5 +187,5 @@
vol->cluster_size = sectors_per_cluster *
le16_to_cpu(bs->bpb.bytes_per_sector);
- if (vol->cluster_size & vol->cluster_size - 1) {
+ if (vol->cluster_size & (vol->cluster_size - 1)) {
Dprintf("Error: %s is not a valid NTFS partition! "
"cluster_size is not a power of 2.\n", name);
@@ -213,5 +213,5 @@
else
vol->mft_record_size = vol->cluster_size * c;
- if (vol->mft_record_size & vol->mft_record_size - 1) {
+ if (vol->mft_record_size & (vol->mft_record_size - 1)) {
Dprintf("Error: %s is not a valid NTFS partition! "
"mft_record_size is not a power of 2.\n", name);
@@ -396,5 +396,5 @@
Dprintf("Loading $UpCase... ");
mref = (MFT_REF)FILE_$UpCase;
- if (err = __read_file_record(vol, &mref, &mb, NULL)) {
+ if ((err = __read_file_record(vol, &mref, &mb, NULL))) {
Dputs(FAILED);
errno = -err;
@@ -460,5 +460,5 @@
Dprintf("Loading $Volume... ");
mref = (MFT_REF)FILE_$Volume;
- if (err = __read_file_record(vol, &mref, &mb, NULL)) {
+ if ((err = __read_file_record(vol, &mref, &mb, NULL))) {
Dputs(FAILED);
errno = -err;
|