Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build]: Fix compiling warnings using ARM 32 bit compiler #1015

Merged
merged 25 commits into from
Aug 16, 2019
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ade486c
ARM32 bit fixes, for 64bit printf format specifier
antony-rheneus Jul 23, 2019
b4b65d9
ARM32 bit fixes, for 64bit printf format specifier
antony-rheneus Jul 23, 2019
1dac556
ARM32 bit fixes, for 64bit printf format specifier
antony-rheneus Jul 24, 2019
82fbf82
Merge remote-tracking branch 'upstream/master'
antony-rheneus Jul 24, 2019
b980260
Add synchronous switch to orch agent (#987)
kcudnik Jul 25, 2019
b5ffa3e
[test]: Update test_vlan to use dvs functions (#986)
stcheng Jul 25, 2019
c764b05
Support per buffer pool watermark polling mode (#973)
wendani Jul 25, 2019
c679b0b
[vstest]: report error when team kernel module is not available (#994)
lguohan Jul 25, 2019
d7f6c02
[qosorch]: Add cir and pir parameters for scheduler (#991)
tengfei-astfs Jul 25, 2019
77e4126
[vstest]: add --imgname option to specify vs image to test (#996)
lguohan Jul 27, 2019
6bb0924
[test]: Add Class object in each test script file (#992)
stcheng Jul 28, 2019
d0fa310
[Warning] Fixed warning reported in ARM32 compiler
antony-rheneus Aug 1, 2019
dfbe8d8
removed extra headers
antony-rheneus Aug 1, 2019
7305d49
merge conflicts
antony-rheneus Aug 1, 2019
9e126c4
merge conflicts
antony-rheneus Aug 1, 2019
d7ea2b3
merge conflicts
antony-rheneus Aug 1, 2019
00c8c93
merge conflicts
antony-rheneus Aug 1, 2019
6512be8
[Warning] Replacing stoul with strtoumax to fix 32/64 bit arch issue
antony-rheneus Aug 2, 2019
b5a52e9
COnverted uint32 to time_t using mktime()
antony-rheneus Aug 6, 2019
c85c1b9
Fix uint32 to time_t using mktime
antony-rheneus Aug 7, 2019
3f94411
Reverted mktime() changes, and used typecast to convert int to time_t
antony-rheneus Aug 7, 2019
df498f3
Removed extra blank spaces and used size_t() instead of typecast
antony-rheneus Aug 13, 2019
f18bb7f
Merge remote-tracking branch 'upstream/master'
antony-rheneus Aug 13, 2019
f6df981
Warning fix for time_t
antony-rheneus Aug 13, 2019
4bb9142
Waring fixes for time_t - fix for tests failure
antony-rheneus Aug 14, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fpmsyncd/fpm/fpm.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ fpm_msg_next (fpm_msg_hdr_t *hdr, size_t *len)
*len -= msg_len;
}

return (fpm_msg_hdr_t *) (((char*) hdr) + msg_len);
return reinterpret_cast<fpm_msg_hdr_t *>(static_cast<void *>(((char*) hdr) + msg_len));
}

/*
Expand Down
2 changes: 1 addition & 1 deletion fpmsyncd/fpmlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void FpmLink::readData()
/* Check for complete messages */
while (true)
{
hdr = (fpm_msg_hdr_t *)(m_messageBuffer + start);
hdr = reinterpret_cast<fpm_msg_hdr_t *>(static_cast<void *>(m_messageBuffer + start));
antony-rheneus marked this conversation as resolved.
Show resolved Hide resolved
left = m_pos - start;
if (left < FPM_MSG_HDR_LEN)
break;
Expand Down
2 changes: 1 addition & 1 deletion fpmsyncd/fpmsyncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ int main(int argc, char **argv)
if (warmStartEnabled)
{
/* Obtain warm-restart timer defined for routing application */
uint32_t warmRestartIval = sync.m_warmStartHelper.getRestartTimer();
time_t warmRestartIval = sync.m_warmStartHelper.getRestartTimer();
antony-rheneus marked this conversation as resolved.
Show resolved Hide resolved
if (!warmRestartIval)
{
warmStartTimer.setInterval(timespec{DEFAULT_ROUTING_RESTART_INTERVAL, 0});
Expand Down
8 changes: 4 additions & 4 deletions orchagent/countercheckorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ void CounterCheckOrch::mcCounterCheck()
bool isLossy = ((1 << prio) & pfcMask) == 0;
if (newMcCounters[prio] == numeric_limits<uint64_t>::max())
{
SWSS_LOG_WARN("Could not retreive MC counters on queue %" PRIu64 " port %s",
SWSS_LOG_WARN("Could not retreive MC counters on queue %zu port %s",
prio,
port.m_alias.c_str());
}
else if (!isLossy && mcCounters[prio] < newMcCounters[prio])
{
SWSS_LOG_WARN("Got Multicast %" PRIu64 " frame(s) on lossless queue %" PRIu64 " port %s",
SWSS_LOG_WARN("Got Multicast %" PRIu64 " frame(s) on lossless queue %zu port %s",
newMcCounters[prio] - mcCounters[prio],
prio,
port.m_alias.c_str());
Expand Down Expand Up @@ -125,13 +125,13 @@ void CounterCheckOrch::pfcFrameCounterCheck()
bool isLossy = ((1 << prio) & pfcMask) == 0;
if (newCounters[prio] == numeric_limits<uint64_t>::max())
{
SWSS_LOG_WARN("Could not retreive PFC frame count on queue %" PRIu64 " port %s",
SWSS_LOG_WARN("Could not retreive PFC frame count on queue %zu port %s",
prio,
port.m_alias.c_str());
}
else if (isLossy && counters[prio] < newCounters[prio])
{
SWSS_LOG_WARN("Got PFC %" PRIu64 " frame(s) on lossy queue %" PRIu64 " port %s",
SWSS_LOG_WARN("Got PFC %" PRIu64 " frame(s) on lossy queue %zu port %s",
newCounters[prio] - counters[prio],
prio,
port.m_alias.c_str());
Expand Down
5 changes: 4 additions & 1 deletion orchagent/crmorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,11 @@ void CrmOrch::handleSetCommand(const string& key, const vector<FieldValueTuple>&
{
if (field == CRM_POLLING_INTERVAL)
{
struct tm tmInterval;
memset(&tmInterval, 0, sizeof(tmInterval));
tmInterval.tm_sec = static_cast<int> (m_pollingInterval.count());
m_pollingInterval = chrono::seconds(to_uint<uint32_t>(value));
auto interv = timespec { .tv_sec = m_pollingInterval.count(), .tv_nsec = 0 };
auto interv = timespec { .tv_sec = mktime(&tmInterval), .tv_nsec = 0 };
m_timer->setInterval(interv);
m_timer->reset();
}
Expand Down
6 changes: 3 additions & 3 deletions orchagent/pfcactionhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ bool PfcWdLossyHandler::getHwCounters(PfcWdHwStats& counters)
return false;
}

sai_object_id_t pg = portInstance.m_priority_group_ids[getQueueId()];
sai_object_id_t pg = portInstance.m_priority_group_ids[static_cast <size_t> (getQueueId())];
antony-rheneus marked this conversation as resolved.
Show resolved Hide resolved
vector<uint64_t> pgStats;
pgStats.resize(pgStatIds.size());

Expand Down Expand Up @@ -469,7 +469,7 @@ PfcWdZeroBufferHandler::PfcWdZeroBufferHandler(sai_object_id_t port,
return;
}

sai_object_id_t pg = portInstance.m_priority_group_ids[queueId];
sai_object_id_t pg = portInstance.m_priority_group_ids[static_cast <size_t> (queueId)];

attr.id = SAI_INGRESS_PRIORITY_GROUP_ATTR_BUFFER_PROFILE;

Expand Down Expand Up @@ -521,7 +521,7 @@ PfcWdZeroBufferHandler::~PfcWdZeroBufferHandler(void)
return;
}

sai_object_id_t pg = portInstance.m_priority_group_ids[getQueueId()];
sai_object_id_t pg = portInstance.m_priority_group_ids[static_cast <size_t> (getQueueId())];
antony-rheneus marked this conversation as resolved.
Show resolved Hide resolved

attr.id = SAI_INGRESS_PRIORITY_GROUP_ATTR_BUFFER_PROFILE;
attr.value.oid = m_originalPgBufferProfile;
Expand Down
9 changes: 5 additions & 4 deletions orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,8 @@ bool PortsOrch::bake()
vector<FieldValueTuple> tuples;
string value;
bool foundPortConfigDone = m_portTable->hget("PortConfigDone", "count", value);
unsigned long portCount;
uintmax_t portCount;
char* endPtr = NULL;
SWSS_LOG_NOTICE("foundPortConfigDone = %d", foundPortConfigDone);

bool foundPortInitDone = m_portTable->get("PortInitDone", tuples);
Expand All @@ -1447,12 +1448,12 @@ bool PortsOrch::bake()
return false;
}

portCount = stoul(value);
SWSS_LOG_NOTICE("portCount = %" PRIu64 ", m_portCount = %u", portCount, m_portCount);
portCount = strtoumax(value.c_str(), &endPtr, 0);
SWSS_LOG_NOTICE("portCount = %" PRIuMAX ", m_portCount = %u", portCount, m_portCount);
if (portCount != keys.size() - 2)
{
// Invalid port table
SWSS_LOG_ERROR("Invalid port table: portCount, expecting %" PRIu64 ", got %" PRIu64,
SWSS_LOG_ERROR("Invalid port table: portCount, expecting %" PRIuMAX ", got %zu",
portCount, keys.size() - 2);

cleanPortTable(keys);
Expand Down
2 changes: 1 addition & 1 deletion orchagent/qosorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ bool QosOrch::applySchedulerToQueueSchedulerGroup(Port &port, size_t queue_ind,
const sai_object_id_t group_id = getSchedulerGroup(port, queue_id);
if(group_id == SAI_NULL_OBJECT_ID)
{
SWSS_LOG_ERROR("Failed to find a scheduler group for port: %s queue: %" PRIu64, port.m_alias.c_str(), queue_ind);
SWSS_LOG_ERROR("Failed to find a scheduler group for port: %s queue: %zu", port.m_alias.c_str(), queue_ind);
return false;
}

Expand Down
7 changes: 5 additions & 2 deletions orchagent/watermarkorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ void WatermarkOrch::handleWmConfigUpdate(const std::string &key, const std::vect
{
if (i.first == "interval")
{
auto intervT = timespec { .tv_sec = to_uint<uint32_t>(i.second.c_str()) , .tv_nsec = 0 };
struct tm tmInterval;
memset(&tmInterval, 0, sizeof(tmInterval));
tmInterval.tm_sec = to_uint<uint32_t>(i.second.c_str());
antony-rheneus marked this conversation as resolved.
Show resolved Hide resolved
auto intervT = timespec { .tv_sec = mktime(&tmInterval), .tv_nsec = 0 };
m_telemetryTimer->setInterval(intervT);
// reset the timer interval when current timer expires
m_timerChanged = true;
Expand Down Expand Up @@ -295,7 +298,7 @@ void WatermarkOrch::clearSingleWm(Table *table, string wm_name, vector<sai_objec
{
/* Zero-out some WM in some table for some vector of object ids*/
SWSS_LOG_ENTER();
SWSS_LOG_DEBUG("clear WM %s, for %" PRId64 " obj ids", wm_name.c_str(), obj_ids.size());
SWSS_LOG_DEBUG("clear WM %s, for %zu obj ids", wm_name.c_str(), obj_ids.size());

vector<FieldValueTuple> vfvt = {{wm_name, "0"}};

Expand Down
2 changes: 1 addition & 1 deletion warmrestart/warmRestartAssist.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class AppRestartAssist
std::string m_appTableName; // application table name

bool m_warmStartInProgress; // indicate if warm start is in progress
uint32_t m_reconcileTimer; // reconcile timer value
time_t m_reconcileTimer; // reconcile timer value
antony-rheneus marked this conversation as resolved.
Show resolved Hide resolved
SelectableTimer m_warmStartTimer; // reconcile timer

// Set or get cache entry state
Expand Down