Commit Graph

177 Commits

Author SHA1 Message Date
Aaron Carlisle 6e0cf86e73 Cleanup: use new c++ guarded allocator API
API added in rBa3ad5abf2fe85d623f9e78fefc34e27bdc14632e
2021-12-24 22:18:04 -05:00
Campbell Barton 973dac9b5f Cleanup: use doxy section for itasc_plugin
It wasn't obvious all callbacks were part of the plugin-API.
2021-12-09 21:19:46 +11:00
Campbell Barton 74f45ed9c5 Cleanup: spelling in comments 2021-10-03 12:13:29 +11:00
Campbell Barton 9b89de2571 Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXX
Also use doxy style function reference `#` prefix chars when
referencing identifiers.
2021-07-04 00:43:40 +10:00
Campbell Barton f1e4903854 Cleanup: full sentences in comments, improve comment formatting 2021-06-26 21:50:48 +10:00
Campbell Barton b2a6e2abdb Cleanup: remove extra in trailing asterisk
Comment blocks not conforming to convention.
2021-01-20 16:14:00 +11:00
Campbell Barton c61c7d9926 Cleanup: spelling (use 'gimbal' instead of 'gimble') 2021-01-04 17:38:07 +11:00
Jacques Lucke c93f826661 Cleanup: various clang tidy fixes 2020-12-09 16:29:11 +01:00
Sybren A. Stüvel 11c4066159 Cleanup: partial Clang-Tidy modernize-loop-convert
Modernize loops by using the `for(type variable : container)` syntax.

Some loops were trivial to fix, whereas others required more attention
to avoid semantic changes. I couldn't address all old-style loops, so
this commit doesn't enable the `modernize-loop-convert` rule.

Although Clang-Tidy's auto-fixer prefers to use `auto` for the loop
variable declaration, I made as many declarations as possible explicit.
To me this increases local readability, as you don't need to fully
understand the container in order to understand the loop variable type.

No functional changes.
2020-12-07 12:41:17 +01:00
Sybren A. Stüvel 7f2d356a67 Cleanup: Clang-Tidy, modernize-use-using
Replace `typedef` with `using` in C++ code.

In the case of `typedef struct SomeName { ... } SomeName;` I removed the
`typedef` altogether, as this is unnecessary in C++. Such cases have been
rewritten to `struct SomeName { ... };`

No functional changes.
2020-12-04 12:46:43 +01:00
Sybren A. Stüvel 958df2ed1b Cleanup: Clang-Tidy, modernize-deprecated-headers
No functional changes.
2020-12-04 11:28:09 +01:00
Sybren A. Stüvel 16732def37 Cleanup: Clang-Tidy modernize-use-nullptr
Replace `NULL` with `nullptr` in C++ code.

No functional changes.
2020-11-06 18:08:25 +01:00
Sergey Sharybin af35ada2f3 Cleanup: Clang-Tidy, modernize-use-bool-literals 2020-11-06 14:32:51 +01:00
Campbell Barton 7cb20d841d Cleanup: follow our code style for float literals 2020-11-06 12:32:54 +11:00
Campbell Barton 2abfcebb0e Cleanup: use C comments for descriptive text
Follow our code style guide by using C-comments for text descriptions.
2020-10-10 22:04:51 +11:00
Valentin 5ac4778056 Cleanup: convert gforge task ID's to phabricator format
Cleanup old tracker task format to the new. e.g: [#34039] to T34039

Ref D8718
2020-09-30 20:11:06 +10:00
Campbell Barton 8c17269183 Cleanup: use C style doxygen comments 2020-09-12 16:33:34 +10:00
Sybren A. Stüvel fb5e2f5610 Cleanup: Clang-Tidy bugprone-incorrect-roundings fixes
Should cause no noticeable difference.
2020-09-04 16:23:08 +02:00
Sybren A. Stüvel c04088fed1 Cleanup: Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule. This should be the final commit of the series of commits that
addresses this particular rule.

No functional changes.
2020-08-07 13:38:07 +02:00
Jacques Lucke 7283e6fb73 Merge branch 'blender-v2.90-release' into master 2020-08-07 10:04:57 +02:00
Jacques Lucke 91694b9b58 Code Style: use "#pragma once" in source directory
This replaces header include guards with `#pragma once`.
A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`),
because they are used in other places.

This patch has been generated by P1561 followed by `make format`.

Differential Revision: https://developer.blender.org/D8466
2020-08-07 09:50:34 +02:00
Dalai Felinto 7bad5e0d18 Cleanup: clang-format after recent cleanup commit
Remember to run `make format` after any massive cleanup please.

This "issue" introduced on 901ee66ea1.
2020-08-04 16:01:26 +02:00
Campbell Barton 901ee66ea1 Cleanup: use term init instead of initialize/initialise
The abbreviation 'init' is brief, unambiguous and already used
in thousands of places, also initialize is often accidentally
written with British spelling.
2020-08-01 13:51:05 +10:00
Sergey Sharybin 9739fc4d1b Clang-Tidy: More fixed of redundant check before delete
For some reason got unnoticed in the original cleanup pass.
2020-07-03 16:47:59 +02:00
Jacques Lucke 6f985574b7 Cleanup: take includes out of 'extern "C"' blocks
Surrounding includes with an 'extern "C"' block is not necessary anymore.
Also that made it harder to add any C++ code to some headers, or include headers
that have "optional" C++ code like `MEM_guardedalloc.h`.

I tested compilation on linux and windows (and got help from @LazyDodo).
If this still breaks compilation due to some linker error, the header containing
the symbol in question is probably missing an 'extern "C"' block.

Differential Revision: https://developer.blender.org/D7653
2020-05-08 18:22:41 +02:00
Dalai Felinto d138cbfb47 Code Quality: Replace for loops with LISTBASE_FOREACH
Note this only changes cases where the variable was declared inside
the for loop. To handle it outside as well is a different challenge.

Differential Revision: https://developer.blender.org/D7320
2020-04-03 19:27:46 +02:00
Dalai Felinto 2d1cce8331 Cleanup: `make format` after SortedIncludes change 2020-03-19 09:33:58 +01:00
Sergey Sharybin 598ab525da Cleanup: Replace ABS/SQUARE/CUBE with function calls
While it might be handy to have type-less functionality which is
similar to how C++ math is implemented it can not be easily achieved
with just preprocessor in a way which does not have side-effects on
wrong usage.

There macros where often used on a non-trivial expression, and there
was at least one usage where it was causing an actual side effect/bug
on Windows (see change around square_f(sh[index++]) in studiolight.c).

For such cases it is handy to have a function which is guaranteed to
have zero side-effects. The motivation behind actually removing the
macros is that there is already a way to do similar calculation. Also,
not having such macros is a way to guarantee that its usage is not
changed in a way which have side-effects and that it's not used as an
inspiration for cases where it should not be used.

Differential Revision: https://developer.blender.org/D7051
2020-03-09 14:47:59 +01:00
Campbell Barton f37b9ffdcb Cleanup: unused BIK_api struct & defines
This was part of an unfinished API,
however this wasn't touched since 2009.
2020-02-15 15:24:02 +11:00
Campbell Barton fd05f01be6 Partially revert "Cleanup: use post increment/decrement"
This partially reverts commit 0b2d1badec

Post increment can deep-copy for C++ iterators, while in my own checks
GCC was able to optimize this to get the same output,
better follow C++ best practice and use pre-increment for iterators.
2019-09-08 04:08:10 +10:00
Campbell Barton 0b2d1badec Cleanup: use post increment/decrement
When the result isn't used, prefer post increment/decrement
(already used nearly everywhere in Blender).
2019-09-08 00:23:25 +10:00
Campbell Barton dc434bc273 Cleanup: correct use of term 'split' 2019-08-24 12:06:58 +10:00
Campbell Barton 0c7a4c74d3 Cleanup: clang-format, also typo fix. 2019-08-02 20:04:45 +10:00
Campbell Barton 760dbd1cbf Cleanup: misc spelling fixes
T68035 by @luzpaz
2019-08-01 14:02:41 +10:00
Brecht Van Lommel 604fdb6e85 Spelling fixes in comments and descriptions, patch by luzpaz
Differential Revision: https://developer.blender.org/D3744
2019-07-31 14:27:35 +02:00
Campbell Barton 5db4608f70 Cleanup: extra-semi-stmt warning 2019-06-06 10:16:18 +10:00
Campbell Barton aba4e6810f Cleanup: style, use braces in source/ (include disabled blocks) 2019-05-31 23:22:52 +10:00
Campbell Barton d8dbd49a2f Cleanup: style, use braces in source/
Automated using clang-tidy.
2019-05-31 22:55:15 +10:00
Campbell Barton f70470b540 Cleanup: comments (long lines) in ikplugin 2019-05-01 11:01:20 +10:00
Campbell Barton 41d4a19865 ClangFormat: format '#if 0' code in source/ 2019-04-17 08:24:14 +02:00
Campbell Barton e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
Campbell Barton 5498e7f193 CMake: add library deps to CMakeLists.txt
Tested to work on Linux and macOS.

This will be enabled once all platforms are verified.

See D4684
2019-04-16 06:20:52 +02:00
Campbell Barton 813e470eac CMake: cleanup, arg rename, add definitions last 2019-04-16 06:15:18 +02:00
Campbell Barton 47adab4f99 CMake: prepare for BLENDER_SORTED_LIBS removal
No functional change, this adds LIB definition and args to cmake files.
Without this it's difficult to migrate away from 'BLENDER_SORTED_LIBS'
since there are many platforms/configurations that could break when
changing linking order.

Manually add and enable WITHOUT_SORTED_LIBS to try building
without sorted libs (currently fails since all variables are empty).
This check will eventually be removed.

See T46725.
2019-04-14 15:37:24 +02:00
Campbell Barton de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
Campbell Barton eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
Campbell Barton ab5e69e660 Cleanup: remove contributors for CMake files
Following removal from C source code.

See: 8c68ed6df1
2019-02-05 09:10:32 +11:00
Campbell Barton 65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
Campbell Barton c0f88ed8a8 Cleanup: sort forward declarations of enum & struct
Done using:
  source/tools/utils_maintenance/c_sort_blocks.py
2019-01-28 21:17:58 +11:00
Campbell Barton 1e4aab36c2 Cleanup: remove redundant BKE/BLI/BIF headers 2019-01-26 21:20:25 +11:00