diff options
| author | Andreas Schneider <mail@cynapses.org> | 2009-02-02 16:09:38 +0000 |
|---|---|---|
| committer | Andreas Schneider <mail@cynapses.org> | 2009-02-02 16:09:38 +0000 |
| commit | 974a160fd31c10852e9bb811d14a33cff1bae7c4 (patch) | |
| tree | 4bda1914a6a8f141a4faf57014cf54a868a0c0f2 /libssh | |
| parent | 5e03a95a937c8c64e4bfab8f796d88a4168857bd (diff) | |
| download | libssh-974a160fd31c10852e9bb811d14a33cff1bae7c4.tar.gz libssh-974a160fd31c10852e9bb811d14a33cff1bae7c4.tar.xz libssh-974a160fd31c10852e9bb811d14a33cff1bae7c4.zip | |
Fix several build warnings.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@214 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh')
| -rw-r--r-- | libssh/init.c | 2 | ||||
| -rw-r--r-- | libssh/kex.c | 2 | ||||
| -rw-r--r-- | libssh/keyfiles.c | 3 | ||||
| -rw-r--r-- | libssh/keys.c | 6 | ||||
| -rw-r--r-- | libssh/match.c | 14 | ||||
| -rw-r--r-- | libssh/messages.c | 16 | ||||
| -rw-r--r-- | libssh/misc.c | 7 | ||||
| -rw-r--r-- | libssh/options.c | 2 |
8 files changed, 28 insertions, 24 deletions
diff --git a/libssh/init.c b/libssh/init.c index 1b48a407..fd5919a0 100644 --- a/libssh/init.c +++ b/libssh/init.c @@ -33,7 +33,7 @@ MA 02111-1307, USA. */ * \brief finalize and cleanup all libssh and cryptographic data structures * \returns 0 */ -int ssh_finalize() +int ssh_finalize(void) { ssh_crypto_finalize(); #ifdef HAVE_LIBGCRYPT diff --git a/libssh/kex.c b/libssh/kex.c index b5a2f633..c1260077 100644 --- a/libssh/kex.c +++ b/libssh/kex.c @@ -348,7 +348,7 @@ static int modulus_smaller(PUBLIC_KEY *k1, PUBLIC_KEY *k2){ } #define ABS(A) ( (A)<0 ? -(A):(A) ) -STRING *encrypt_session_key(SSH_SESSION *session, PUBLIC_KEY *svrkey, +static STRING *encrypt_session_key(SSH_SESSION *session, PUBLIC_KEY *svrkey, PUBLIC_KEY *hostkey,int slen, int hlen ){ unsigned char buffer[32]; int i; diff --git a/libssh/keyfiles.c b/libssh/keyfiles.c index d1bb9197..45cb42a4 100644 --- a/libssh/keyfiles.c +++ b/libssh/keyfiles.c @@ -466,6 +466,9 @@ int read_dsa_privatekey(FILE *fp, gcry_sexp_t *r, ssh_auth_callback cb, void *us static int pem_get_password(char *buf, int size, int rwflag, void *userdata) { SSH_SESSION *session = userdata; + /* unused flag */ + (void) rwflag; + ZERO_STRUCTP(buf); if (session && session->options->auth_function) { diff --git a/libssh/keys.c b/libssh/keys.c index a40b0df3..2b981ac6 100644 --- a/libssh/keys.c +++ b/libssh/keys.c @@ -360,7 +360,7 @@ STRING *publickey_to_string(PUBLIC_KEY *key){ /* Signature decoding functions */ -STRING *signature_to_string(SIGNATURE *sign){ +static STRING *signature_to_string(SIGNATURE *sign){ STRING *str; STRING *rs; #ifdef HAVE_LIBGCRYPT @@ -692,6 +692,10 @@ STRING *ssh_encrypt_rsa1(SSH_SESSION *session, STRING *data, PUBLIC_KEY *key){ RSA_public_encrypt(len,data->string,ret->string,key->rsa_pub, RSA_PKCS1_PADDING); #endif + + /* unused member variable */ + (void) session; + return ret; } diff --git a/libssh/match.c b/libssh/match.c index cd2fc45a..83600065 100644 --- a/libssh/match.c +++ b/libssh/match.c @@ -43,9 +43,7 @@ * and * as wildcards), and zero if it does not match. */ -int -match_pattern(const char *s, const char *pattern) -{ +static int match_pattern(const char *s, const char *pattern) { for (;;) { /* If at end of pattern, accept if also at end of string. */ if (!*pattern) @@ -108,10 +106,8 @@ match_pattern(const char *s, const char *pattern) * a positive match, 0 if there is no match at all. */ -int -match_pattern_list(const char *string, const char *pattern, u_int len, - int dolower) -{ +static int match_pattern_list(const char *string, const char *pattern, + u_int len, int dolower) { char sub[1024]; int negated; int got_positive; @@ -168,8 +164,6 @@ match_pattern_list(const char *string, const char *pattern, u_int len, * indicate negation). Returns -1 if negation matches, 1 if there is * a positive match, 0 if there is no match at all. */ -int -match_hostname(const char *host, const char *pattern, u_int len) -{ +static int match_hostname(const char *host, const char *pattern, u_int len) { return match_pattern_list(host, pattern, len, 1); } diff --git a/libssh/messages.c b/libssh/messages.c index c70a56e0..8df682b7 100644 --- a/libssh/messages.c +++ b/libssh/messages.c @@ -169,11 +169,13 @@ int ssh_message_auth_reply_success(SSH_MESSAGE *msg,int partial){ } static SSH_MESSAGE *handle_channel_request_open(SSH_SESSION *session){ - enter_function(); - SSH_MESSAGE *msg=message_new(session); + SSH_MESSAGE *msg; STRING *type; char *type_c; - u32 sender,window,packet; + u32 sender, window, packet; + + enter_function(); + msg=message_new(session); msg->type=SSH_CHANNEL_REQUEST_OPEN; type=buffer_get_ssh_string(session->in_buffer); type_c=string_to_char(type); @@ -198,9 +200,11 @@ static SSH_MESSAGE *handle_channel_request_open(SSH_SESSION *session){ } CHANNEL *ssh_message_channel_request_open_reply_accept(SSH_MESSAGE *msg){ - SSH_SESSION *session=msg->session; - enter_function(); - CHANNEL *chan=channel_new(session); + SSH_SESSION *session=msg->session; + CHANNEL *chan; + + enter_function(); + chan=channel_new(session); chan->local_channel=ssh_channel_new_id(session); chan->local_maxpacket=35000; chan->local_window=32000; diff --git a/libssh/misc.c b/libssh/misc.c index 0ec37b2b..cd3f1cbb 100644 --- a/libssh/misc.c +++ b/libssh/misc.c @@ -36,10 +36,10 @@ MA 02111-1307, USA. */ #include <pwd.h> #endif -#include "libssh/libssh.h" +#include "libssh/priv.h" #ifndef _WIN32 -char *ssh_get_user_home_dir(){ +char *ssh_get_user_home_dir(void) { static char szPath[PATH_MAX] = {0}; struct passwd *pwd = NULL; @@ -55,7 +55,7 @@ char *ssh_get_user_home_dir(){ #else /* _WIN32 */ -char *ssh_get_user_home_dir(){ +char *ssh_get_user_home_dir(void) { static char szPath[MAX_PATH]; if (SHGetSpecialFolderPathA(NULL, szPath, CSIDL_PROFILE, TRUE)) return szPath; @@ -72,7 +72,6 @@ int ssh_file_readaccess_ok(char *file){ return 0; } - u64 ntohll(u64 a){ #ifdef WORDS_BIGENDIAN return a; diff --git a/libssh/options.c b/libssh/options.c index 9de84ad4..1d6a081a 100644 --- a/libssh/options.c +++ b/libssh/options.c @@ -45,7 +45,7 @@ MA 02111-1307, USA. */ * \see ssh_options_getopt() */ -SSH_OPTIONS *ssh_options_new(){ +SSH_OPTIONS *ssh_options_new(void) { SSH_OPTIONS *option=malloc(sizeof(SSH_OPTIONS)); memset(option,0,sizeof(SSH_OPTIONS)); option->port=22; /* set the default port */ |
