From f1df0b7fbc3c8f95dec46a63a45819f57cfa7283 Mon Sep 17 00:00:00 2001 From: Alexander Lamaison Date: Wed, 28 Apr 2010 17:38:00 +0100 Subject: [PATCH] Changed sftp_attrsize macro to a static function. --- src/sftp.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/sftp.c b/src/sftp.c index 84609c0..ad90300 100644 --- a/src/sftp.c +++ b/src/sftp.c @@ -92,12 +92,15 @@ static int sftp_close_handle(LIBSSH2_SFTP_HANDLE *handle); /* sftp_attrsize * Size that attr with this flagset will occupy when turned into a bin struct */ -#define sftp_attrsize(f) \ - (4 + /* flags(4) */ \ - (((f) & LIBSSH2_SFTP_ATTR_SIZE)?8:0) + \ - (((f) & LIBSSH2_SFTP_ATTR_UIDGID)?8:0) + \ - (((f) & LIBSSH2_SFTP_ATTR_PERMISSIONS)?4:0) + \ - (((f) & LIBSSH2_SFTP_ATTR_ACMODTIME)?8:0)) /* atime + mtime as u32 */ +static int sftp_attrsize(unsigned long flags) +{ + return (4 + /* flags(4) */ + (((flags) & LIBSSH2_SFTP_ATTR_SIZE) ? 8 : 0) + + (((flags) & LIBSSH2_SFTP_ATTR_UIDGID) ? 8 : 0) + + (((flags) & LIBSSH2_SFTP_ATTR_PERMISSIONS) ? 4 : 0) + + (((flags) & LIBSSH2_SFTP_ATTR_ACMODTIME) ? 8 : 0)); + /* atime + mtime as u32 */ +} /* _libssh2_store_u64 */