Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2020-11-05 04:46:05 +0300
committerHans Goudey <h.goudey@me.com>2020-11-05 04:46:05 +0300
commit4f903560a8ddfd90c30c465677ea0db577941ea4 (patch)
tree13fb9af9f6ef3352793480f74a944f3ed93dcc8f
parent29780b8101eb7fa14a8729ff2cd7b73ef4e84c5a (diff)
Revert "Cleanup: Use shorthand variables"
This reverts commit 4115229637c0acdcffbaceae282ccd854bfdb1c8.
-rw-r--r--source/blender/editors/interface/interface_panel.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index bfe5dc223c8..ce9c19168cd 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -1639,55 +1639,53 @@ bool UI_panel_is_dragging(const struct Panel *panel)
}
/**
- * \note about sorting:
- * The #Panel.sortorder has a lower value for new panels being added.
+ * \note about sorting;
+ * the #Panel.sortorder has a lower value for new panels being added.
* however, that only works to insert a single panel, when more new panels get
* added the coordinates of existing panels and the previously stored to-be-inserted
- * panels do not match for sorting.
+ * panels do not match for sorting
*/
-static int find_highest_panel(const void *a, const void *b)
+static int find_highest_panel(const void *a1, const void *a2)
{
- const Panel *panel_a = ((PanelSort *)a)->panel;
- const Panel *panel_b = ((PanelSort *)b)->panel;
+ const PanelSort *ps1 = a1, *ps2 = a2;
- /* Stick uppermost header-less panels to the top of the region -
- * prevent them from being sorted (multiple header-less panels have to be sorted though). */
- if (panel_a->type->flag & PNL_NO_HEADER && panel_b->type->flag & PNL_NO_HEADER) {
+ /* stick uppermost header-less panels to the top of the region -
+ * prevent them from being sorted (multiple header-less panels have to be sorted though) */
+ if (ps1->panel->type->flag & PNL_NO_HEADER && ps2->panel->type->flag & PNL_NO_HEADER) {
/* Skip and check for `ofsy` and #Panel.sortorder below. */
}
- if (panel_a->type->flag & PNL_NO_HEADER) {
+ if (ps1->panel->type->flag & PNL_NO_HEADER) {
return -1;
}
- if (panel_b->type->flag & PNL_NO_HEADER) {
+ if (ps2->panel->type->flag & PNL_NO_HEADER) {
return 1;
}
- if (panel_a->ofsy + panel_a->sizey < panel_b->ofsy + panel_b->sizey) {
+ if (ps1->panel->ofsy + ps1->panel->sizey < ps2->panel->ofsy + ps2->panel->sizey) {
return 1;
}
- if (panel_a->ofsy + panel_a->sizey > panel_b->ofsy + panel_b->sizey) {
+ if (ps1->panel->ofsy + ps1->panel->sizey > ps2->panel->ofsy + ps2->panel->sizey) {
return -1;
}
- if (panel_a->sortorder > panel_b->sortorder) {
+ if (ps1->panel->sortorder > ps2->panel->sortorder) {
return 1;
}
- if (panel_a->sortorder < panel_b->sortorder) {
+ if (ps1->panel->sortorder < ps2->panel->sortorder) {
return -1;
}
return 0;
}
-static int compare_panel(const void *a, const void *b)
+static int compare_panel(const void *a1, const void *a2)
{
- const Panel *panel_a = ((PanelSort *)a)->panel;
- const Panel *panel_b = ((PanelSort *)b)->panel;
+ const PanelSort *ps1 = a1, *ps2 = a2;
- if (panel_a->sortorder > panel_b->sortorder) {
+ if (ps1->panel->sortorder > ps2->panel->sortorder) {
return 1;
}
- if (panel_a->sortorder < panel_b->sortorder) {
+ if (ps1->panel->sortorder < ps2->panel->sortorder) {
return -1;
}