mirror of
https://github.com/libssh2/libssh2.git
synced 2025-08-07 08:02:56 +03:00
include: silence warnings with casts in public libssh2_sftp.h
Avoid triggering warnings in macros coming from public libssh2 headers. Cherry-picked from: #846 Closes #862
This commit is contained in:
@@ -231,10 +231,11 @@ libssh2_sftp_open_ex(LIBSSH2_SFTP *sftp,
|
|||||||
unsigned long flags,
|
unsigned long flags,
|
||||||
long mode, int open_type);
|
long mode, int open_type);
|
||||||
#define libssh2_sftp_open(sftp, filename, flags, mode) \
|
#define libssh2_sftp_open(sftp, filename, flags, mode) \
|
||||||
libssh2_sftp_open_ex((sftp), (filename), strlen(filename), (flags), \
|
libssh2_sftp_open_ex((sftp), \
|
||||||
(mode), LIBSSH2_SFTP_OPENFILE)
|
(filename), (unsigned int)strlen(filename), \
|
||||||
|
(flags), (mode), LIBSSH2_SFTP_OPENFILE)
|
||||||
#define libssh2_sftp_opendir(sftp, path) \
|
#define libssh2_sftp_opendir(sftp, path) \
|
||||||
libssh2_sftp_open_ex((sftp), (path), strlen(path), 0, 0, \
|
libssh2_sftp_open_ex((sftp), (path), (unsigned int)strlen(path), 0, 0, \
|
||||||
LIBSSH2_SFTP_OPENDIR)
|
LIBSSH2_SFTP_OPENDIR)
|
||||||
|
|
||||||
LIBSSH2_API ssize_t libssh2_sftp_read(LIBSSH2_SFTP_HANDLE *handle,
|
LIBSSH2_API ssize_t libssh2_sftp_read(LIBSSH2_SFTP_HANDLE *handle,
|
||||||
@@ -281,8 +282,9 @@ LIBSSH2_API int libssh2_sftp_rename_ex(LIBSSH2_SFTP *sftp,
|
|||||||
unsigned int dest_filename_len,
|
unsigned int dest_filename_len,
|
||||||
long flags);
|
long flags);
|
||||||
#define libssh2_sftp_rename(sftp, sourcefile, destfile) \
|
#define libssh2_sftp_rename(sftp, sourcefile, destfile) \
|
||||||
libssh2_sftp_rename_ex((sftp), (sourcefile), strlen(sourcefile), \
|
libssh2_sftp_rename_ex((sftp), \
|
||||||
(destfile), strlen(destfile), \
|
(sourcefile), (unsigned int)strlen(sourcefile), \
|
||||||
|
(destfile), (unsigned int)strlen(destfile), \
|
||||||
LIBSSH2_SFTP_RENAME_OVERWRITE | \
|
LIBSSH2_SFTP_RENAME_OVERWRITE | \
|
||||||
LIBSSH2_SFTP_RENAME_ATOMIC | \
|
LIBSSH2_SFTP_RENAME_ATOMIC | \
|
||||||
LIBSSH2_SFTP_RENAME_NATIVE)
|
LIBSSH2_SFTP_RENAME_NATIVE)
|
||||||
@@ -305,13 +307,13 @@ LIBSSH2_API int libssh2_sftp_mkdir_ex(LIBSSH2_SFTP *sftp,
|
|||||||
const char *path,
|
const char *path,
|
||||||
unsigned int path_len, long mode);
|
unsigned int path_len, long mode);
|
||||||
#define libssh2_sftp_mkdir(sftp, path, mode) \
|
#define libssh2_sftp_mkdir(sftp, path, mode) \
|
||||||
libssh2_sftp_mkdir_ex((sftp), (path), strlen(path), (mode))
|
libssh2_sftp_mkdir_ex((sftp), (path), (unsigned int)strlen(path), (mode))
|
||||||
|
|
||||||
LIBSSH2_API int libssh2_sftp_rmdir_ex(LIBSSH2_SFTP *sftp,
|
LIBSSH2_API int libssh2_sftp_rmdir_ex(LIBSSH2_SFTP *sftp,
|
||||||
const char *path,
|
const char *path,
|
||||||
unsigned int path_len);
|
unsigned int path_len);
|
||||||
#define libssh2_sftp_rmdir(sftp, path) \
|
#define libssh2_sftp_rmdir(sftp, path) \
|
||||||
libssh2_sftp_rmdir_ex((sftp), (path), strlen(path))
|
libssh2_sftp_rmdir_ex((sftp), (path), (unsigned int)strlen(path))
|
||||||
|
|
||||||
LIBSSH2_API int libssh2_sftp_stat_ex(LIBSSH2_SFTP *sftp,
|
LIBSSH2_API int libssh2_sftp_stat_ex(LIBSSH2_SFTP *sftp,
|
||||||
const char *path,
|
const char *path,
|
||||||
@@ -319,14 +321,14 @@ LIBSSH2_API int libssh2_sftp_stat_ex(LIBSSH2_SFTP *sftp,
|
|||||||
int stat_type,
|
int stat_type,
|
||||||
LIBSSH2_SFTP_ATTRIBUTES *attrs);
|
LIBSSH2_SFTP_ATTRIBUTES *attrs);
|
||||||
#define libssh2_sftp_stat(sftp, path, attrs) \
|
#define libssh2_sftp_stat(sftp, path, attrs) \
|
||||||
libssh2_sftp_stat_ex((sftp), (path), strlen(path), LIBSSH2_SFTP_STAT, \
|
libssh2_sftp_stat_ex((sftp), (path), (unsigned int)strlen(path), \
|
||||||
(attrs))
|
LIBSSH2_SFTP_STAT, (attrs))
|
||||||
#define libssh2_sftp_lstat(sftp, path, attrs) \
|
#define libssh2_sftp_lstat(sftp, path, attrs) \
|
||||||
libssh2_sftp_stat_ex((sftp), (path), strlen(path), LIBSSH2_SFTP_LSTAT, \
|
libssh2_sftp_stat_ex((sftp), (path), (unsigned int)strlen(path), \
|
||||||
(attrs))
|
LIBSSH2_SFTP_LSTAT, (attrs))
|
||||||
#define libssh2_sftp_setstat(sftp, path, attrs) \
|
#define libssh2_sftp_setstat(sftp, path, attrs) \
|
||||||
libssh2_sftp_stat_ex((sftp), (path), strlen(path), LIBSSH2_SFTP_SETSTAT, \
|
libssh2_sftp_stat_ex((sftp), (path), (unsigned int)strlen(path), \
|
||||||
(attrs))
|
LIBSSH2_SFTP_SETSTAT, (attrs))
|
||||||
|
|
||||||
LIBSSH2_API int libssh2_sftp_symlink_ex(LIBSSH2_SFTP *sftp,
|
LIBSSH2_API int libssh2_sftp_symlink_ex(LIBSSH2_SFTP *sftp,
|
||||||
const char *path,
|
const char *path,
|
||||||
@@ -335,13 +337,19 @@ LIBSSH2_API int libssh2_sftp_symlink_ex(LIBSSH2_SFTP *sftp,
|
|||||||
unsigned int target_len,
|
unsigned int target_len,
|
||||||
int link_type);
|
int link_type);
|
||||||
#define libssh2_sftp_symlink(sftp, orig, linkpath) \
|
#define libssh2_sftp_symlink(sftp, orig, linkpath) \
|
||||||
libssh2_sftp_symlink_ex((sftp), (orig), strlen(orig), (linkpath), \
|
libssh2_sftp_symlink_ex((sftp), \
|
||||||
strlen(linkpath), LIBSSH2_SFTP_SYMLINK)
|
(orig), (unsigned int)strlen(orig), \
|
||||||
|
(linkpath), (unsigned int)strlen(linkpath), \
|
||||||
|
LIBSSH2_SFTP_SYMLINK)
|
||||||
#define libssh2_sftp_readlink(sftp, path, target, maxlen) \
|
#define libssh2_sftp_readlink(sftp, path, target, maxlen) \
|
||||||
libssh2_sftp_symlink_ex((sftp), (path), strlen(path), (target), (maxlen), \
|
libssh2_sftp_symlink_ex((sftp), \
|
||||||
|
(path), (unsigned int)strlen(path), \
|
||||||
|
(target), (maxlen), \
|
||||||
LIBSSH2_SFTP_READLINK)
|
LIBSSH2_SFTP_READLINK)
|
||||||
#define libssh2_sftp_realpath(sftp, path, target, maxlen) \
|
#define libssh2_sftp_realpath(sftp, path, target, maxlen) \
|
||||||
libssh2_sftp_symlink_ex((sftp), (path), strlen(path), (target), (maxlen), \
|
libssh2_sftp_symlink_ex((sftp), \
|
||||||
|
(path), (unsigned int)strlen(path), \
|
||||||
|
(target), (maxlen), \
|
||||||
LIBSSH2_SFTP_REALPATH)
|
LIBSSH2_SFTP_REALPATH)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
Reference in New Issue
Block a user