Commit b72f732d authored by Mike Hibler's avatar Mike Hibler

Fix things that clang found.

Including one piece of incorrect code that might have prevented us
from getting a meaningful error message on a failed RPC.
parent e81136ad
/*
* Copyright (c) 2004-2011 University of Utah and the Flux Group.
* Copyright (c) 2004-2014 University of Utah and the Flux Group.
*
* {{{EMULAB-LICENSE
*
......@@ -84,6 +84,7 @@ int console_agent_invariant(console_agent_t ca)
{
assert(ca != NULL);
assert(local_agent_invariant(&ca->ca_local_agent));
return 1;
}
static void do_start(console_agent_t ca, sched_event_t *se)
......
/*
* emulab_proxy.cpp
*
* Copyright (c) 2004 The University of Utah and the Flux Group.
* Copyright (c) 2004-2014 The University of Utah and the Flux Group.
* All rights reserved.
*
* This file is licensed under the terms of the GNU Public License.
......@@ -39,7 +39,7 @@ EmulabResponse::EmulabResponse(xmlrpc_c::value result)
std::map<std::string, xmlrpc_c::value> result_map;
std::map<std::string, xmlrpc_c::value>::iterator p;
if (!result.type() == xmlrpc_c::value::TYPE_STRUCT)
if (result.type() != xmlrpc_c::value::TYPE_STRUCT)
{
throw girerr::error("Invalid response from server");
}
......
/*
* Copyright (c) 2004-2011 University of Utah and the Flux Group.
* Copyright (c) 2004-2014 University of Utah and the Flux Group.
*
* {{{EMULAB-LICENSE
*
......@@ -128,6 +128,7 @@ int node_agent_invariant(node_agent_t na)
{
assert(na != NULL);
assert(local_agent_invariant(&na->na_local_agent));
return 1;
}
static char *expand_nodeids(sched_event_t *se)
......
/*
* Copyright (c) 2000-2011 University of Utah and the Flux Group.
* Copyright (c) 2000-2014 University of Utah and the Flux Group.
*
* {{{EMULAB-LICENSE
*
......@@ -142,7 +142,7 @@ sched_event_enqueue(sched_event_t event)
"enqueued event (event=(notification=%p, "
"time=(tv_sec=%ld, tv_usec=%ld)))\n",
event.notification,
event.time.tv_sec,
(long int)event.time.tv_sec,
event.time.tv_usec);
}
......@@ -213,7 +213,7 @@ sched_event_dequeue(sched_event_t *event, int wait)
if (debug > 3) {
fprintf(stderr,
"sleeping until time=(tv_sec=%ld, tv_usec=%ld).\n",
event->time.tv_sec, event->time.tv_usec);
(long int)event->time.tv_sec, event->time.tv_usec);
}
if ((err = pthread_cond_timedwait(&event_queue_cond,
......@@ -272,7 +272,7 @@ sched_event_dequeue(sched_event_t *event, int wait)
"dequeued event (event=(notification=%p, "
"time=(tv_sec=%ld, tv_usec=%ld)))\n",
event->notification,
event->time.tv_sec,
(long int)event->time.tv_sec,
event->time.tv_usec);
}
......@@ -312,7 +312,7 @@ sched_event_queue_dump_node_and_descendents(FILE *fp, int index, int level)
fprintf(fp, " ");
}
fprintf(fp, "node %d: event=(time=(tv_sec=%ld, tv_usec=%ld))\n", index,
event_queue[index].time.tv_sec,
(long int)event_queue[index].time.tv_sec,
event_queue[index].time.tv_usec);
fflush(fp);
......
......@@ -158,6 +158,8 @@ RPC_connect(xmlrpc_c::clientXmlTransport **transport)
if (pthread_mutex_unlock(&rpc_data.mutex) != 0)
assert(0);
return retval;
}
static void
......
......@@ -504,11 +504,11 @@ static int strreltime(char *buf, size_t buflen, time_t secs)
secs = secs % 60;
if (hours)
snprintf(buf, buflen, "%s%dh%dm%ds", signage, hours, mins, secs);
snprintf(buf, buflen, "%s%dh%dm%ds", signage, hours, mins, (int)secs);
else if (mins)
snprintf(buf, buflen, "%s%dm%ds", signage, mins, secs);
snprintf(buf, buflen, "%s%dm%ds", signage, mins, (int)secs);
else
snprintf(buf, buflen, "%s%ds", signage, secs);
snprintf(buf, buflen, "%s%ds", signage, (int)secs);
return retval;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment