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
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-03-24 07:24:54 +0300
committerHans Goudey <h.goudey@me.com>2022-03-24 07:24:54 +0300
commitaeb2c2afaf00d1c1ef6cce73b106d5400e52566e (patch)
treeb270abfc0f710366b98ea01e01a2f372c39caa76 /source/blender/blenkernel/intern/image.cc
parente253f9f66d6f63592ffd97afe207ef7c72547d03 (diff)
Cleanup: Clang tidy
- Deprecated headers - Else after return - Inconsistent parameter names (I used the most recently modified) - Raw string literals
Diffstat (limited to 'source/blender/blenkernel/intern/image.cc')
-rw-r--r--source/blender/blenkernel/intern/image.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/image.cc b/source/blender/blenkernel/intern/image.cc
index 0e3c913189c..296364e71ca 100644
--- a/source/blender/blenkernel/intern/image.cc
+++ b/source/blender/blenkernel/intern/image.cc
@@ -239,7 +239,7 @@ static void image_foreach_cache(ID *id,
auto gputexture_offset = [image](int target, int eye, int resolution) {
constexpr size_t base_offset = offsetof(Image, gputexture);
- const auto first = &image->gputexture[0][0][0];
+ struct GPUTexture **first = &image->gputexture[0][0][0];
const size_t array_offset = sizeof(*first) *
(&image->gputexture[target][eye][resolution] - first);
return base_offset + array_offset;
@@ -489,9 +489,9 @@ static void image_add_view(Image *ima, const char *viewname, const char *filepat
/** \name Image Cache
* \{ */
-typedef struct ImageCacheKey {
+struct ImageCacheKey {
int index;
-} ImageCacheKey;
+};
static unsigned int imagecache_hashhash(const void *key_v)
{
@@ -3325,14 +3325,14 @@ void BKE_image_ensure_tile_token(char *filename)
* with other digit sequences, we can leverage the supported range of roughly
* 1000 through 2000 to provide better detection.
*/
- std::regex pattern("(^|.*?\\D)([12]\\d{3})(\\D.*)");
+ std::regex pattern(R"((^|.*?\D)([12]\d{3})(\D.*))");
if (std::regex_search(path, match, pattern)) {
BLI_strncpy(filename, match.format("$1<UDIM>$3").c_str(), FILE_MAX);
return;
}
/* General u##_v### "uvtile" pattern. */
- pattern = std::regex("(.*)(u\\d{1,2}_v\\d{1,3})(\\D.*)");
+ pattern = std::regex(R"((.*)(u\d{1,2}_v\d{1,3})(\D.*))");
if (std::regex_search(path, match, pattern)) {
BLI_strncpy(filename, match.format("$1<UVTILE>$3").c_str(), FILE_MAX);
return;
@@ -5053,7 +5053,7 @@ void BKE_image_user_file_path_ex(ImageUser *iuser, Image *ima, char *filepath, b
bool BKE_image_has_alpha(Image *image)
{
void *lock;
- ImBuf *ibuf = BKE_image_acquire_ibuf(image, NULL, &lock);
+ ImBuf *ibuf = BKE_image_acquire_ibuf(image, nullptr, &lock);
const int planes = (ibuf ? ibuf->planes : 0);
BKE_image_release_ibuf(image, ibuf, lock);