1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 16:52:39 +00:00

fix a handful of CL warnings & errors in libtransmission. mikedld

This commit is contained in:
Jordan Lee 2013-09-08 17:58:14 +00:00
parent 677769a462
commit 0ba7c5f3cf
3 changed files with 8 additions and 8 deletions

View file

@ -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

View file

@ -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; i<n; ++i)
{

View file

@ -216,7 +216,7 @@ static int lpd_extractParam (const char* const str, const char* const name, int
{
/* configure maximum length of search string here */
enum { maxLength = 30 };
char sstr[maxLength] = { };
char sstr[maxLength] = { 0 };
const char* pos;
assert (str != NULL && name != NULL);
@ -445,7 +445,7 @@ tr_lpdSendAnnounce (const tr_torrent* t)
CRLF;
char hashString[lengthof (t->info.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,