[Pkg-privacy-commits] [libotr] 63/225: Make compilation clean with -Wall

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 12:44:55 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository libotr.

commit 8a66d775073ee01de65daf04ddf307b525c77dcb
Author: Ian Goldberg <iang at cs.uwaterloo.ca>
Date:   Thu May 3 18:19:59 2012 -0400

    Make compilation clean with -Wall
    
    Most imporantly, otrl_instag_get_new() wasn't returning the value it
    computed!
---
 src/auth.c    | 6 ++----
 src/auth.h    | 6 ++----
 src/instag.c  | 3 ++-
 src/message.c | 1 -
 src/proto.c   | 5 ++---
 5 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/src/auth.c b/src/auth.c
index e3fad2e..9dd2733 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -1389,8 +1389,7 @@ err:
  * instance. The fields copied will depend on the state of the
  * master auth.
  */
-gcry_error_t otrl_auth_copy_on_commit(OtrlAuthInfo *m_auth,
-	OtrlAuthInfo *auth)
+void otrl_auth_copy_on_commit(OtrlAuthInfo *m_auth, OtrlAuthInfo *auth)
 {
     switch(m_auth->authstate) {
 	case OTRL_AUTHSTATE_NONE:
@@ -1425,8 +1424,7 @@ gcry_error_t otrl_auth_copy_on_commit(OtrlAuthInfo *m_auth,
  * instance. The fields copied will depend on the state of the
  * master auth.
  */
-gcry_error_t otrl_auth_copy_on_key(OtrlAuthInfo *m_auth,
-	OtrlAuthInfo *auth)
+void otrl_auth_copy_on_key(OtrlAuthInfo *m_auth, OtrlAuthInfo *auth)
 {
     switch(m_auth->authstate) {
 	case OTRL_AUTHSTATE_AWAITING_DHKEY:
diff --git a/src/auth.h b/src/auth.h
index ee69ade..adaba6a 100644
--- a/src/auth.h
+++ b/src/auth.h
@@ -165,8 +165,7 @@ gcry_error_t otrl_auth_handle_v1_key_exchange(OtrlAuthInfo *auth,
  * instance. The fields copied will depend on the state of the
  * master auth.
  */
-gcry_error_t otrl_auth_copy_on_commit(OtrlAuthInfo *m_auth,
-	OtrlAuthInfo *auth);
+void otrl_auth_copy_on_commit(OtrlAuthInfo *m_auth, OtrlAuthInfo *auth);
 
 /*
  * Copy relevant information from the master OtrlAuthInfo to an
@@ -174,7 +173,6 @@ gcry_error_t otrl_auth_copy_on_commit(OtrlAuthInfo *m_auth,
  * instance. The fields copied will depend on the state of the
  * master auth.
  */
-gcry_error_t otrl_auth_copy_on_key(OtrlAuthInfo *m_auth,
-	OtrlAuthInfo *auth);
+void otrl_auth_copy_on_key(OtrlAuthInfo *m_auth, OtrlAuthInfo *auth);
 
 #endif
diff --git a/src/instag.c b/src/instag.c
index a17f774..6960005 100644
--- a/src/instag.c
+++ b/src/instag.c
@@ -100,7 +100,6 @@ gcry_error_t otrl_instag_read_FILEp(OtrlUserState us, FILE *instf)
 	char *prevpos;
 	char *pos;
 	unsigned int instag = 0;
-	int i;
 
 	p = malloc(sizeof(*p));
 	if (!p) {
@@ -195,6 +194,8 @@ otrl_instag_t otrl_instag_get_new()
 	result = *instag;
 	gcry_free(instag);
     }
+
+    return result;
 }
 
 /* Generate a new instance tag for the given account and write to file
diff --git a/src/message.c b/src/message.c
index 7f6112d..c929583 100644
--- a/src/message.c
+++ b/src/message.c
@@ -109,7 +109,6 @@ static gcry_error_t fragment_and_send(const OtrlMessageAppOps *ops,
 			context->protocol, context->username, message);
 	    } else {
 		/* Copy and return the entire given message. */
-		int l = strlen(message) + 1;
 		*returnFragment = strdup(message);
 	    }
 	}
diff --git a/src/proto.c b/src/proto.c
index 7fbc83a..051f47d 100644
--- a/src/proto.c
+++ b/src/proto.c
@@ -279,7 +279,6 @@ unsigned int otrl_proto_query_bestversion(const char *otrquerymsg,
 {
     char *otrtag;
     unsigned int query_versions = 0;
-    unsigned int query_position = 0;
 
 
     otrtag = strstr(otrquerymsg, "?OTR");
@@ -430,7 +429,7 @@ int otrl_proto_message_version(const char *message)
 gcry_error_t otrl_proto_instance(const char *otrmsg,
 	unsigned int *instance_from, unsigned int *instance_to)
 {
-    gcry_error_t err;
+    gcry_error_t err = gcry_error(GPG_ERR_NO_ERROR);
 
     const char *otrtag = otrmsg;
     unsigned char *bufp = NULL;
@@ -882,7 +881,7 @@ OtrlFragmentResult otrl_proto_fragment_accumulate(char **unfragmessagep,
     tag = strstr(msg, "?OTR|");
     if (tag) {
 	sscanf(tag, "?OTR|%*x|%*x,%hu,%hu,%n%*[^,],%n", &k, &n, &start, &end);
-    } else if (tag = strstr(msg, "?OTR,")) {
+    } else if ((tag = strstr(msg, "?OTR,")) != NULL) {
 	sscanf(tag, "?OTR,%hu,%hu,%n%*[^,],%n", &k, &n, &start, &end);
     } else {
 	/* Unfragmented message, so discard any fragment we may have */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/libotr.git



More information about the Pkg-privacy-commits mailing list