Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-12-16BLI: remove implicit casts between some span typesJacques Lucke
Casting pointers from one type to another does change the value of the pointer in some cases. Therefore, casting a span that contains pointers of one type to a span that contains pointers of another type, is not generally safe. In practice, this issue mainly comes up when dealing with classes that have a vtable. There are some special cases that are still allowed. For example, adding const to the pointer does not change the address. Also, casting to a void pointer is fine. In cases where implicit conversion is disabled, but one is sure that the cast is valid, an explicit call of `span.cast<NewType>()` can be used.
2020-12-16BLI: constexpr Span, IndexRange, StringRef(Null/Base)Ankit Meel
Motivated by `std::string_view` being usable in const (compile-time) context. One functional change was needed for StringRef: `std::char_traits<char>::length(str)` instead of `strlen`. Reviewed By: JacquesLucke, LazyDodo Differential Revision: https://developer.blender.org/D9788
2020-08-14BLI: add reverse iterators, iterator constructor and Vector.insert/prependJacques Lucke
The new reverse iterators behave as the reverse iterators for contains from the standard library. Have a look at the tests to see how to use them. Using them will hopefully become easier with ranges in C++20. A Vector can now be constructed from two iterators, which is very common in the standard library. New Vector.insert methods allow adding elements in the middle of a vector. These methods should not be used often in practice, because they has a linear running time. New Vector.prepend methods allow adding elements to the beginning of a vector. These methods are O(n) as well.
2020-08-07Cleanup: use C++ style casts in various placesJacques Lucke
2020-08-07Merge branch 'blender-v2.90-release' into masterJacques Lucke
2020-08-07Code Style: use "#pragma once" in source directoryJacques Lucke
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-07-23Cleanup: unify naming between different spansJacques Lucke
2020-07-23BLI: Add MutableSpan.copy_from methodJacques Lucke
2020-07-20Particles: support removing particles during the simulationJacques Lucke
This still cannot be controlled by the user. Currently, all particles are killed after two seconds
2020-07-20Refactor: Update integer type usageJacques Lucke
This updates the usage of integer types in code I wrote according to our new style guides. Major changes: * Use signed instead of unsigned integers in many places. * C++ containers in blenlib use `int64_t` for size and indices now (instead of `uint`). * Hash values for C++ containers are 64 bit wide now (instead of 32 bit). I do hope that I broke no builds, but it is quite likely that some compiler reports slightly different errors. Please let me know when there are any errors. If the fix is small, feel free to commit it yourself. I compiled successfully on linux with gcc and on windows.
2020-07-13BLI: don't allow mutable span of initializer listJacques Lucke
2020-07-08BLI: improve constructors and conversions to spanJacques Lucke
This allows us to avoid many calls to `as_span()` methods. I will remove those in the next commit. Furthermore, constructors of Vector and Array can convert from one type to another now. I tested these changes on Linux with gcc and on Windows.
2020-07-08Cleanup: remove unused functionJacques Lucke
This is not necessary in C++17 anymore.
2020-07-08Cleanup: use c++17 helper variable templatesJacques Lucke
2020-07-03Cleanup: add const in various placesJacques Lucke
2020-07-03Cleanup: Use trailing underscore for non-public data membersJacques Lucke
This makes the code conform better with our style guide.
2020-06-09BLI: remove incorrect constJacques Lucke
2020-06-09BLI: rename ArrayRef to SpanJacques Lucke
This also renames `MutableArrayRef` to `MutableSpan`. The name "Span" works better, because `std::span` will provide similar functionality in C++20. Furthermore, a shorter, more concise name for a common data structure is nice.