Fix indentation: this is a better way to address new gcc warnings

This commit is contained in:
Dmitri Tikhonov 2018-05-07 14:30:52 -04:00
parent 3b55db2dfb
commit 2a5cd80e91
6 changed files with 30 additions and 36 deletions

View file

@ -37,12 +37,6 @@ SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -fno-omit-frame-pointer")
IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9.3)
SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -Wno-missing-field-initializers")
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCC AND (
CMAKE_C_COMPILER_VERSION VERSION_EQUAL 6.0.0
OR
CMAKE_C_COMPILER_VERSION VERSION_GREATER 6))
SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -Wno-misleading-indentation")
ENDIF()
IF(DEVEL_MODE EQUAL 1)
SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -O0 -g3")
IF(CMAKE_C_COMPILER MATCHES "clang" AND

View file

@ -657,7 +657,7 @@ engine_decref_conn (lsquic_engine_t *engine, lsquic_conn_t *conn,
(refflags2str(conn->cn_flags, str[1]), str[1]));
if (0 == (conn->cn_flags & CONN_REF_FLAGS))
{
eng_hist_inc(&engine->history, 0, sl_del_full_conns);
eng_hist_inc(&engine->history, 0, sl_del_full_conns);
destroy_conn(engine, conn);
return NULL;
}
@ -695,7 +695,7 @@ conn_iter_next_tickable (struct lsquic_engine *engine)
{
lsquic_conn_t *conn;
conn = lsquic_mh_pop(&engine->conns_tickable);
conn = lsquic_mh_pop(&engine->conns_tickable);
if (conn)
conn = engine_decref_conn(engine, conn, LSCONN_TICKABLE);

View file

@ -39,7 +39,7 @@
void
lsquic_ev_log_packet_in (lsquic_cid_t cid, const lsquic_packet_in_t *packet_in)
{
LCID("packet in: %"PRIu64, packet_in->pi_packno);
LCID("packet in: %"PRIu64, packet_in->pi_packno);
}

View file

@ -501,13 +501,13 @@ apply_peer_settings (struct full_conn *conn)
return 0;
#endif
for (n = 0; n < sizeof(tags) / sizeof(tags[0]); ++n)
if (0 != conn->fc_conn.cn_esf->esf_get_peer_setting(
conn->fc_conn.cn_enc_session, tags[n].tag, tags[n].val))
{
LSQ_INFO("peer did not supply value for %s", tags[n].tag_str);
return -1;
}
for (n = 0; n < sizeof(tags) / sizeof(tags[0]); ++n)
if (0 != conn->fc_conn.cn_esf->esf_get_peer_setting(
conn->fc_conn.cn_enc_session, tags[n].tag, tags[n].val))
{
LSQ_INFO("peer did not supply value for %s", tags[n].tag_str);
return -1;
}
LSQ_DEBUG("peer settings: CFCW: %u; SFCW: %u; MIDS: %u",
cfcw, sfcw, mids);
@ -1793,7 +1793,7 @@ reconstruct_packet_number (struct full_conn *conn, lsquic_packet_in_t *packet_in
static int
conn_decrypt_packet (struct full_conn *conn, lsquic_packet_in_t *packet_in)
{
return lsquic_conn_decrypt_packet(&conn->fc_conn, conn->fc_enpub,
return lsquic_conn_decrypt_packet(&conn->fc_conn, conn->fc_enpub,
packet_in);
}

View file

@ -638,30 +638,30 @@ static int parse_hs_data (lsquic_enc_session_t *enc_session, uint32_t tag,
break;
case QTAG_SNO:
lsquic_str_setto(&enc_session->ssno, val, len);
lsquic_str_setto(&enc_session->ssno, val, len);
ESHIST_APPEND(enc_session, ESHE_SET_SNO);
break;
case QTAG_STK:
if (lsquic_str_len(&enc_session->info->sstk) > 0)
remove_session_info_entry(&enc_session->info->sstk);
lsquic_str_setto(&enc_session->info->sstk, val, len);
if (lsquic_str_len(&enc_session->info->sstk) > 0)
remove_session_info_entry(&enc_session->info->sstk);
lsquic_str_setto(&enc_session->info->sstk, val, len);
ESHIST_APPEND(enc_session, ESHE_SET_STK);
break;
case QTAG_SCID:
if (len != SCID_LENGTH)
return -1;
memcpy(enc_session->info->sscid, val, len);
memcpy(enc_session->info->sscid, val, len);
ESHIST_APPEND(enc_session, ESHE_SET_SCID);
break;
case QTAG_AEAD:
enc_session->info->aead = get_tag_value_i32(val, len);
enc_session->info->aead = get_tag_value_i32(val, len);
break;
case QTAG_KEXS:
enc_session->info->kexs = get_tag_value_i32(val, len);
enc_session->info->kexs = get_tag_value_i32(val, len);
break;
case QTAG_NONC:
@ -671,8 +671,8 @@ static int parse_hs_data (lsquic_enc_session_t *enc_session, uint32_t tag,
break;
case QTAG_SCFG:
lsquic_str_setto(&enc_session->info->scfg, val, len);
enc_session->info->scfg_flag = 1;
lsquic_str_setto(&enc_session->info->scfg, val, len);
enc_session->info->scfg_flag = 1;
break;
case QTAG_PROF:
@ -1135,9 +1135,9 @@ determine_diversification_key (lsquic_enc_session_t *enc_session,
unsigned char *key_i, *iv;
uint8_t ikm[aes128_key_len + aes128_iv_len];
ctx_s_key = &enc_session->dec_ctx_i;
key_i = enc_session->dec_key_i;
iv = enc_session->dec_key_nonce_i;
ctx_s_key = &enc_session->dec_ctx_i;
key_i = enc_session->dec_key_i;
iv = enc_session->dec_key_nonce_i;
memcpy(ikm, key_i, aes128_key_len);
memcpy(ikm + aes128_key_len, iv, aes128_iv_len);
export_key_material(ikm, aes128_key_len + aes128_iv_len,
@ -1437,10 +1437,10 @@ verify_packet_hash (const lsquic_enc_session_t *enc_session,
if (version >= LSQVER_037)
{
hash = fnv1a_128_3(buf, *header_len,
buf + *header_len + HS_PKT_HASH_LENGTH,
data_len - HS_PKT_HASH_LENGTH,
(unsigned char *) "Server", 6);
hash = fnv1a_128_3(buf, *header_len,
buf + *header_len + HS_PKT_HASH_LENGTH,
data_len - HS_PKT_HASH_LENGTH,
(unsigned char *) "Server", 6);
}
else
{
@ -1602,8 +1602,8 @@ lsquic_enc_session_encrypt (lsquic_enc_session_t *enc_session,
if (version >= LSQVER_037)
{
hash = fnv1a_128_3(header, header_len, data, data_len,
(unsigned char *) "Client", 6);
hash = fnv1a_128_3(header, header_len, data, data_len,
(unsigned char *) "Client", 6);
}
else
{

View file

@ -825,7 +825,7 @@ send_ctl_next_lost (lsquic_send_ctl_t *ctl)
TAILQ_REMOVE(&ctl->sc_lost_packets, lost_packet, po_next);
if (lost_packet->po_frame_types & (1 << QUIC_FRAME_STREAM))
{
lsquic_packet_out_elide_reset_stream_frames(lost_packet, 0);
lsquic_packet_out_elide_reset_stream_frames(lost_packet, 0);
}
return lost_packet;
}