comparison libpurple/connection.h @ 21357:5a3242b676ad

rlaager suggested using the last element of the PurpleDisconnectReason enum for sanity checking, which sidesteps the "should NUM_REASONS be in or out of the enum?" problem.
author Will Thompson <will.thompson@collabora.co.uk>
date Sun, 14 Oct 2007 12:19:20 +0000
parents c521b0f72a7b
children ba41f2a60253
comparison
equal deleted inserted replaced
21356:be75cb19f548 21357:5a3242b676ad
117 PURPLE_REASON_CERT_OTHER_ERROR = 14, 117 PURPLE_REASON_CERT_OTHER_ERROR = 14,
118 118
119 /** Some other error occured which fits into none of the other 119 /** Some other error occured which fits into none of the other
120 * categories. 120 * categories.
121 */ 121 */
122 /* purple_connection_error_reason() in connection.c uses the fact that
123 * this is the last member of the enum when sanity-checking; if other
124 * reasons are added after it, the check must be updated.
125 */
122 PURPLE_REASON_OTHER_ERROR = 15 126 PURPLE_REASON_OTHER_ERROR = 15
123 } PurpleDisconnectReason; 127 } PurpleDisconnectReason;
124
125 /** 1 more than the value of the last #PurpleDisconnectReason. */
126 #define PURPLE_NUM_REASONS 16
127 128
128 #include <time.h> 129 #include <time.h>
129 130
130 #include "account.h" 131 #include "account.h"
131 #include "plugin.h" 132 #include "plugin.h"