mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Fixed some warnings printed during wpilibC++Sim build
Change-Id: I11eea8a577af7c37c61978edd721ca16e4e41748
This commit is contained in:
committed by
Brad Miller (WPI)
parent
771b5807f4
commit
a7feaddd6b
@@ -56,7 +56,7 @@ uint32_t Resource::Allocate(const std::string &resourceDesc) {
|
||||
}
|
||||
}
|
||||
wpi_setWPIErrorWithContext(NoAvailableResources, resourceDesc);
|
||||
return ~0ul;
|
||||
return std::numeric_limits<uint32_t>::max();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,11 +69,11 @@ uint32_t Resource::Allocate(uint32_t index, const std::string &resourceDesc) {
|
||||
std::unique_lock<priority_recursive_mutex> sync(m_allocateLock);
|
||||
if (index >= m_isAllocated.size()) {
|
||||
wpi_setWPIErrorWithContext(ChannelIndexOutOfRange, resourceDesc);
|
||||
return ~0ul;
|
||||
return std::numeric_limits<uint32_t>::max();
|
||||
}
|
||||
if (m_isAllocated[index]) {
|
||||
wpi_setWPIErrorWithContext(ResourceAlreadyAllocated, resourceDesc);
|
||||
return ~0ul;
|
||||
return std::numeric_limits<uint32_t>::max();
|
||||
}
|
||||
m_isAllocated[index] = true;
|
||||
return index;
|
||||
@@ -88,7 +88,7 @@ uint32_t Resource::Allocate(uint32_t index, const std::string &resourceDesc) {
|
||||
*/
|
||||
void Resource::Free(uint32_t index) {
|
||||
std::unique_lock<priority_recursive_mutex> sync(m_allocateLock);
|
||||
if (index == ~0ul) return;
|
||||
if (index == std::numeric_limits<uint32_t>::max()) return;
|
||||
if (index >= m_isAllocated.size()) {
|
||||
wpi_setWPIError(NotAllocated);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user