Skip to content

Commit

Permalink
clang-format-3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuhiro-t committed Oct 15, 2016
1 parent e9d562f commit 0cf6848
Show file tree
Hide file tree
Showing 48 changed files with 4,763 additions and 4,828 deletions.
15 changes: 8 additions & 7 deletions examples/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ enum { IO_NONE, WANT_READ, WANT_WRITE };

#define MAKE_NV(NAME, VALUE) \
{ \
(uint8_t *) NAME, (uint8_t *)VALUE, sizeof(NAME) - 1, sizeof(VALUE) - 1, \
(uint8_t *)NAME, (uint8_t *)VALUE, sizeof(NAME) - 1, sizeof(VALUE) - 1, \
NGHTTP2_NV_FLAG_NONE \
}

#define MAKE_NV_CS(NAME, VALUE) \
{ \
(uint8_t *) NAME, (uint8_t *)VALUE, sizeof(NAME) - 1, strlen(VALUE), \
(uint8_t *)NAME, (uint8_t *)VALUE, sizeof(NAME) - 1, strlen(VALUE), \
NGHTTP2_NV_FLAG_NONE \
}

Expand Down Expand Up @@ -457,11 +457,12 @@ static void ctl_poll(struct pollfd *pollfd, struct Connection *connection) {
static void submit_request(struct Connection *connection, struct Request *req) {
int32_t stream_id;
/* Make sure that the last item is NULL */
const nghttp2_nv nva[] = {
MAKE_NV(":method", "GET"), MAKE_NV_CS(":path", req->path),
MAKE_NV(":scheme", "https"), MAKE_NV_CS(":authority", req->hostport),
MAKE_NV("accept", "*/*"),
MAKE_NV("user-agent", "nghttp2/" NGHTTP2_VERSION)};
const nghttp2_nv nva[] = {MAKE_NV(":method", "GET"),
MAKE_NV_CS(":path", req->path),
MAKE_NV(":scheme", "https"),
MAKE_NV_CS(":authority", req->hostport),
MAKE_NV("accept", "*/*"),
MAKE_NV("user-agent", "nghttp2/" NGHTTP2_VERSION)};

stream_id = nghttp2_submit_request(connection->session, NULL, nva,
sizeof(nva) / sizeof(nva[0]), NULL, req);
Expand Down
2 changes: 1 addition & 1 deletion examples/deflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#define MAKE_NV(K, V) \
{ \
(uint8_t *) K, (uint8_t *)V, sizeof(K) - 1, sizeof(V) - 1, \
(uint8_t *)K, (uint8_t *)V, sizeof(K) - 1, sizeof(V) - 1, \
NGHTTP2_NV_FLAG_NONE \
}

Expand Down
4 changes: 2 additions & 2 deletions examples/libevent-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,13 +383,13 @@ static void send_client_connection_header(http2_session_data *session_data) {

#define MAKE_NV(NAME, VALUE, VALUELEN) \
{ \
(uint8_t *) NAME, (uint8_t *)VALUE, sizeof(NAME) - 1, VALUELEN, \
(uint8_t *)NAME, (uint8_t *)VALUE, sizeof(NAME) - 1, VALUELEN, \
NGHTTP2_NV_FLAG_NONE \
}

#define MAKE_NV2(NAME, VALUE) \
{ \
(uint8_t *) NAME, (uint8_t *)VALUE, sizeof(NAME) - 1, sizeof(VALUE) - 1, \
(uint8_t *)NAME, (uint8_t *)VALUE, sizeof(NAME) - 1, sizeof(VALUE) - 1, \
NGHTTP2_NV_FLAG_NONE \
}

Expand Down
2 changes: 1 addition & 1 deletion examples/libevent-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@

#define MAKE_NV(NAME, VALUE) \
{ \
(uint8_t *) NAME, (uint8_t *)VALUE, sizeof(NAME) - 1, sizeof(VALUE) - 1, \
(uint8_t *)NAME, (uint8_t *)VALUE, sizeof(NAME) - 1, sizeof(VALUE) - 1, \
NGHTTP2_NV_FLAG_NONE \
}

Expand Down
89 changes: 41 additions & 48 deletions lib/includes/nghttp2/nghttp2.h
Original file line number Diff line number Diff line change
Expand Up @@ -2802,8 +2802,8 @@ NGHTTP2_EXTERN int nghttp2_session_send(nghttp2_session *session);
* buffer up small chunks of data as necessary to avoid this
* situation.
*/
NGHTTP2_EXTERN ssize_t
nghttp2_session_mem_send(nghttp2_session *session, const uint8_t **data_ptr);
NGHTTP2_EXTERN ssize_t nghttp2_session_mem_send(nghttp2_session *session,
const uint8_t **data_ptr);

/**
* @function
Expand Down Expand Up @@ -3018,9 +3018,8 @@ nghttp2_session_get_outbound_queue_size(nghttp2_session *session);
*
* This function returns -1 if it fails.
*/
NGHTTP2_EXTERN int32_t
nghttp2_session_get_stream_effective_recv_data_length(nghttp2_session *session,
int32_t stream_id);
NGHTTP2_EXTERN int32_t nghttp2_session_get_stream_effective_recv_data_length(
nghttp2_session *session, int32_t stream_id);

/**
* @function
Expand All @@ -3039,9 +3038,8 @@ nghttp2_session_get_stream_effective_recv_data_length(nghttp2_session *session,
*
* This function returns -1 if it fails.
*/
NGHTTP2_EXTERN int32_t
nghttp2_session_get_stream_effective_local_window_size(nghttp2_session *session,
int32_t stream_id);
NGHTTP2_EXTERN int32_t nghttp2_session_get_stream_effective_local_window_size(
nghttp2_session *session, int32_t stream_id);

/**
* @function
Expand All @@ -3055,9 +3053,8 @@ nghttp2_session_get_stream_effective_local_window_size(nghttp2_session *session,
*
* This function returns -1 if it fails.
*/
NGHTTP2_EXTERN int32_t
nghttp2_session_get_stream_local_window_size(nghttp2_session *session,
int32_t stream_id);
NGHTTP2_EXTERN int32_t nghttp2_session_get_stream_local_window_size(
nghttp2_session *session, int32_t stream_id);

/**
* @function
Expand Down Expand Up @@ -3124,9 +3121,8 @@ nghttp2_session_get_local_window_size(nghttp2_session *session);
*
* This function returns -1 if it fails.
*/
NGHTTP2_EXTERN int32_t
nghttp2_session_get_stream_remote_window_size(nghttp2_session *session,
int32_t stream_id);
NGHTTP2_EXTERN int32_t nghttp2_session_get_stream_remote_window_size(
nghttp2_session *session, int32_t stream_id);

/**
* @function
Expand Down Expand Up @@ -3279,9 +3275,8 @@ NGHTTP2_EXTERN int nghttp2_submit_shutdown_notice(nghttp2_session *session);
* The |id| must be one of values defined in
* :enum:`nghttp2_settings_id`.
*/
NGHTTP2_EXTERN uint32_t
nghttp2_session_get_remote_settings(nghttp2_session *session,
nghttp2_settings_id id);
NGHTTP2_EXTERN uint32_t nghttp2_session_get_remote_settings(
nghttp2_session *session, nghttp2_settings_id id);

/**
* @function
Expand All @@ -3290,9 +3285,8 @@ nghttp2_session_get_remote_settings(nghttp2_session *session,
* by the remote endpoint. The |id| must be one of the values defined
* in :enum:`nghttp2_settings_id`.
*/
NGHTTP2_EXTERN uint32_t
nghttp2_session_get_local_settings(nghttp2_session *session,
nghttp2_settings_id id);
NGHTTP2_EXTERN uint32_t nghttp2_session_get_local_settings(
nghttp2_session *session, nghttp2_settings_id id);

/**
* @function
Expand Down Expand Up @@ -3587,9 +3581,8 @@ NGHTTP2_EXTERN int nghttp2_session_upgrade2(nghttp2_session *session,
* :enum:`NGHTTP2_ERR_INSUFF_BUFSIZE`
* The provided |buflen| size is too small to hold the output.
*/
NGHTTP2_EXTERN ssize_t
nghttp2_pack_settings_payload(uint8_t *buf, size_t buflen,
const nghttp2_settings_entry *iv, size_t niv);
NGHTTP2_EXTERN ssize_t nghttp2_pack_settings_payload(
uint8_t *buf, size_t buflen, const nghttp2_settings_entry *iv, size_t niv);

/**
* @function
Expand Down Expand Up @@ -3714,12 +3707,10 @@ nghttp2_priority_spec_check_default(const nghttp2_priority_spec *pri_spec);
* frame.
*
*/
NGHTTP2_EXTERN int32_t
nghttp2_submit_request(nghttp2_session *session,
const nghttp2_priority_spec *pri_spec,
const nghttp2_nv *nva, size_t nvlen,
const nghttp2_data_provider *data_prd,
void *stream_user_data);
NGHTTP2_EXTERN int32_t nghttp2_submit_request(
nghttp2_session *session, const nghttp2_priority_spec *pri_spec,
const nghttp2_nv *nva, size_t nvlen, const nghttp2_data_provider *data_prd,
void *stream_user_data);

/**
* @function
Expand Down Expand Up @@ -3934,11 +3925,10 @@ NGHTTP2_EXTERN int nghttp2_submit_trailer(nghttp2_session *session,
* frame.
*
*/
NGHTTP2_EXTERN int32_t
nghttp2_submit_headers(nghttp2_session *session, uint8_t flags,
int32_t stream_id, const nghttp2_priority_spec *pri_spec,
const nghttp2_nv *nva, size_t nvlen,
void *stream_user_data);
NGHTTP2_EXTERN int32_t nghttp2_submit_headers(
nghttp2_session *session, uint8_t flags, int32_t stream_id,
const nghttp2_priority_spec *pri_spec, const nghttp2_nv *nva, size_t nvlen,
void *stream_user_data);

/**
* @function
Expand Down Expand Up @@ -4146,10 +4136,9 @@ NGHTTP2_EXTERN int nghttp2_submit_settings(nghttp2_session *session,
* is called for this frame.
*
*/
NGHTTP2_EXTERN int32_t
nghttp2_submit_push_promise(nghttp2_session *session, uint8_t flags,
int32_t stream_id, const nghttp2_nv *nva,
size_t nvlen, void *promised_stream_user_data);
NGHTTP2_EXTERN int32_t nghttp2_submit_push_promise(
nghttp2_session *session, uint8_t flags, int32_t stream_id,
const nghttp2_nv *nva, size_t nvlen, void *promised_stream_user_data);

/**
* @function
Expand Down Expand Up @@ -4693,9 +4682,10 @@ nghttp2_hd_deflate_change_table_size(nghttp2_hd_deflater *deflater,
* :enum:`NGHTTP2_ERR_INSUFF_BUFSIZE`
* The provided |buflen| size is too small to hold the output.
*/
NGHTTP2_EXTERN ssize_t
nghttp2_hd_deflate_hd(nghttp2_hd_deflater *deflater, uint8_t *buf,
size_t buflen, const nghttp2_nv *nva, size_t nvlen);
NGHTTP2_EXTERN ssize_t nghttp2_hd_deflate_hd(nghttp2_hd_deflater *deflater,
uint8_t *buf, size_t buflen,
const nghttp2_nv *nva,
size_t nvlen);

/**
* @function
Expand Down Expand Up @@ -4724,9 +4714,11 @@ nghttp2_hd_deflate_hd(nghttp2_hd_deflater *deflater, uint8_t *buf,
* :enum:`NGHTTP2_ERR_INSUFF_BUFSIZE`
* The provided |buflen| size is too small to hold the output.
*/
NGHTTP2_EXTERN ssize_t
nghttp2_hd_deflate_hd_vec(nghttp2_hd_deflater *deflater, const nghttp2_vec *vec,
size_t veclen, const nghttp2_nv *nva, size_t nvlen);
NGHTTP2_EXTERN ssize_t nghttp2_hd_deflate_hd_vec(nghttp2_hd_deflater *deflater,
const nghttp2_vec *vec,
size_t veclen,
const nghttp2_nv *nva,
size_t nvlen);

/**
* @function
Expand Down Expand Up @@ -5046,10 +5038,11 @@ NGHTTP2_EXTERN ssize_t nghttp2_hd_inflate_hd(nghttp2_hd_inflater *inflater,
* }
*
*/
NGHTTP2_EXTERN ssize_t
nghttp2_hd_inflate_hd2(nghttp2_hd_inflater *inflater, nghttp2_nv *nv_out,
int *inflate_flags, const uint8_t *in, size_t inlen,
int in_final);
NGHTTP2_EXTERN ssize_t nghttp2_hd_inflate_hd2(nghttp2_hd_inflater *inflater,
nghttp2_nv *nv_out,
int *inflate_flags,
const uint8_t *in, size_t inlen,
int in_final);

/**
* @function
Expand Down
7 changes: 4 additions & 3 deletions lib/nghttp2_hd.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
/* Make scalar initialization form of nghttp2_hd_entry */
#define MAKE_STATIC_ENT(N, V, T, H) \
{ \
{ NULL, NULL, (uint8_t *)(N), sizeof((N)) - 1, -1 } \
, {NULL, NULL, (uint8_t *)(V), sizeof((V)) - 1, -1}, \
{NULL, NULL, (uint8_t *)(N), sizeof((N)) - 1, -1}, \
{NULL, NULL, (uint8_t *)(V), sizeof((V)) - 1, -1}, \
{(uint8_t *)(N), (uint8_t *)(V), sizeof((N)) - 1, sizeof((V)) - 1, 0}, \
T, H \
}
Expand Down Expand Up @@ -1296,7 +1296,8 @@ static const nghttp2_nv *nghttp2_hd_table_get2(nghttp2_hd_context *context,
assert(INDEX_RANGE_VALID(context, idx));
if (idx >= NGHTTP2_STATIC_TABLE_LENGTH) {
return &hd_ringbuf_get(&context->hd_table,
idx - NGHTTP2_STATIC_TABLE_LENGTH)->cnv;
idx - NGHTTP2_STATIC_TABLE_LENGTH)
->cnv;
}

return &static_table[idx].cnv;
Expand Down
Loading

0 comments on commit 0cf6848

Please sign in to comment.