From 8a210f7776b1db6aace176919c0c44a69be24e12 Mon Sep 17 00:00:00 2001 From: jpandre Date: Tue, 9 Oct 2007 07:37:07 +0000 Subject: [PATCH] Cleaned code - added a few const to arguments where needed - casted to long long arguments fprintf'ed with %lld --- libntfs-3g/index.c | 7 ++++--- libntfs-3g/inode.c | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libntfs-3g/index.c b/libntfs-3g/index.c index 5f7e9843..5cef69da 100644 --- a/libntfs-3g/index.c +++ b/libntfs-3g/index.c @@ -115,7 +115,7 @@ static int ntfs_icx_ib_write(ntfs_index_context *icx) * Return NULL if allocation failed. */ ntfs_index_context *ntfs_index_ctx_get(ntfs_inode *ni, - ntfschar *name, u32 name_len) + const ntfschar *name, u32 name_len) { ntfs_index_context *icx; @@ -426,7 +426,7 @@ static int ntfs_ia_check(ntfs_index_context *icx, INDEX_BLOCK *ib, VCN vcn) } /* static JPA removed for use in security.c */ -INDEX_ROOT *ntfs_ir_lookup(ntfs_inode *ni, ntfschar *name, +INDEX_ROOT *ntfs_ir_lookup(ntfs_inode *ni, const ntfschar *name, u32 name_len, ntfs_attr_search_ctx **ctx) { ATTR_RECORD *a; @@ -458,7 +458,8 @@ err_out: return ir; } -static INDEX_ROOT *ntfs_ir_lookup2(ntfs_inode *ni, ntfschar *name, u32 len) +static INDEX_ROOT *ntfs_ir_lookup2(ntfs_inode *ni, const ntfschar *name, + u32 len) { ntfs_attr_search_ctx *ctx; INDEX_ROOT *ir; diff --git a/libntfs-3g/inode.c b/libntfs-3g/inode.c index 9e7accd6..369c4189 100644 --- a/libntfs-3g/inode.c +++ b/libntfs-3g/inode.c @@ -422,7 +422,8 @@ ntfs_inode *ntfs_extent_inode_open(ntfs_inode *base_ni, const MFT_REF mref) ni->mrec->sequence_number)) { errno = EIO; ntfs_log_perror("Found stale extent mft " - "reference mft=%lld", ni->mft_no); + "reference mft=%lld", + (long long)ni->mft_no); return NULL; } return ni; @@ -605,7 +606,7 @@ static int ntfs_inode_sync_file_name(ntfs_inode *ni) if (!err) err = errno; ntfs_log_perror("Failed to open inode %lld with index", - le64_to_cpu(fn->parent_directory)); + (long long)le64_to_cpu(fn->parent_directory)); continue; } ictx = ntfs_index_ctx_get(index_ni, NTFS_INDEX_I30, 4);