From: Jordan Lee Date: Sun, 8 Sep 2013 17:58:14 +0000 (+0000) Subject: fix a handful of CL warnings & errors in libtransmission. mikedld X-Git-Tag: 2.83~88 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0ba7c5f3cf9abf7555cce11e61f5155f9e8287cb;p=transmission fix a handful of CL warnings & errors in libtransmission. mikedld --- diff --git a/libtransmission/quark.h b/libtransmission/quark.h index d84268d10..87ba0d190 100644 --- a/libtransmission/quark.h +++ b/libtransmission/quark.h @@ -414,7 +414,7 @@ bool tr_quark_lookup (const void * str, size_t len, tr_quark * setme); /** * Get the string that corresponds to the specified quark */ -const char * tr_quark_get_string (const tr_quark quark, size_t * len); +const char * tr_quark_get_string (tr_quark quark, size_t * len); /** * Create a new quark for the specified string. If a quark already diff --git a/libtransmission/rpcimpl.c b/libtransmission/rpcimpl.c index 10d3c78fe..85d8951d3 100644 --- a/libtransmission/rpcimpl.c +++ b/libtransmission/rpcimpl.c @@ -900,8 +900,8 @@ addInfo (tr_torrent * tor, tr_variant * d, tr_variant * fields) if (n > 0) { int i; - const tr_info const * inf = tr_torrentInfo (tor); - const tr_stat const * st = tr_torrentStat ((tr_torrent*)tor); + const tr_info * const inf = tr_torrentInfo (tor); + const tr_stat * const st = tr_torrentStat ((tr_torrent*)tor); for (i=0; iinfo.hashString)]; - char query[lpd_maxDatagramLength + 1] = { }; + char query[lpd_maxDatagramLength + 1] = { 0 }; if (t == NULL) return false; @@ -499,8 +499,8 @@ static int tr_lpdConsiderAnnounce (tr_pex* peer, const char* const msg) }; struct lpd_protocolVersion ver = { -1, -1 }; - char value[maxValueLen] = { }; - char hashString[maxHashLen] = { }; + char value[maxValueLen] = { 0 }; + char hashString[maxHashLen] = { 0 }; int res = 0, peerPort = 0; if (peer != NULL && msg != NULL) @@ -644,7 +644,7 @@ static void event_callback (evutil_socket_t s UNUSED, short type, void* ignore U int addrLen = sizeof foreignAddr; /* be paranoid enough about zero terminating the foreign string */ - char foreignMsg[lpd_maxDatagramLength + 1] = { }; + char foreignMsg[lpd_maxDatagramLength + 1] = { 0 }; /* process local announcement from foreign peer */ int res = recvfrom (lpd_socket, foreignMsg, lpd_maxDatagramLength,