Skip to content

Commit

Permalink
fix compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadim Lopatin committed Apr 3, 2012
1 parent 641e1c8 commit 4225af0
Show file tree
Hide file tree
Showing 40 changed files with 224 additions and 196 deletions.
6 changes: 3 additions & 3 deletions cr3qt/src/settings.cpp
Expand Up @@ -172,8 +172,8 @@ SettingsDlg::SettingsDlg(QWidget *parent, CR3View * docView ) :

int n = m_props->getIntDef( PROP_PAGE_MARGIN_LEFT, 8 );
int mi = 0;
for ( int i=0; i<MAX_MARGIN_INDEX; i++ ) {
if ( n <= def_margins[i] ) {
for (int i=0; i < (int)MAX_MARGIN_INDEX; i++) {
if (n <= def_margins[i]) {
mi = i;
break;
}
Expand Down Expand Up @@ -232,7 +232,7 @@ SettingsDlg::SettingsDlg(QWidget *parent, CR3View * docView ) :
//PROP_HYPHENATION_DICT
QString v = QString("%1").arg(m_props->getIntDef(PROP_INTERLINE_SPACE, 100)) + "%";
QStringList isitems;
for ( int i=0; i<sizeof(interline_spaces)/sizeof(int); i++ )
for (int i = 0; i < (int)(sizeof(interline_spaces) / sizeof(int)); i++)
isitems.append(QString("%1").arg(interline_spaces[i]) + "%");
m_ui->cbInterlineSpace->addItems(isitems);
int isi = m_ui->cbInterlineSpace->findText(v);
Expand Down
3 changes: 2 additions & 1 deletion crengine/Tools/HyphConv/mkpattern.cpp
Expand Up @@ -17,7 +17,7 @@ class Convertor {
}
~Convertor() {
fprintf(out, "</HyphenationDescription>\n");
fclose(out);
//fclose(out);
}
void processLine(lString16 & line) {
if (line.lastChar()=='\r' || line.lastChar()=='\n')
Expand Down Expand Up @@ -89,5 +89,6 @@ int main(int argc, char* argv[])
cnv.processLine(line);
}
fclose(src);
fclose(out);
return 0;
}
6 changes: 3 additions & 3 deletions crengine/include/crgui.h
Expand Up @@ -325,7 +325,7 @@ enum CRGUIEventType {

CREV_WM_EVENTS_START=100,
CREV_UPDATE = 100,
CREV_RESIZE,
CREV_RESIZE

};

Expand Down Expand Up @@ -367,7 +367,7 @@ class CRGUIScreen
// for turbo updates
enum UpdateMode {
NormalMode,
PrepareMode,
PrepareMode
};
virtual void setTurboUpdateEnabled( bool flg ) { }
virtual bool getTurboUpdateEnabled() { return false; }
Expand Down Expand Up @@ -990,7 +990,7 @@ enum CRMenuControlCmd {
};

enum CRGUICmd {
GCMD_PASS_TO_PARENT = 550,
GCMD_PASS_TO_PARENT = 550
};

class CRMenu;
Expand Down
4 changes: 2 additions & 2 deletions crengine/include/crskin.h
Expand Up @@ -253,7 +253,7 @@ enum page_skin_type_t {
PAGE_SKIN_SCROLL,
PAGE_SKIN_LEFT_PAGE,
PAGE_SKIN_RIGHT_PAGE,
PAGE_SKIN_SINGLE_PAGE,
PAGE_SKIN_SINGLE_PAGE
};

class CRPageSkin : public CRSkinnedItem
Expand Down Expand Up @@ -314,7 +314,7 @@ class CRScrollSkin : public CRRectSkin
public:
enum Location {
Title,
Status,
Status
};

protected:
Expand Down
12 changes: 6 additions & 6 deletions crengine/include/crtxtenc.h
Expand Up @@ -37,19 +37,19 @@ enum char_encoding_type {
ce_utf16_le = 3,
ce_utf32_be = 4,
ce_utf32_le = 5,
ce_8bit_cp = 6,
ce_8bit_cp = 6
#if GBK_ENCODING_SUPPORT == 1
ce_gbk = 7,
,ce_gbk = 7
#endif
#if JIS_ENCODING_SUPPORT == 1
ce_euc_jis = 8,
ce_shift_jis = 9,
,ce_euc_jis = 8
,ce_shift_jis = 9
#endif
#if JIS_ENCODING_SUPPORT == 1
ce_big5 = 10,
,ce_big5 = 10
#endif
#if EUC_KR_ENCODING_SUPPORT == 1
ce_euc_kr = 11,
,ce_euc_kr = 11
#endif
};

Expand Down
26 changes: 13 additions & 13 deletions crengine/include/cssdef.h
Expand Up @@ -39,15 +39,15 @@ enum css_display_t {
css_d_table_column,
css_d_table_cell,
css_d_table_caption,
css_d_none,
css_d_none
};

/// white-space property values
enum css_white_space_t {
css_ws_inherit,
css_ws_normal,
css_ws_pre,
css_ws_nowrap,
css_ws_nowrap
};

/// text-align property values
Expand All @@ -56,7 +56,7 @@ enum css_text_align_t {
css_ta_left,
css_ta_right,
css_ta_center,
css_ta_justify,
css_ta_justify
};

/// vertical-align property values
Expand All @@ -69,7 +69,7 @@ enum css_vertical_align_t {
css_va_text_top,
css_va_middle,
css_va_bottom,
css_va_text_bottom,
css_va_text_bottom
};

/// text-decoration property values
Expand All @@ -80,22 +80,22 @@ enum css_text_decoration_t {
css_td_underline = 2,
css_td_overline = 3,
css_td_line_through = 4,
css_td_blink = 5,
css_td_blink = 5
};

/// hyphenate property values
enum css_hyphenate_t {
css_hyph_inherit = 0,
css_hyph_none = 1,
css_hyph_auto = 2,
css_hyph_auto = 2
};

/// font-style property values
enum css_font_style_t {
css_fs_inherit,
css_fs_normal,
css_fs_italic,
css_fs_oblique,
css_fs_oblique
};

/// font-weight property values
Expand All @@ -113,7 +113,7 @@ enum css_font_weight_t {
css_fw_600,
css_fw_700,
css_fw_800,
css_fw_900,
css_fw_900
};

/// font-family property values
Expand All @@ -123,7 +123,7 @@ enum css_font_family_t {
css_ff_sans_serif,
css_ff_cursive,
css_ff_fantasy,
css_ff_monospace,
css_ff_monospace
};

/// page split property values
Expand All @@ -133,7 +133,7 @@ enum css_page_break_t {
css_pb_always,
css_pb_avoid,
css_pb_left,
css_pb_right,
css_pb_right
};

/// list-style-type property values
Expand All @@ -147,14 +147,14 @@ enum css_list_style_type_t {
css_lst_upper_roman,
css_lst_lower_alpha,
css_lst_upper_alpha,
css_lst_none,
css_lst_none
};

/// list-style-position property values
enum css_list_style_position_t {
css_lsp_inherit,
css_lsp_inside,
css_lsp_outside,
css_lsp_outside
};

/// css length value types
Expand All @@ -170,7 +170,7 @@ enum css_value_type_t {
css_val_pt, // 1/72 in
css_val_pc, // 12 pt
css_val_percent,
css_val_color,
css_val_color
};

/// css length value
Expand Down
2 changes: 1 addition & 1 deletion crengine/include/hist.h
Expand Up @@ -19,7 +19,7 @@ enum bmk_type {
bmkt_lastpos,
bmkt_pos,
bmkt_comment,
bmkt_correction,
bmkt_correction
};

class CRBookmark {
Expand Down
3 changes: 2 additions & 1 deletion crengine/include/hyphman.h
Expand Up @@ -35,7 +35,7 @@ enum HyphDictType
HDT_NONE, // disable hyphenation
HDT_ALGORITHM, // universal
HDT_DICT_ALAN, // tex/alreader
HDT_DICT_TEX, // tex/fbreader
HDT_DICT_TEX // tex/fbreader
};

class HyphDictionary
Expand All @@ -53,6 +53,7 @@ class HyphDictionary
lString16 getFilename() { return _filename; }
bool activate();
virtual lUInt32 getHash() { return getTitle().getHash(); }
virtual ~HyphDictionary() { }
};

#define HYPH_DICT_ID_NONE L"@none"
Expand Down
6 changes: 3 additions & 3 deletions crengine/include/lvdocview.h
Expand Up @@ -318,15 +318,15 @@ enum LVDocCmd
DCMD_EDIT_HOME,
DCMD_EDIT_END,
DCMD_EDIT_INSERT_CHAR,
DCMD_EDIT_REPLACE_CHAR,
DCMD_EDIT_REPLACE_CHAR
};
#define LVDOCVIEW_COMMANDS_END DCMD_TOGGLE_BOLD

/// document view mode: pages/scroll
enum LVDocViewMode
{
DVM_SCROLL,
DVM_PAGES,
DVM_PAGES
};

/// document scroll position info
Expand Down Expand Up @@ -354,7 +354,7 @@ enum {
PGHDR_CLOCK=16,
PGHDR_BATTERY=32,
PGHDR_CHAPTER_MARKS=64,
PGHDR_PERCENT=128,
PGHDR_PERCENT=128
};


Expand Down
4 changes: 2 additions & 2 deletions crengine/include/lvdrawbuf.h
Expand Up @@ -32,7 +32,7 @@ enum cr_rotate_angle_t {
CR_ROTATE_ANGLE_0 = 0,
CR_ROTATE_ANGLE_90,
CR_ROTATE_ANGLE_180,
CR_ROTATE_ANGLE_270,
CR_ROTATE_ANGLE_270
};

class LVFont;
Expand Down Expand Up @@ -228,7 +228,7 @@ enum DrawBufPixelFormat
DRAW_BUF_4_BPP = 4, /// 4 bpp, 1 pixel per byte, higher 4 bits are significant
DRAW_BUF_8_BPP = 8, /// 8 bpp, 1 pixel per byte, all 8 bits are significant
DRAW_BUF_16_BPP = 16, /// color 16bit RGB 565
DRAW_BUF_32_BPP = 32, /// color 32bit RGB 888
DRAW_BUF_32_BPP = 32 /// color 32bit RGB 888
};

/**
Expand Down
2 changes: 1 addition & 1 deletion crengine/include/lvfntman.h
Expand Up @@ -125,7 +125,7 @@ struct LVFontGlyphCacheItem
enum hinting_mode_t {
HINTING_MODE_DISABLED,
HINTING_MODE_BYTECODE_INTERPRETOR,
HINTING_MODE_AUTOHINT,
HINTING_MODE_AUTOHINT
};


Expand Down
2 changes: 1 addition & 1 deletion crengine/include/lvimg.h
Expand Up @@ -51,7 +51,7 @@ enum ImageTransform {
IMG_TRANSFORM_NONE, // just draw w/o any resizing/tiling
IMG_TRANSFORM_SPLIT, // split at specified pixel, fill extra middle space with value of this pixel
IMG_TRANSFORM_STRETCH, // stretch image proportionally to fill whole area
IMG_TRANSFORM_TILE, // tile image
IMG_TRANSFORM_TILE // tile image
};

/// creates image which stretches source image by filling center with pixels at splitX, splitY
Expand Down
2 changes: 1 addition & 1 deletion crengine/include/lvpagesplitter.h
Expand Up @@ -49,7 +49,7 @@

enum page_type_t {
PAGE_TYPE_NORMAL = 0,
PAGE_TYPE_COVER = 1,
PAGE_TYPE_COVER = 1
};

/// footnote fragment inside page
Expand Down
2 changes: 1 addition & 1 deletion crengine/include/lvstream.h
Expand Up @@ -58,7 +58,7 @@ enum lverror_t {
LVERR_FAIL, ///< failed (unknown error)
LVERR_EOF, ///< end of file reached
LVERR_NOTFOUND, ///< file not found
LVERR_NOTIMPL, ///< method is not implemented
LVERR_NOTIMPL ///< method is not implemented
};

/// File open modes enum
Expand Down
18 changes: 9 additions & 9 deletions crengine/include/lvstring.h
Expand Up @@ -113,8 +113,8 @@ struct lstring_chunk_t {
const lChar16 * data16() const { return buf16; }
const lChar8 * data8() const { return buf8; }
private:
lUInt32 size; // 0 for free chunk
lUInt32 len; // count of chars in string
lInt32 size; // 0 for free chunk
lInt32 len; // count of chars in string
int nref; // reference counter
union {
lstring_chunk_t * nextfree;
Expand Down Expand Up @@ -144,7 +144,7 @@ namespace fmt {
explicit hex(lInt64 v) : value(v) { }
lUInt64 get() const { return value; }
};
};
}

/**
\brief lChar8 string
Expand Down Expand Up @@ -664,11 +664,11 @@ class lString16Collection
void parse( lString16 string, lString16 delimiter, bool flgTrim );
void reserve(int space);
int add( const lString16 & str );
int add(const lChar16 * str) { add(lString16(str)); }
int add(const lChar8 * str) { add(lString16(str)); }
int add(const lChar16 * str) { return add(lString16(str)); }
int add(const lChar8 * str) { return add(lString16(str)); }
void addAll( const lString16Collection & v )
{
for ( unsigned i=0; i<v.length(); i++ )
for (int i=0; i<v.length(); i++)
add( v[i] );
}
void erase(int offset, int count);
Expand All @@ -688,8 +688,8 @@ class lString16Collection
void clear();
bool contains( lString16 value )
{
for ( unsigned i=0; i<count; i++ )
if ( value.compare(at(i))==0 )
for (int i = 0; i < count; i++)
if (value.compare(at(i)) == 0)
return true;
return false;
}
Expand Down Expand Up @@ -1028,7 +1028,7 @@ class CRLog
LL_WARN,
LL_INFO,
LL_DEBUG,
LL_TRACE,
LL_TRACE
};
/// set current log level
static void setLogLevel( log_level level );
Expand Down
2 changes: 1 addition & 1 deletion crengine/include/lvstsheet.h
Expand Up @@ -99,7 +99,7 @@ enum LVCssSelectorRuleType
cssrt_attrhas, // E[foo~="value"]
cssrt_attrstarts, // E[foo|="value"]
cssrt_id, // E#id
cssrt_class, // E.class
cssrt_class // E.class
};

class LVCssSelectorRule
Expand Down

0 comments on commit 4225af0

Please sign in to comment.