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,9 +133,6 @@ 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;
@ -146,9 +143,9 @@ typedef struct {
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 {
@ -74,7 +72,7 @@ typedef struct Group_Chat {
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)
{ {