diff --git a/crengine/src/docxfmt.cpp b/crengine/src/docxfmt.cpp index e04886870..6ba1e519e 100644 --- a/crengine/src/docxfmt.cpp +++ b/crengine/src/docxfmt.cpp @@ -1623,10 +1623,9 @@ bool ImportDocXDocument( LVStreamRef stream, ldomDocument * doc, LVDocViewCallba } docxImportContext::docxImportContext(OpcPackage *package, ldomDocument *doc) : - odx_ImportContext(doc), m_abstractNumbers(16), - m_Numbers(16), m_footNoteCount(0), m_endNoteCount(0), - m_inField(false), m_linkNode(NULL), m_pStyle(NULL), - m_package(package) + odx_ImportContext(doc), m_abstractNumbers(16), m_Numbers(16), + m_package(package), m_footNoteCount(0), m_endNoteCount(0), + m_inField(false), m_linkNode(NULL), m_pStyle(NULL) { } diff --git a/crengine/src/hyphman.cpp b/crengine/src/hyphman.cpp index 397e55bd6..1b9dbfb04 100644 --- a/crengine/src/hyphman.cpp +++ b/crengine/src/hyphman.cpp @@ -1359,7 +1359,7 @@ lUInt8 UserHyphDict::init(lString32 filename, bool reload) char mask[HYPHENATION_LENGTH]; lvsize_t pos = 0; // pos in puffer while (pos < count ) { - int i; + unsigned i; for ( i = 0; i < WORD_LENGTH-1; ++i ) { // -1 because of trailing NULL if ( buf[pos] == ';' ) { ++pos; @@ -1450,7 +1450,7 @@ bool UserHyphDict::getMask(lChar32 *word, char *mask) lString32 UserHyphDict::getHyphenation(const char *word) { lString32 orig_word_str(word); - size_t orig_len = orig_word_str.length(); + int orig_len = orig_word_str.length(); // Given some combined words like stairway2heaven, we want to get the first potential part // as the candidate for hyphenation for a clearer layout, with smaller gaps. diff --git a/crengine/src/lvstsheet.cpp b/crengine/src/lvstsheet.cpp index 5a51a5ea3..2b469cbf3 100644 --- a/crengine/src/lvstsheet.cpp +++ b/crengine/src/lvstsheet.cpp @@ -1888,8 +1888,8 @@ class AtRuleLogicalConditionParser { int level; bool malformed; lxmlDocBase * doc; - lChar32 stop_char; - lChar32 stop_char2; + char stop_char; + char stop_char2; AtRuleLogicalConditionParser(lxmlDocBase * d, char stopchar='{', char stopchar2=0) : doc(d), stop_char(stopchar), stop_char2(stopchar2) { malformed = false; diff --git a/crengine/src/lvtextfm.cpp b/crengine/src/lvtextfm.cpp index 72ada9fa5..b59ee20aa 100644 --- a/crengine/src/lvtextfm.cpp +++ b/crengine/src/lvtextfm.cpp @@ -536,7 +536,7 @@ class LVFormatter { embedded_float_t * flt = m_pbuffer->floats[i]; if (flt->to_position) // ignore not yet positioned floats continue; - if (flt->y <= y && flt->y + flt->height > y) { // this float is spanning this y + if (flt->y <= y && flt->y + (int)flt->height > y) { // this float is spanning this y if (flt->is_right) { if (flt->x < fl_right_min_x) fl_right_min_x = flt->x; @@ -753,7 +753,7 @@ class LVFormatter { embedded_float_t * flt = m_pbuffer->floats[i]; if (flt->to_position) // ignore not yet positioned floats (even if continue; // there shouldn't be any when this is called) - if (flt->y < m_y && flt->y + flt->height > m_y) { + if (flt->y < m_y && flt->y + (int)flt->height > m_y) { has_ongoing_float = true; break; } @@ -824,7 +824,7 @@ class LVFormatter { embedded_float_t * flt = m_pbuffer->floats[i]; if (flt->to_position) // ignore not yet positioned floats, as they continue; // are not yet running past m_y - if (flt->y < m_y && flt->y + flt->height > m_y) { + if (flt->y < m_y && flt->y + (int)flt->height > m_y) { m_has_ongoing_float = true; break; } @@ -862,7 +862,7 @@ class LVFormatter { embedded_float_t * flt = m_pbuffer->floats[i]; if (flt->to_position) // ignore not yet positioned floats continue; - if (flt->y <= y && flt->y + flt->height > y) { // this float is spanning this y + if (flt->y <= y && flt->y + (int)flt->height > y) { // this float is spanning this y if (flt->is_right) { if (flt->x < fl_right_min_x) fl_right_min_x = flt->x; @@ -6407,7 +6407,7 @@ void LFormattedText::Draw( LVDrawBuf * buf, int x, int y, ldomMarkedRangeList * int top_overflow = fmt.getTopOverflow(); int bottom_overflow = fmt.getBottomOverflow(); - if (y + flt->y - top_overflow < clip.bottom && y + flt->y + flt->height + bottom_overflow > clip.top) { + if (y + flt->y - top_overflow < clip.bottom && y + flt->y + (int)flt->height + bottom_overflow > clip.top) { // DrawDocument() parameters (y0 + doc_y must be equal to our y, // doc_y just shift the viewport, so anything outside is not drawn). int x0 = x + flt->x; diff --git a/crengine/src/lvtinydom.cpp b/crengine/src/lvtinydom.cpp index bf940ee30..1bb28e00c 100644 --- a/crengine/src/lvtinydom.cpp +++ b/crengine/src/lvtinydom.cpp @@ -2705,12 +2705,9 @@ bool tinyNodeCollection::loadNodeData(lUInt16 type, ldomNode ** list, int nodeco // buf contains `sz' ldomNode items // _elemList, _textList (as `list' argument) must always be TNC_PART_LEN size // add into `list' zero filled (TNC_PART_LEN - sz) items - list[i] = (ldomNode *)realloc(buf, TNC_PART_LEN * sizeof(ldomNode)); - if (NULL == list[i]) { - free(buf); - CRLog::error("Not enough memory!"); + list[i] = cr_realloc(buf, TNC_PART_LEN); + if (NULL == list[i]) return false; - } memset( list[i] + sz, 0, (TNC_PART_LEN - sz) * sizeof(ldomNode) ); } for (int j=0; jsrctext == NULL ) continue; - if (pt.x >= flt->x && pt.x < flt->x + flt->width && pt.y >= flt->y && pt.y < flt->y + flt->height ) { + if (pt.x >= flt->x && pt.x < flt->x + flt->width && pt.y >= flt->y && pt.y < flt->y + (int)flt->height ) { // pt is inside this float. ldomNode * node = (ldomNode *) flt->srctext->object; // floatBox node ldomXPointer inside_ptr = createXPointer( orig_pt, direction, strictBounds, node ); @@ -15733,8 +15730,6 @@ void ldomDocumentWriterFilter::OnAttribute( const lChar32 * nsname, const lChar3 return; } - lUInt16 id = _currNode->_element->getNodeId(); - // Add the attribute lUInt16 attr_ns = (nsname && nsname[0]) ? _document->getNsNameIndex( nsname ) : 0; lUInt16 attr_id = (attrname && attrname[0]) ? _document->getAttrNameIndex( attrname ) : 0; diff --git a/crengine/src/mathml.cpp b/crengine/src/mathml.cpp index b851da561..315f66082 100644 --- a/crengine/src/mathml.cpp +++ b/crengine/src/mathml.cpp @@ -1944,8 +1944,8 @@ static void fixupMathML( ldomNode * node, bool is_in_script ) { const mathml_operator_dict_entry * infix = NULL; const mathml_operator_dict_entry * prefix = NULL; const mathml_operator_dict_entry * postfix = NULL; - bool found = getOperatorProperties((const lChar32 *)text.c_str(), infix, prefix, postfix); - // printf("%s %d %d %d %d\n", UnicodeToLocal(text).c_str(), found, infix, prefix, postfix); + /*bool found =*/ getOperatorProperties((const lChar32 *)text.c_str(), infix, prefix, postfix); + // printf("%s %d %d %d %d\n", UnicodeToLocal(text).c_str(), found, infix, prefix, postfix); // The "form" (prefix/infix/postfix) to be used depends on various things: // https://mathml-refresh.github.io/mathml-core/#dictionary-based-attributes