From a75724fea8fb22d1d77443c8678f5ac459f20224 Mon Sep 17 00:00:00 2001 From: jpandre Date: Tue, 24 Nov 2009 14:18:53 +0000 Subject: [PATCH] Fixed a few misleading endianness types --- include/ntfs-3g/volume.h | 4 ++-- libntfs-3g/collate.c | 2 +- libntfs-3g/unistr.c | 8 ++++---- libntfs-3g/volume.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/ntfs-3g/volume.h b/include/ntfs-3g/volume.h index a0c71bdf..2a3d0d8a 100644 --- a/include/ntfs-3g/volume.h +++ b/include/ntfs-3g/volume.h @@ -159,7 +159,7 @@ struct _ntfs_volume { ntfs_inode *vol_ni; /* ntfs_inode structure for FILE_Volume. */ u8 major_ver; /* Ntfs major version of volume. */ u8 minor_ver; /* Ntfs minor version of volume. */ - u16 flags; /* Bit array of VOLUME_* flags. */ + le16 flags; /* Bit array of VOLUME_* flags. */ u16 sector_size; /* Byte size of a sector. */ u8 sector_size_bits; /* Log(2) of the byte size of a sector. */ @@ -261,7 +261,7 @@ extern int ntfs_version_is_supported(ntfs_volume *vol); extern int ntfs_volume_check_hiberfile(ntfs_volume *vol, int verbose); extern int ntfs_logfile_reset(ntfs_volume *vol); -extern int ntfs_volume_write_flags(ntfs_volume *vol, const u16 flags); +extern int ntfs_volume_write_flags(ntfs_volume *vol, const le16 flags); extern int ntfs_volume_error(int err); extern void ntfs_mount_error(const char *vol, const char *mntpoint, int err); diff --git a/libntfs-3g/collate.c b/libntfs-3g/collate.c index 20e5db1e..c3e0d58b 100644 --- a/libntfs-3g/collate.c +++ b/libntfs-3g/collate.c @@ -177,7 +177,7 @@ static int ntfs_collate_ntofs_security_hash(ntfs_volume *vol __attribute__((unus { int rc; u32 d1, d2; - const u32 *p1, *p2; + const le32 *p1, *p2; ntfs_log_trace("Entering.\n"); if (data1_len != data2_len || data1_len != 8) { diff --git a/libntfs-3g/unistr.c b/libntfs-3g/unistr.c index 22eb2c61..19cb1234 100644 --- a/libntfs-3g/unistr.c +++ b/libntfs-3g/unistr.c @@ -162,7 +162,7 @@ int ntfs_names_collate(const ntfschar *name1, const u32 name1_len, const u32 upcase_len) { u32 cnt; - ntfschar c1, c2; + u16 c1, c2; #ifdef DEBUG if (!name1 || !name2 || (ic && (!upcase || !upcase_len))) { @@ -264,7 +264,7 @@ int ntfs_ucsncmp(const ntfschar *s1, const ntfschar *s2, size_t n) int ntfs_ucsncasecmp(const ntfschar *s1, const ntfschar *s2, size_t n, const ntfschar *upcase, const u32 upcase_size) { - ntfschar c1, c2; + u16 c1, c2; size_t i; #ifdef DEBUG @@ -357,7 +357,7 @@ void ntfs_name_upcase(ntfschar *name, u32 name_len, const ntfschar *upcase, const u32 upcase_len) { u32 i; - ntfschar u; + u16 u; for (i = 0; i < name_len; i++) if ((u = le16_to_cpu(name[i])) < upcase_len) @@ -505,7 +505,7 @@ static int ntfs_utf16_to_utf8(const ntfschar *ins, const int ins_len, char *t; int i, size, ret = -1; - ntfschar halfpair; + int halfpair; halfpair = 0; if (!*outs) diff --git a/libntfs-3g/volume.c b/libntfs-3g/volume.c index 74037d02..b87ad9e6 100644 --- a/libntfs-3g/volume.c +++ b/libntfs-3g/volume.c @@ -1045,7 +1045,7 @@ ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, unsigned long flags) goto error_exit; for (j = 0; j < (s32)u; j++) { - ntfschar uc = le16_to_cpu(vname[j]); + u16 uc = le16_to_cpu(vname[j]); if (uc > 0xff) uc = (ntfschar)'_'; vol->vol_name[j] = (char)uc; @@ -1432,7 +1432,7 @@ error_exit: * * Return 0 if successful and -1 if not with errno set to the error code. */ -int ntfs_volume_write_flags(ntfs_volume *vol, const u16 flags) +int ntfs_volume_write_flags(ntfs_volume *vol, const le16 flags) { ATTR_RECORD *a; VOLUME_INFORMATION *c;