summaryrefslogtreecommitdiffstats
path: root/source/include/smb_macros.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/include/smb_macros.h')
-rw-r--r--source/include/smb_macros.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/include/smb_macros.h b/source/include/smb_macros.h
index 5155d241d84..79bca5d7029 100644
--- a/source/include/smb_macros.h
+++ b/source/include/smb_macros.h
@@ -162,10 +162,10 @@
#define UNIXERROR(defclass,deferror) unix_error_packet(outbuf,defclass,deferror,__LINE__,__FILE__)
#define SMB_ROUNDUP(x,g) (((x)+((g)-1))&~((g)-1))
-#define SMB_ROUNDUP_ALLOCATION(s) (SMB_ROUNDUP((SMB_OFF_T)((s)+1), ((SMB_OFF_T)SMB_ROUNDUP_ALLOCATION_SIZE)))
+#define SMB_ROUNDUP_ALLOCATION(s) ((s) ? (SMB_ROUNDUP((SMB_OFF_T)((s)+1), ((SMB_OFF_T)SMB_ROUNDUP_ALLOCATION_SIZE))) : 0 )
/* Extra macros added by Ying Chen at IBM - speed increase by inlining. */
-#define smb_buf(buf) (buf + smb_size + CVAL(buf,smb_wct)*2)
+#define smb_buf(buf) (((char *)(buf)) + smb_size + CVAL(buf,smb_wct)*2)
#define smb_buflen(buf) (SVAL(buf,smb_vwv0 + (int)CVAL(buf, smb_wct)*2))
/* Note that chain_size must be available as an extern int to this macro. */
@@ -238,13 +238,13 @@ copy an IP address from one buffer to another
vfs stat wrapper that calls dos_to_unix.
********************************************************************/
-#define vfs_stat(conn, fname, st) ((conn)->vfs_ops.stat((conn), dos_to_unix((fname),False),(st)))
+#define vfs_stat(conn, fname, st) ((conn)->vfs_ops.stat((conn), dos_to_unix_static((fname)),(st)))
/*******************************************************************
vfs lstat wrapper that calls dos_to_unix.
********************************************************************/
-#define vfs_lstat(conn, fname, st) ((conn)->vfs_ops.lstat((conn), dos_to_unix((fname),False),(st)))
+#define vfs_lstat(conn, fname, st) ((conn)->vfs_ops.lstat((conn), dos_to_unix_static((fname)),(st)))
/*******************************************************************
vfs fstat wrapper that calls dos_to_unix.
@@ -256,30 +256,30 @@ copy an IP address from one buffer to another
vfs rmdir wrapper that calls dos_to_unix.
********************************************************************/
-#define vfs_rmdir(conn,fname) ((conn)->vfs_ops.rmdir((conn),dos_to_unix((fname),False)))
+#define vfs_rmdir(conn,fname) ((conn)->vfs_ops.rmdir((conn),dos_to_unix_static((fname))))
/*******************************************************************
vfs Unlink wrapper that calls dos_to_unix.
********************************************************************/
-#define vfs_unlink(conn, fname) ((conn)->vfs_ops.unlink((conn),dos_to_unix((fname),False)))
+#define vfs_unlink(conn, fname) ((conn)->vfs_ops.unlink((conn),dos_to_unix_static((fname))))
/*******************************************************************
vfs chmod wrapper that calls dos_to_unix.
********************************************************************/
-#define vfs_chmod(conn,fname,mode) ((conn)->vfs_ops.chmod((conn),dos_to_unix((fname),False),(mode)))
+#define vfs_chmod(conn,fname,mode) ((conn)->vfs_ops.chmod((conn),dos_to_unix_static((fname)),(mode)))
/*******************************************************************
vfs chown wrapper that calls dos_to_unix.
********************************************************************/
-#define vfs_chown(conn,fname,uid,gid) ((conn)->vfs_ops.chown((conn),dos_to_unix((fname),False),(uid),(gid)))
+#define vfs_chown(conn,fname,uid,gid) ((conn)->vfs_ops.chown((conn),dos_to_unix_static((fname)),(uid),(gid)))
/*******************************************************************
A wrapper for vfs_chdir().
********************************************************************/
-#define vfs_chdir(conn,fname) ((conn)->vfs_ops.chdir((conn),dos_to_unix((fname),False)))
+#define vfs_chdir(conn,fname) ((conn)->vfs_ops.chdir((conn),dos_to_unix_static((fname))))
#endif /* _SMB_MACROS_H */