2005-05-17 Mikael Hallendal <micke@imendio.com>
* loudmouth/lm-ssl.c:
* loudmouth/lm-connection.c:
* loudmouth/lm-proxy.c:
- Fixed some gcc 4.0 warnings.
* loudmouth/lm-ssl.[ch]: Made the API more consistent.
* examples/test-lm.c: Fixed some gcc 4.0 warnings.
--- a/ChangeLog Fri May 13 19:27:54 2005 +0000
+++ b/ChangeLog Mon May 16 23:32:19 2005 +0000
@@ -1,3 +1,12 @@
+2005-05-17 Mikael Hallendal <micke@imendio.com>
+
+ * loudmouth/lm-ssl.c:
+ * loudmouth/lm-connection.c:
+ * loudmouth/lm-proxy.c:
+ - Fixed some gcc 4.0 warnings.
+ * loudmouth/lm-ssl.[ch]: Made the API more consistent.
+ * examples/test-lm.c: Fixed some gcc 4.0 warnings.
+
2005-05-13 Mikael Hallendal <micke@imendio.com>
* loudmouth/lm-ssl.c: (_lm_ssl_read):
--- a/examples/test-lm.c Fri May 13 19:27:54 2005 +0000
+++ b/examples/test-lm.c Mon May 16 23:32:19 2005 +0000
@@ -43,15 +43,18 @@
g_free (info);
}
-static unsigned char expected_fingerprint[20];
+static char expected_fingerprint[20];
static void
-print_finger (const unsigned char *fpr, unsigned int size)
+print_finger (const char *fpr, unsigned int size)
{
gint i;
- for (i = 0; i < size-1; i++)
- g_print ("%02X:", (unsigned char) fpr[i]);
- g_print ("%02X", (unsigned char) fpr[size-1]);
+
+ for (i = 0; i < size-1; i++) {
+ g_print ("%02X:", fpr[i]);
+ }
+
+ g_print ("%02X", fpr[size-1]);
}
static LmSSLResponse
@@ -75,7 +78,7 @@
g_print ("Certificate hostname does not match expected hostname!\n");
break;
case LM_SSL_STATUS_CERT_FINGERPRINT_MISMATCH: {
- const unsigned char *fpr = lm_ssl_get_fingerprint (ssl);
+ const char *fpr = lm_ssl_get_fingerprint (ssl);
g_print ("Certificate fingerprint does not match expected fingerprint!\n");
g_print ("Remote fingerprint: ");
print_finger (fpr, 16);
--- a/loudmouth/lm-connection.c Fri May 13 19:27:54 2005 +0000
+++ b/loudmouth/lm-connection.c Mon May 16 23:32:19 2005 +0000
@@ -447,7 +447,7 @@
{
LmConnectData *connect_data;
int error;
- int len = sizeof(error);
+ guint len = sizeof(error);
connect_data = (LmConnectData *) data;
@@ -773,14 +773,14 @@
buf[bytes_read] = '\0';
g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET, "\nRECV [%d]:\n",
- bytes_read);
+ (int)bytes_read);
g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET,
"-----------------------------------\n");
g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET, "'%s'\n", buf);
g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET,
"-----------------------------------\n");
- lm_verbose ("Read: %d chars\n", bytes_read);
+ lm_verbose ("Read: %d chars\n", (int)bytes_read);
lm_parser_parse (connection->parser, buf);
--- a/loudmouth/lm-proxy.c Fri May 13 19:27:54 2005 +0000
+++ b/loudmouth/lm-proxy.c Mon May 16 23:32:19 2005 +0000
@@ -187,7 +187,7 @@
LmConnectData *connect_data;
LmProxy *proxy;
int error;
- int len = sizeof(error);
+ guint len = sizeof(error);
connect_data = (LmConnectData *) data;
connection = connect_data->connection;
--- a/loudmouth/lm-ssl.c Fri May 13 19:27:54 2005 +0000
+++ b/loudmouth/lm-ssl.c Mon May 16 23:32:19 2005 +0000
@@ -93,8 +93,8 @@
if (gnutls_certificate_type_get (ssl->gnutls_session) == GNUTLS_CRT_X509) {
const gnutls_datum* cert_list;
- int cert_list_size;
- int digest_size;
+ guint cert_list_size;
+ size_t digest_size;
gnutls_x509_crt cert;
cert_list = gnutls_certificate_get_peers (ssl->gnutls_session, &cert_list_size);
@@ -323,12 +323,12 @@
*
* Return value: A 16-byte array representing the fingerprint or %NULL if unknown.
**/
-const unsigned char *
+const gchar *
lm_ssl_get_fingerprint (LmSSL *ssl)
{
g_return_val_if_fail (ssl != NULL, NULL);
- return (unsigned char*) ssl->fingerprint;
+ return ssl->fingerprint;
}
/**
--- a/loudmouth/lm-ssl.h Fri May 13 19:27:54 2005 +0000
+++ b/loudmouth/lm-ssl.h Mon May 16 23:32:19 2005 +0000
@@ -49,9 +49,9 @@
LM_SSL_RESPONSE_STOP,
} LmSSLResponse;
-typedef LmSSLResponse (* LmSSLFunction) (LmSSL *ssl,
- LmSSLStatus status,
- gpointer user_data);
+typedef LmSSLResponse (* LmSSLFunction) (LmSSL *ssl,
+ LmSSLStatus status,
+ gpointer user_data);
LmSSL * lm_ssl_new (const gchar *expected_fingerprint,
LmSSLFunction ssl_function,
@@ -60,7 +60,7 @@
gboolean lm_ssl_is_supported (void);
-const unsigned char * lm_ssl_get_fingerprint (LmSSL *ssl);
+const gchar * lm_ssl_get_fingerprint (LmSSL *ssl);
LmSSL * lm_ssl_ref (LmSSL *ssl);