Include trcompat.h for asprintf()
Don't mix function and non function pointers without casting. Replace a couple bzero()s with memset()s. Remove a stray ; Include a missing header.
This commit is contained in:
parent
adc0d4ac92
commit
900aff7beb
|
@ -23,7 +23,9 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include <ctype.h> /* isprint */
|
#include <ctype.h> /* isprint */
|
||||||
|
|
||||||
#include "transmission.h"
|
#include "transmission.h"
|
||||||
|
#include "trcompat.h"
|
||||||
|
|
||||||
static int charToInt( char character );
|
static int charToInt( char character );
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include "transmission.h"
|
#include "transmission.h"
|
||||||
#include "http.h"
|
#include "http.h"
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
|
#include "trcompat.h"
|
||||||
|
|
||||||
#define HTTP_PORT 80 /* default http port 80 */
|
#define HTTP_PORT 80 /* default http port 80 */
|
||||||
#define HTTP_TIMEOUT 60000 /* one minute http timeout */
|
#define HTTP_TIMEOUT 60000 /* one minute http timeout */
|
||||||
|
|
|
@ -240,7 +240,7 @@ ipc_initmsgs( void )
|
||||||
if( NULL != tree )
|
if( NULL != tree )
|
||||||
{
|
{
|
||||||
RB_INIT( &tree->msgs );
|
RB_INIT( &tree->msgs );
|
||||||
tree->def = NULL;
|
tree->def = (trd_msgfunc) NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return tree;
|
return tree;
|
||||||
|
@ -254,7 +254,7 @@ ipc_addmsg( struct ipc_funcs * tree, enum ipc_msg id, trd_msgfunc func )
|
||||||
assert( MSGVALID( id ) );
|
assert( MSGVALID( id ) );
|
||||||
assert( IPC_MSG_VERSION != id );
|
assert( IPC_MSG_VERSION != id );
|
||||||
|
|
||||||
bzero( &key, sizeof key );
|
memset( &key, 0, sizeof key );
|
||||||
key.id = id;
|
key.id = id;
|
||||||
entry = RB_FIND( functree, &tree->msgs, &key );
|
entry = RB_FIND( functree, &tree->msgs, &key );
|
||||||
assert( NULL == entry );
|
assert( NULL == entry );
|
||||||
|
@ -1114,7 +1114,7 @@ gotmsg( struct ipc_info * info, benc_val_t * name, benc_val_t * val,
|
||||||
msg = msglookup( name->val.s.s );
|
msg = msglookup( name->val.s.s );
|
||||||
if( NULL != msg && msg->minvers <= info->vers )
|
if( NULL != msg && msg->minvers <= info->vers )
|
||||||
{
|
{
|
||||||
bzero( &key, sizeof key );
|
memset( &key, 0, sizeof key );
|
||||||
key.id = msg->id;
|
key.id = msg->id;
|
||||||
handler = RB_FIND( functree, &info->funcs->msgs, &key );
|
handler = RB_FIND( functree, &info->funcs->msgs, &key );
|
||||||
if( NULL != handler )
|
if( NULL != handler )
|
||||||
|
@ -1162,7 +1162,7 @@ ipc_ishandled( struct ipc_info * info, enum ipc_msg id )
|
||||||
|
|
||||||
assert( MSGVALID( id ) );
|
assert( MSGVALID( id ) );
|
||||||
|
|
||||||
bzero( &key, sizeof key );
|
memset( &key, 0, sizeof key );
|
||||||
key.id = id;
|
key.id = id;
|
||||||
return ( NULL != RB_FIND( functree, &info->funcs->msgs, &key ) );
|
return ( NULL != RB_FIND( functree, &info->funcs->msgs, &key ) );
|
||||||
}
|
}
|
||||||
|
@ -1218,7 +1218,7 @@ ipc_infotypes( enum ipc_msg id, benc_val_t * list )
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bzero( &key, sizeof key );
|
memset( &key, 0, sizeof key );
|
||||||
for( jj = 0; list->val.l.count > jj; jj++ )
|
for( jj = 0; list->val.l.count > jj; jj++ )
|
||||||
{
|
{
|
||||||
name = &list->val.l.vals[jj];
|
name = &list->val.l.vals[jj];
|
||||||
|
@ -1302,7 +1302,7 @@ msglookup( const char * name )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bzero( &key, sizeof key );
|
memset( &key, 0, sizeof key );
|
||||||
key.name = name;
|
key.name = name;
|
||||||
return RB_FIND( msgtree, &tree, &key );
|
return RB_FIND( msgtree, &tree, &key );
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ peertreekeycmp( tr_peertree_entry_t * aa, tr_peertree_entry_t * bb )
|
||||||
return memcmp( aa->peer, bb->peer, 6 );
|
return memcmp( aa->peer, bb->peer, 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
RB_GENERATE_STATIC( tr_peertree_s, tr_peertree_entry_s, magic, peertreekeycmp );
|
RB_GENERATE_STATIC( tr_peertree_s, tr_peertree_entry_s, magic, peertreekeycmp )
|
||||||
|
|
||||||
static int
|
static int
|
||||||
peertreeCount( tr_peertree_t * tree )
|
peertreeCount( tr_peertree_t * tree )
|
||||||
|
|
|
@ -227,7 +227,7 @@ void tr_threadCreate( tr_thread_t * t,
|
||||||
B_NORMAL_PRIORITY, t );
|
B_NORMAL_PRIORITY, t );
|
||||||
resume_thread( t->thread );
|
resume_thread( t->thread );
|
||||||
#else
|
#else
|
||||||
pthread_create( &t->thread, NULL, (void *) ThreadFunc, t );
|
pthread_create( &t->thread, NULL, (void * (*) (void *)) ThreadFunc, t );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,11 +26,13 @@
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
#include <limits.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#include "transmission.h"
|
#include "transmission.h"
|
||||||
#include "http.h"
|
#include "http.h"
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
|
#include "trcompat.h"
|
||||||
#include "upnp.h"
|
#include "upnp.h"
|
||||||
#include "xml.h"
|
#include "xml.h"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue