Skip to content

Commit

Permalink
fix warnings about unused functions/variables
Browse files Browse the repository at this point in the history
  • Loading branch information
bbshelper authored and poire-z committed Oct 3, 2023
1 parent 9c669db commit 3380f70
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 17 deletions.
1 change: 0 additions & 1 deletion crengine/src/hyphman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,6 @@ bool AlgoHyph::hyphenate( const lChar32 * str, int len, lUInt16 * widths, lUInt8
if ( len > WORD_LENGTH-2 )
len = WORD_LENGTH - 2;
lStr_getCharProps( str, len, chprops );
bool res = false;

int min = len+1;
int nb_visible = 0;
Expand Down
2 changes: 2 additions & 0 deletions crengine/src/lvdocview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ static css_font_family_t DEFAULT_FONT_FAMILY = css_ff_sans_serif;
/// minimum EM width of page (prevents show two pages for windows that not enougn wide)
#define MIN_EM_PER_PAGE 20

#if USE_LIMITED_FONT_SIZES_SET
static int def_font_sizes[] = { 18, 20, 22, 24, 29, 33, 39, 44 };
#endif

LVDocView::LVDocView(int bitsPerPixel, bool noDefaultDocument) :
m_bitsPerPixel(bitsPerPixel), m_dx(400), m_dy(200), _pos(0), _page(0),
Expand Down
16 changes: 5 additions & 11 deletions crengine/src/lvfntman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2880,9 +2880,13 @@ class LVFreeTypeFace : public LVFont
hb_shape(_hb_font, _hb_buffer, _hb_features.ptr(), (unsigned int)_hb_features.length());

// Harfbuzz has guessed and set a direction even if we did not provide one.
#ifdef DEBUG_MEASURE_TEXT
bool is_rtl = false;
#endif
if ( hb_buffer_get_direction(_hb_buffer) == HB_DIRECTION_RTL ) {
#ifdef DEBUG_MEASURE_TEXT
is_rtl = true;
#endif
// "For buffers in the right-to-left (RTL) or bottom-to-top (BTT) text
// flow direction, the directionality of the buffer itself is reversed
// for final output as a matter of design. Therefore, HarfBuzz inverts
Expand Down Expand Up @@ -2947,7 +2951,6 @@ class LVFreeTypeFace : public LVFont
int cur_cluster = 0;
int hg = 0; // index in glyph_info/glyph_pos
int hcl = 0; // cluster glyph at hg
bool is_cluster_tail = false;
int t_notdef_start = -1;
int t_notdef_end = -1;
for (int t = 0; t < len; t++) {
Expand Down Expand Up @@ -3132,9 +3135,6 @@ class LVFreeTypeFace : public LVFont
} // _kerningMode == KERNING_MODE_HARFBUZZ

else if (_kerningMode == KERNING_MODE_HARFBUZZ_LIGHT) {
unsigned int glyph_count;
hb_glyph_info_t* glyph_info = 0;
hb_glyph_position_t* glyph_pos = 0;
struct LVCharTriplet triplet;
struct LVCharPosInfo posInfo;
triplet.Char = 0;
Expand Down Expand Up @@ -3625,10 +3625,9 @@ class LVFreeTypeFace : public LVFont
int value = 0;
// Tables we might look at
TT_OS2 * os2 = (TT_OS2 *)FT_Get_Sfnt_Table(_face, FT_SFNT_OS2);
bool has_ot_math_data = false;
#if MATHML_SUPPORT==1
#if USE_HARFBUZZ==1
has_ot_math_data = hb_ot_math_has_data(hb_font_get_face(_hb_font));
bool has_ot_math_data = hb_ot_math_has_data(hb_font_get_face(_hb_font));
#define VALUE_FROM_OT_MATH_CONSTANT(x) if ( has_ot_math_data ) { \
value = hb_ot_math_get_constant(_hb_font, HB_OT_MATH_CONSTANT_##x); \
value_set = true; }
Expand Down Expand Up @@ -4409,11 +4408,6 @@ class LVFreeTypeFace : public LVFont

} // _kerningMode == KERNING_MODE_HARFBUZZ
else if (_kerningMode == KERNING_MODE_HARFBUZZ_LIGHT) {
hb_glyph_info_t *glyph_info = 0;
hb_glyph_position_t *glyph_pos = 0;
unsigned int glyph_count;
int w;
unsigned int len_new = 0;
struct LVCharTriplet triplet;
struct LVCharPosInfo posInfo;
triplet.Char = 0;
Expand Down
2 changes: 0 additions & 2 deletions crengine/src/lvpagesplitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1386,12 +1386,10 @@ bool LVRendPageInfo::deserialize( SerialBuf & buf )

void LVRendPageList::replacePages(int old_y, int old_h, LVRendPageList * pages, int next_pages_shift_y)
{
int i = 0;
int remove_idx = -1;
int remove_count = 0;
int insert_idx = -1;
int added_count = pages->length();
int new_page_index_shift = 0;
for ( int i=0; i < length(); i++ ) {
LVRendPageInfo * pi = ((*this)[i]);
if ( pi->start + pi->height <= old_y ) {
Expand Down
1 change: 0 additions & 1 deletion crengine/src/lvrend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7428,7 +7428,6 @@ void renderBlockElementEnhanced( FlowState * flow, ldomNode * enode, int x, int
// we should compute our width from the child style, and possibly
// from its rendered content width.
ldomNode * child = enode->getChildNode(0);
lUInt16 childElementId = child->getNodeId();
css_style_ref_t child_style = child->getStyle();

// We may tweak child styles
Expand Down
4 changes: 4 additions & 0 deletions crengine/src/lvstsheet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@
//#define DUMP_CSS_PARSING

// Helper to debug string parsing, showing current position and context
#if 0
static void dbg_str_pos(const char * prefix, const char * str) {
printf("/----------|---------- %s\n", prefix);
printf("\\%.*s\n", 20, str - 10);
}
#endif

#define IMPORTANT_DECL_HIGHER ((lUInt32)0x80000000U) // | to prop_code
#define IMPORTANT_DECL_SET ((lUInt32)0x40000000U) // | to prop_code
Expand Down Expand Up @@ -317,6 +319,7 @@ inline bool css_is_alnum( char ch )
return ( css_is_alpha(ch) || ( ch>='0' && ch<='9' ) );
}

#if 0
static int substr_compare( const char * sub, const char * & str )
{
int j;
Expand All @@ -334,6 +337,7 @@ static int substr_compare( const char * sub, const char * & str )
}
return 0;
}
#endif

inline char toLower( char c )
{
Expand Down
1 change: 0 additions & 1 deletion crengine/src/lvtextfm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6054,7 +6054,6 @@ void LFormattedText::Draw( LVDrawBuf * buf, int x, int y, ldomMarkedRangeList *
for (j=0; j<frmline->word_count; j++) {
word = &frmline->words[j];
srcline = &m_pbuffer->srctext[word->src_text_index];
ldomNode * node = (ldomNode *) srcline->object;
if (word->flags & LTEXT_WORD_IS_PAD && word->o.baseline ) { // there is some border to draw
bool is_right_pad = srcline->o.objflags & LTEXT_OBJECT_IS_PAD_RIGHT;
bool is_mirrored = word->flags & LTEXT_WORD_DIRECTION_IS_RTL; // will be drawn as if on the other side
Expand Down
2 changes: 1 addition & 1 deletion crengine/src/lvtinydom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5437,7 +5437,7 @@ bool ldomDocument::partialRender( ldomNode * node ) {
lvRect new_rc;
node->getAbsRect(new_rc);
int orig_h = orig_rc.bottom - base_y;
int new_h = new_rc.bottom - base_y;
// int new_h = new_rc.bottom - base_y;
int next_fragments_shift_y = new_rc.bottom - orig_rc.bottom;
// printf("fixing fragment %d (%d ~ %d => %d , +%d => +%d)\n", node->getNodeIndex(), base_y, orig_rc.top, new_rc.top, orig_h, new_h);

Expand Down

0 comments on commit 3380f70

Please sign in to comment.