diff --git a/src/protocol/nntp/codes.h b/src/protocol/nntp/codes.h index 7a01e364..ea9e5ef6 100644 --- a/src/protocol/nntp/codes.h +++ b/src/protocol/nntp/codes.h @@ -96,4 +96,5 @@ enum nntp_code { NNTP_CODE_580_AUTH_FAILED = 580, /* Authorization Failed */ }; +typedef int nntp_code_T; #endif diff --git a/src/protocol/nntp/connection.c b/src/protocol/nntp/connection.c index 2a5f4dff..bc3fb12e 100644 --- a/src/protocol/nntp/connection.c +++ b/src/protocol/nntp/connection.c @@ -280,7 +280,7 @@ read_nntp_data(struct socket *socket, struct read_buffer *rb) /* Translate NNTP code to the internal connection state. */ static struct connection_state -get_nntp_connection_state(enum nntp_code code) +get_nntp_connection_state(nntp_code_T code) { switch (code) { case NNTP_CODE_400_GOODBYE: return connection_state(S_NNTP_SERVER_HANG_UP); diff --git a/src/protocol/nntp/connection.h b/src/protocol/nntp/connection.h index ad2e9cf5..04ac9b7b 100644 --- a/src/protocol/nntp/connection.h +++ b/src/protocol/nntp/connection.h @@ -63,7 +63,7 @@ struct nntp_connection_info { enum nntp_command command; /* The current NNTP status or response code received from the server */ - enum nntp_code code; + nntp_code_T code; /* Strings pointing into the connection URI. They caches info useful * for requesting the target. */ diff --git a/src/protocol/nntp/response.c b/src/protocol/nntp/response.c index aaf68d11..a2193787 100644 --- a/src/protocol/nntp/response.c +++ b/src/protocol/nntp/response.c @@ -557,13 +557,13 @@ parse_nntp_group_parameters(struct nntp_connection_info *nntp, return 1; } -enum nntp_code +nntp_code_T get_nntp_response_code(struct connection *conn, struct read_buffer *rb) { struct nntp_connection_info *nntp = (struct nntp_connection_info *)conn->info; char *line = rb->data; char *end = get_nntp_line_end(rb->data, rb->length); - enum nntp_code code; + nntp_code_T code; int linelen; if (!end) return NNTP_CODE_NONE; diff --git a/src/protocol/nntp/response.h b/src/protocol/nntp/response.h index 5343a8e1..f730c71a 100644 --- a/src/protocol/nntp/response.h +++ b/src/protocol/nntp/response.h @@ -27,7 +27,7 @@ read_nntp_response_data(struct connection *conn, struct read_buffer *rb); * check should be rescheduled. * NNTP_CODE_INVALID if the response code is not within the range * 100 - 599 of valid codes. */ -enum nntp_code +nntp_code_T get_nntp_response_code(struct connection *conn, struct read_buffer *rb); #ifdef __cplusplus