Cleanup: Various clang-tidy warnings in intern

Pull Request: https://projects.blender.org/blender/blender/pulls/133734
This commit is contained in:
Brecht Van Lommel
2025-01-26 20:08:09 +01:00
parent c721c1a7e8
commit 0d92a7f57a
132 changed files with 1395 additions and 1450 deletions

View File

@@ -12,13 +12,13 @@
#include "utf_winfunc.hh"
#include "utfconv.hh"
#include <cwchar>
#include <io.h>
#include <wchar.h>
#include <windows.h>
FILE *ufopen(const char *filename, const char *mode)
{
FILE *f = NULL;
FILE *f = nullptr;
UTF16_ENCODE(filename);
UTF16_ENCODE(mode);
@@ -108,7 +108,7 @@ int umkdir(const char *pathname)
char *u_alloc_getenv(const char *varname)
{
char *r = 0;
char *r = nullptr;
wchar_t *str;
UTF16_ENCODE(varname);
if (varname_16) {

View File

@@ -13,7 +13,7 @@
# error "This file can only compile on windows"
#endif
#include <stdio.h>
#include <cstdio>
FILE *ufopen(const char *filename, const char *mode);
int uopen(const char *filename, int oflag, int pmode);

View File

@@ -280,9 +280,9 @@ static void utf_8_cut_end(char *inout8, size_t maxcutpoint)
char *alloc_utf_8_from_16(const wchar_t *in16, size_t add)
{
size_t bsize = count_utf_8_from_16(in16);
char *out8 = NULL;
char *out8 = nullptr;
if (!bsize) {
return NULL;
return nullptr;
}
out8 = (char *)malloc(sizeof(char) * (bsize + add));
conv_utf_16_to_8(in16, out8, bsize);
@@ -292,9 +292,9 @@ char *alloc_utf_8_from_16(const wchar_t *in16, size_t add)
wchar_t *alloc_utf16_from_8(const char *in8, size_t add)
{
size_t bsize = count_utf_16_from_8(in8);
wchar_t *out16 = NULL;
wchar_t *out16 = nullptr;
if (!bsize) {
return NULL;
return nullptr;
}
out16 = (wchar_t *)malloc(sizeof(wchar_t) * (bsize + add));
conv_utf_8_to_16(in8, out16, bsize);

View File

@@ -9,9 +9,9 @@
#ifndef __UTFCONV_H__
#define __UTFCONV_H__
#include <stdio.h>
#include <stdlib.h>
#include <wchar.h>
#include <cstdio>
#include <cstdlib>
#include <cwchar>
/**
* Counts how many bytes is required for future utf-8 string using utf-16