diff --git a/escher/image/inliner.c b/escher/image/inliner.c index 67d983feb..a2f49e655 100644 --- a/escher/image/inliner.c +++ b/escher/image/inliner.c @@ -179,8 +179,8 @@ void generateImplementationFromImage(FILE * file, const char * header, const cha int maxSizeOfCompressedPixelBuffer = LZ4_compressBound(sizeOfPixelBuffer); uint8_t * compressedPixelBuffer = malloc(maxSizeOfCompressedPixelBuffer); int sizeOfCompressedPixelBuffer = LZ4_compress_HC( - pixelBuffer, - compressedPixelBuffer, + (const char *)pixelBuffer, + (char *)compressedPixelBuffer, sizeOfPixelBuffer, maxSizeOfCompressedPixelBuffer, LZ4HC_CLEVEL_MAX diff --git a/escher/src/text_field.cpp b/escher/src/text_field.cpp index 713999917..3e795925d 100644 --- a/escher/src/text_field.cpp +++ b/escher/src/text_field.cpp @@ -171,11 +171,12 @@ bool TextField::ContentView::removeCodePoint() { bool TextField::ContentView::removeEndOfLine() { assert(m_isEditing); - if (m_currentDraftTextLength == cursorLocation() - m_draftTextBuffer) { + size_t lengthToCursor = (size_t)(cursorLocation() - m_draftTextBuffer); + if (m_currentDraftTextLength == lengthToCursor) { return false; } reloadRectFromPosition(m_horizontalAlignment == 0.0f ? cursorLocation() : m_draftTextBuffer); - m_currentDraftTextLength = cursorLocation() - m_draftTextBuffer; + m_currentDraftTextLength = lengthToCursor; *(const_cast(cursorLocation())) = 0; layoutSubviews(); return true; diff --git a/ion/include/ion/unicode/utf8_decoder.h b/ion/include/ion/unicode/utf8_decoder.h index 7b309b2dc..430075a83 100644 --- a/ion/include/ion/unicode/utf8_decoder.h +++ b/ion/include/ion/unicode/utf8_decoder.h @@ -28,7 +28,7 @@ public: CodePoint previousCodePoint(); const char * stringPosition() const { return m_stringPosition; } static size_t CharSizeOfCodePoint(CodePoint c); - static size_t CodePointToChars(CodePoint c, char * buffer, int bufferSize); + static size_t CodePointToChars(CodePoint c, char * buffer, size_t bufferSize); private: const char * const m_string; const char * m_stringPosition; diff --git a/ion/src/shared/unicode/utf8_decoder.cpp b/ion/src/shared/unicode/utf8_decoder.cpp index e70e08683..73ef028a1 100644 --- a/ion/src/shared/unicode/utf8_decoder.cpp +++ b/ion/src/shared/unicode/utf8_decoder.cpp @@ -9,6 +9,7 @@ static inline int leading_ones(uint8_t value) { value = value << 1; } assert(false); + return 0; } static inline uint8_t last_k_bits(uint8_t value, uint8_t bits) { @@ -68,7 +69,7 @@ size_t UTF8Decoder::CharSizeOfCodePoint(CodePoint c) { return 4; } -size_t UTF8Decoder::CodePointToChars(CodePoint c, char * buffer, int bufferSize) { +size_t UTF8Decoder::CodePointToChars(CodePoint c, char * buffer, size_t bufferSize) { if (bufferSize <= 0) { return 0; }