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:
Josh Elsasser 2007-07-18 17:25:42 +00:00
parent adc0d4ac92
commit 900aff7beb
6 changed files with 13 additions and 8 deletions

View File

@ -23,7 +23,9 @@
*****************************************************************************/
#include <ctype.h> /* isprint */
#include "transmission.h"
#include "trcompat.h"
static int charToInt( char character );

View File

@ -31,6 +31,7 @@
#include "transmission.h"
#include "http.h"
#include "net.h"
#include "trcompat.h"
#define HTTP_PORT 80 /* default http port 80 */
#define HTTP_TIMEOUT 60000 /* one minute http timeout */

View File

@ -240,7 +240,7 @@ ipc_initmsgs( void )
if( NULL != tree )
{
RB_INIT( &tree->msgs );
tree->def = NULL;
tree->def = (trd_msgfunc) NULL;
}
return tree;
@ -254,7 +254,7 @@ ipc_addmsg( struct ipc_funcs * tree, enum ipc_msg id, trd_msgfunc func )
assert( MSGVALID( id ) );
assert( IPC_MSG_VERSION != id );
bzero( &key, sizeof key );
memset( &key, 0, sizeof key );
key.id = id;
entry = RB_FIND( functree, &tree->msgs, &key );
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 );
if( NULL != msg && msg->minvers <= info->vers )
{
bzero( &key, sizeof key );
memset( &key, 0, sizeof key );
key.id = msg->id;
handler = RB_FIND( functree, &info->funcs->msgs, &key );
if( NULL != handler )
@ -1162,7 +1162,7 @@ ipc_ishandled( struct ipc_info * info, enum ipc_msg id )
assert( MSGVALID( id ) );
bzero( &key, sizeof key );
memset( &key, 0, sizeof key );
key.id = id;
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;
}
bzero( &key, sizeof key );
memset( &key, 0, sizeof key );
for( jj = 0; list->val.l.count > jj; 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;
return RB_FIND( msgtree, &tree, &key );
}

View File

@ -46,7 +46,7 @@ peertreekeycmp( tr_peertree_entry_t * aa, tr_peertree_entry_t * bb )
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
peertreeCount( tr_peertree_t * tree )

View File

@ -227,7 +227,7 @@ void tr_threadCreate( tr_thread_t * t,
B_NORMAL_PRIORITY, t );
resume_thread( t->thread );
#else
pthread_create( &t->thread, NULL, (void *) ThreadFunc, t );
pthread_create( &t->thread, NULL, (void * (*) (void *)) ThreadFunc, t );
#endif
}

View File

@ -26,11 +26,13 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <limits.h>
#include <stdarg.h>
#include "transmission.h"
#include "http.h"
#include "net.h"
#include "trcompat.h"
#include "upnp.h"
#include "xml.h"