From bc5d56877ed33bffffa238be01026f0fae5ca451 Mon Sep 17 00:00:00 2001 From: "Savio S. Machado" Date: Mon, 13 Oct 2014 12:35:40 -0300 Subject: [PATCH] expedite-cxx: Remove XXX and made some minor improvements. --- src/bin/cxx/font_effect_blur_alpha.cc | 2 +- src/bin/cxx/image_blend_border.cc | 4 +- src/bin/cxx/image_blend_border_recolor.cc | 2 +- src/bin/cxx/image_blend_fade_pow2_unscaled.cc | 2 +- src/bin/cxx/image_blend_fade_unscaled.cc | 2 +- src/bin/cxx/image_blend_occlude1.cc | 2 +- src/bin/cxx/image_blend_occlude1_few.cc | 2 +- src/bin/cxx/image_blend_occlude3.cc | 2 +- .../cxx/image_blend_solid_fade_unscaled.cc | 4 +- src/bin/cxx/image_crossfade.cc | 12 +++--- src/bin/cxx/image_data_argb.cc | 2 +- ...ata_ycbcr601pl_map_nearest_solid_rotate.cc | 2 +- src/bin/cxx/image_map_3d_flow.cc | 4 +- .../cxx/image_map_color_alpha_solid_rotate.cc | 18 ++++----- src/bin/cxx/text_change.cc | 2 +- src/bin/cxx/textblock_basic.cc | 30 +++++++-------- src/bin/cxx/textblock_intl.cc | 27 +++++++------- src/bin/cxx/textblock_text_append.cc | 37 ++++++++++--------- src/bin/cxx/widgets_file_icons.cc | 2 +- src/bin/cxx/widgets_file_icons_2.cc | 2 +- src/bin/cxx/widgets_file_icons_2_grouped.cc | 5 +-- src/bin/cxx/widgets_file_icons_2_same.cc | 2 +- src/bin/cxx/widgets_list_2.cc | 2 +- src/bin/cxx/widgets_list_2_grouped.cc | 2 +- src/bin/cxx/widgets_list_4.cc | 2 +- 25 files changed, 87 insertions(+), 86 deletions(-) diff --git a/src/bin/cxx/font_effect_blur_alpha.cc b/src/bin/cxx/font_effect_blur_alpha.cc index 0dfb5a7..543cad1 100644 --- a/src/bin/cxx/font_effect_blur_alpha.cc +++ b/src/bin/cxx/font_effect_blur_alpha.cc @@ -51,7 +51,7 @@ static void _cleanup(void) static void _loop(double t, int f) { char buf[256]; - char *str = "padding_set(%d);blur(%d,color=black);"; // XXX remove warning + char *str = "padding_set(%d);blur(%d,color=black);"; sprintf(buf, str, MAX_BLUR, ((f % MAX_BLUR) + 1)); eo_do(text, evas_obj_text_filter_program_set(buf)); diff --git a/src/bin/cxx/image_blend_border.cc b/src/bin/cxx/image_blend_border.cc index 9f859fa..549f603 100644 --- a/src/bin/cxx/image_blend_border.cc +++ b/src/bin/cxx/image_blend_border.cc @@ -1,4 +1,4 @@ -// XXX DONE + #ifdef HAVE_CONFIG_H # include #endif @@ -26,7 +26,7 @@ static void _setup() evas::canvas canvas(::eo_ref(G_evas)); for (int i = 0; i < OBNUM; i++) { - evas::image o(efl::eo::parent = canvas); // XXX: + evas::image o(efl::eo::parent = canvas); images.push_back(o); eo_do(o._eo_ptr(), efl_file_set(build_path("bar.png"), NULL)); // XXX o.border_set(6, 6, 6, 6); diff --git a/src/bin/cxx/image_blend_border_recolor.cc b/src/bin/cxx/image_blend_border_recolor.cc index e1435da..a9217f2 100644 --- a/src/bin/cxx/image_blend_border_recolor.cc +++ b/src/bin/cxx/image_blend_border_recolor.cc @@ -1,4 +1,4 @@ -// XXX DONE + #ifdef HAVE_CONFIG_H # include #endif diff --git a/src/bin/cxx/image_blend_fade_pow2_unscaled.cc b/src/bin/cxx/image_blend_fade_pow2_unscaled.cc index 82c6ce5..249dd55 100644 --- a/src/bin/cxx/image_blend_fade_pow2_unscaled.cc +++ b/src/bin/cxx/image_blend_fade_pow2_unscaled.cc @@ -1,4 +1,4 @@ -// XXX DONE + #ifdef HAVE_CONFIG_H # include #endif diff --git a/src/bin/cxx/image_blend_fade_unscaled.cc b/src/bin/cxx/image_blend_fade_unscaled.cc index 634f0dd..27d067e 100644 --- a/src/bin/cxx/image_blend_fade_unscaled.cc +++ b/src/bin/cxx/image_blend_fade_unscaled.cc @@ -1,4 +1,4 @@ -// XXX DONE + #ifdef HAVE_CONFIG_H # include #endif diff --git a/src/bin/cxx/image_blend_occlude1.cc b/src/bin/cxx/image_blend_occlude1.cc index bf2db13..c5d2ec6 100644 --- a/src/bin/cxx/image_blend_occlude1.cc +++ b/src/bin/cxx/image_blend_occlude1.cc @@ -60,7 +60,7 @@ static void _cleanup() /* loop - do things */ static void _loop(double t, int f) { - int i = 0; // XXX + int i = 0; for (evas::image& img : images) { if (i < (OBNUM / 2)) diff --git a/src/bin/cxx/image_blend_occlude1_few.cc b/src/bin/cxx/image_blend_occlude1_few.cc index 6be38fa..dced7ac 100644 --- a/src/bin/cxx/image_blend_occlude1_few.cc +++ b/src/bin/cxx/image_blend_occlude1_few.cc @@ -63,7 +63,7 @@ static void _cleanup() /* loop - do things */ static void _loop(double t, int f) { - int i = 0; // XXX + int i = 0; for (evas::image& img : images) { if (i < (OBNUM / 2)) diff --git a/src/bin/cxx/image_blend_occlude3.cc b/src/bin/cxx/image_blend_occlude3.cc index 86b6381..064ccb8 100644 --- a/src/bin/cxx/image_blend_occlude3.cc +++ b/src/bin/cxx/image_blend_occlude3.cc @@ -62,7 +62,7 @@ static void _cleanup() /* loop - do things */ static void _loop(double t, int f) { - int i = 0; // XXX + int i = 0; for (evas::image& img : images) { if (i > (OBNUM / 2)) diff --git a/src/bin/cxx/image_blend_solid_fade_unscaled.cc b/src/bin/cxx/image_blend_solid_fade_unscaled.cc index 5d63007..bfe5259 100644 --- a/src/bin/cxx/image_blend_solid_fade_unscaled.cc +++ b/src/bin/cxx/image_blend_solid_fade_unscaled.cc @@ -41,8 +41,8 @@ static void _setup(void) /* cleanup */ static void _cleanup(void) { - for (evas::image o : images) - o.visibility_set(false); // XXX + for (evas::image& img : images) + img.visibility_set(false); // XXX images.clear(); } diff --git a/src/bin/cxx/image_crossfade.cc b/src/bin/cxx/image_crossfade.cc index f7036ed..dc05ae3 100644 --- a/src/bin/cxx/image_crossfade.cc +++ b/src/bin/cxx/image_crossfade.cc @@ -54,11 +54,13 @@ static void _cleanup(void) /* loop - do things */ static void _loop(double t, int f) { - if (images.empty()) return; // XXX - int a = f & 0x1f; - a = ((a << 3) | (a >> 2)) & 0xff; - evas::image img = images.back(); - img.evas::object::color_set(a, a, a, a); + if (!images.empty()) + { + int a = f & 0x1f; + a = ((a << 3) | (a >> 2)) & 0xff; + evas::image img = images.back(); + img.evas::object::color_set(a, a, a, a); + } FPS_STD(NAME); } diff --git a/src/bin/cxx/image_data_argb.cc b/src/bin/cxx/image_data_argb.cc index 2eecb82..f5deceb 100644 --- a/src/bin/cxx/image_data_argb.cc +++ b/src/bin/cxx/image_data_argb.cc @@ -63,7 +63,7 @@ static void _loop(double t, int f) img.evas::object::size_set(w, h); img.fill_set(0, 0, w, h); data = static_cast(img.data_get(1)); - st = img.stride_get(); // XXX + st = img.stride_get(); st = st >> 2; p = data; for (y = 0; y < h; y++) diff --git a/src/bin/cxx/image_data_ycbcr601pl_map_nearest_solid_rotate.cc b/src/bin/cxx/image_data_ycbcr601pl_map_nearest_solid_rotate.cc index 2651bcf..3366b72 100644 --- a/src/bin/cxx/image_data_ycbcr601pl_map_nearest_solid_rotate.cc +++ b/src/bin/cxx/image_data_ycbcr601pl_map_nearest_solid_rotate.cc @@ -49,7 +49,7 @@ static void _setup(void) fread(vp, 320 * 240, 1, f); fclose(f); } - unsigned char **data = static_cast(o.data_get(1)); // XXX + unsigned char **data = static_cast(o.data_get(1)); unsigned char **lp = data; for (int y = 0; y < 480; y++) { diff --git a/src/bin/cxx/image_map_3d_flow.cc b/src/bin/cxx/image_map_3d_flow.cc index c8b22c0..ec69365 100644 --- a/src/bin/cxx/image_map_3d_flow.cc +++ b/src/bin/cxx/image_map_3d_flow.cc @@ -33,7 +33,7 @@ static void _setup(void) char buf[256]; evas::image o1(efl::eo::parent = canvas); - snprintf(buf, sizeof(buf), "cube%i.png", (i % 6) + 1); // XXX + snprintf(buf, sizeof(buf), "cube%i.png", (i % 6) + 1); eo_do(o1._eo_ptr(), efl_file_set(build_path(buf), NULL)); // XXX o1.fill_set(0, 0, 256, 256); o1.evas::object::size_set(256, 256); @@ -42,7 +42,7 @@ static void _setup(void) images.push_back(o1); evas::image o2(efl::eo::parent = canvas); - snprintf(buf, sizeof(buf), "cube%i.png", (i % 6) + 1); // XXX + snprintf(buf, sizeof(buf), "cube%i.png", (i % 6) + 1); eo_do(o2._eo_ptr(), efl_file_set(build_path(buf), NULL)); // XXX o2.fill_set(0, 0, 256, 256); o2.size_set(256, 256); diff --git a/src/bin/cxx/image_map_color_alpha_solid_rotate.cc b/src/bin/cxx/image_map_color_alpha_solid_rotate.cc index b600dbf..34f7ca4 100644 --- a/src/bin/cxx/image_map_color_alpha_solid_rotate.cc +++ b/src/bin/cxx/image_map_color_alpha_solid_rotate.cc @@ -50,24 +50,24 @@ static void _loop(double t, int f) { static Evas_Map *m = NULL; if (!m) m = evas_map_new(4); - int i = 0; // XXX + int i = 0; for (evas::image& img : images) { Evas_Coord w = 120; Evas_Coord h = 160; Evas_Coord x = (win_w / 2) - (w / 2); - x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + x += ::sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); Evas_Coord y = (win_h / 2) - (h / 2); - y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + y += ::cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); - evas_map_util_points_populate_from_geometry(m, x, y, w, h, 0); + ::evas_map_util_points_populate_from_geometry(m, x, y, w, h, 0); - evas_map_point_color_set(m, 0, 255, 255, 255, 255); - evas_map_point_color_set(m, 1, 255, 0, 0, 255); - evas_map_point_color_set(m, 2, 0, 0, 255, 255); - evas_map_point_color_set(m, 3, 0, 0, 0, 0); + ::evas_map_point_color_set(m, 0, 255, 255, 255, 255); + ::evas_map_point_color_set(m, 1, 255, 0, 0, 255); + ::evas_map_point_color_set(m, 2, 0, 0, 255, 255); + ::evas_map_point_color_set(m, 3, 0, 0, 0, 0); - evas_map_util_rotate(m, f, x + (w / 2), y + (h / 2)); + ::evas_map_util_rotate(m, f, x + (w / 2), y + (h / 2)); img.map_enable_set(1); img.map_set(m); ++i; diff --git a/src/bin/cxx/text_change.cc b/src/bin/cxx/text_change.cc index da9bc12..f337bd6 100644 --- a/src/bin/cxx/text_change.cc +++ b/src/bin/cxx/text_change.cc @@ -37,7 +37,7 @@ static void _setup(void) evas::text o(efl::eo::parent = canvas); texts.push_back(o); o.font_set("Vera-Bold", 20); - snprintf(buf, sizeof(buf), "%s %s %s %s.", // XXX + snprintf(buf, sizeof(buf), "%s %s %s %s.", strs[rnd() % (sizeof(strs) / sizeof(char *))], strs[rnd() % (sizeof(strs) / sizeof(char *))], strs[rnd() % (sizeof(strs) / sizeof(char *))], diff --git a/src/bin/cxx/textblock_basic.cc b/src/bin/cxx/textblock_basic.cc index 567568d..84cedc7 100644 --- a/src/bin/cxx/textblock_basic.cc +++ b/src/bin/cxx/textblock_basic.cc @@ -129,21 +129,21 @@ static void _cleanup(void) /* loop - do things */ static void _loop(double t, int f) { - Evas_Coord x, y, w, h, w0, h0; - int i = 0; - - if (!text_block) goto fps; // XXX - w0 = 160; - h0 = 120; - w = 150 + ((1.0 + cos((double)(f + (i * 10)) / (37.4 * SLOW) )) * w0 * 2); - h = 50 + ((1.0 + sin((double)(f + (i * 19)) / (52.6 * SLOW) )) * h0 * 2); - x = (win_w / 2) - (w / 2); - x += sin((double)(f + (i * 13)) / (86.7 * SLOW)) * (w0 / 2); - y = (win_h / 2) - (h / 2); - y += cos((double)(f + (i * 28)) / (93.8 * SLOW)) * (h0 / 2); - text_block->evas::object::position_set(x, y); - text_block->evas::object::size_set(w, 5000); - fps: + if (text_block) + { + Evas_Coord x, y, w, h, w0, h0; + int i = 0; + w0 = 160; + h0 = 120; + w = 150 + ((1.0 + cos((double)(f + (i * 10)) / (37.4 * SLOW) )) * w0 * 2); + h = 50 + ((1.0 + sin((double)(f + (i * 19)) / (52.6 * SLOW) )) * h0 * 2); + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (86.7 * SLOW)) * (w0 / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (93.8 * SLOW)) * (h0 / 2); + text_block->evas::object::position_set(x, y); + text_block->evas::object::size_set(w, 5000); + } FPS_STD(NAME); } diff --git a/src/bin/cxx/textblock_intl.cc b/src/bin/cxx/textblock_intl.cc index afef9ad..54fffb7 100644 --- a/src/bin/cxx/textblock_intl.cc +++ b/src/bin/cxx/textblock_intl.cc @@ -99,19 +99,20 @@ static void _cleanup(void) /* loop - do things */ static void _loop(double t, int f) { - Evas_Coord x, y, w, h, w0, h0; - int i = 0; - if (!text_block) goto fps; // XXX - text_block->size_native_get(&w0, &h0); - w = w0; - h = h0; - x = (win_w / 2) - (w / 2); - x += sin((double)(f + (i * 13)) / (31.1 * SLOW)) * (w0 / (2 * 2)); - y = (win_h / 2) - (h / 2); - y += cos((double)(f + (i * 28)) / (19.6 * SLOW)) * (h0 / (2 * 2)); - text_block->evas::object::position_set(x, y); - text_block->evas::object::size_set(w, h); -fps: + if (text_block) + { + Evas_Coord x, y, w, h, w0, h0; + int i = 0; + text_block->size_native_get(&w0, &h0); + w = w0; + h = h0; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (31.1 * SLOW)) * (w0 / (2 * 2)); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (19.6 * SLOW)) * (h0 / (2 * 2)); + text_block->evas::object::position_set(x, y); + text_block->evas::object::size_set(w, h); + } FPS_STD(NAME); } diff --git a/src/bin/cxx/textblock_text_append.cc b/src/bin/cxx/textblock_text_append.cc index 4cfa7b5..736e4e1 100644 --- a/src/bin/cxx/textblock_text_append.cc +++ b/src/bin/cxx/textblock_text_append.cc @@ -111,26 +111,27 @@ static void _cleanup(void) /* loop - do things */ static void _loop(double t, int f) { - Evas_Textblock_Cursor *cur; - static Evas_Textblock_Cursor *cur2; - if (!text_block) goto fps; // XXX - - cur = text_block->cursor_get(); - evas_textblock_cursor_text_append(cur, "*"); - evas_textblock_cursor_char_delete(cur); - - evas_textblock_cursor_paragraph_char_first(cur); - if (!cur2) + if (text_block) { - cur2 = text_block->cursor_new(); - evas_textblock_cursor_paragraph_last(cur2); - evas_textblock_cursor_paragraph_char_first(cur2); + Evas_Textblock_Cursor *cur; + static Evas_Textblock_Cursor *cur2; + + cur = text_block->cursor_get(); + evas_textblock_cursor_text_append(cur, "*"); + evas_textblock_cursor_char_delete(cur); + + evas_textblock_cursor_paragraph_char_first(cur); + if (!cur2) + { + cur2 = text_block->cursor_new(); + evas_textblock_cursor_paragraph_last(cur2); + evas_textblock_cursor_paragraph_char_first(cur2); + } + if (!evas_textblock_cursor_compare(cur, cur2)) + evas_textblock_cursor_paragraph_first(cur); + else + evas_textblock_cursor_paragraph_next(cur); } - if (!evas_textblock_cursor_compare(cur, cur2)) - evas_textblock_cursor_paragraph_first(cur); - else - evas_textblock_cursor_paragraph_next(cur); -fps: FPS_STD(NAME); } diff --git a/src/bin/cxx/widgets_file_icons.cc b/src/bin/cxx/widgets_file_icons.cc index ecaa977..9378fae 100644 --- a/src/bin/cxx/widgets_file_icons.cc +++ b/src/bin/cxx/widgets_file_icons.cc @@ -24,7 +24,7 @@ static int done = 0; static efl::eina::list images; static efl::eina::list texts; -static const char *icons[] = // XXX +static const char *icons[] = { "bug.png", "bulb.png", diff --git a/src/bin/cxx/widgets_file_icons_2.cc b/src/bin/cxx/widgets_file_icons_2.cc index 1303681..32327ae 100644 --- a/src/bin/cxx/widgets_file_icons_2.cc +++ b/src/bin/cxx/widgets_file_icons_2.cc @@ -23,7 +23,7 @@ static int done = 0; static efl::eina::list images; static efl::eina::list texts; -static const char *icons[] = // XXX +static const char *icons[] = { "bug.png", "bulb.png", diff --git a/src/bin/cxx/widgets_file_icons_2_grouped.cc b/src/bin/cxx/widgets_file_icons_2_grouped.cc index 02ef0e4..767d9ae 100644 --- a/src/bin/cxx/widgets_file_icons_2_grouped.cc +++ b/src/bin/cxx/widgets_file_icons_2_grouped.cc @@ -87,10 +87,7 @@ static void _cleanup(void) images.clear(); for (evas::text& t : texts) - { - //t.visibility_set(false); // XXX - t.parent_set(efl::eo::base(nullptr)); - } + t.parent_set(efl::eo::base(nullptr)); texts.clear(); } diff --git a/src/bin/cxx/widgets_file_icons_2_same.cc b/src/bin/cxx/widgets_file_icons_2_same.cc index 861cf6e..847ed50 100644 --- a/src/bin/cxx/widgets_file_icons_2_same.cc +++ b/src/bin/cxx/widgets_file_icons_2_same.cc @@ -24,7 +24,7 @@ static int done = 0; static efl::eina::list images; static efl::eina::list texts; -static const char *icons[] = // XXX +static const char *icons[] = { "e.png", }; diff --git a/src/bin/cxx/widgets_list_2.cc b/src/bin/cxx/widgets_list_2.cc index d8debb5..3f1cfe0 100644 --- a/src/bin/cxx/widgets_list_2.cc +++ b/src/bin/cxx/widgets_list_2.cc @@ -24,7 +24,7 @@ static int done = 0; static efl::eina::list images; static efl::eina::list texts; -static const char *labels[] = // XXX +static const char *labels[] = { "Andrew", "Alex", diff --git a/src/bin/cxx/widgets_list_2_grouped.cc b/src/bin/cxx/widgets_list_2_grouped.cc index facf8af..3ac9f32 100644 --- a/src/bin/cxx/widgets_list_2_grouped.cc +++ b/src/bin/cxx/widgets_list_2_grouped.cc @@ -24,7 +24,7 @@ static int done = 0; static efl::eina::list images; static efl::eina::list texts; -static const char *labels[] = // XXX +static const char *labels[] = { "Andrew", "Alex", diff --git a/src/bin/cxx/widgets_list_4.cc b/src/bin/cxx/widgets_list_4.cc index 61fe485..bec8116 100644 --- a/src/bin/cxx/widgets_list_4.cc +++ b/src/bin/cxx/widgets_list_4.cc @@ -25,7 +25,7 @@ static efl::eina::list images; static efl::eina::list icons; static efl::eina::list texts; -static const char *_icons[] = // XXX +static const char *_icons[] = { "bug.png", "bulb.png",