From 07cba950b89253a1a9d2857dfcec7744e87fc5ba Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Tue, 10 Feb 2015 16:14:49 -0600 Subject: [PATCH] Fix gcc compile warnings. --- aux/broker | 2 +- src/EventHandler.cc | 2 +- src/comm/Data.cc | 10 ++++++---- src/comm/Manager.cc | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/aux/broker b/aux/broker index 0af74017e2..9def853ec4 160000 --- a/aux/broker +++ b/aux/broker @@ -1 +1 @@ -Subproject commit 0af74017e28d78179a25d60ca80385af444d39f1 +Subproject commit 9def853ec4498e0133735938355832e0a7628ec8 diff --git a/src/EventHandler.cc b/src/EventHandler.cc index d623f43b66..c252951781 100644 --- a/src/EventHandler.cc +++ b/src/EventHandler.cc @@ -94,7 +94,7 @@ void EventHandler::Call(val_list* vl, bool no_remote) msg.emplace_back(Name()); bool valid_args = true; - for ( auto i = 0u; i < vl->length(); ++i ) + for ( auto i = 0; i < vl->length(); ++i ) { auto opt_data = comm::val_to_data((*vl)[i]); diff --git a/src/comm/Data.cc b/src/comm/Data.cc index 0ea7666f9e..77b2a496bf 100644 --- a/src/comm/Data.cc +++ b/src/comm/Data.cc @@ -192,7 +192,8 @@ struct val_converter { auto expected_index_types = tt->Indices()->Types(); - if ( expected_index_types->length() != indices->size() ) + if ( static_cast(expected_index_types->length()) != + indices->size() ) { Unref(rval); return nullptr; @@ -244,7 +245,8 @@ struct val_converter { auto expected_index_types = tt->Indices()->Types(); - if ( expected_index_types->length() != indices->size() ) + if ( static_cast(expected_index_types->length()) != + indices->size() ) { Unref(rval); return nullptr; @@ -315,7 +317,7 @@ struct val_converter { auto rt = type->AsRecordType(); - if ( a.fields.size() != rt->NumFields() ) + if ( a.fields.size() != static_cast(rt->NumFields()) ) return nullptr; auto rval = new RecordVal(rt); @@ -505,7 +507,7 @@ broker::util::optional comm::val_to_data(Val* v) { auto rec = v->AsRecordVal(); broker::record rval; - auto num_fields = v->Type()->AsRecordType()->NumFields(); + size_t num_fields = v->Type()->AsRecordType()->NumFields(); rval.fields.reserve(num_fields); for ( auto i = 0u; i < num_fields; ++i ) diff --git a/src/comm/Manager.cc b/src/comm/Manager.cc index 6c09c08f2b..92b2c167dd 100644 --- a/src/comm/Manager.cc +++ b/src/comm/Manager.cc @@ -322,7 +322,7 @@ RecordVal* comm::Manager::MakeEventArgs(val_list* args) rval->Assign(1, arg_vec); Func* func; - for ( auto i = 0u; i < args->length(); ++i ) + for ( auto i = 0; i < args->length(); ++i ) { auto arg_val = (*args)[i]; @@ -742,7 +742,7 @@ void comm::Manager::Process() auto arg_types = ehp->FType()->ArgTypes()->Types(); - if ( arg_types->length() != em.size() - 1 ) + if ( static_cast(arg_types->length()) != em.size() - 1 ) { reporter->Warning("got event message with invalid # of args," " got %zd, expected %d", em.size() - 1, @@ -766,7 +766,7 @@ void comm::Manager::Process() } } - if ( vl->length() == em.size() - 1 ) + if ( static_cast(vl->length()) == em.size() - 1 ) mgr.QueueEvent(ehp, vl); else delete_vals(vl);