Remove compilation warnings

This commit is contained in:
Léa Saviot
2019-01-24 13:38:50 +01:00
committed by Émilie Feral
parent f9fbcabb30
commit 39f6f4f5bb
4 changed files with 8 additions and 6 deletions

View File

@@ -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

View File

@@ -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<char *>(cursorLocation())) = 0;
layoutSubviews();
return true;

View File

@@ -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;

View File

@@ -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;
}