Cleaned up integer type usage in wpilibc (#92)

Replaced all unsigned types to signed and int32_t with int in wpilibc
This commit is contained in:
Tyler Veness
2016-09-06 00:01:45 -07:00
committed by Peter Johnson
parent ff93050b31
commit 0cd05d1a42
169 changed files with 914 additions and 943 deletions

View File

@@ -20,8 +20,8 @@
#include "Timer.h"
#include "WPIErrors.h"
static const unsigned int kMaxPacketSize = 1536;
static const unsigned int kImageBufferAllocationIncrement = 1000;
static const int kMaxPacketSize = 1536;
static const int kImageBufferAllocationIncrement = 1000;
static const std::string kWhiteBalanceStrings[] = {
"auto", "hold", "fixed_outdoor1", "fixed_outdoor2",
@@ -123,8 +123,8 @@ HSLImage* AxisCamera::GetImage() {
* @param numBytes The size of the destination image.
* @return 0 if failed (no source image or no memory), 1 if success.
*/
int AxisCamera::CopyJPEG(char** destImage, unsigned int& destImageSize,
unsigned int& destImageBufferSize) {
int AxisCamera::CopyJPEG(char** destImage, int& destImageSize,
int& destImageBufferSize) {
std::lock_guard<priority_mutex> lock(m_imageDataMutex);
if (destImage == nullptr) {
wpi_setWPIErrorWithContext(NullParameter, "destImage must not be nullptr");
@@ -134,7 +134,7 @@ int AxisCamera::CopyJPEG(char** destImage, unsigned int& destImageSize,
if (m_imageData.size() == 0) return 0; // if no source image
// if current destination buffer too small
if (destImageBufferSize < m_imageData.size()) {
if (static_cast<uint32_t>(destImageBufferSize) < m_imageData.size()) {
if (*destImage != nullptr) delete[] * destImage;
destImageBufferSize = m_imageData.size() + kImageBufferAllocationIncrement;
*destImage = new char[destImageBufferSize];

View File

@@ -622,19 +622,18 @@ int frcColorEqualize(Image* dest, const Image* source, int colorEqualization) {
* @return On success: 1. On failure: 0. To get extended error information, call
* GetLastError().
*/
int frcSmartThreshold(Image* dest, const Image* source,
unsigned int windowWidth, unsigned int windowHeight,
LocalThresholdMethod method, double deviationWeight,
ObjectType type) {
int frcSmartThreshold(Image* dest, const Image* source, int windowWidth,
int windowHeight, LocalThresholdMethod method,
double deviationWeight, ObjectType type) {
float replaceValue = 1.0;
return imaqLocalThreshold(dest, source, windowWidth, windowHeight, method,
deviationWeight, type, replaceValue);
}
int frcSmartThreshold(Image* dest, const Image* source,
unsigned int windowWidth, unsigned int windowHeight,
LocalThresholdMethod method, double deviationWeight,
ObjectType type, float replaceValue) {
int frcSmartThreshold(Image* dest, const Image* source, int windowWidth,
int windowHeight, LocalThresholdMethod method,
double deviationWeight, ObjectType type,
float replaceValue) {
return imaqLocalThreshold(dest, source, windowWidth, windowHeight, method,
deviationWeight, type, replaceValue);
}