Skip to content

Commit

Permalink
Fix type errors building in 64-bit mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mikee47 committed Jun 18, 2024
1 parent 3682263 commit 0af995d
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Sming/Libraries/ArduCAM/ArduCAMStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ uint16_t ArduCAMStream::readMemoryBlock(char* data, int bufSize) {

}

int bytesread = min(len, (unsigned int)bufSize);
int bytesread = min(len, size_t(bufSize));

ACAM_DEBUG("ArduCAMStream::readMemoryBlock [%d] (%d bytes) remaining (%d bytes)\n", bcount++, bytesread, len);

Expand Down
2 changes: 1 addition & 1 deletion Sming/Libraries/HardwareSPI
2 changes: 1 addition & 1 deletion Sming/Libraries/LittleFS
Submodule LittleFS updated 1 files
+1 −1 src/FileSystem.cpp
2 changes: 1 addition & 1 deletion Sming/Libraries/MultipartParser/src/MultipartParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ int MultipartParser::partHeadersComplete(multipart_parser_t* p)
.name = name,
.fileName = fileName,
.mime = headers[HTTP_HEADER_CONTENT_TYPE],
.length = contentLength ? contentLength.toInt() : -1,
.length = contentLength ? int(contentLength.toInt()) : -1,
};

auto checkerStream = static_cast<PartCheckerStream*>(stream);
Expand Down
2 changes: 1 addition & 1 deletion Sming/Libraries/SPI/test/app/SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ class SpiTest : public TestGroup
{
String inData = outData;
auto bufptr = reinterpret_cast<uint8_t*>(inData.begin() + startOffset);
auto length = inData.length() - startOffset;
unsigned length = inData.length() - startOffset;

debug_i("TX %u bytes, startOffset %u, %cSB first", length, startOffset,
settings.bitOrder == MSBFIRST ? 'M' : 'L');
Expand Down
2 changes: 1 addition & 1 deletion Sming/Libraries/USB
Submodule USB updated 1 files
+1 −1 src/USB/MSC/Device.cpp
2 changes: 1 addition & 1 deletion Sming/System/include/m_printf.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ size_t m_puts(const char* str);

extern "C++" {

template <typename... Args> int snprintf(char* buf, int length, const char* fmt, Args... args)
template <typename... Args> int snprintf(char* buf, size_t length, const char* fmt, Args... args)
{
return m_snprintf(buf, length, fmt, args...);
}
Expand Down
4 changes: 2 additions & 2 deletions Sming/Wiring/WVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ template <typename Element> class Vector : public Countable<Element>
removeAllElements();
}

bool ensureCapacity(unsigned int minCapacity);
bool ensureCapacity(size_t minCapacity);

void removeAllElements()
{
Expand Down Expand Up @@ -376,7 +376,7 @@ template <class Element> bool Vector<Element>::addElement(Element* objp)
return true;
}

template <class Element> bool Vector<Element>::ensureCapacity(unsigned int minCapacity)
template <class Element> bool Vector<Element>::ensureCapacity(size_t minCapacity)
{
if(_data.size >= minCapacity) {
return true;
Expand Down
2 changes: 1 addition & 1 deletion samples/Basic_Storage/app/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void printPart(Storage::Partition part)
String s = part.getDeviceName();
s += '/';
s += part.name();
m_printHex(s.c_str(), buf, std::min(128U, bufSize));
m_printHex(s.c_str(), buf, std::min(size_t(128U), bufSize));
Serial << _F("Elapsed: ") << elapsed.toString() << endl;
if(elapsed != 0) {
Serial << _F("Speed: ") << 1000 * bufSize / elapsed << " KB/s" << endl;
Expand Down
4 changes: 2 additions & 2 deletions tests/HostTests/modules/ArduinoString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ class ArduinoStringTest : public TestGroup
REQUIRE(str == "cleanclean");
// non-decimal negative #s should be as if they were unsigned
str = String((int)-100, 16);
REQUIRE(str == "ffffff9c");
REQUIRE_EQ(str, sizeof(long) == 4 ? "ffffff9c" : "ffffffffffffff9c");
str = String((long)-101, 16);
REQUIRE(str == "ffffff9b");
REQUIRE_EQ(str, sizeof(long) == 4 ? "ffffff9b" : "ffffffffffffff9b");
str = String((int)-100, 10);
REQUIRE(str == "-100");
str = String((long)-100, 10);
Expand Down

0 comments on commit 0af995d

Please sign in to comment.