Changes by: flatcap
Update of /cvsroot/linux-ntfs/ntfsprogs/libntfs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2642/libntfs
Modified Files:
attrib.c attrlist.c collate.c gnome-vfs-method.c
gnome-vfs-module.c index.c inode.c lcnalloc.c logfile.c mft.c
security.c volume.c win32_io.c
Log Message:
Tidy whitespace: trailing space; <space><tab> at the beginning of lines
Fix warnings about sign differences
Fix warnings about unused parameters
Tidy a few functions that didn't have { on a new line
Index: attrib.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/attrib.c,v
retrieving revision 1.160
retrieving revision 1.161
diff -u -p -r1.160 -r1.161
--- attrib.c 12 Jun 2005 15:23:25 -0000 1.160
+++ attrib.c 19 Jun 2005 21:09:40 -0000 1.161
@@ -428,7 +428,7 @@ int ntfs_attr_map_runlist(ntfs_attr *na,
Dprintf("%s(): Entering for inode 0x%llx, attr 0x%x, vcn 0x%llx.\n",
__FUNCTION__, (unsigned long long)na->ni->mft_no,
na->type, (long long)vcn);
-
+
lcn = ntfs_rl_vcn_to_lcn(na->rl, vcn);
if (lcn >= 0 || lcn == LCN_HOLE || lcn == LCN_ENOENT)
return 0;
@@ -490,7 +490,7 @@ int ntfs_attr_map_whole_runlist(ntfs_att
a = NULL;
while (1) {
runlist_element *rl;
-
+
int not_mapped = 0;
if (ntfs_rl_vcn_to_lcn(na->rl, next_vcn) == LCN_RL_NOT_MAPPED)
not_mapped = 1;
@@ -1219,7 +1219,7 @@ s64 ntfs_attr_pwrite(ntfs_attr *na, cons
free(buf);
}
if (rl->vcn < cur_vcn) {
- /*
+ /*
* Clusters that replaced hole are merged with
* previous run, so we need to update offset.
*/
@@ -2423,7 +2423,7 @@ int ntfs_attr_can_be_resident(const ntfs
int ntfs_make_room_for_attr(MFT_RECORD *m, u8 *pos, u32 size)
{
u32 biu;
-
+
Dprintf("%s(): Entering for pos 0x%d, size %u.\n",
__FUNCTION__, (int)(pos - (u8*)m), (unsigned) size);
@@ -2705,7 +2705,7 @@ int ntfs_non_resident_attr_record_add(nt
ntfs_attr_put_search_ctx(ctx);
errno = err;
return -1;
-
+
}
offset = (u8*)ctx->attr - (u8*)ctx->mrec;
ntfs_attr_put_search_ctx(ctx);
@@ -2867,7 +2867,7 @@ int ntfs_attr_record_rm(ntfs_attr_search
* added transparently to caller. So, this function should not be called with
* @type == AT_ATTRIBUTE_LIST, if you really need to add attribute list call
* ntfs_inode_add_attrlist instead.
- *
+ *
* On success return opened new ntfs attribute. On error return NULL with errno
* set to the error code.
*/
@@ -2878,7 +2878,7 @@ ntfs_attr *ntfs_attr_add(ntfs_inode *ni,
int err, i, offset;
ntfs_inode *attr_ni;
ntfs_attr *na;
-
+
if (!ni || size < 0 || type == AT_ATTRIBUTE_LIST) {
Dprintf("%s(): Invalid arguments passed.\n", __FUNCTION__);
errno = EINVAL;
@@ -2908,7 +2908,7 @@ ntfs_attr *ntfs_attr_add(ntfs_inode *ni,
}
/*
- * Determine resident or not will be new attribute. We add 8 to size in
+ * Determine resident or not will be new attribute. We add 8 to size in
* non resident case for mapping pairs.
*/
if (ntfs_attr_can_be_resident(ni->vol, type)) {
@@ -3056,7 +3056,7 @@ int ntfs_attr_rm(ntfs_attr *na)
{
ntfs_attr_search_ctx *ctx;
int ret = 0;
-
+
if (!na) {
Dprintf("%s(): Invalid arguments passed.\n", __FUNCTION__);
errno = EINVAL;
@@ -3262,7 +3262,7 @@ int ntfs_attr_record_move_to(ntfs_attr_s
}
/* Make space and move attribute. */
- if (ntfs_make_room_for_attr(ni->mrec, (u8*) nctx->attr,
+ if (ntfs_make_room_for_attr(ni->mrec, (u8*) nctx->attr,
le32_to_cpu(a->length))) {
err = errno;
Dprintf("%s(): Couldn't make space for attribute.\n",
@@ -3298,7 +3298,7 @@ put_err_out:
*
* New attribute record holder must have free @extra bytes after moving
* attribute record to it.
- *
+ *
* If this function succeed, user should reinit search context if he/she wants
* use it anymore.
*
@@ -3319,7 +3319,7 @@ int ntfs_attr_record_move_away(ntfs_attr
Dprintf("%s(): Entering for attr 0x%x, inode 0x%llx.\n", __FUNCTION__,
(unsigned) le32_to_cpu(ctx->attr->type),
(long long) ctx->ntfs_ino->mft_no);
-
+
if (ctx->ntfs_ino->nr_extents == -1)
base_ni = ctx->base_ntfs_ino;
else
@@ -3356,7 +3356,7 @@ int ntfs_attr_record_move_away(ntfs_attr
return 0;
}
- /*
+ /*
* Failed to move attribute to one of the current extents, so allocate
* new extent and move attribute to it.
*/
@@ -3467,7 +3467,7 @@ static int ntfs_attr_make_non_resident(n
NAttrClearSparse(na);
NAttrClearEncrypted(na);
- if (rl) {
+ if (rl) {
/* Now copy the attribute value to the allocated cluster(s). */
bw = ntfs_attr_pwrite(na, 0, le32_to_cpu(a->value_length),
(u8*)a + le16_to_cpu(a->value_offset));
@@ -3736,14 +3736,14 @@ static int ntfs_resident_attr_resize(ntf
err = ENOSPC;
goto put_err_out;
}
-
+
/* Add attribute list if not present. */
if (na->ni->nr_extents == -1)
ni = na->ni->base_ni;
else
ni = na->ni;
if (!NInoAttrList(ni)) {
- ntfs_attr_put_search_ctx(ctx);
+ ntfs_attr_put_search_ctx(ctx);
if (ntfs_inode_add_attrlist(ni))
return -1;
return ntfs_resident_attr_resize(na, newsize);
@@ -4004,8 +4004,8 @@ retry:
Dprintf("%s(): Entering for inode 0x%llx, attr 0x%x.\n", __FUNCTION__,
(unsigned long long)na->ni->mft_no, na->type);
-
- if (na->ni->nr_extents == -1)
+
+ if (na->ni->nr_extents == -1)
base_ni = na->ni->base_ni;
else
base_ni = na->ni;
@@ -4058,7 +4058,7 @@ retry:
/* If we in the first extent, then set/clean sparse bit. */
if (!a->lowest_vcn) {
int sparse;
-
+
sparse = ntfs_rl_sparse(na->rl);
if (sparse == -1) {
Dprintf("%s(): Bad runlist.\n", __FUNCTION__);
@@ -4163,7 +4163,7 @@ retry:
* Determine maximum possible length of mapping pairs,
* if we shall *not* expand space for mapping pairs.
*/
- cur_max_mp_size = le32_to_cpu(a->length) -
+ cur_max_mp_size = le32_to_cpu(a->length) -
le16_to_cpu(a->mapping_pairs_offset);
/*
* Determine maximum possible length of mapping pairs in the
@@ -4270,7 +4270,7 @@ retry:
Dprintf("%s(): Attribute lookup failed.\n", __FUNCTION__);
goto put_err_out;
}
-
+
/* Deallocate not used attribute extents and return with success. */
if (finished_build) {
ntfs_attr_reinit_search_ctx(ctx);
@@ -4446,7 +4446,7 @@ static int ntfs_non_resident_attr_shrink
errno = err;
return -1;
}
-
+
/* Truncate the runlist itself. */
if (ntfs_rl_truncate(&na->rl, first_free_vcn)) {
err = errno;
@@ -4461,7 +4461,7 @@ static int ntfs_non_resident_attr_shrink
errno = err;
return -1;
}
-
+
/* Write mapping pairs for new runlist. */
if (ntfs_attr_update_mapping_pairs(na)) {
err = errno;
@@ -4472,7 +4472,7 @@ static int ntfs_non_resident_attr_shrink
return -1;
}
}
-
+
/* Get the first attribute record. */
ctx = ntfs_attr_get_search_ctx(na->ni, NULL);
if (!ctx) {
@@ -4497,7 +4497,7 @@ static int ntfs_non_resident_attr_shrink
goto put_err_out;
}
a = ctx->attr;
-
+
/* Update allocated size only if it is changed. */
if ((na->allocated_size >> vol->cluster_size_bits) != first_free_vcn) {
na->allocated_size = first_free_vcn << vol->cluster_size_bits;
@@ -4822,7 +4822,7 @@ int ntfs_attr_truncate(ntfs_attr *na, co
errno = EINVAL;
return -1;
}
-
+
if (na->data_size == newsize)
return 0;
/*
Index: attrlist.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/attrlist.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -p -r1.22 -r1.23
--- attrlist.c 28 Jan 2005 13:48:19 -0000 1.22
+++ attrlist.c 19 Jun 2005 21:09:40 -0000 1.23
@@ -65,7 +65,7 @@ int ntfs_attrlist_need(ntfs_inode *ni)
errno = EINVAL;
return -1;
}
-
+
if (!ni->attr_list) {
Dprintf("%s(): Corrput in-memory struct.\n", __FUNCTION__);
errno = EINVAL;
@@ -255,7 +255,7 @@ int ntfs_attrlist_entry_rm(ntfs_attr_sea
"%lld.\n", __FUNCTION__, (long long) ctx->ntfs_ino->mft_no,
(unsigned) le32_to_cpu(ctx->al_entry->type),
(long long) le64_to_cpu(ctx->al_entry->lowest_vcn));
-
+
if (!NInoAttrList(base_ni)) {
Dprintf("%s(): Attribute list isn't present.\n", __FUNCTION__);
errno = ENOENT;
@@ -270,7 +270,7 @@ int ntfs_attrlist_entry_rm(ntfs_attr_sea
errno = ENOMEM;
return -1;
}
-
+
/* Reisze $ATTRIBUTE_LIST to new length. */
na = ntfs_attr_open(base_ni, AT_ATTRIBUTE_LIST, NULL, 0);
if (!na) {
Index: collate.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/collate.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- collate.c 6 Jun 2005 04:26:28 -0000 1.4
+++ collate.c 19 Jun 2005 21:09:40 -0000 1.5
@@ -73,7 +73,7 @@ static int ntfs_collate_file_name(ntfs_v
const void *data2, const int data2_len __attribute__((unused))){
int rc;
const FILE_NAME_ATTR *fn1, *fn2;
-
+
ntfs_debug("Entering.");
fn1 = (const FILE_NAME_ATTR *)data1;
fn2 = (const FILE_NAME_ATTR *)data2;
Index: gnome-vfs-method.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/gnome-vfs-method.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- gnome-vfs-method.c 9 Sep 2004 07:54:06 -0000 1.4
+++ gnome-vfs-method.c 19 Jun 2005 21:09:40 -0000 1.5
@@ -4,7 +4,7 @@
*
* Copyright (c) 2003 Jan Kratochvil <pro...@ja...>
* Copyright (c) 2003 Anton Altaparmakov
- *
+ *
* This program/include file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License, or
Index: gnome-vfs-module.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/gnome-vfs-module.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- gnome-vfs-module.c 9 Sep 2004 07:54:06 -0000 1.3
+++ gnome-vfs-module.c 19 Jun 2005 21:09:40 -0000 1.4
@@ -4,7 +4,7 @@
*
* Copyright (c) 2003 Jan Kratochvil <pro...@ja...>
* Copyright (c) 2003 Anton Altaparmakov
- *
+ *
* This program/include file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License, or
Index: index.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/index.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- index.c 5 Jun 2005 23:48:55 -0000 1.4
+++ index.c 19 Jun 2005 21:09:40 -0000 1.5
@@ -269,7 +269,7 @@ done:
descend_into_child_node:
ntfs_debug("Descend into node with VCN %lld.", vcn);
/* Read index allocation block. */
- if (ntfs_attr_mst_pread(na, vcn << vol->cluster_size_bits, 1,
+ if (ntfs_attr_mst_pread(na, vcn << vol->cluster_size_bits, 1,
ictx->block_size, ia) != 1) {
ntfs_error(, "Failed to read index allocation.");
goto err_out;
Index: inode.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/inode.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -p -r1.54 -r1.55
--- inode.c 8 Jun 2005 18:02:29 -0000 1.54
+++ inode.c 19 Jun 2005 21:09:40 -0000 1.55
@@ -389,7 +389,7 @@ int ntfs_inode_attach_all_extents(ntfs_i
/* Inode haven't got attribute list, thus nothing to attach. */
if (!NInoAttrList(ni))
return 0;
-
+
if (!ni->attr_list) {
Dprintf("%s(): Corrput in-memory struct.\n", __FUNCTION__);
errno = EINVAL;
@@ -681,7 +681,7 @@ int ntfs_inode_sync(ntfs_inode *ni)
for (i = 0; i < ni->nr_extents; ++i) {
ntfs_inode *eni;
-
+
eni = ni->extent_nis[i];
if (NInoTestAndClearDirty(eni)) {
if (ntfs_mft_record_write(eni->vol, eni->mft_no,
@@ -740,7 +740,7 @@ int ntfs_inode_add_attrlist(ntfs_inode *
errno = EEXIST;
return -1;
}
-
+
al_allocated = 0x40;
al_len = 0;
al = malloc(al_allocated);
@@ -750,7 +750,7 @@ int ntfs_inode_add_attrlist(ntfs_inode *
errno = ENOMEM;
return -1;
}
-
+
/* Form attribute list. */
ctx = ntfs_attr_get_search_ctx(ni, NULL);
if (!ctx) {
@@ -937,10 +937,10 @@ int ntfs_inode_free_space(ntfs_inode *ni
errno = EINVAL;
return -1;
}
-
+
Dprintf("%s(): Entering for inode 0x%llx, size %d.\n",
__FUNCTION__, (long long) ni->mft_no, size);
-
+
freed = (le32_to_cpu(ni->mrec->bytes_allocated) -
le32_to_cpu(ni->mrec->bytes_in_use));
Index: lcnalloc.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/lcnalloc.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -p -r1.30 -r1.31
--- lcnalloc.c 5 Nov 2004 20:02:16 -0000 1.30
+++ lcnalloc.c 19 Jun 2005 21:09:40 -0000 1.31
@@ -111,7 +111,7 @@ runlist *ntfs_cluster_alloc(ntfs_volume
errno = EINVAL;
return NULL;
}
-
+
/* Return empty runlist if @count == 0 */
if (!count) {
rl = malloc(0x1000);
Index: logfile.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/logfile.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- logfile.c 25 Jan 2005 21:41:25 -0000 1.2
+++ logfile.c 19 Jun 2005 21:09:40 -0000 1.3
@@ -504,7 +504,7 @@ BOOL ntfs_check_logfile(ntfs_attr *log_n
* Check the restart page for consistency and get a copy of the
* complete multi sector transfer deprotected restart page.
*/
- if (!ntfs_check_and_load_restart_page(log_na,
+ if (!ntfs_check_and_load_restart_page(log_na,
(RESTART_PAGE_HEADER*)buf, pos,
!pos ? &rstr1_ph : &rstr2_ph)) {
/* Error output already done inside the function. */
Index: mft.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/mft.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -p -r1.29 -r1.30
--- mft.c 11 Jan 2005 20:28:28 -0000 1.29
+++ mft.c 19 Jun 2005 21:09:40 -0000 1.30
@@ -1472,7 +1472,7 @@ int ntfs_mft_record_free(ntfs_volume *vo
u64 mft_no;
int err;
u16 seq_no, old_seq_no;
-
+
Dprintf("%s(): Entering for inode 0x%llx.\n",
__FUNCTION__, (long long) ni->mft_no);
Index: security.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/security.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- security.c 23 Apr 2004 10:54:57 -0000 1.6
+++ security.c 19 Jun 2005 21:09:40 -0000 1.7
@@ -92,7 +92,7 @@ char *ntfs_guid_to_mbs(const GUID *guid,
return _guid_str;
if (!guid_str)
free(_guid_str);
- errno = EINVAL;
+ errno = EINVAL;
return NULL;
}
Index: volume.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/volume.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -p -r1.44 -r1.45
--- volume.c 10 May 2005 16:53:48 -0000 1.44
+++ volume.c 19 Jun 2005 21:09:40 -0000 1.45
@@ -563,7 +563,7 @@ static int ntfs_volume_check_logfile(ntf
ntfs_inode *ni;
ntfs_attr *na = NULL;
int ret, err = 0;
-
+
if ((ni = ntfs_inode_open(vol, FILE_LogFile)) == NULL) {
Dprintf("Failed to open inode FILE_LogFile.\n");
errno = EIO;
@@ -610,13 +610,13 @@ static ntfs_inode *ntfs_hiberfile_open(n
errno = EINVAL;
return NULL;
}
-
+
ni_root = ntfs_inode_open(vol, FILE_root);
if (!ni_root) {
Dprintf("Couldn't open the root directory.\n");
return NULL;
}
-
+
unicode_len = ntfs_mbstoucs(hiberfile, &unicode, 0);
if (unicode_len < 0) {
Dperror("Couldn't convert 'hiberfil.sys' to Unicode");
@@ -659,7 +659,7 @@ static int ntfs_volume_check_hiberfile(n
ntfs_attr *na = NULL;
int i, bytes_read, ret = -1;
char *buf = NULL;
-
+
ni = ntfs_hiberfile_open(vol);
if (!ni) {
if (errno == ENOENT)
Index: win32_io.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/win32_io.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -p -r1.35 -r1.36
--- win32_io.c 6 Jun 2005 14:51:09 -0000 1.35
+++ win32_io.c 19 Jun 2005 21:09:40 -0000 1.36
@@ -165,7 +165,7 @@ static BOOL WINAPI libntfs_SetFilePointe
*
* The Find*Volume and SetFilePointerEx functions exist only on win2k+, as such
* we cannot just staticly import them.
- *
+ *
* This function initializes the imports if the functions do exist and in the
* SetFilePointerEx case, we emulate the function ourselves if it is not
* present.
@@ -257,11 +257,11 @@ static int ntfs_device_win32_simple_open
*handle = CreateFile(filename,
ntfs_device_unix_status_flags_to_win32(flags),
locking ? 0 : (FILE_SHARE_WRITE | FILE_SHARE_READ),
- NULL, OPEN_EXISTING, 0, NULL);
+ NULL, OPEN_EXISTING, 0, NULL);
if (*handle == INVALID_HANDLE_VALUE) {
errno = ntfs_w32error_to_errno(GetLastError());
Dprintf("CreateFile(%s) failed.\n", filename);
- return -1;
+ return -1;
}
return 0;
}
@@ -512,7 +512,7 @@ static __inline__ int ntfs_device_win32_
if (ntfs_device_win32_simple_open_file(filename, &handle, flags,
FALSE)) {
/* open error */
- return -1;
+ return -1;
}
/* fill fd */
fd->handle = handle;
@@ -545,7 +545,7 @@ static __inline__ int ntfs_device_win32_
if ((err = ntfs_device_win32_simple_open_file(filename, &handle, flags,
TRUE))) {
/* open error */
- return err;
+ return err;
}
/* store the drive geometry */
ntfs_device_win32_getgeo(handle, fd);
@@ -798,7 +798,7 @@ static int ntfs_device_win32_open_partit
drive_id);
CloseHandle(handle);
errno = ENODEV;
- return -1;
+ return -1;
}
}
@@ -1257,7 +1257,7 @@ static s64 ntfs_device_win32_write(struc
}
}
/* Copy the data to be written into @alignedbuffer. */
- memcpy(alignedbuffer + ofs, b, count);
+ memcpy(alignedbuffer + ofs, b, count);
}
if (fd->vol_handle != INVALID_HANDLE_VALUE && old_pos < fd->geo_size) {
s64 vol_to_write = fd->geo_size - old_pos;
@@ -1379,8 +1379,8 @@ static __inline__ int ntfs_win32_blksszg
DWORD bytesReturned;
DISK_GEOMETRY dg;
- if (DeviceIoControl(fd->handle, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0,
- &dg, sizeof(DISK_GEOMETRY), &bytesReturned, NULL)) {
+ if (DeviceIoControl(fd->handle, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0,
+ &dg, sizeof(DISK_GEOMETRY), &bytesReturned, NULL)) {
/* success */
*argp = dg.BytesPerSector;
return 0;
|