summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2020-03-14 03:37:28 +0000
committeriphydf <iphydf@users.noreply.github.com>2020-03-14 13:40:36 +0000
commit94d98ddd863279d5bf811d0107d73c373380dda2 (patch)
tree543a21f95e30c86e314dce4577f99421789bba0d
parentcb22b3df5f0b7509a37e091360ecbb4d8a9f2873 (diff)
Standardise on having a comma at the end of enums.
Most of our enums already have one. Some didn't. Tokstyle is going to require commas at the end of enumerator lists in enum definitions.
-rw-r--r--toxav/toxav.c2
-rw-r--r--toxcore/Messenger.h18
-rw-r--r--toxcore/TCP_client.h2
-rw-r--r--toxcore/friend_connection.h2
-rw-r--r--toxcore/group.c2
-rw-r--r--toxcore/group.h6
-rw-r--r--toxcore/logger.h2
-rw-r--r--toxcore/tox.c6
8 files changed, 21 insertions, 19 deletions
diff --git a/toxav/toxav.c b/toxav/toxav.c
index 897c63c0..ba27fe27 100644
--- a/toxav/toxav.c
+++ b/toxav/toxav.c
@@ -274,7 +274,7 @@ void toxav_iterate(ToxAV *av)
274 av->dmsst += current_time_monotonic(av->m->mono_time) - start; 274 av->dmsst += current_time_monotonic(av->m->mono_time) - start;
275 275
276 if (++av->dmssc == 3) { 276 if (++av->dmssc == 3) {
277 av->dmssa = av->dmsst / 3 + 5 /* NOTE Magic Offset for precision */; 277 av->dmssa = av->dmsst / 3 + 5; /* NOTE Magic Offset 5 for precision */
278 av->dmssc = 0; 278 av->dmssc = 0;
279 av->dmsst = 0; 279 av->dmsst = 0;
280 } 280 }
diff --git a/toxcore/Messenger.h b/toxcore/Messenger.h
index 85f730cf..74c19e09 100644
--- a/toxcore/Messenger.h
+++ b/toxcore/Messenger.h
@@ -33,7 +33,7 @@
33 33
34typedef enum Message_Type { 34typedef enum Message_Type {
35 MESSAGE_NORMAL, 35 MESSAGE_NORMAL,
36 MESSAGE_ACTION 36 MESSAGE_ACTION,
37} Message_Type; 37} Message_Type;
38 38
39typedef struct Messenger Messenger; 39typedef struct Messenger Messenger;
@@ -98,7 +98,7 @@ typedef enum Friend_Add_Error {
98 FAERR_ALREADYSENT = -4, 98 FAERR_ALREADYSENT = -4,
99 FAERR_BADCHECKSUM = -6, 99 FAERR_BADCHECKSUM = -6,
100 FAERR_SETNEWNOSPAM = -7, 100 FAERR_SETNEWNOSPAM = -7,
101 FAERR_NOMEM = -8 101 FAERR_NOMEM = -8,
102} Friend_Add_Error; 102} Friend_Add_Error;
103 103
104 104
@@ -109,7 +109,7 @@ typedef enum Connection_Status {
109 CONNECTION_NONE, 109 CONNECTION_NONE,
110 CONNECTION_TCP, 110 CONNECTION_TCP,
111 CONNECTION_UDP, 111 CONNECTION_UDP,
112 CONNECTION_UNKNOWN 112 CONNECTION_UNKNOWN,
113} Connection_Status; 113} Connection_Status;
114 114
115/* USERSTATUS - 115/* USERSTATUS -
@@ -120,7 +120,7 @@ typedef enum Userstatus {
120 USERSTATUS_NONE, 120 USERSTATUS_NONE,
121 USERSTATUS_AWAY, 121 USERSTATUS_AWAY,
122 USERSTATUS_BUSY, 122 USERSTATUS_BUSY,
123 USERSTATUS_INVALID 123 USERSTATUS_INVALID,
124} Userstatus; 124} Userstatus;
125 125
126#define FILE_ID_LENGTH 32 126#define FILE_ID_LENGTH 32
@@ -140,26 +140,26 @@ typedef enum Filestatus {
140 FILESTATUS_NOT_ACCEPTED, 140 FILESTATUS_NOT_ACCEPTED,
141 FILESTATUS_TRANSFERRING, 141 FILESTATUS_TRANSFERRING,
142 // FILESTATUS_BROKEN, 142 // FILESTATUS_BROKEN,
143 FILESTATUS_FINISHED 143 FILESTATUS_FINISHED,
144} Filestatus; 144} Filestatus;
145 145
146typedef enum File_Pause { 146typedef enum File_Pause {
147 FILE_PAUSE_NOT, 147 FILE_PAUSE_NOT,
148 FILE_PAUSE_US, 148 FILE_PAUSE_US,
149 FILE_PAUSE_OTHER, 149 FILE_PAUSE_OTHER,
150 FILE_PAUSE_BOTH 150 FILE_PAUSE_BOTH,
151} File_Pause; 151} File_Pause;
152 152
153typedef enum Filecontrol { 153typedef enum Filecontrol {
154 FILECONTROL_ACCEPT, 154 FILECONTROL_ACCEPT,
155 FILECONTROL_PAUSE, 155 FILECONTROL_PAUSE,
156 FILECONTROL_KILL, 156 FILECONTROL_KILL,
157 FILECONTROL_SEEK 157 FILECONTROL_SEEK,
158} Filecontrol; 158} Filecontrol;
159 159
160typedef enum Filekind { 160typedef enum Filekind {
161 FILEKIND_DATA, 161 FILEKIND_DATA,
162 FILEKIND_AVATAR 162 FILEKIND_AVATAR,
163} Filekind; 163} Filekind;
164 164
165 165
@@ -722,7 +722,7 @@ typedef enum Messenger_Error {
722 MESSENGER_ERROR_NONE, 722 MESSENGER_ERROR_NONE,
723 MESSENGER_ERROR_PORT, 723 MESSENGER_ERROR_PORT,
724 MESSENGER_ERROR_TCP_SERVER, 724 MESSENGER_ERROR_TCP_SERVER,
725 MESSENGER_ERROR_OTHER 725 MESSENGER_ERROR_OTHER,
726} Messenger_Error; 726} Messenger_Error;
727 727
728/* Run this at startup. 728/* Run this at startup.
diff --git a/toxcore/TCP_client.h b/toxcore/TCP_client.h
index 89f0d779..cecf5a6d 100644
--- a/toxcore/TCP_client.h
+++ b/toxcore/TCP_client.h
@@ -17,7 +17,7 @@
17typedef enum TCP_Proxy_Type { 17typedef enum TCP_Proxy_Type {
18 TCP_PROXY_NONE, 18 TCP_PROXY_NONE,
19 TCP_PROXY_HTTP, 19 TCP_PROXY_HTTP,
20 TCP_PROXY_SOCKS5 20 TCP_PROXY_SOCKS5,
21} TCP_Proxy_Type; 21} TCP_Proxy_Type;
22 22
23typedef struct TCP_Proxy_Info { 23typedef struct TCP_Proxy_Info {
diff --git a/toxcore/friend_connection.h b/toxcore/friend_connection.h
index 16df0236..92e38703 100644
--- a/toxcore/friend_connection.h
+++ b/toxcore/friend_connection.h
@@ -43,7 +43,7 @@
43typedef enum Friendconn_Status { 43typedef enum Friendconn_Status {
44 FRIENDCONN_STATUS_NONE, 44 FRIENDCONN_STATUS_NONE,
45 FRIENDCONN_STATUS_CONNECTING, 45 FRIENDCONN_STATUS_CONNECTING,
46 FRIENDCONN_STATUS_CONNECTED 46 FRIENDCONN_STATUS_CONNECTED,
47} Friendconn_Status; 47} Friendconn_Status;
48 48
49typedef struct Friend_Connections Friend_Connections; 49typedef struct Friend_Connections Friend_Connections;
diff --git a/toxcore/group.c b/toxcore/group.c
index 3b9c7f40..aebf3092 100644
--- a/toxcore/group.c
+++ b/toxcore/group.c
@@ -265,7 +265,7 @@ static uint64_t calculate_comp_value(const uint8_t *pk1, const uint8_t *pk2)
265typedef enum Groupchat_Closest { 265typedef enum Groupchat_Closest {
266 GROUPCHAT_CLOSEST_NONE, 266 GROUPCHAT_CLOSEST_NONE,
267 GROUPCHAT_CLOSEST_ADDED, 267 GROUPCHAT_CLOSEST_ADDED,
268 GROUPCHAT_CLOSEST_REMOVED 268 GROUPCHAT_CLOSEST_REMOVED,
269} Groupchat_Closest; 269} Groupchat_Closest;
270 270
271static int add_to_closest(Group_Chats *g_c, uint32_t groupnumber, const uint8_t *real_pk, const uint8_t *temp_pk) 271static int add_to_closest(Group_Chats *g_c, uint32_t groupnumber, const uint8_t *real_pk, const uint8_t *temp_pk)
diff --git a/toxcore/group.h b/toxcore/group.h
index c5601378..ee0829cb 100644
--- a/toxcore/group.h
+++ b/toxcore/group.h
@@ -14,12 +14,12 @@
14typedef enum Groupchat_Status { 14typedef enum Groupchat_Status {
15 GROUPCHAT_STATUS_NONE, 15 GROUPCHAT_STATUS_NONE,
16 GROUPCHAT_STATUS_VALID, 16 GROUPCHAT_STATUS_VALID,
17 GROUPCHAT_STATUS_CONNECTED 17 GROUPCHAT_STATUS_CONNECTED,
18} Groupchat_Status; 18} Groupchat_Status;
19 19
20typedef enum Groupchat_Type { 20typedef enum Groupchat_Type {
21 GROUPCHAT_TYPE_TEXT, 21 GROUPCHAT_TYPE_TEXT,
22 GROUPCHAT_TYPE_AV 22 GROUPCHAT_TYPE_AV,
23} Groupchat_Type; 23} Groupchat_Type;
24 24
25#define MAX_LOSSY_COUNT 256 25#define MAX_LOSSY_COUNT 256
@@ -63,7 +63,7 @@ typedef struct Group_Peer {
63typedef enum Groupchat_Close_Type { 63typedef enum Groupchat_Close_Type {
64 GROUPCHAT_CLOSE_NONE, 64 GROUPCHAT_CLOSE_NONE,
65 GROUPCHAT_CLOSE_CONNECTION, 65 GROUPCHAT_CLOSE_CONNECTION,
66 GROUPCHAT_CLOSE_ONLINE 66 GROUPCHAT_CLOSE_ONLINE,
67} Groupchat_Close_Type; 67} Groupchat_Close_Type;
68 68
69/* Connection is to one of the closest DESIRED_CLOSE_CONNECTIONS peers */ 69/* Connection is to one of the closest DESIRED_CLOSE_CONNECTIONS peers */
diff --git a/toxcore/logger.h b/toxcore/logger.h
index d2be3401..cbd8752b 100644
--- a/toxcore/logger.h
+++ b/toxcore/logger.h
@@ -23,7 +23,7 @@ typedef enum Logger_Level {
23 LOGGER_LEVEL_DEBUG, 23 LOGGER_LEVEL_DEBUG,
24 LOGGER_LEVEL_INFO, 24 LOGGER_LEVEL_INFO,
25 LOGGER_LEVEL_WARNING, 25 LOGGER_LEVEL_WARNING,
26 LOGGER_LEVEL_ERROR 26 LOGGER_LEVEL_ERROR,
27} Logger_Level; 27} Logger_Level;
28 28
29typedef struct Logger Logger; 29typedef struct Logger Logger;
diff --git a/toxcore/tox.c b/toxcore/tox.c
index 2099a26f..b70be7a3 100644
--- a/toxcore/tox.c
+++ b/toxcore/tox.c
@@ -2070,7 +2070,8 @@ Tox_Conference_Type tox_conference_get_type(const Tox *tox, uint32_t conference_
2070 return (Tox_Conference_Type)ret; 2070 return (Tox_Conference_Type)ret;
2071} 2071}
2072 2072
2073bool tox_conference_get_id(const Tox *tox, uint32_t conference_number, uint8_t *id /* TOX_CONFERENCE_ID_SIZE bytes */) 2073/* id is TOX_CONFERENCE_ID_SIZE bytes */
2074bool tox_conference_get_id(const Tox *tox, uint32_t conference_number, uint8_t *id)
2074{ 2075{
2075 lock(tox); 2076 lock(tox);
2076 bool ret = conference_get_id(tox->m->conferences_object, conference_number, id); 2077 bool ret = conference_get_id(tox->m->conferences_object, conference_number, id);
@@ -2079,7 +2080,8 @@ bool tox_conference_get_id(const Tox *tox, uint32_t conference_number, uint8_t *
2079} 2080}
2080 2081
2081// TODO(iphydf): Delete in 0.3.0. 2082// TODO(iphydf): Delete in 0.3.0.
2082bool tox_conference_get_uid(const Tox *tox, uint32_t conference_number, uint8_t *uid /* TOX_CONFERENCE_ID_SIZE bytes */) 2083/* uid is TOX_CONFERENCE_ID_SIZE bytes */
2084bool tox_conference_get_uid(const Tox *tox, uint32_t conference_number, uint8_t *uid)
2083{ 2085{
2084 return tox_conference_get_id(tox, conference_number, uid); 2086 return tox_conference_get_id(tox, conference_number, uid);
2085} 2087}