Changeset 9d3260a4b8dbc4dd64a162b37f1b6fa4f460a938

Show
Ignore:
Timestamp:
11/30/11 17:14:01 (3 years 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
  • src/modules/handoff_ingestor.c

    r8c1b28d r9d3260a  
    5959static noit_log_stream_t ds_err = NULL; 
    6060static noit_log_stream_t ds_deb = NULL; 
    61 static noit_log_stream_t ds_pool_deb = NULL; 
    6261static noit_log_stream_t ingest_err = NULL; 
    6362 
  • src/modules/httptrap.c

    rf91ddca r9d3260a  
    413413static int noit_httptrap_init(noit_module_t *self) { 
    414414  const char *config_val; 
    415   int sockaddr_len; 
    416415  httptrap_mod_config_t *conf; 
    417416  conf = noit_module_get_userdata(self); 
  • src/modules/librabbitmq/amqp_api.c

    r1e8ae2b r9d3260a  
    5555  amqp_basic_properties_t default_properties; 
    5656 
    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)); 
    5858 
    5959  if (properties == NULL) { 
     
    6767  f.payload.properties.body_size = body.len; 
    6868  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)); 
    7070 
    7171  body_offset = 0; 
     
    8787 
    8888    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)); 
    9090  } 
    9191 
     
    224224      .multiple = multiple 
    225225    }; 
    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)); 
    227227  return 0; 
    228228} 
  • src/modules/librabbitmq/amqp_connection.c

    r1e8ae2b r9d3260a  
    210210          decoded_frame->frame_type = AMQP_FRAME_METHOD; 
    211211          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, 
    213213                                               &state->decoding_pool, 
    214214                                               encoded, 
     
    227227          decoded_frame->payload.properties.class_id = D_16(state->inbound_buffer, HEADER_SIZE); 
    228228          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, 
    230230                                                   &state->decoding_pool, 
    231231                                                   encoded, 
     
    382382  switch (separate_body) { 
    383383    case 0: 
    384       AMQP_CHECK_RESULT(write(state->sockfd, 
     384      (void)AMQP_CHECK_RESULT(write(state->sockfd, 
    385385                              state->outbound_buffer.bytes, 
    386386                              payload_len + (HEADER_SIZE + FOOTER_SIZE))); 
     
    388388 
    389389    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)); 
    392392      { 
    393393        assert(FOOTER_SIZE == 1); 
    394394        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)); 
    396396      } 
    397397      return 0; 
     
    414414  switch (separate_body) { 
    415415    case 0: 
    416       AMQP_CHECK_RESULT(fn(context, 
     416      (void)AMQP_CHECK_RESULT(fn(context, 
    417417                           state->outbound_buffer.bytes, 
    418418                           payload_len + (HEADER_SIZE + FOOTER_SIZE))); 
     
    420420 
    421421    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)); 
    424424      { 
    425425        assert(FOOTER_SIZE == 1); 
    426426        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)); 
    428428      } 
    429429      return 0; 
  • src/modules/librabbitmq/amqp_framing.c

    r1e8ae2b r9d3260a  
    141141      offset++; 
    142142      table_result = amqp_decode_table(encoded, pool, &(m->server_properties), &offset); 
    143       AMQP_CHECK_RESULT(table_result); 
     143      (void)AMQP_CHECK_RESULT(table_result); 
    144144      m->mechanisms.len = D_32(encoded, offset); 
    145145      offset += 4; 
     
    156156      amqp_connection_start_ok_t *m = (amqp_connection_start_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_connection_start_ok_t)); 
    157157      table_result = amqp_decode_table(encoded, pool, &(m->client_properties), &offset); 
    158       AMQP_CHECK_RESULT(table_result); 
     158      (void)AMQP_CHECK_RESULT(table_result); 
    159159      m->mechanism.len = D_8(encoded, offset); 
    160160      offset++; 
     
    309309      offset += m->reply_text.len; 
    310310      table_result = amqp_decode_table(encoded, pool, &(m->details), &offset); 
    311       AMQP_CHECK_RESULT(table_result); 
     311      (void)AMQP_CHECK_RESULT(table_result); 
    312312      *decoded = m; 
    313313      return 0; 
     
    376376      m->nowait = (bit_buffer & (1 << 4)) ? 1 : 0; 
    377377      table_result = amqp_decode_table(encoded, pool, &(m->arguments), &offset); 
    378       AMQP_CHECK_RESULT(table_result); 
     378      (void)AMQP_CHECK_RESULT(table_result); 
    379379      *decoded = m; 
    380380      return 0; 
     
    421421      m->nowait = (bit_buffer & (1 << 4)) ? 1 : 0; 
    422422      table_result = amqp_decode_table(encoded, pool, &(m->arguments), &offset); 
    423       AMQP_CHECK_RESULT(table_result); 
     423      (void)AMQP_CHECK_RESULT(table_result); 
    424424      *decoded = m; 
    425425      return 0; 
     
    458458      m->nowait = (bit_buffer & (1 << 0)) ? 1 : 0; 
    459459      table_result = amqp_decode_table(encoded, pool, &(m->arguments), &offset); 
    460       AMQP_CHECK_RESULT(table_result); 
     460      (void)AMQP_CHECK_RESULT(table_result); 
    461461      *decoded = m; 
    462462      return 0; 
     
    528528      offset += m->routing_key.len; 
    529529      table_result = amqp_decode_table(encoded, pool, &(m->arguments), &offset); 
    530       AMQP_CHECK_RESULT(table_result); 
     530      (void)AMQP_CHECK_RESULT(table_result); 
    531531      *decoded = m; 
    532532      return 0; 
     
    10981098      amqp_tunnel_request_t *m = (amqp_tunnel_request_t *) amqp_pool_alloc(pool, sizeof(amqp_tunnel_request_t)); 
    10991099      table_result = amqp_decode_table(encoded, pool, &(m->meta_data), &offset); 
    1100       AMQP_CHECK_RESULT(table_result); 
     1100      (void)AMQP_CHECK_RESULT(table_result); 
    11011101      *decoded = m; 
    11021102      return 0; 
     
    11511151      amqp_test_table_t *m = (amqp_test_table_t *) amqp_pool_alloc(pool, sizeof(amqp_test_table_t)); 
    11521152      table_result = amqp_decode_table(encoded, pool, &(m->table), &offset); 
    1153       AMQP_CHECK_RESULT(table_result); 
     1153      (void)AMQP_CHECK_RESULT(table_result); 
    11541154      m->integer_op = D_8(encoded, offset); 
    11551155      offset++; 
     
    12531253      if (flags & AMQP_BASIC_HEADERS_FLAG) { 
    12541254        table_result = amqp_decode_table(encoded, pool, &(p->headers), &offset); 
    1255         AMQP_CHECK_RESULT(table_result); 
     1255        (void)AMQP_CHECK_RESULT(table_result); 
    12561256      } 
    12571257      if (flags & AMQP_BASIC_DELIVERY_MODE_FLAG) { 
     
    13351335      if (flags & AMQP_FILE_HEADERS_FLAG) { 
    13361336        table_result = amqp_decode_table(encoded, pool, &(p->headers), &offset); 
    1337         AMQP_CHECK_RESULT(table_result); 
     1337        (void)AMQP_CHECK_RESULT(table_result); 
    13381338      } 
    13391339      if (flags & AMQP_FILE_PRIORITY_FLAG) { 
     
    13891389      if (flags & AMQP_STREAM_HEADERS_FLAG) { 
    13901390        table_result = amqp_decode_table(encoded, pool, &(p->headers), &offset); 
    1391         AMQP_CHECK_RESULT(table_result); 
     1391        (void)AMQP_CHECK_RESULT(table_result); 
    13921392      } 
    13931393      if (flags & AMQP_STREAM_PRIORITY_FLAG) { 
     
    14191419      if (flags & AMQP_TUNNEL_HEADERS_FLAG) { 
    14201420        table_result = amqp_decode_table(encoded, pool, &(p->headers), &offset); 
    1421         AMQP_CHECK_RESULT(table_result); 
     1421        (void)AMQP_CHECK_RESULT(table_result); 
    14221422      } 
    14231423      if (flags & AMQP_TUNNEL_PROXY_NAME_FLAG) { 
  • src/modules/librabbitmq/amqp_socket.c

    r1e8ae2b r9d3260a  
    165165      buffer.len = state->sock_inbound_limit - state->sock_inbound_offset; 
    166166      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))); 
    168168      state->sock_inbound_offset += result; 
    169169 
     
    216216  amqp_frame_t frame; 
    217217 
    218   AMQP_CHECK_EOF_RESULT(amqp_simple_wait_frame(state, &frame)); 
     218  (void)AMQP_CHECK_EOF_RESULT(amqp_simple_wait_frame(state, &frame)); 
    219219  amqp_assert(frame.channel == expected_channel, 
    220220              "Expected 0x%08X method frame on channel %d, got frame on channel %d", 
     
    352352  amqp_send_header(state); 
    353353 
    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)); 
    355355  { 
    356356    amqp_connection_start_t *s = (amqp_connection_start_t *) method.decoded; 
     
    374374        .locale = {.len = 5, .bytes = "en_US"} 
    375375      }; 
    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)); 
    377377  } 
    378378 
    379379  amqp_release_buffers(state); 
    380380 
    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)); 
    382382  { 
    383383    amqp_connection_tune_t *s = (amqp_connection_tune_t *) method.decoded; 
     
    404404  } 
    405405 
    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)); 
    407407 
    408408  { 
     
    413413        .heartbeat = heartbeat 
    414414      }; 
    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)); 
    416416  } 
    417417 
  • src/modules/librabbitmq/amqp_table.c

    r1e8ae2b r9d3260a  
    7979        break; 
    8080      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)); 
    8282        break; 
    8383      default: 
     
    142142        break; 
    143143      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)); 
    145145        break; 
    146146      default: 
  • src/modules/lua.c

    r899f2d2 r9d3260a  
    252252  char av[2] = { '\0', '\0' }; 
    253253  noit_check_t *check; 
    254   noit_lua_check_info_t *ci; 
    255254  if(lua_gettop(L)) luaL_error(L, "wrong number of arguments"); 
    256255  check = lua_touserdata(L, lua_upvalueindex(1)); 
     
    273272  char status[2] = { '\0', '\0' }; 
    274273  noit_check_t *check; 
    275   noit_lua_check_info_t *ci; 
    276274  if(lua_gettop(L)) luaL_error(L, "wrong number of arguments"); 
    277275  check = lua_touserdata(L, lua_upvalueindex(1)); 
  • src/modules/lua_noit.c

    re442782 r9d3260a  
    529529  noit_lua_check_info_t *ci; 
    530530  eventer_t e, *eptr; 
    531   struct timeval now; 
    532531  int tmpmask, rv; 
    533532 
  • src/modules/rabbitmq_driver.c

    rf1ce404 r9d3260a  
    130130static void noit_rabbimq_deallocate(iep_thread_driver_t *d) { 
    131131  struct amqp_driver *dr = (struct amqp_driver *)d; 
    132   int i; 
    133132  noit_rabbimq_disconnect(d); 
    134133  pthread_mutex_lock(&driver_lock); 
    135   memset(dr, 0, sizeof(dr)); 
     134  memset(dr, 0, sizeof(*dr)); 
    136135  pthread_mutex_unlock(&driver_lock); 
    137136  noit_atomic_dec64(&stats.concurrency); 
     
    414413  } 
    415414  pthread_mutex_unlock(&driver_lock); 
    416 
     415  return 1; 
     416
     417 
    417418static void 
    418419register_console_rabbitmq_commands() {