Changeset 9d3260a4b8dbc4dd64a162b37f1b6fa4f460a938
- Timestamp:
- 11/30/11 17:14:01
(1 year ago)
- Author:
- Theo Schlossnagle <jesus@omniti.com>
- git-committer:
- Theo Schlossnagle <jesus@omniti.com> 1322673241 -0500
- git-parent:
[dfec9683c6674557f3639bb6485d369ebd6a347b]
- git-author:
- Theo Schlossnagle <jesus@omniti.com> 1322673241 -0500
- Message:
Make sure we compile with Clang (trunk) even with -Wall -Werror (everywhere)
When (temporarily) adding -Werror -Wall to SHCFLAGS we'll get a lot more
failures. This patchset gurantees that all of them are fixed.
While we now can pass a compile with Clang we're still far away from
passing through GCC 4.6.1
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r8c1b28d |
r9d3260a |
|
| 59 | 59 | static noit_log_stream_t ds_err = NULL; |
|---|
| 60 | 60 | static noit_log_stream_t ds_deb = NULL; |
|---|
| 61 | | static noit_log_stream_t ds_pool_deb = NULL; |
|---|
| 62 | 61 | static noit_log_stream_t ingest_err = NULL; |
|---|
| 63 | 62 | |
|---|
| rf91ddca |
r9d3260a |
|
| 413 | 413 | static int noit_httptrap_init(noit_module_t *self) { |
|---|
| 414 | 414 | const char *config_val; |
|---|
| 415 | | int sockaddr_len; |
|---|
| 416 | 415 | httptrap_mod_config_t *conf; |
|---|
| 417 | 416 | conf = noit_module_get_userdata(self); |
|---|
| r1e8ae2b |
r9d3260a |
|
| 55 | 55 | amqp_basic_properties_t default_properties; |
|---|
| 56 | 56 | |
|---|
| 57 | | AMQP_CHECK_RESULT(amqp_send_method(state, channel, AMQP_BASIC_PUBLISH_METHOD, &m)); |
|---|
| | 57 | (void)AMQP_CHECK_RESULT(amqp_send_method(state, channel, AMQP_BASIC_PUBLISH_METHOD, &m)); |
|---|
| 58 | 58 | |
|---|
| 59 | 59 | if (properties == NULL) { |
|---|
| … | … | |
| 67 | 67 | f.payload.properties.body_size = body.len; |
|---|
| 68 | 68 | f.payload.properties.decoded = (void *) properties; |
|---|
| 69 | | AMQP_CHECK_RESULT(amqp_send_frame(state, &f)); |
|---|
| | 69 | (void)AMQP_CHECK_RESULT(amqp_send_frame(state, &f)); |
|---|
| 70 | 70 | |
|---|
| 71 | 71 | body_offset = 0; |
|---|
| … | … | |
| 87 | 87 | |
|---|
| 88 | 88 | body_offset += f.payload.body_fragment.len; |
|---|
| 89 | | AMQP_CHECK_RESULT(amqp_send_frame(state, &f)); |
|---|
| | 89 | (void)AMQP_CHECK_RESULT(amqp_send_frame(state, &f)); |
|---|
| 90 | 90 | } |
|---|
| 91 | 91 | |
|---|
| … | … | |
| 224 | 224 | .multiple = multiple |
|---|
| 225 | 225 | }; |
|---|
| 226 | | AMQP_CHECK_RESULT(amqp_send_method(state, channel, AMQP_BASIC_ACK_METHOD, &m)); |
|---|
| | 226 | (void)AMQP_CHECK_RESULT(amqp_send_method(state, channel, AMQP_BASIC_ACK_METHOD, &m)); |
|---|
| 227 | 227 | return 0; |
|---|
| 228 | 228 | } |
|---|
| r1e8ae2b |
r9d3260a |
|
| 210 | 210 | decoded_frame->frame_type = AMQP_FRAME_METHOD; |
|---|
| 211 | 211 | decoded_frame->payload.method.id = D_32(state->inbound_buffer, HEADER_SIZE); |
|---|
| 212 | | AMQP_CHECK_RESULT(amqp_decode_method(decoded_frame->payload.method.id, |
|---|
| | 212 | (void)AMQP_CHECK_RESULT(amqp_decode_method(decoded_frame->payload.method.id, |
|---|
| 213 | 213 | &state->decoding_pool, |
|---|
| 214 | 214 | encoded, |
|---|
| … | … | |
| 227 | 227 | decoded_frame->payload.properties.class_id = D_16(state->inbound_buffer, HEADER_SIZE); |
|---|
| 228 | 228 | decoded_frame->payload.properties.body_size = D_64(state->inbound_buffer, HEADER_SIZE+4); |
|---|
| 229 | | AMQP_CHECK_RESULT(amqp_decode_properties(decoded_frame->payload.properties.class_id, |
|---|
| | 229 | (void)AMQP_CHECK_RESULT(amqp_decode_properties(decoded_frame->payload.properties.class_id, |
|---|
| 230 | 230 | &state->decoding_pool, |
|---|
| 231 | 231 | encoded, |
|---|
| … | … | |
| 382 | 382 | switch (separate_body) { |
|---|
| 383 | 383 | case 0: |
|---|
| 384 | | AMQP_CHECK_RESULT(write(state->sockfd, |
|---|
| | 384 | (void)AMQP_CHECK_RESULT(write(state->sockfd, |
|---|
| 385 | 385 | state->outbound_buffer.bytes, |
|---|
| 386 | 386 | payload_len + (HEADER_SIZE + FOOTER_SIZE))); |
|---|
| … | … | |
| 388 | 388 | |
|---|
| 389 | 389 | case 1: |
|---|
| 390 | | AMQP_CHECK_RESULT(write(state->sockfd, state->outbound_buffer.bytes, HEADER_SIZE)); |
|---|
| 391 | | AMQP_CHECK_RESULT(write(state->sockfd, encoded.bytes, payload_len)); |
|---|
| | 390 | (void)AMQP_CHECK_RESULT(write(state->sockfd, state->outbound_buffer.bytes, HEADER_SIZE)); |
|---|
| | 391 | (void)AMQP_CHECK_RESULT(write(state->sockfd, encoded.bytes, payload_len)); |
|---|
| 392 | 392 | { |
|---|
| 393 | 393 | assert(FOOTER_SIZE == 1); |
|---|
| 394 | 394 | unsigned char frame_end_byte = AMQP_FRAME_END; |
|---|
| 395 | | AMQP_CHECK_RESULT(write(state->sockfd, &frame_end_byte, FOOTER_SIZE)); |
|---|
| | 395 | (void)AMQP_CHECK_RESULT(write(state->sockfd, &frame_end_byte, FOOTER_SIZE)); |
|---|
| 396 | 396 | } |
|---|
| 397 | 397 | return 0; |
|---|
| … | … | |
| 414 | 414 | switch (separate_body) { |
|---|
| 415 | 415 | case 0: |
|---|
| 416 | | AMQP_CHECK_RESULT(fn(context, |
|---|
| | 416 | (void)AMQP_CHECK_RESULT(fn(context, |
|---|
| 417 | 417 | state->outbound_buffer.bytes, |
|---|
| 418 | 418 | payload_len + (HEADER_SIZE + FOOTER_SIZE))); |
|---|
| … | … | |
| 420 | 420 | |
|---|
| 421 | 421 | case 1: |
|---|
| 422 | | AMQP_CHECK_RESULT(fn(context, state->outbound_buffer.bytes, HEADER_SIZE)); |
|---|
| 423 | | AMQP_CHECK_RESULT(fn(context, encoded.bytes, payload_len)); |
|---|
| | 422 | (void)AMQP_CHECK_RESULT(fn(context, state->outbound_buffer.bytes, HEADER_SIZE)); |
|---|
| | 423 | (void)AMQP_CHECK_RESULT(fn(context, encoded.bytes, payload_len)); |
|---|
| 424 | 424 | { |
|---|
| 425 | 425 | assert(FOOTER_SIZE == 1); |
|---|
| 426 | 426 | unsigned char frame_end_byte = AMQP_FRAME_END; |
|---|
| 427 | | AMQP_CHECK_RESULT(fn(context, &frame_end_byte, FOOTER_SIZE)); |
|---|
| | 427 | (void)AMQP_CHECK_RESULT(fn(context, &frame_end_byte, FOOTER_SIZE)); |
|---|
| 428 | 428 | } |
|---|
| 429 | 429 | return 0; |
|---|
| r1e8ae2b |
r9d3260a |
|
| 141 | 141 | offset++; |
|---|
| 142 | 142 | table_result = amqp_decode_table(encoded, pool, &(m->server_properties), &offset); |
|---|
| 143 | | AMQP_CHECK_RESULT(table_result); |
|---|
| | 143 | (void)AMQP_CHECK_RESULT(table_result); |
|---|
| 144 | 144 | m->mechanisms.len = D_32(encoded, offset); |
|---|
| 145 | 145 | offset += 4; |
|---|
| … | … | |
| 156 | 156 | amqp_connection_start_ok_t *m = (amqp_connection_start_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_connection_start_ok_t)); |
|---|
| 157 | 157 | table_result = amqp_decode_table(encoded, pool, &(m->client_properties), &offset); |
|---|
| 158 | | AMQP_CHECK_RESULT(table_result); |
|---|
| | 158 | (void)AMQP_CHECK_RESULT(table_result); |
|---|
| 159 | 159 | m->mechanism.len = D_8(encoded, offset); |
|---|
| 160 | 160 | offset++; |
|---|
| … | … | |
| 309 | 309 | offset += m->reply_text.len; |
|---|
| 310 | 310 | table_result = amqp_decode_table(encoded, pool, &(m->details), &offset); |
|---|
| 311 | | AMQP_CHECK_RESULT(table_result); |
|---|
| | 311 | (void)AMQP_CHECK_RESULT(table_result); |
|---|
| 312 | 312 | *decoded = m; |
|---|
| 313 | 313 | return 0; |
|---|
| … | … | |
| 376 | 376 | m->nowait = (bit_buffer & (1 << 4)) ? 1 : 0; |
|---|
| 377 | 377 | table_result = amqp_decode_table(encoded, pool, &(m->arguments), &offset); |
|---|
| 378 | | AMQP_CHECK_RESULT(table_result); |
|---|
| | 378 | (void)AMQP_CHECK_RESULT(table_result); |
|---|
| 379 | 379 | *decoded = m; |
|---|
| 380 | 380 | return 0; |
|---|
| … | … | |
| 421 | 421 | m->nowait = (bit_buffer & (1 << 4)) ? 1 : 0; |
|---|
| 422 | 422 | table_result = amqp_decode_table(encoded, pool, &(m->arguments), &offset); |
|---|
| 423 | | AMQP_CHECK_RESULT(table_result); |
|---|
| | 423 | (void)AMQP_CHECK_RESULT(table_result); |
|---|
| 424 | 424 | *decoded = m; |
|---|
| 425 | 425 | return 0; |
|---|
| … | … | |
| 458 | 458 | m->nowait = (bit_buffer & (1 << 0)) ? 1 : 0; |
|---|
| 459 | 459 | table_result = amqp_decode_table(encoded, pool, &(m->arguments), &offset); |
|---|
| 460 | | AMQP_CHECK_RESULT(table_result); |
|---|
| | 460 | (void)AMQP_CHECK_RESULT(table_result); |
|---|
| 461 | 461 | *decoded = m; |
|---|
| 462 | 462 | return 0; |
|---|
| … | … | |
| 528 | 528 | offset += m->routing_key.len; |
|---|
| 529 | 529 | table_result = amqp_decode_table(encoded, pool, &(m->arguments), &offset); |
|---|
| 530 | | AMQP_CHECK_RESULT(table_result); |
|---|
| | 530 | (void)AMQP_CHECK_RESULT(table_result); |
|---|
| 531 | 531 | *decoded = m; |
|---|
| 532 | 532 | return 0; |
|---|
| … | … | |
| 1098 | 1098 | amqp_tunnel_request_t *m = (amqp_tunnel_request_t *) amqp_pool_alloc(pool, sizeof(amqp_tunnel_request_t)); |
|---|
| 1099 | 1099 | table_result = amqp_decode_table(encoded, pool, &(m->meta_data), &offset); |
|---|
| 1100 | | AMQP_CHECK_RESULT(table_result); |
|---|
| | 1100 | (void)AMQP_CHECK_RESULT(table_result); |
|---|
| 1101 | 1101 | *decoded = m; |
|---|
| 1102 | 1102 | return 0; |
|---|
| … | … | |
| 1151 | 1151 | amqp_test_table_t *m = (amqp_test_table_t *) amqp_pool_alloc(pool, sizeof(amqp_test_table_t)); |
|---|
| 1152 | 1152 | table_result = amqp_decode_table(encoded, pool, &(m->table), &offset); |
|---|
| 1153 | | AMQP_CHECK_RESULT(table_result); |
|---|
| | 1153 | (void)AMQP_CHECK_RESULT(table_result); |
|---|
| 1154 | 1154 | m->integer_op = D_8(encoded, offset); |
|---|
| 1155 | 1155 | offset++; |
|---|
| … | … | |
| 1253 | 1253 | if (flags & AMQP_BASIC_HEADERS_FLAG) { |
|---|
| 1254 | 1254 | table_result = amqp_decode_table(encoded, pool, &(p->headers), &offset); |
|---|
| 1255 | | AMQP_CHECK_RESULT(table_result); |
|---|
| | 1255 | (void)AMQP_CHECK_RESULT(table_result); |
|---|
| 1256 | 1256 | } |
|---|
| 1257 | 1257 | if (flags & AMQP_BASIC_DELIVERY_MODE_FLAG) { |
|---|
| … | … | |
| 1335 | 1335 | if (flags & AMQP_FILE_HEADERS_FLAG) { |
|---|
| 1336 | 1336 | table_result = amqp_decode_table(encoded, pool, &(p->headers), &offset); |
|---|
| 1337 | | AMQP_CHECK_RESULT(table_result); |
|---|
| | 1337 | (void)AMQP_CHECK_RESULT(table_result); |
|---|
| 1338 | 1338 | } |
|---|
| 1339 | 1339 | if (flags & AMQP_FILE_PRIORITY_FLAG) { |
|---|
| … | … | |
| 1389 | 1389 | if (flags & AMQP_STREAM_HEADERS_FLAG) { |
|---|
| 1390 | 1390 | table_result = amqp_decode_table(encoded, pool, &(p->headers), &offset); |
|---|
| 1391 | | AMQP_CHECK_RESULT(table_result); |
|---|
| | 1391 | (void)AMQP_CHECK_RESULT(table_result); |
|---|
| 1392 | 1392 | } |
|---|
| 1393 | 1393 | if (flags & AMQP_STREAM_PRIORITY_FLAG) { |
|---|
| … | … | |
| 1419 | 1419 | if (flags & AMQP_TUNNEL_HEADERS_FLAG) { |
|---|
| 1420 | 1420 | table_result = amqp_decode_table(encoded, pool, &(p->headers), &offset); |
|---|
| 1421 | | AMQP_CHECK_RESULT(table_result); |
|---|
| | 1421 | (void)AMQP_CHECK_RESULT(table_result); |
|---|
| 1422 | 1422 | } |
|---|
| 1423 | 1423 | if (flags & AMQP_TUNNEL_PROXY_NAME_FLAG) { |
|---|
| r1e8ae2b |
r9d3260a |
|
| 165 | 165 | buffer.len = state->sock_inbound_limit - state->sock_inbound_offset; |
|---|
| 166 | 166 | buffer.bytes = ((char *) state->sock_inbound_buffer.bytes) + state->sock_inbound_offset; |
|---|
| 167 | | AMQP_CHECK_RESULT((result = amqp_handle_input(state, buffer, decoded_frame))); |
|---|
| | 167 | (void)AMQP_CHECK_RESULT((result = amqp_handle_input(state, buffer, decoded_frame))); |
|---|
| 168 | 168 | state->sock_inbound_offset += result; |
|---|
| 169 | 169 | |
|---|
| … | … | |
| 216 | 216 | amqp_frame_t frame; |
|---|
| 217 | 217 | |
|---|
| 218 | | AMQP_CHECK_EOF_RESULT(amqp_simple_wait_frame(state, &frame)); |
|---|
| | 218 | (void)AMQP_CHECK_EOF_RESULT(amqp_simple_wait_frame(state, &frame)); |
|---|
| 219 | 219 | amqp_assert(frame.channel == expected_channel, |
|---|
| 220 | 220 | "Expected 0x%08X method frame on channel %d, got frame on channel %d", |
|---|
| … | … | |
| 352 | 352 | amqp_send_header(state); |
|---|
| 353 | 353 | |
|---|
| 354 | | AMQP_CHECK_EOF_RESULT(amqp_simple_wait_method(state, 0, AMQP_CONNECTION_START_METHOD, &method)); |
|---|
| | 354 | (void)AMQP_CHECK_EOF_RESULT(amqp_simple_wait_method(state, 0, AMQP_CONNECTION_START_METHOD, &method)); |
|---|
| 355 | 355 | { |
|---|
| 356 | 356 | amqp_connection_start_t *s = (amqp_connection_start_t *) method.decoded; |
|---|
| … | … | |
| 374 | 374 | .locale = {.len = 5, .bytes = "en_US"} |
|---|
| 375 | 375 | }; |
|---|
| 376 | | AMQP_CHECK_RESULT(amqp_send_method(state, 0, AMQP_CONNECTION_START_OK_METHOD, &s)); |
|---|
| | 376 | (void)AMQP_CHECK_RESULT(amqp_send_method(state, 0, AMQP_CONNECTION_START_OK_METHOD, &s)); |
|---|
| 377 | 377 | } |
|---|
| 378 | 378 | |
|---|
| 379 | 379 | amqp_release_buffers(state); |
|---|
| 380 | 380 | |
|---|
| 381 | | AMQP_CHECK_EOF_RESULT(amqp_simple_wait_method(state, 0, AMQP_CONNECTION_TUNE_METHOD, &method)); |
|---|
| | 381 | (void)AMQP_CHECK_EOF_RESULT(amqp_simple_wait_method(state, 0, AMQP_CONNECTION_TUNE_METHOD, &method)); |
|---|
| 382 | 382 | { |
|---|
| 383 | 383 | amqp_connection_tune_t *s = (amqp_connection_tune_t *) method.decoded; |
|---|
| … | … | |
| 404 | 404 | } |
|---|
| 405 | 405 | |
|---|
| 406 | | AMQP_CHECK_RESULT(amqp_tune_connection(state, channel_max, frame_max, heartbeat)); |
|---|
| | 406 | (void)AMQP_CHECK_RESULT(amqp_tune_connection(state, channel_max, frame_max, heartbeat)); |
|---|
| 407 | 407 | |
|---|
| 408 | 408 | { |
|---|
| … | … | |
| 413 | 413 | .heartbeat = heartbeat |
|---|
| 414 | 414 | }; |
|---|
| 415 | | AMQP_CHECK_RESULT(amqp_send_method(state, 0, AMQP_CONNECTION_TUNE_OK_METHOD, &s)); |
|---|
| | 415 | (void)AMQP_CHECK_RESULT(amqp_send_method(state, 0, AMQP_CONNECTION_TUNE_OK_METHOD, &s)); |
|---|
| 416 | 416 | } |
|---|
| 417 | 417 | |
|---|
| r1e8ae2b |
r9d3260a |
|
| 79 | 79 | break; |
|---|
| 80 | 80 | case 'F': |
|---|
| 81 | | AMQP_CHECK_RESULT(amqp_decode_table(encoded, pool, &(entry->value.table), &offset)); |
|---|
| | 81 | (void)AMQP_CHECK_RESULT(amqp_decode_table(encoded, pool, &(entry->value.table), &offset)); |
|---|
| 82 | 82 | break; |
|---|
| 83 | 83 | default: |
|---|
| … | … | |
| 142 | 142 | break; |
|---|
| 143 | 143 | case 'F': |
|---|
| 144 | | AMQP_CHECK_RESULT(amqp_encode_table(encoded, &(entry->value.table), &offset)); |
|---|
| | 144 | (void)AMQP_CHECK_RESULT(amqp_encode_table(encoded, &(entry->value.table), &offset)); |
|---|
| 145 | 145 | break; |
|---|
| 146 | 146 | default: |
|---|
| r899f2d2 |
r9d3260a |
|
| 252 | 252 | char av[2] = { '\0', '\0' }; |
|---|
| 253 | 253 | noit_check_t *check; |
|---|
| 254 | | noit_lua_check_info_t *ci; |
|---|
| 255 | 254 | if(lua_gettop(L)) luaL_error(L, "wrong number of arguments"); |
|---|
| 256 | 255 | check = lua_touserdata(L, lua_upvalueindex(1)); |
|---|
| … | … | |
| 273 | 272 | char status[2] = { '\0', '\0' }; |
|---|
| 274 | 273 | noit_check_t *check; |
|---|
| 275 | | noit_lua_check_info_t *ci; |
|---|
| 276 | 274 | if(lua_gettop(L)) luaL_error(L, "wrong number of arguments"); |
|---|
| 277 | 275 | check = lua_touserdata(L, lua_upvalueindex(1)); |
|---|
| re442782 |
r9d3260a |
|
| 529 | 529 | noit_lua_check_info_t *ci; |
|---|
| 530 | 530 | eventer_t e, *eptr; |
|---|
| 531 | | struct timeval now; |
|---|
| 532 | 531 | int tmpmask, rv; |
|---|
| 533 | 532 | |
|---|
| rf1ce404 |
r9d3260a |
|
| 130 | 130 | static void noit_rabbimq_deallocate(iep_thread_driver_t *d) { |
|---|
| 131 | 131 | struct amqp_driver *dr = (struct amqp_driver *)d; |
|---|
| 132 | | int i; |
|---|
| 133 | 132 | noit_rabbimq_disconnect(d); |
|---|
| 134 | 133 | pthread_mutex_lock(&driver_lock); |
|---|
| 135 | | memset(dr, 0, sizeof(dr)); |
|---|
| | 134 | memset(dr, 0, sizeof(*dr)); |
|---|
| 136 | 135 | pthread_mutex_unlock(&driver_lock); |
|---|
| 137 | 136 | noit_atomic_dec64(&stats.concurrency); |
|---|
| … | … | |
| 414 | 413 | } |
|---|
| 415 | 414 | pthread_mutex_unlock(&driver_lock); |
|---|
| 416 | | } |
|---|
| | 415 | return 1; |
|---|
| | 416 | } |
|---|
| | 417 | |
|---|
| 417 | 418 | static void |
|---|
| 418 | 419 | register_console_rabbitmq_commands() { |
|---|