Signed-off-by: Eric Biggers <ebigge...@gmail.com>
---
 src/lowntfs-3g.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/lowntfs-3g.c b/src/lowntfs-3g.c
index a91d123..9d933d2 100644
--- a/src/lowntfs-3g.c
+++ b/src/lowntfs-3g.c
@@ -1493,15 +1493,15 @@ close:
                        of->parent = 0;
                        of->ino = ino;
                        of->state = state;
-#ifdef PLUGIN_ENABLED
+#ifndef PLUGINS_DISABLED
                        memcpy(&of->fi, fi, sizeof(struct fuse_file_info));
-#endif /* PLUGIN_ENABLED */
+#endif /* PLUGINS_DISABLED */
                        of->next = ctx->open_files;
                        of->previous = (struct open_file*)NULL;
                        if (ctx->open_files)
                                ctx->open_files->previous = of;
                        ctx->open_files = of;
-                       fi->fh = (long)of;
+                       fi->fh = (uintptr_t)of;
                }
        }
        if (res)
@@ -1542,7 +1542,7 @@ static void ntfs_fuse_read(fuse_req_t req, fuse_ino_t 
ino, size_t size,
                REPARSE_POINT *reparse;
                struct open_file *of;
 
-               of = (struct open_file*)fi;
+               of = (struct open_file*)(uintptr_t)fi->fh;
                res = CALL_REPARSE_PLUGIN(ni, read, buf, size, offset, &of->fi);
                if (res >= 0) {
                        goto stamps;
@@ -1623,7 +1623,7 @@ static void ntfs_fuse_write(fuse_req_t req, fuse_ino_t 
ino, const char *buf,
                REPARSE_POINT *reparse;
                struct open_file *of;
 
-               of = (struct open_file*)fi;
+               of = (struct open_file*)(uintptr_t)fi->fh;
                res = CALL_REPARSE_PLUGIN(ni, write, buf, size, offset,
                                                                &of->fi);
                if (res >= 0) {
@@ -2283,7 +2283,7 @@ exit:
                        if (ctx->open_files)
                                ctx->open_files->previous = of;
                        ctx->open_files = of;
-                       fi->fh = (long)of;
+                       fi->fh = (uintptr_t)of;
                }
        }
        return res;
@@ -2774,7 +2774,7 @@ static void ntfs_fuse_release(fuse_req_t req, fuse_ino_t 
ino,
        char ghostname[GHOSTLTH];
        int res;
 
-       of = (struct open_file*)(long)fi->fh;
+       of = (struct open_file*)(uintptr_t)fi->fh;
        /* Only for marked descriptors there is something to do */
        if (!of
            || !(of->state & (CLOSE_COMPRESSED | CLOSE_ENCRYPTED
-- 
2.10.1


------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
ntfs-3g-devel mailing list
ntfs-3g-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel

Reply via email to