From 3878f0c48e456cf2fd82232e34928c534649cfd5 Mon Sep 17 00:00:00 2001 From: seleznevae Date: Sat, 12 Jan 2019 14:37:07 +0300 Subject: [PATCH] [F] Fixed compilation error with c++ --- .travis.yml | 6 ++++++ lib/fort.c | 4 ++-- src/properties.c | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a0c465f..eff3af6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -137,6 +137,12 @@ script: - ${CC} -Wall -Wextra -Werror --std=gnu89 -DFT_CONGIG_HAVE_WCHAR fort.c -c -o fort.o - rm fort.o - cd .. + + # basic build c++ compiler + - cd lib + - ${CXX} -Wall -Wextra -Werror fort.c -c -o fort.o + - rm fort.o + - cd .. # cppcheck run diff --git a/lib/fort.c b/lib/fort.c index 9b1bd68..e470ce3 100644 --- a/lib/fort.c +++ b/lib/fort.c @@ -2927,14 +2927,14 @@ static fort_status_t set_cell_property_impl(fort_cell_props_t *opt, uint32_t pro if (v == FT_TSTYLE_DEFAULT) { opt->cell_text_style = FT_TSTYLE_DEFAULT; } else { - opt->cell_text_style |= v; + opt->cell_text_style = (enum ft_text_style)(opt->cell_text_style | v); } } else if (PROP_IS_SET(property, FT_CPROP_CONT_TEXT_STYLE)) { enum ft_text_style v = (enum ft_text_style)value; if (v == FT_TSTYLE_DEFAULT) { opt->content_text_style = v; } else { - opt->content_text_style |= v; + opt->content_text_style = (enum ft_text_style)(opt->content_text_style | v); } } diff --git a/src/properties.c b/src/properties.c index 67a2f41..a193355 100644 --- a/src/properties.c +++ b/src/properties.c @@ -471,14 +471,14 @@ static fort_status_t set_cell_property_impl(fort_cell_props_t *opt, uint32_t pro if (v == FT_TSTYLE_DEFAULT) { opt->cell_text_style = FT_TSTYLE_DEFAULT; } else { - opt->cell_text_style |= v; + opt->cell_text_style = (enum ft_text_style)(opt->cell_text_style | v); } } else if (PROP_IS_SET(property, FT_CPROP_CONT_TEXT_STYLE)) { enum ft_text_style v = (enum ft_text_style)value; if (v == FT_TSTYLE_DEFAULT) { opt->content_text_style = v; } else { - opt->content_text_style |= v; + opt->content_text_style = (enum ft_text_style)(opt->content_text_style | v); } }