Page MenuHome

T74432 : Rename PanelType* variables from pt to panel_type
Needs ReviewPublic

Authored by Diptangshu Dey (Tha_Hobbist) on Mar 31 2022, 3:32 PM.
This revision needs review, but there are no reviewers specified.

Details

Summary

Rename PanelType* variables from pt to panel_type

Diff Detail

Repository
rB Blender
Branch
Rename_PanelType_variables (branched from master)
Build Status
Buildable 21387
Build 21387: arc lint + arc unit

Event Timeline

Diptangshu Dey (Tha_Hobbist) requested review of this revision.Mar 31 2022, 3:32 PM
Diptangshu Dey (Tha_Hobbist) created this revision.
Diptangshu Dey (Tha_Hobbist) retitled this revision from T74432: Rename PanelType* variables from pt to panel_type to T74432 : Rename PanelType* variables from pt to panel_type.Mar 31 2022, 3:33 PM
Diptangshu Dey (Tha_Hobbist) edited the summary of this revision. (Show Details)
Ray Molenkamp (LazyDodo) added inline comments.
source/blender/editors/interface/interface.c
4401

panel_type cannot be both const char* and PanelType you have to rename one of these two variables.

  • fixed typos and conflicts
  • fixed conflict
Leon Schittek (lone_noel) added inline comments.
source/blender/editors/include/UI_interface.h
2798

Since "panel_type" is much longer than "pt" some long lines like this need reformatting. Clang format can take care of that for you: https://wiki.blender.org/wiki/Tools/ClangFormat

People sometimes forget to run clang format before committing, so it can happen that areas you haven't touched get reformatted as well. If that happens, make sure to not include those changes in your patch - they will be taken care of by someone in a cleanup commit. ;)

Diptangshu Dey (Tha_Hobbist) marked an inline comment as done.Apr 1 2022, 10:47 PM
source/blender/editors/include/UI_interface.h
2798

In the new developers' guide it is written that the clang format is already available in the c/c++ tools in vscode, and installing the separate extension is the old procedure and not needed now, which is the method specified in the link you have suggested. I am already using clang format and format on save in vscode, and the formatting seemed alright to me. If there is anything wrong with my setup, please guide me on how to fix it.

  • fixed variable name pt to identifier
source/blender/editors/include/UI_interface.h
2798

Well, applying your patch and running make format in the console changes a bunch of stuff: P2879 (Not only your stuff, btw...)
Maybe try running make format through the console yourself. If it changes anything, there probably is an issue with the setup.

Since I don't use vscode a lot, I unfortunately can't help you much, except suggest to recheck, if you setup everything according to the description you mentioned.

I wasn't aware that the setup for clang format changed. So that's good to know, thanks!

Diptangshu Dey (Tha_Hobbist) marked an inline comment as done.Apr 4 2022, 3:48 PM