Commit Graph

58 Commits

Author SHA1 Message Date
1884f6e729 BLI_array: add BLI_array_trim utility to re-allocate the current size
Use this in BKE_view_layer_array_* functions.
2022-02-21 12:01:32 +11:00
c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00
3d3bc74884 Cleanup: remove redundant const qualifiers for POD types
MSVC used to warn about const mismatch for arguments passed by value.
Remove these as newer versions of MSVC no longer show this warning.
2022-01-07 14:16:26 +11:00
9e365069af Cleanup: move public doc-strings into headers for 'blenlib'
- Added space below non doc-string comments to make it clear
  these aren't comments for the symbols directly below them.
- Use doxy sections for some headers.
- Minor improvements to doc-strings.

Ref T92709
2021-12-09 20:01:44 +11:00
0d2589d08c Cleanup: spelling 2021-08-04 10:03:07 +10:00
c3a400b73f Cleanup: use single back-tick quoting in comments
While doxygen supports both, conform to our style guide.

Note that single back-tick's are already used in a majority of comments.
2021-07-20 22:58:14 +10:00
f1e4903854 Cleanup: full sentences in comments, improve comment formatting 2021-06-26 21:50:48 +10:00
54b47da565 Cleanup: clang-format 2020-08-27 15:33:33 +10:00
f807b27b67 Cleanup: Fix const warning with BLI_array_free
when you call the BLI_array_free macro with a const pointer you get a
warning when the macro calls `MEM_freeN` (warning C4090: 'function':
different 'const' qualifiers)

This was warning originating from
`smart_uv_project_calculate_project_normals` in `uvedit_unwrap_ops.c`

Normally we resolve these with a non const cast at the callsite
but given BLI_array_free is a macro not a function this is not
an option here and it has to be resolved in the macro.
2020-08-26 11:42:40 -06:00
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
249f4423ee Cleanup: doxygen comments
Also correct some outdated symbol references,
add missing 'name' commands.
2019-11-25 01:51:11 +11:00
adae93281c Cleanup: clang-format 2019-09-05 12:56:34 +10:00
bb8a9a6f8b Fix BLI_array macro so can use BLI_strict_flags.h.
Was doing int comparision against size_t, so added casts.
2019-08-30 11:39:27 -04:00
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
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
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
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
f20dbc293f Cleanup: blank lines over doxy headers 2019-01-26 21:43:24 +11:00
342593f124 Cleanup: rename BLI_array_count -> len
Match naming convention used everywhere else.
Count should only be used when this isn't directly accessible.
2018-03-15 01:53:20 +11:00
078e012cd9 Cleanup: rename BLI_*_empty() -> clear()
Consistent with other BLI API's
2018-02-01 13:40:53 +11:00
393ba0cf16 Cleanup: multistatement-macros warning 2017-07-29 08:18:20 +10:00
00c4f49a6d Cleanup: indentation, long lines 2017-06-12 13:38:21 +10:00
7a977df6d4 Refactor array_utils out of BLI_array
BLI_array.h is for resizing array macros, where as array_utils can operate on any arrays.
2015-02-14 08:00:41 +11:00
839e24c0c3 Correct recent error in BLI_array_append_ret 2014-09-28 17:29:48 +10:00
5f267ab9f3 BLI_array: add BLI_array_append_ret
returns the newly appended item.
also make make it so reserve doesn't have to grow then shrink the array size.
2014-09-28 15:08:54 +10:00
ed26d9dd90 BLI_array: utility function for searching an array 2014-08-17 16:02:20 +10:00
9142c062e0 Remove MSVC2008 workaround 2014-08-14 14:18:37 +10:00
78d38a9033 BLI_array: avoid mixing terms count/length 2014-07-11 15:30:42 +10:00
974d2dc54a BLI_array: avoid accidental assignment to BLI_array_count 2014-06-27 00:31:50 +10:00
898667b497 Fix BLI_array_staticdeclare size 2014-06-27 00:20:17 +10:00
8beb565c59 code cleanup: headers - doxy comments. 2013-09-12 03:02:50 +00:00
5ba898d868 utility functions to reverse and wrap arrays. 2013-08-13 23:43:44 +00:00
fc4a777511 use '_exec' suffix for operator execute callbacks, also picky change to sizeof() use in BLI_array.h 2013-07-28 17:06:31 +00:00
4982f200fa move alloca define into its own header since its not related to BLI_array 2013-07-28 10:38:25 +00:00
72f2917032 bmesh: skip error checks when building in release mode (minor speedup),
also more strict use of BLI_array_declare(), only allow after array is declared.
2013-07-28 09:05:27 +00:00
4c66463218 code cleanup: quiet pedantic warning in array macro. 2013-05-25 22:26:41 +00:00
858ff6b696 Fix for [#34898] Typo in error message of mathutils.Vector
* Also fixed some more cases of "more then" -> "more than".
2013-04-07 15:09:06 +00:00
38cee985bb code cleanup: style & warnings. 2013-01-21 02:30:40 +00:00
7c75bfd744 minor change r53918 was supposed to resolve. 2013-01-20 11:54:43 +00:00
8aa891ac6d correction for msvc2008 2013-01-20 08:43:44 +00:00
23af6743c7 code cleanup: BLI_array.h's BLI_array_grow_items macro was unmanageable.
moved the main re-alloc logic into a C function.
2013-01-19 07:35:55 +00:00
f25618f29a make Node.links return a tuple, this may you can't do socket.links.append() by mistake.
removed RNAMeta mixin class since you cant register subclasses.

also some minor code cleanup
2012-12-21 12:16:13 +00:00
0f97d53c74 add include so alloca() is found on mingw. 2012-12-13 11:59:07 +00:00
1eadcf743d fix for building with msvc 2012-12-11 15:29:08 +00:00
71730f26d7 replace BLI_array_fixedstack_declare with() new macro BLI_array_alloca() which uses stack memory always and doesn't need to be freed explicitly. 2012-12-11 15:10:19 +00:00
6857d31180 fix [#33305] Bevel tool crashes Blender if the number of segments exceeds 28
this was infact a general bug in BLI_array_grow_items(), surprising we didnt run into it before.
- growing the array for the first time would use the static var even if it wasn't big enough.
2012-11-26 04:58:33 +00:00
b96c622015 style cleanup 2012-08-11 22:12:32 +00:00
0107385f7f code cleanup: ensure macros require ';' endings 2012-08-08 21:20:10 +00:00
15cb064e1b style cleanup 2012-06-25 07:24:48 +00:00
9892736206 code cleanup: header cleanup and remove some duplicate defines. 2012-05-12 20:39:39 +00:00