From: Gabriel VLASIU Date: Wed, 3 Apr 2013 15:42:40 +0000 (+0300) Subject: wmbiff: Fix signedness and/or cast. X-Git-Tag: wmix-3.2~45 X-Git-Url: https://repo.or.cz/w/dockapps.git/commitdiff_plain/7b53eab0b4952152811d75850c3504d82929f9b6 wmbiff: Fix signedness and/or cast. --- diff --git a/wmbiff/wmbiff/gnutls-common.c b/wmbiff/wmbiff/gnutls-common.c index 22eee10..d199d47 100644 --- a/wmbiff/wmbiff/gnutls-common.c +++ b/wmbiff/wmbiff/gnutls-common.c @@ -39,7 +39,7 @@ void print_x509_info(gnutls_session session, const char* hostname) { gnutls_x509_crt crt; const gnutls_datum *cert_list; - int cert_list_size = 0, ret; + unsigned int cert_list_size = 0, ret; char digest[20]; char serial[40]; char dn[256]; diff --git a/wmbiff/wmbiff/test_wmbiff.c b/wmbiff/wmbiff/test_wmbiff.c index 10ffea5..950cbb6 100644 --- a/wmbiff/wmbiff/test_wmbiff.c +++ b/wmbiff/wmbiff/test_wmbiff.c @@ -366,7 +366,7 @@ int test_sock_connect(void) { struct sockaddr_in addr; int s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - int addrlen = sizeof(struct sockaddr_in); + socklen_t addrlen = sizeof(struct sockaddr_in); if (s < 0) { perror("socket"); return 1; diff --git a/wmbiff/wmbiff/tlsComm.c b/wmbiff/wmbiff/tlsComm.c index f4896fe..05e6dd8 100644 --- a/wmbiff/wmbiff/tlsComm.c +++ b/wmbiff/wmbiff/tlsComm.c @@ -124,7 +124,7 @@ static int wait_for_it(int sd, int timeoutseconds) ProcessPendingEvents(); gettimeofday(&time_now, NULL); - tv.tv_sec = max(time_out.tv_sec - time_now.tv_sec + 1, 0); /* sloppy, but bfd */ + tv.tv_sec = max(time_out.tv_sec - time_now.tv_sec + 1, (time_t) 0); /* sloppy, but bfd */ tv.tv_usec = 0; /* select will return if we have X stuff or we have comm stuff on sd */ FD_ZERO(&readfds); @@ -295,6 +295,7 @@ void tlscomm_printf(struct connection_state *scs, const char *format, ...) va_list args; char buf[1024]; int bytes; + ssize_t unused __attribute__((unused)); if (scs == NULL) { DMA(DEBUG_ERROR, "null connection to tlscomm_printf\n"); @@ -316,7 +317,8 @@ void tlscomm_printf(struct connection_state *scs, const char *format, ...) } } else #endif - (void) write(scs->sd, buf, bytes); + /* Why???? */ + unused = write(scs->sd, buf, bytes); } else { printf ("warning: tlscomm_printf called with an invalid socket descriptor\n"); @@ -382,8 +384,8 @@ static int tls_compare_certificates(const gnutls_datum * peercert) return 0; } - ptr = (unsigned char *) strstr(b64_data.data, CERT_SEP) + 1; - ptr = (unsigned char *) strstr(ptr, CERT_SEP); + ptr = (unsigned char *) strstr((char *) b64_data.data, CERT_SEP) + 1; + ptr = (unsigned char *) strstr((char *) ptr, CERT_SEP); b64_data.size = b64_data.size - (ptr - b64_data.data); b64_data.data = ptr; @@ -412,7 +414,7 @@ tls_check_certificate(struct connection_state *scs, { int certstat; const gnutls_datum *cert_list; - int cert_list_size = 0; + unsigned int cert_list_size = 0; gnutls_x509_crt cert; if (gnutls_auth_get_type(scs->tls_state) != GNUTLS_CRD_CERTIFICATE) {