Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(MY_CLASS): add parentheses to MY_CLASS definition #5485

Merged
merged 4 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/lv_obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_obj_class
#define MY_CLASS (&lv_obj_class)
#define LV_OBJ_DEF_WIDTH (LV_DPX(100))
#define LV_OBJ_DEF_HEIGHT (LV_DPX(50))
#define STYLE_TRANSITION_MAX 32
Expand Down
2 changes: 1 addition & 1 deletion src/core/lv_obj_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_obj_class
#define MY_CLASS (&lv_obj_class)

/**********************
* TYPEDEFS
Expand Down
2 changes: 1 addition & 1 deletion src/core/lv_obj_draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_obj_class
#define MY_CLASS (&lv_obj_class)

/**********************
* TYPEDEFS
Expand Down
2 changes: 1 addition & 1 deletion src/core/lv_obj_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_obj_class
#define MY_CLASS (&lv_obj_class)

/**********************
* TYPEDEFS
Expand Down
2 changes: 1 addition & 1 deletion src/core/lv_obj_pos.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_obj_class
#define MY_CLASS (&lv_obj_class)
#define update_layout_mutex LV_GLOBAL_DEFAULT()->layout_update_mutex

/**********************
Expand Down
2 changes: 1 addition & 1 deletion src/core/lv_obj_scroll.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_obj_class
#define MY_CLASS (&lv_obj_class)
#define SCROLL_ANIM_TIME_MIN 200 /*ms*/
#define SCROLL_ANIM_TIME_MAX 400 /*ms*/
#define SCROLLBAR_MIN_SIZE (LV_DPX(10))
Expand Down
2 changes: 1 addition & 1 deletion src/core/lv_obj_style.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_obj_class
#define MY_CLASS (&lv_obj_class)
#define style_refr LV_GLOBAL_DEFAULT()->style_refresh
#define style_trans_ll_p &(LV_GLOBAL_DEFAULT()->style_trans_ll)
#define _style_custom_prop_flag_lookup_table LV_GLOBAL_DEFAULT()->style_custom_prop_flag_lookup_table
Expand Down
2 changes: 1 addition & 1 deletion src/core/lv_obj_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_obj_class
#define MY_CLASS (&lv_obj_class)
#define disp_ll_p &(LV_GLOBAL_DEFAULT()->disp_ll)

#define OBJ_DUMP_STRING_LEN 128
Expand Down
2 changes: 1 addition & 1 deletion src/libs/barcode/lv_barcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_barcode_class
#define MY_CLASS (&lv_barcode_class)

/**********************
* TYPEDEFS
Expand Down
2 changes: 1 addition & 1 deletion src/libs/ffmpeg/lv_ffmpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#error Unsupported LV_COLOR_DEPTH
#endif

#define MY_CLASS &lv_ffmpeg_player_class
#define MY_CLASS (&lv_ffmpeg_player_class)

#define FRAME_DEF_REFR_PERIOD 33 /*[ms]*/

Expand Down
2 changes: 1 addition & 1 deletion src/libs/gif/lv_gif.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_gif_class
#define MY_CLASS (&lv_gif_class)

/**********************
* TYPEDEFS
Expand Down
2 changes: 1 addition & 1 deletion src/libs/qrcode/lv_qrcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_qrcode_class
#define MY_CLASS (&lv_qrcode_class)

/**********************
* TYPEDEFS
Expand Down
2 changes: 1 addition & 1 deletion src/libs/rlottie/lv_rlottie.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_rlottie_class
#define MY_CLASS (&lv_rlottie_class)
#define LV_ARGB32 32

/**********************
Expand Down
2 changes: 1 addition & 1 deletion src/others/file_explorer/lv_file_explorer.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_file_explorer_class
#define MY_CLASS (&lv_file_explorer_class)

#define FILE_EXPLORER_QUICK_ACCESS_AREA_WIDTH (22)
#define FILE_EXPLORER_BROWSER_AREA_WIDTH (100 - FILE_EXPLORER_QUICK_ACCESS_AREA_WIDTH)
Expand Down
2 changes: 1 addition & 1 deletion src/others/ime/lv_ime_pinyin.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_ime_pinyin_class
#define MY_CLASS (&lv_ime_pinyin_class)
#define cand_len LV_GLOBAL_DEFAULT()->ime_cand_len

/**********************
Expand Down
2 changes: 1 addition & 1 deletion src/others/sysmon/lv_sysmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_sysmon_class
#define MY_CLASS (&lv_sysmon_class)

#define SYSMON_REFR_PERIOD_DEF 300 /* ms */

Expand Down
2 changes: 1 addition & 1 deletion src/widgets/animimage/lv_animimage.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*********************/
#define LV_OBJX_NAME "lv_animimg"

#define MY_CLASS &lv_animimg_class
#define MY_CLASS (&lv_animimg_class)

/**********************
* TYPEDEFS
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/arc/lv_arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_arc_class
#define MY_CLASS (&lv_arc_class)

#define VALUE_UNSET INT16_MIN
#define CLICK_OUTSIDE_BG_ANGLES ((uint32_t) 0x00U)
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/bar/lv_bar.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_bar_class
#define MY_CLASS (&lv_bar_class)

/** hor. pad and ver. pad cannot make the indicator smaller than this [px]*/
#define LV_BAR_SIZE_MIN 4
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/button/lv_button.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_button_class
#define MY_CLASS (&lv_button_class)

/**********************
* TYPEDEFS
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/buttonmatrix/lv_buttonmatrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_buttonmatrix_class
#define MY_CLASS (&lv_buttonmatrix_class)

#define BTN_EXTRA_CLICK_AREA_MAX (LV_DPI_DEF / 10)
#define LV_BUTTONMATRIX_WIDTH_MASK 0x000F
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/calendar/lv_calendar.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#define LV_CALENDAR_CTRL_TODAY LV_BUTTONMATRIX_CTRL_CUSTOM_1
#define LV_CALENDAR_CTRL_HIGHLIGHT LV_BUTTONMATRIX_CTRL_CUSTOM_2

#define MY_CLASS &lv_calendar_class
#define MY_CLASS (&lv_calendar_class)

/**********************
* TYPEDEFS
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/canvas/lv_canvas.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_canvas_class
#define MY_CLASS (&lv_canvas_class)

/**********************
* TYPEDEFS
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/chart/lv_chart.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_chart_class
#define MY_CLASS (&lv_chart_class)

#define LV_CHART_HDIV_DEF 3
#define LV_CHART_VDIV_DEF 5
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/checkbox/lv_checkbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_checkbox_class
#define MY_CLASS (&lv_checkbox_class)

/**********************
* TYPEDEFS
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/dropdown/lv_dropdown.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_dropdown_class
#define MY_CLASS (&lv_dropdown_class)
#define MY_CLASS_LIST &lv_dropdownlist_class

#define LV_DROPDOWN_PR_NONE 0xFFFF
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/image/lv_image.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_image_class
#define MY_CLASS (&lv_image_class)

/**********************
* TYPEDEFS
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/imagebutton/lv_imagebutton.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_imagebutton_class
#define MY_CLASS (&lv_imagebutton_class)

/**********************
* TYPEDEFS
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/keyboard/lv_keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_keyboard_class
#define MY_CLASS (&lv_keyboard_class)
#define LV_KB_BTN(width) LV_BUTTONMATRIX_CTRL_POPOVER | width

/**********************
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/label/lv_label.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_label_class
#define MY_CLASS (&lv_label_class)

#define LV_LABEL_DEF_SCROLL_SPEED lv_anim_speed_clamped(40, 300, 10000)
#define LV_LABEL_SCROLL_DELAY 300
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/led/lv_led.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_led_class
#define MY_CLASS (&lv_led_class)

/**********************
* TYPEDEFS
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/line/lv_line.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_line_class
#define MY_CLASS (&lv_line_class)

/**********************
* TYPEDEFS
Expand Down
10 changes: 6 additions & 4 deletions src/widgets/list/lv_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
/*********************
* DEFINES
*********************/
#define MV_CLASS &lv_list
W-Mai marked this conversation as resolved.
Show resolved Hide resolved
#define MY_CLASS (&lv_list_class)
#define MY_CLASS_BUTTON (&lv_list_class)
#define MY_CLASS_TEXT (&lv_list_class)

/**********************
* TYPEDEFS
Expand Down Expand Up @@ -63,7 +65,7 @@ const lv_obj_class_t lv_list_text_class = {
lv_obj_t * lv_list_create(lv_obj_t * parent)
{
LV_LOG_INFO("begin");
lv_obj_t * obj = lv_obj_class_create_obj(&lv_list_class, parent);
lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent);
lv_obj_class_init_obj(obj);
lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_COLUMN);
return obj;
Expand All @@ -73,7 +75,7 @@ lv_obj_t * lv_list_add_text(lv_obj_t * list, const char * txt)
{
LV_LOG_INFO("begin");

lv_obj_t * obj = lv_obj_class_create_obj(&lv_list_text_class, list);
lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS_TEXT, list);
lv_obj_class_init_obj(obj);
lv_label_set_text(obj, txt);
return obj;
Expand All @@ -82,7 +84,7 @@ lv_obj_t * lv_list_add_text(lv_obj_t * list, const char * txt)
lv_obj_t * lv_list_add_button(lv_obj_t * list, const void * icon, const char * txt)
{
LV_LOG_INFO("begin");
lv_obj_t * obj = lv_obj_class_create_obj(&lv_list_button_class, list);
lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS_BUTTON, list);
lv_obj_class_init_obj(obj);
lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_ROW);

Expand Down
2 changes: 1 addition & 1 deletion src/widgets/menu/lv_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_menu_class
#define MY_CLASS (&lv_menu_class)

#include "../../core/lv_obj.h"
#include "../../layouts/lv_layout.h"
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/msgbox/lv_msgbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* DEFINES
*********************/
#define LV_MSGBOX_FLAG_AUTO_PARENT LV_OBJ_FLAG_WIDGET_1 /*Mark that the parent was automatically created*/
#define MY_CLASS &lv_msgbox_class
#define MY_CLASS (&lv_msgbox_class)

/**********************
* TYPEDEFS
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/objx_templ/lv_objx_templ.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_templ_class
#define MY_CLASS (&lv_templ_class)

/**********************
* TYPEDEFS
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/roller/lv_roller.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_roller_class
#define MY_CLASS (&lv_roller_class)
#define MY_CLASS_LABEL &lv_roller_label_class
#define EXTRA_INF_SIZE 1000 /*[px]: add the options multiple times until getting this height*/

Expand Down
2 changes: 1 addition & 1 deletion src/widgets/scale/lv_scale.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_scale_class
#define MY_CLASS (&lv_scale_class)

#define LV_SCALE_LABEL_TXT_LEN (20U)
#define LV_SCALE_DEFAULT_ANGLE_RANGE ((uint32_t) 270U)
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/slider/lv_slider.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_slider_class
#define MY_CLASS (&lv_slider_class)

#define LV_SLIDER_KNOB_COORD(is_reversed, area) (is_reversed ? area.x1 : area.x2)
#define LV_SLIDER_KNOB_COORD_VERTICAL(is_reversed, area) (is_reversed ? area.y2 : area.y1)
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/span/lv_span.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_spangroup_class
#define MY_CLASS (&lv_spangroup_class)
#define snippet_stack LV_GLOBAL_DEFAULT()->span_snippet_stack

/**********************
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/spinbox/lv_spinbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/*********************
* DEFINES
*********************/
#define MY_CLASS &lv_spinbox_class
#define MY_CLASS (&lv_spinbox_class)
#define LV_SPINBOX_MAX_DIGIT_COUNT_WITH_8BYTES (LV_SPINBOX_MAX_DIGIT_COUNT + 8U)
#define LV_SPINBOX_MAX_DIGIT_COUNT_WITH_4BYTES (LV_SPINBOX_MAX_DIGIT_COUNT + 4U)

Expand Down