minor bencode cleanup: (1) remove unused BENC_NULL (2) make tr_bencInit() a private static function in bencode.c
This commit is contained in:
parent
e16279d0f4
commit
8dd3e46450
|
@ -38,8 +38,6 @@
|
||||||
#include "ptrarray.h"
|
#include "ptrarray.h"
|
||||||
#include "utils.h" /* tr_new(), tr_free() */
|
#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);
|
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_bencParse()
|
||||||
**** tr_bencLoad()
|
**** tr_bencLoad()
|
||||||
|
|
|
@ -79,12 +79,6 @@ tr_benc * tr_bencDictFindFirst( tr_benc * dict, ... );
|
||||||
|
|
||||||
/* convenience functions for building tr_benc structures */
|
/* 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 ) \
|
#define tr_bencInitStr( a, b, c, d ) \
|
||||||
_tr_bencInitStr( (a), ( char * )(b), (c), (d) )
|
_tr_bencInitStr( (a), ( char * )(b), (c), (d) )
|
||||||
void _tr_bencInitStr( tr_benc * val, char * str, int len, int nofree );
|
void _tr_bencInitStr( tr_benc * val, char * str, int len, int nofree );
|
||||||
|
|
Loading…
Reference in New Issue