Browse Source

C++ fixes

pull/26/head
Luca Deri 7 years ago
parent
commit
ae815c22e2
  1. 8
      n2n.c
  2. 4
      n2n.h

8
n2n.c

@ -279,11 +279,11 @@ size_t peer_list_size(const struct peer_info * list)
* insertion. list takes ownership of new. * insertion. list takes ownership of new.
*/ */
void peer_list_add(struct peer_info * * list, void peer_list_add(struct peer_info * * list,
struct peer_info * new) struct peer_info * newp)
{ {
new->next = *list; newp->next = *list;
new->last_seen = time(NULL); newp->last_seen = time(NULL);
*list = new; *list = newp;
} }

4
n2n.h

@ -220,11 +220,13 @@ struct n2n_edge {
/* ************************************** */ /* ************************************** */
#ifndef TRACE_ERROR
#define TRACE_ERROR 0, __FILE__, __LINE__ #define TRACE_ERROR 0, __FILE__, __LINE__
#define TRACE_WARNING 1, __FILE__, __LINE__ #define TRACE_WARNING 1, __FILE__, __LINE__
#define TRACE_NORMAL 2, __FILE__, __LINE__ #define TRACE_NORMAL 2, __FILE__, __LINE__
#define TRACE_INFO 3, __FILE__, __LINE__ #define TRACE_INFO 3, __FILE__, __LINE__
#define TRACE_DEBUG 4, __FILE__, __LINE__ #define TRACE_DEBUG 4, __FILE__, __LINE__
#endif
/* ************************************** */ /* ************************************** */
@ -281,7 +283,7 @@ void print_n2n_version();
struct peer_info * find_peer_by_mac( struct peer_info * list, struct peer_info * find_peer_by_mac( struct peer_info * list,
const n2n_mac_t mac ); const n2n_mac_t mac );
void peer_list_add( struct peer_info * * list, void peer_list_add( struct peer_info * * list,
struct peer_info * new ); struct peer_info * newp );
size_t peer_list_size( const struct peer_info * list ); size_t peer_list_size( const struct peer_info * list );
size_t purge_peer_list( struct peer_info ** peer_list, size_t purge_peer_list( struct peer_info ** peer_list,
time_t purge_before ); time_t purge_before );

Loading…
Cancel
Save