1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

minor bencode cleanup: (1) remove unused BENC_NULL (2) make tr_bencInit() a private static function in bencode.c

This commit is contained in:
Charles Kerr 2008-06-19 02:53:57 +00:00
parent e16279d0f4
commit 8dd3e46450
2 changed files with 8 additions and 8 deletions

View file

@ -38,8 +38,6 @@
#include "ptrarray.h"
#include "utils.h" /* tr_new(), tr_free() */
const tr_benc BENC_NULL = { 0, { 0 } };
/**
***
**/
@ -61,6 +59,14 @@ isSomething( const tr_benc * val )
return isContainer(val) || tr_bencIsInt(val) || tr_bencIsString(val);
}
static void
tr_bencInit( tr_benc * val, int type )
{
memset( val, 0, sizeof( *val ) );
val->type = type;
}
/***
**** tr_bencParse()
**** tr_bencLoad()

View file

@ -79,12 +79,6 @@ tr_benc * tr_bencDictFindFirst( tr_benc * dict, ... );
/* convenience functions for building tr_benc structures */
static inline void tr_bencInit( tr_benc * val, int type )
{
memset( val, 0, sizeof( *val ) );
val->type = type;
}
#define tr_bencInitStr( a, b, c, d ) \
_tr_bencInitStr( (a), ( char * )(b), (c), (d) )
void _tr_bencInitStr( tr_benc * val, char * str, int len, int nofree );