Skip to content

Misc refactor#1506

Merged
gmaurel merged 34 commits intouncrustify:masterfrom
CDanU:misc-refactor
Dec 19, 2017
Merged

Misc refactor#1506
gmaurel merged 34 commits intouncrustify:masterfrom
CDanU:misc-refactor

Conversation

@CDanU
Copy link
Copy Markdown
Collaborator

@CDanU CDanU commented Dec 18, 2017

Here are some of the refactoring commits I gathered over the time.

CDanU added 29 commits December 18, 2017 16:25
apply early return to save horizontal space
apply early return to save horizontal space
move variable definitions closer to their use
limit variable scope
simplify branching by moving CT_TPAREN_OPEN check into SS_DANGLE if condition
limit variable scope
- limit range of possible input values by making the frm param a const reference
- dereferences frm pointer in when calling insert_vbrace,
  adds nullptr guards for that
- add early returns to save horizontal space
- (personal preference) replace ugly do while loop
- limit range of possible input values by making the frm param a const reference
- remove unused pc param
- add early returns to save horizontal space
- move variable definitions closer to their use
- move variable definitions closer to their use
- fix a typo
- limit variable scope
- directly return result from the close_statement function as that will lead to
  the same result in the end
- add newlines to enhance visibillity
- eliminate needless nesting of successive if checks
- apply const to variables
- add down-case 'pse_tos' to int in order to prevent up-casting of the '1' and
  enable possible signed-ness of the to be calculated value
- eliminate needless nesting of successive if checks
- add todo comment for the enum hack, replace cast
- limit variable scope
- add missing nullptr check
- replace C style error string generation with std::cerr stream
- add early returns to save horizontal space
- move variable definitions closer to their use
- replace memset with an aggregate-initialization
- eliminate needless nesting of successive if checks
- add missing nullptr check, throw if frm is nullptr to guard a possible
  re-initialization of frm
- add early returns to save horizontal space
- replace memset with an brace (aggregate) initialization
- (subjective) simplifies function by moving loop flow statements into for loops
  headers
- use vector to store chunk_t* elements, minimizes upfront element
  initialization (testbase uses max 16 elements), allows to handle more elements
  than a fixed max number
- move variable definitions closer to their use
- move variable definitions closer to their use
- limit variable scope
- eliminate needless nesting of successive if checks
- eliminate needless nesting of successive if checks
- move variable definitions closer to their use
- move variable definitions closer to their use
- limit variable scope
- eliminate needless nesting of successive if checks
- move variable definitions closer to their use
- limit variable scope
- eliminate needless nesting of successive if checks
- move variable definitions closer to their use
- limit variable scope
- eliminate needless nesting of successive if checks
- replace memset with brace (aggregate) initializer
- combine if checks with identical bodys
- move some single condition checks before multi condition checks in 'if' heads
- remove useless parenthesis pairs
- add early returns to save horizontal space
- add early returns to save horizontal space
- move variable definitions closer to their use
- eliminate needless nesting of successive if checks, simplify if checks
- add comments
- reorder
- add a safer abs calculation
- move variable definitions closer to their use
- remove useless parenthesis pairs
- limit variable scope
- use a safer size_t abs calculation
@gmaurel gmaurel merged commit 3febfd7 into uncrustify:master Dec 19, 2017
@CDanU
Copy link
Copy Markdown
Collaborator Author

CDanU commented Dec 19, 2017

Could you make a Coverity run again? The numbers should drop.
I think we should automate Coverity in general, note that they do have quotas: Coverity frequency

I googled a bit, we can use Travis for Cron jobs, maybe we could tweek the scripts made for the rsyslog project: https://github.com/rsyslog/rsyslog/commit/6c05f4126949fd25f36647a070ce590c9544b187

@CDanU CDanU deleted the misc-refactor branch December 19, 2017 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants