mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
Clean some warnings
This commit is contained in:
@@ -69,7 +69,7 @@ int CartesianFunction::derivativeNameWithArgument(char * buffer, size_t bufferSi
|
||||
// Fill buffer with f(x). Keep size for derivative sign.
|
||||
int derivativeSize = UTF8Decoder::CharSizeOfCodePoint('\'');
|
||||
int numberOfChars = nameWithArgument(buffer, bufferSize - derivativeSize, arg);
|
||||
assert(numberOfChars + derivativeSize < bufferSize);
|
||||
assert(numberOfChars + derivativeSize < (int)bufferSize);
|
||||
char * firstParenthesis = const_cast<char *>(UTF8Helper::CodePointSearch(buffer, '('));
|
||||
if (!UTF8Helper::CodePointIs(firstParenthesis, '(')) {
|
||||
return numberOfChars;
|
||||
|
||||
@@ -68,7 +68,7 @@ int Function::nameWithArgument(char * buffer, size_t bufferSize, CodePoint arg)
|
||||
assert(UTF8Decoder::CharSizeOfCodePoint(arg) == 1);
|
||||
const char * functionName = fullName();
|
||||
size_t baseNameLength = SymbolAbstract::TruncateExtension(buffer, functionName, bufferSize - k_parenthesedArgumentLength);
|
||||
int result = baseNameLength + strlcpy(&buffer[baseNameLength], k_parenthesedArgument, bufferSize-baseNameLength);
|
||||
size_t result = baseNameLength + strlcpy(&buffer[baseNameLength], k_parenthesedArgument, bufferSize-baseNameLength);
|
||||
int bufferRemainingSize = bufferSize - (baseNameLength+1);
|
||||
if (bufferRemainingSize > 0) {
|
||||
UTF8Decoder::CodePointToChars(arg, buffer+baseNameLength+1, bufferRemainingSize);
|
||||
|
||||
@@ -11,7 +11,7 @@ void PadWithSpaces(char * buffer, int bufferSize, int * currentNumberOfChar, int
|
||||
size_t currentGlyphLength = UTF8Helper::StringGlyphLength(buffer, *currentNumberOfChar);
|
||||
bool addedPadding = false;
|
||||
assert(UTF8Decoder::CharSizeOfCodePoint(' ') == 1);
|
||||
while (currentGlyphLength < maxGlyphLengthWithPadding && *currentNumberOfChar < bufferSize) {
|
||||
while ((int)currentGlyphLength < maxGlyphLengthWithPadding && *currentNumberOfChar < bufferSize) {
|
||||
*currentNumberOfChar = *currentNumberOfChar + UTF8Decoder::CodePointToChars(' ', buffer + *currentNumberOfChar, bufferSize - *currentNumberOfChar);
|
||||
addedPadding = true;
|
||||
currentGlyphLength++;
|
||||
|
||||
@@ -21,7 +21,7 @@ TextArea::TextArea(Responder * parentResponder, View * contentView, const KDFont
|
||||
|
||||
static inline void InsertSpacesAtLocation(int spacesCount, char * buffer, int bufferSize) {
|
||||
assert(buffer != nullptr);
|
||||
assert(strlen(buffer) + spacesCount < bufferSize);
|
||||
assert((int)(strlen(buffer) + spacesCount) < bufferSize);
|
||||
|
||||
size_t sizeToMove = strlen(buffer) + 1;
|
||||
size_t spaceCharSize = UTF8Decoder::CharSizeOfCodePoint(' ');
|
||||
|
||||
@@ -105,7 +105,7 @@ size_t UTF8Decoder::CodePointToChars(CodePoint c, char * buffer, size_t bufferSi
|
||||
return 0;
|
||||
}
|
||||
size_t i = 0;
|
||||
int charCount = CharSizeOfCodePoint(c);
|
||||
size_t charCount = CharSizeOfCodePoint(c);
|
||||
if (charCount == 1) {
|
||||
buffer[i++] = c;
|
||||
} else if (charCount == 2) {
|
||||
|
||||
@@ -100,6 +100,7 @@ void CopyAndRemoveCodePoint(char * dst, size_t dstSize, const char * src, CodePo
|
||||
const char * nextPointer = decoder.stringPosition();
|
||||
size_t bufferIndex = 0;
|
||||
size_t codePointCharSize = UTF8Decoder::CharSizeOfCodePoint(c);
|
||||
(void)codePointCharSize; // Silence compilation warning about unused variable.
|
||||
|
||||
// Remove CodePoint c
|
||||
while (codePoint != UCodePointNull && bufferIndex < dstSize) {
|
||||
@@ -122,7 +123,8 @@ void RemoveCodePoint(char * buffer, CodePoint c, const char * * pointerToUpdate,
|
||||
const char * initialPointerToUpdate = *pointerToUpdate;
|
||||
const char * nextPointer = decoder.stringPosition();
|
||||
size_t bufferIndex = 0;
|
||||
size_t codePointCharSize = UTF8Decoder::CharSizeOfCodePoint(c);
|
||||
int codePointCharSize = UTF8Decoder::CharSizeOfCodePoint(c);
|
||||
(void)codePointCharSize; // Silence compilation warning about unused variable.
|
||||
|
||||
while (codePoint != UCodePointNull && (stoppingPosition == nullptr || currentPointer < stoppingPosition)) {
|
||||
if (codePoint != c) {
|
||||
|
||||
Reference in New Issue
Block a user