[A] Added more builds

This commit is contained in:
seleznevae 2019-04-27 16:00:20 +03:00
parent e4cff24d51
commit 535641cddf
8 changed files with 125 additions and 99 deletions

View File

@ -110,6 +110,22 @@ if("${FORT_COMPILER}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
endif() endif()
# ------------------------------------------------------------------------------
# Disable NDEBUG for all builds
# ------------------------------------------------------------------------------
foreach(flags_var_to_scrub
CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS_MINSIZEREL
)
string (REGEX REPLACE "(^| )[/-]D *NDEBUG($| )" " "
"${flags_var_to_scrub}" "${${flags_var_to_scrub}}")
endforeach()
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Add WChar support for the build # Add WChar support for the build
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------

View File

@ -244,7 +244,7 @@ void print_different_border_styles()
ft_set_cell_prop(table, FT_ANY_ROW, FT_ANY_COLUMN, FT_CPROP_TOP_PADDING, 3); ft_set_cell_prop(table, FT_ANY_ROW, FT_ANY_COLUMN, FT_CPROP_TOP_PADDING, 3);
ft_set_cell_prop(table, FT_ANY_ROW, 1, FT_CPROP_LEFT_PADDING, 10); ft_set_cell_prop(table, FT_ANY_ROW, 1, FT_CPROP_LEFT_PADDING, 10);
struct ft_border_style *styles[] = { const struct ft_border_style *styles[] = {
FT_BASIC_STYLE, FT_BASIC_STYLE,
FT_BASIC2_STYLE, FT_BASIC2_STYLE,
FT_SIMPLE_STYLE, FT_SIMPLE_STYLE,

View File

@ -1967,44 +1967,49 @@ int ft_add_separator(ft_table_t *table)
return FT_SUCCESS; return FT_SUCCESS;
} }
static const struct fort_border_style * built_in_styles[] = {
&FORT_BASIC_STYLE,
&FORT_BASIC2_STYLE,
&FORT_SIMPLE_STYLE,
&FORT_PLAIN_STYLE,
&FORT_DOT_STYLE,
&FORT_EMPTY_STYLE,
&FORT_EMPTY2_STYLE,
&FORT_SOLID_STYLE,
&FORT_SOLID_ROUND_STYLE,
&FORT_NICE_STYLE,
&FORT_DOUBLE_STYLE,
&FORT_DOUBLE2_STYLE,
&FORT_BOLD_STYLE,
&FORT_BOLD2_STYLE,
&FORT_FRAME_STYLE,
};
#define BUILT_IN_STYLES_SZ (sizeof(built_in_styles) / sizeof(built_in_styles[0]))
/* todo: remove this stupide and dangerous code */
static const struct ft_border_style built_in_external_styles[BUILT_IN_STYLES_SZ];
struct ft_border_style *const FT_BASIC_STYLE = (struct ft_border_style *) &FORT_BASIC_STYLE; const struct ft_border_style *const FT_BASIC_STYLE = &built_in_external_styles[0];
struct ft_border_style *const FT_BASIC2_STYLE = (struct ft_border_style *) &FORT_BASIC2_STYLE; const struct ft_border_style *const FT_BASIC2_STYLE = &built_in_external_styles[1];
struct ft_border_style *const FT_SIMPLE_STYLE = (struct ft_border_style *) &FORT_SIMPLE_STYLE; const struct ft_border_style *const FT_SIMPLE_STYLE = &built_in_external_styles[2];
struct ft_border_style *const FT_PLAIN_STYLE = (struct ft_border_style *) &FORT_PLAIN_STYLE; const struct ft_border_style *const FT_PLAIN_STYLE = &built_in_external_styles[3];
struct ft_border_style *const FT_DOT_STYLE = (struct ft_border_style *) &FORT_DOT_STYLE; const struct ft_border_style *const FT_DOT_STYLE = &built_in_external_styles[4];
struct ft_border_style *const FT_EMPTY_STYLE = (struct ft_border_style *) &FORT_EMPTY_STYLE; const struct ft_border_style *const FT_EMPTY_STYLE = &built_in_external_styles[5];
struct ft_border_style *const FT_EMPTY2_STYLE = (struct ft_border_style *) &FORT_EMPTY2_STYLE; const struct ft_border_style *const FT_EMPTY2_STYLE = &built_in_external_styles[6];
struct ft_border_style *const FT_SOLID_STYLE = (struct ft_border_style *) &FORT_SOLID_STYLE; const struct ft_border_style *const FT_SOLID_STYLE = &built_in_external_styles[7];
struct ft_border_style *const FT_SOLID_ROUND_STYLE = (struct ft_border_style *) &FORT_SOLID_ROUND_STYLE; const struct ft_border_style *const FT_SOLID_ROUND_STYLE = &built_in_external_styles[8];
struct ft_border_style *const FT_NICE_STYLE = (struct ft_border_style *) &FORT_NICE_STYLE; const struct ft_border_style *const FT_NICE_STYLE = &built_in_external_styles[9];
struct ft_border_style *const FT_DOUBLE_STYLE = (struct ft_border_style *) &FORT_DOUBLE_STYLE; const struct ft_border_style *const FT_DOUBLE_STYLE = &built_in_external_styles[10];
struct ft_border_style *const FT_DOUBLE2_STYLE = (struct ft_border_style *) &FORT_DOUBLE2_STYLE; const struct ft_border_style *const FT_DOUBLE2_STYLE = &built_in_external_styles[11];
struct ft_border_style *const FT_BOLD_STYLE = (struct ft_border_style *) &FORT_BOLD_STYLE; const struct ft_border_style *const FT_BOLD_STYLE = &built_in_external_styles[12];
struct ft_border_style *const FT_BOLD2_STYLE = (struct ft_border_style *) &FORT_BOLD2_STYLE; const struct ft_border_style *const FT_BOLD2_STYLE = &built_in_external_styles[13];
struct ft_border_style *const FT_FRAME_STYLE = (struct ft_border_style *) &FORT_FRAME_STYLE; const struct ft_border_style *const FT_FRAME_STYLE = &built_in_external_styles[14];
static void set_border_props_for_props(fort_table_properties_t *properties, const struct ft_border_style *style) static void set_border_props_for_props(fort_table_properties_t *properties, const struct ft_border_style *style)
{ {
if ((const struct fort_border_style *)style == &FORT_BASIC_STYLE if (style >= built_in_external_styles && style < (built_in_external_styles + BUILT_IN_STYLES_SZ)) {
|| (const struct fort_border_style *)style == &FORT_BASIC2_STYLE size_t pos = (size_t)(style - built_in_external_styles);
|| (const struct fort_border_style *)style == &FORT_SIMPLE_STYLE memcpy(&(properties->border_style), built_in_styles[pos], sizeof(struct fort_border_style));
|| (const struct fort_border_style *)style == &FORT_DOT_STYLE
|| (const struct fort_border_style *)style == &FORT_PLAIN_STYLE
|| (const struct fort_border_style *)style == &FORT_EMPTY_STYLE
|| (const struct fort_border_style *)style == &FORT_EMPTY2_STYLE
|| (const struct fort_border_style *)style == &FORT_SOLID_STYLE
|| (const struct fort_border_style *)style == &FORT_SOLID_ROUND_STYLE
|| (const struct fort_border_style *)style == &FORT_NICE_STYLE
|| (const struct fort_border_style *)style == &FORT_DOUBLE_STYLE
|| (const struct fort_border_style *)style == &FORT_DOUBLE2_STYLE
|| (const struct fort_border_style *)style == &FORT_BOLD_STYLE
|| (const struct fort_border_style *)style == &FORT_BOLD2_STYLE
|| (const struct fort_border_style *)style == &FORT_FRAME_STYLE) {
memcpy(&(properties->border_style), (const struct fort_border_style *)style, sizeof(struct fort_border_style));
return; return;
} }

View File

@ -616,21 +616,21 @@ struct ft_border_style {
* @name Built-in table border styles. * @name Built-in table border styles.
* @{ * @{
*/ */
extern struct ft_border_style *const FT_BASIC_STYLE; extern const struct ft_border_style *const FT_BASIC_STYLE;
extern struct ft_border_style *const FT_BASIC2_STYLE; extern const struct ft_border_style *const FT_BASIC2_STYLE;
extern struct ft_border_style *const FT_SIMPLE_STYLE; extern const struct ft_border_style *const FT_SIMPLE_STYLE;
extern struct ft_border_style *const FT_PLAIN_STYLE; extern const struct ft_border_style *const FT_PLAIN_STYLE;
extern struct ft_border_style *const FT_DOT_STYLE; extern const struct ft_border_style *const FT_DOT_STYLE;
extern struct ft_border_style *const FT_EMPTY_STYLE; extern const struct ft_border_style *const FT_EMPTY_STYLE;
extern struct ft_border_style *const FT_EMPTY2_STYLE; extern const struct ft_border_style *const FT_EMPTY2_STYLE;
extern struct ft_border_style *const FT_SOLID_STYLE; extern const struct ft_border_style *const FT_SOLID_STYLE;
extern struct ft_border_style *const FT_SOLID_ROUND_STYLE; extern const struct ft_border_style *const FT_SOLID_ROUND_STYLE;
extern struct ft_border_style *const FT_NICE_STYLE; extern const struct ft_border_style *const FT_NICE_STYLE;
extern struct ft_border_style *const FT_DOUBLE_STYLE; extern const struct ft_border_style *const FT_DOUBLE_STYLE;
extern struct ft_border_style *const FT_DOUBLE2_STYLE; extern const struct ft_border_style *const FT_DOUBLE2_STYLE;
extern struct ft_border_style *const FT_BOLD_STYLE; extern const struct ft_border_style *const FT_BOLD_STYLE;
extern struct ft_border_style *const FT_BOLD2_STYLE; extern const struct ft_border_style *const FT_BOLD2_STYLE;
extern struct ft_border_style *const FT_FRAME_STYLE; extern const struct ft_border_style *const FT_FRAME_STYLE;
/** @} */ /** @} */

View File

@ -763,7 +763,7 @@ public:
* - True: Success; table border style was changed. * - True: Success; table border style was changed.
* - False: Error * - False: Error
*/ */
bool set_border_style(struct ft_border_style *style) bool set_border_style(const struct ft_border_style *style)
{ {
return FT_IS_SUCCESS(ft_set_border_style(table_, style)); return FT_IS_SUCCESS(ft_set_border_style(table_, style));
} }

View File

@ -616,21 +616,21 @@ struct ft_border_style {
* @name Built-in table border styles. * @name Built-in table border styles.
* @{ * @{
*/ */
extern struct ft_border_style *const FT_BASIC_STYLE; extern const struct ft_border_style *const FT_BASIC_STYLE;
extern struct ft_border_style *const FT_BASIC2_STYLE; extern const struct ft_border_style *const FT_BASIC2_STYLE;
extern struct ft_border_style *const FT_SIMPLE_STYLE; extern const struct ft_border_style *const FT_SIMPLE_STYLE;
extern struct ft_border_style *const FT_PLAIN_STYLE; extern const struct ft_border_style *const FT_PLAIN_STYLE;
extern struct ft_border_style *const FT_DOT_STYLE; extern const struct ft_border_style *const FT_DOT_STYLE;
extern struct ft_border_style *const FT_EMPTY_STYLE; extern const struct ft_border_style *const FT_EMPTY_STYLE;
extern struct ft_border_style *const FT_EMPTY2_STYLE; extern const struct ft_border_style *const FT_EMPTY2_STYLE;
extern struct ft_border_style *const FT_SOLID_STYLE; extern const struct ft_border_style *const FT_SOLID_STYLE;
extern struct ft_border_style *const FT_SOLID_ROUND_STYLE; extern const struct ft_border_style *const FT_SOLID_ROUND_STYLE;
extern struct ft_border_style *const FT_NICE_STYLE; extern const struct ft_border_style *const FT_NICE_STYLE;
extern struct ft_border_style *const FT_DOUBLE_STYLE; extern const struct ft_border_style *const FT_DOUBLE_STYLE;
extern struct ft_border_style *const FT_DOUBLE2_STYLE; extern const struct ft_border_style *const FT_DOUBLE2_STYLE;
extern struct ft_border_style *const FT_BOLD_STYLE; extern const struct ft_border_style *const FT_BOLD_STYLE;
extern struct ft_border_style *const FT_BOLD2_STYLE; extern const struct ft_border_style *const FT_BOLD2_STYLE;
extern struct ft_border_style *const FT_FRAME_STYLE; extern const struct ft_border_style *const FT_FRAME_STYLE;
/** @} */ /** @} */

View File

@ -763,7 +763,7 @@ public:
* - True: Success; table border style was changed. * - True: Success; table border style was changed.
* - False: Error * - False: Error
*/ */
bool set_border_style(struct ft_border_style *style) bool set_border_style(const struct ft_border_style *style)
{ {
return FT_IS_SUCCESS(ft_set_border_style(table_, style)); return FT_IS_SUCCESS(ft_set_border_style(table_, style));
} }

View File

@ -806,44 +806,49 @@ int ft_add_separator(ft_table_t *table)
return FT_SUCCESS; return FT_SUCCESS;
} }
static const struct fort_border_style * built_in_styles[] = {
&FORT_BASIC_STYLE,
&FORT_BASIC2_STYLE,
&FORT_SIMPLE_STYLE,
&FORT_PLAIN_STYLE,
&FORT_DOT_STYLE,
&FORT_EMPTY_STYLE,
&FORT_EMPTY2_STYLE,
&FORT_SOLID_STYLE,
&FORT_SOLID_ROUND_STYLE,
&FORT_NICE_STYLE,
&FORT_DOUBLE_STYLE,
&FORT_DOUBLE2_STYLE,
&FORT_BOLD_STYLE,
&FORT_BOLD2_STYLE,
&FORT_FRAME_STYLE,
};
#define BUILT_IN_STYLES_SZ (sizeof(built_in_styles) / sizeof(built_in_styles[0]))
/* todo: remove this stupide and dangerous code */
static const struct ft_border_style built_in_external_styles[BUILT_IN_STYLES_SZ];
struct ft_border_style *const FT_BASIC_STYLE = (struct ft_border_style *) &FORT_BASIC_STYLE; const struct ft_border_style *const FT_BASIC_STYLE = &built_in_external_styles[0];
struct ft_border_style *const FT_BASIC2_STYLE = (struct ft_border_style *) &FORT_BASIC2_STYLE; const struct ft_border_style *const FT_BASIC2_STYLE = &built_in_external_styles[1];
struct ft_border_style *const FT_SIMPLE_STYLE = (struct ft_border_style *) &FORT_SIMPLE_STYLE; const struct ft_border_style *const FT_SIMPLE_STYLE = &built_in_external_styles[2];
struct ft_border_style *const FT_PLAIN_STYLE = (struct ft_border_style *) &FORT_PLAIN_STYLE; const struct ft_border_style *const FT_PLAIN_STYLE = &built_in_external_styles[3];
struct ft_border_style *const FT_DOT_STYLE = (struct ft_border_style *) &FORT_DOT_STYLE; const struct ft_border_style *const FT_DOT_STYLE = &built_in_external_styles[4];
struct ft_border_style *const FT_EMPTY_STYLE = (struct ft_border_style *) &FORT_EMPTY_STYLE; const struct ft_border_style *const FT_EMPTY_STYLE = &built_in_external_styles[5];
struct ft_border_style *const FT_EMPTY2_STYLE = (struct ft_border_style *) &FORT_EMPTY2_STYLE; const struct ft_border_style *const FT_EMPTY2_STYLE = &built_in_external_styles[6];
struct ft_border_style *const FT_SOLID_STYLE = (struct ft_border_style *) &FORT_SOLID_STYLE; const struct ft_border_style *const FT_SOLID_STYLE = &built_in_external_styles[7];
struct ft_border_style *const FT_SOLID_ROUND_STYLE = (struct ft_border_style *) &FORT_SOLID_ROUND_STYLE; const struct ft_border_style *const FT_SOLID_ROUND_STYLE = &built_in_external_styles[8];
struct ft_border_style *const FT_NICE_STYLE = (struct ft_border_style *) &FORT_NICE_STYLE; const struct ft_border_style *const FT_NICE_STYLE = &built_in_external_styles[9];
struct ft_border_style *const FT_DOUBLE_STYLE = (struct ft_border_style *) &FORT_DOUBLE_STYLE; const struct ft_border_style *const FT_DOUBLE_STYLE = &built_in_external_styles[10];
struct ft_border_style *const FT_DOUBLE2_STYLE = (struct ft_border_style *) &FORT_DOUBLE2_STYLE; const struct ft_border_style *const FT_DOUBLE2_STYLE = &built_in_external_styles[11];
struct ft_border_style *const FT_BOLD_STYLE = (struct ft_border_style *) &FORT_BOLD_STYLE; const struct ft_border_style *const FT_BOLD_STYLE = &built_in_external_styles[12];
struct ft_border_style *const FT_BOLD2_STYLE = (struct ft_border_style *) &FORT_BOLD2_STYLE; const struct ft_border_style *const FT_BOLD2_STYLE = &built_in_external_styles[13];
struct ft_border_style *const FT_FRAME_STYLE = (struct ft_border_style *) &FORT_FRAME_STYLE; const struct ft_border_style *const FT_FRAME_STYLE = &built_in_external_styles[14];
static void set_border_props_for_props(fort_table_properties_t *properties, const struct ft_border_style *style) static void set_border_props_for_props(fort_table_properties_t *properties, const struct ft_border_style *style)
{ {
if ((const struct fort_border_style *)style == &FORT_BASIC_STYLE if (style >= built_in_external_styles && style < (built_in_external_styles + BUILT_IN_STYLES_SZ)) {
|| (const struct fort_border_style *)style == &FORT_BASIC2_STYLE size_t pos = (size_t)(style - built_in_external_styles);
|| (const struct fort_border_style *)style == &FORT_SIMPLE_STYLE memcpy(&(properties->border_style), built_in_styles[pos], sizeof(struct fort_border_style));
|| (const struct fort_border_style *)style == &FORT_DOT_STYLE
|| (const struct fort_border_style *)style == &FORT_PLAIN_STYLE
|| (const struct fort_border_style *)style == &FORT_EMPTY_STYLE
|| (const struct fort_border_style *)style == &FORT_EMPTY2_STYLE
|| (const struct fort_border_style *)style == &FORT_SOLID_STYLE
|| (const struct fort_border_style *)style == &FORT_SOLID_ROUND_STYLE
|| (const struct fort_border_style *)style == &FORT_NICE_STYLE
|| (const struct fort_border_style *)style == &FORT_DOUBLE_STYLE
|| (const struct fort_border_style *)style == &FORT_DOUBLE2_STYLE
|| (const struct fort_border_style *)style == &FORT_BOLD_STYLE
|| (const struct fort_border_style *)style == &FORT_BOLD2_STYLE
|| (const struct fort_border_style *)style == &FORT_FRAME_STYLE) {
memcpy(&(properties->border_style), (const struct fort_border_style *)style, sizeof(struct fort_border_style));
return; return;
} }