Merge pull request #669 from alexandervdm/master

fix 'typedef redefinition' build errors on older gcc versions
This commit is contained in:
irungentoo 2013-12-02 07:03:27 -08:00
commit b6a5aa38c6
5 changed files with 17 additions and 22 deletions

View File

@ -133,24 +133,21 @@ typedef struct {
uint64_t timestamp; uint64_t timestamp;
} pinged_t; } pinged_t;
typedef struct PING PING;
typedef struct Assoc Assoc;
typedef struct { typedef struct {
Net_Crypto *c; Net_Crypto *c;
Client_data close_clientlist[LCLIENT_LIST]; Client_data close_clientlist[LCLIENT_LIST];
uint64_t close_lastgetnodes; uint64_t close_lastgetnodes;
DHT_Friend *friends_list; DHT_Friend *friends_list;
uint16_t num_friends; uint16_t num_friends;
pinged_t send_nodes[LSEND_NODES_ARRAY]; pinged_t send_nodes[LSEND_NODES_ARRAY];
PING *ping; struct PING *ping;
Assoc *assoc; struct Assoc *assoc;
uint64_t last_run; uint64_t last_run;
} DHT; } DHT;
/*----------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------*/

View File

@ -81,7 +81,8 @@ typedef struct Client_entry {
typedef struct candidates_bucket { typedef struct candidates_bucket {
Client_entry *list; /* hashed list */ Client_entry *list; /* hashed list */
} candidates_bucket; } candidates_bucket;
typedef struct Assoc {
struct Assoc {
hash_t self_hash; /* hash of self_client_id */ hash_t self_hash; /* hash of self_client_id */
uint8_t self_client_id[CLIENT_ID_SIZE]; /* don't store entries for this */ uint8_t self_client_id[CLIENT_ID_SIZE]; /* don't store entries for this */
@ -90,7 +91,7 @@ typedef struct Assoc {
size_t candidates_bucket_count; size_t candidates_bucket_count;
size_t candidates_bucket_size; size_t candidates_bucket_size;
candidates_bucket *candidates; candidates_bucket *candidates;
} Assoc; };
/*****************************************************************************/ /*****************************************************************************/
/* HELPER FUNCTIONS */ /* HELPER FUNCTIONS */

View File

@ -12,7 +12,6 @@
* for a potential future use * for a potential future use
*/ */
typedef struct IP_Port IP_Port;
typedef struct Assoc Assoc; typedef struct Assoc Assoc;
/*****************************************************************************/ /*****************************************************************************/

View File

@ -27,8 +27,6 @@
#include "net_crypto.h" #include "net_crypto.h"
typedef struct Assoc Assoc;
#define MAX_NICK_BYTES 128 #define MAX_NICK_BYTES 128
typedef struct { typedef struct {
@ -70,11 +68,11 @@ typedef struct Group_Chat {
uint64_t last_sent_ping; uint64_t last_sent_ping;
uint8_t nick[MAX_NICK_BYTES]; uint8_t nick[MAX_NICK_BYTES];
uint16_t nick_len; uint16_t nick_len;
uint64_t last_sent_nick; uint64_t last_sent_nick;
Assoc *assoc; struct Assoc *assoc;
} Group_Chat; } Group_Chat;
#define GROUP_CHAT_PING 0 #define GROUP_CHAT_PING 0

View File

@ -44,7 +44,7 @@
/* Ping newly announced nodes to ping per TIME_TOPING seconds*/ /* Ping newly announced nodes to ping per TIME_TOPING seconds*/
#define TIME_TOPING 5 #define TIME_TOPING 5
typedef struct PING { struct PING {
Net_Crypto *c; Net_Crypto *c;
pinged_t pings[PING_NUM_MAX]; pinged_t pings[PING_NUM_MAX];
@ -53,7 +53,7 @@ typedef struct PING {
Node_format toping[MAX_TOPING]; Node_format toping[MAX_TOPING];
uint64_t last_toping; uint64_t last_toping;
} PING; };
static int is_ping_timeout(uint64_t time) static int is_ping_timeout(uint64_t time)
{ {