changeset 11488:9c7ca8a8c4b8

[gaim-migrate @ 13730] Fix a bunch of compile warnings, and fix going offline actually disconnecting the account in SILC committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 10 Sep 2005 17:28:04 +0000
parents 4b021f78c1ed
children 63e339161d83
files src/protocols/silc/buddy.c src/protocols/silc/ops.c src/protocols/silc/silc.c src/protocols/silc/util.c
diffstat 4 files changed, 12 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/silc/buddy.c	Sat Sep 10 17:20:36 2005 +0000
+++ b/src/protocols/silc/buddy.c	Sat Sep 10 17:28:04 2005 +0000
@@ -858,7 +858,7 @@
 		unsigned char *verifyd;
 		SilcUInt32 verify_len;
 
-		silc_pkcs_alloc("rsa", &pkcs);
+		silc_pkcs_alloc((unsigned char*)"rsa", &pkcs);
 		verifyd = silc_attribute_get_verify_data(client_entry->attrs,
 							 FALSE, &verify_len);
 		if (verifyd && silc_pkcs_public_key_set(pkcs, client_entry->public_key)){
@@ -879,7 +879,7 @@
 
 		if (silc_pkcs_public_key_decode(serverpk.data, serverpk.data_len,
 						&public_key)) {
-			silc_pkcs_alloc("rsa", &pkcs);
+			silc_pkcs_alloc((unsigned char *)"rsa", &pkcs);
 			verifyd = silc_attribute_get_verify_data(client_entry->attrs,
 								 TRUE, &verify_len);
 			if (verifyd && silc_pkcs_public_key_set(pkcs, public_key)) {
@@ -928,7 +928,7 @@
 		g_snprintf(filename2, sizeof(filename2) - 1,
 			   "%s" G_DIR_SEPARATOR_S "vcard", filename);
 		if (vcard.full_name) {
-			tmp = silc_vcard_encode(&vcard, &len);
+			tmp = (char *)silc_vcard_encode(&vcard, &len);
 			silc_file_writefile(filename2, tmp, len);
 			silc_free(tmp);
 		}
@@ -939,7 +939,7 @@
 			g_snprintf(filename2, sizeof(filename2) - 1,
 				   "%s" G_DIR_SEPARATOR_S "status_message.mime",
 				   filename);
-			silc_file_writefile(filename2, message.mime,
+			silc_file_writefile(filename2, (char *)message.mime,
 					    message.mime_len);
 		}
 
@@ -949,7 +949,7 @@
 			g_snprintf(filename2, sizeof(filename2) - 1,
 				   "%s" G_DIR_SEPARATOR_S "extension.mime",
 				   filename);
-			silc_file_writefile(filename2, extension.mime,
+			silc_file_writefile(filename2, (char *)extension.mime,
 					    extension.mime_len);
 		}
 	}
--- a/src/protocols/silc/ops.c	Sat Sep 10 17:20:36 2005 +0000
+++ b/src/protocols/silc/ops.c	Sat Sep 10 17:28:04 2005 +0000
@@ -762,7 +762,7 @@
 
 	case SILC_COMMAND_CMODE:
 		if (cmd_context->argc == 3 &&
-		    !strcmp(cmd_context->argv[2], "+C"))
+		    !strcmp((char *)cmd_context->argv[2], "+C"))
 			sg->chpk = TRUE;
 		else
 			sg->chpk = FALSE;
@@ -1045,7 +1045,7 @@
 							!= SILC_LIST_END) {
 						SilcUInt32 name_len;
 						char *m = silc_client_chumode_char(umodes[i++]);
-						char *name = silc_channel_get_name(entry, &name_len);
+						char *name = (char *)silc_channel_get_name(entry, &name_len);
 						if (m)
 							silc_strncat(tmp, sizeof(tmp) - 1, m, strlen(m));
 						silc_strncat(tmp, sizeof(tmp) - 1, name, name_len);
@@ -1618,7 +1618,7 @@
 	}
 	password = gaim_connection_get_password(gc);
 	if (password && *password) {
-		completion(TRUE, SILC_AUTH_PASSWORD, password, strlen(password), context);
+		completion(TRUE, SILC_AUTH_PASSWORD, (unsigned char *)password, strlen(password), context);
 		return;
 	}
 
@@ -1832,7 +1832,7 @@
 	/* Save the detachment data to file. */
 	file = silcgaim_session_file(gaim_account_get_username(sg->account));
 	g_unlink(file);
-	silc_file_writefile(file, detach_data, detach_data_len);
+	silc_file_writefile(file, (char *)detach_data, detach_data_len);
 }
 
 SilcClientOperations ops = {
--- a/src/protocols/silc/silc.c	Sat Sep 10 17:20:36 2005 +0000
+++ b/src/protocols/silc/silc.c	Sat Sep 10 17:28:04 2005 +0000
@@ -87,7 +87,8 @@
 	if (strcmp(state, "offline") && !gc) {
 		gaim_account_connect(account);
 		return;
-	} else if (!strcmp(state, "offline")) {
+	} else if (!strcmp(state, "offline") && (gc != NULL)) {
+		gaim_account_disconnect(account);
 		return;
 	}
 
--- a/src/protocols/silc/util.c	Sat Sep 10 17:20:36 2005 +0000
+++ b/src/protocols/silc/util.c	Sat Sep 10 17:28:04 2005 +0000
@@ -300,7 +300,7 @@
 	fingerprint = silc_hash_fingerprint(NULL, pk, pk_len);
 	babbleprint = silc_hash_babbleprint(NULL, pk, pk_len);
 
-	if (silc_pkcs_alloc(public_key->name, &pkcs)) {
+	if (silc_pkcs_alloc((unsigned char *)public_key->name, &pkcs)) {
 		key_len = silc_pkcs_public_key_set(pkcs, public_key);
 		silc_pkcs_free(pkcs);
 	}