obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

UI: Remove UNUSED_PARAMETER where unnecessary

Open cg2121 opened this issue 2 years ago • 1 comments

Description

Since cpp allows removing the unused parameters from the function name, UNUSED_PARAMETER is not needed, unless it is in an ifdef.

Motivation and Context

Less code

How Has This Been Tested?

Compiled OBS to make sure there were no warnings.

Types of changes

  • Code cleanup (non-breaking change which makes code smaller or more readable)

Checklist:

  • [x] My code has been run through clang-format.
  • [x] I have read the contributing document.
  • [x] My code is not on the master branch.
  • [x] The code has been tested.
  • [x] All commit messages are properly formatted and commits squashed where appropriate.
  • [x] I have included updates to all appropriate documentation.

cg2121 avatar Jan 29 '23 02:01 cg2121

If the functions is not from a class (so no declaration). You should put the parameter name as comment. Like it was done in AJA:

  • https://github.com/obsproject/obs-studio/blob/8befd830a9807e35762006b9c715cdb133ab2c75/UI/frontend-plugins/aja-output-ui/aja-ui-main.cpp#L453
  • Where it was discussed: https://github.com/obsproject/obs-studio/pull/6771#discussion_r925232452

Edit: The purpose is mostly to not lose parameters definition/name and their meaning.

tytan652 avatar Jan 29 '23 08:01 tytan652