Cleanup: various non-functional changes for C++
This commit is contained in:
parent
b0fb693e1b
commit
b6b00b61cb
|
@ -538,7 +538,7 @@ void layer_adjustments_to_modifiers(Main &bmain,
|
||||||
STRNCPY(tmd->influence.layer_name, gpl->info);
|
STRNCPY(tmd->influence.layer_name, gpl->info);
|
||||||
|
|
||||||
char modifier_name[64];
|
char modifier_name[64];
|
||||||
BLI_snprintf(modifier_name, 64, "Tint %s", gpl->info);
|
SNPRINTF(modifier_name, "Tint %s", gpl->info);
|
||||||
STRNCPY(md->name, modifier_name);
|
STRNCPY(md->name, modifier_name);
|
||||||
BKE_modifier_unique_name(&dst_object.modifiers, md);
|
BKE_modifier_unique_name(&dst_object.modifiers, md);
|
||||||
|
|
||||||
|
@ -558,7 +558,7 @@ void layer_adjustments_to_modifiers(Main &bmain,
|
||||||
auto *md = reinterpret_cast<NodesModifierData *>(BKE_modifier_new(eModifierType_Nodes));
|
auto *md = reinterpret_cast<NodesModifierData *>(BKE_modifier_new(eModifierType_Nodes));
|
||||||
|
|
||||||
char modifier_name[64];
|
char modifier_name[64];
|
||||||
BLI_snprintf(modifier_name, 64, "Thickness %s", gpl->info);
|
SNPRINTF(modifier_name, "Thickness %s", gpl->info);
|
||||||
STRNCPY(md->modifier.name, modifier_name);
|
STRNCPY(md->modifier.name, modifier_name);
|
||||||
BKE_modifier_unique_name(&dst_object.modifiers, &md->modifier);
|
BKE_modifier_unique_name(&dst_object.modifiers, &md->modifier);
|
||||||
md->node_group = offset_radius_node_tree;
|
md->node_group = offset_radius_node_tree;
|
||||||
|
|
|
@ -596,7 +596,7 @@ void GPU_shader_constant_bool_ex(GPUShader *sh, int location, bool value)
|
||||||
Shader &shader = *unwrap(sh);
|
Shader &shader = *unwrap(sh);
|
||||||
BLI_assert(shader.constants.types[location] == gpu::shader::Type::BOOL);
|
BLI_assert(shader.constants.types[location] == gpu::shader::Type::BOOL);
|
||||||
shader.constants.is_dirty |= assign_if_different(shader.constants.values[location].u,
|
shader.constants.is_dirty |= assign_if_different(shader.constants.values[location].u,
|
||||||
static_cast<uint32_t>(value));
|
uint32_t(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_shader_constant_int(GPUShader *sh, const char *name, int value)
|
void GPU_shader_constant_int(GPUShader *sh, const char *name, int value)
|
||||||
|
|
|
@ -356,5 +356,5 @@ ImbAnimType imb_get_anim_type(const char *filepath)
|
||||||
bool IMB_isanim(const char *filepath)
|
bool IMB_isanim(const char *filepath)
|
||||||
{
|
{
|
||||||
ImbAnimType type = imb_get_anim_type(filepath);
|
ImbAnimType type = imb_get_anim_type(filepath);
|
||||||
return (type != ImbAnimType::NotAnim && type != ImbAnimType::Sequence);
|
return !ELEM(type, ImbAnimType::NotAnim, ImbAnimType::Sequence);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ static void __cpuid(
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int cpu_supports_sse42(void)
|
static int cpu_supports_sse42()
|
||||||
{
|
{
|
||||||
int result[4], num;
|
int result[4], num;
|
||||||
__cpuid(result, 0);
|
__cpuid(result, 0);
|
||||||
|
@ -39,17 +39,17 @@ static int cpu_supports_sse42(void)
|
||||||
|
|
||||||
if (num >= 1) {
|
if (num >= 1) {
|
||||||
__cpuid(result, 0x00000001);
|
__cpuid(result, 0x00000001);
|
||||||
return (result[2] & ((int)1 << 20)) != 0;
|
return (result[2] & (int(1) << 20)) != 0;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *cpu_brand_string(void)
|
static const char *cpu_brand_string()
|
||||||
{
|
{
|
||||||
static char buf[49] = {0};
|
static char buf[49] = {0};
|
||||||
int result[4] = {0};
|
int result[4] = {0};
|
||||||
__cpuid(result, 0x80000000);
|
__cpuid(result, 0x80000000);
|
||||||
if (result[0] >= (int)0x80000004) {
|
if (result[0] >= int(0x80000004)) {
|
||||||
__cpuid((int *)(buf + 0), 0x80000002);
|
__cpuid((int *)(buf + 0), 0x80000002);
|
||||||
__cpuid((int *)(buf + 16), 0x80000003);
|
__cpuid((int *)(buf + 16), 0x80000003);
|
||||||
__cpuid((int *)(buf + 32), 0x80000004);
|
__cpuid((int *)(buf + 32), 0x80000004);
|
||||||
|
@ -60,7 +60,7 @@ static const char *cpu_brand_string(void)
|
||||||
}
|
}
|
||||||
return buf_ptr;
|
return buf_ptr;
|
||||||
}
|
}
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
@ -91,7 +91,7 @@ BOOL WINAPI DllMain(HINSTANCE /* hinstDLL */, DWORD fdwReason, LPVOID /* lpvRese
|
||||||
# include <cstdio>
|
# include <cstdio>
|
||||||
# include <cstdlib>
|
# include <cstdlib>
|
||||||
|
|
||||||
static __attribute__((constructor)) void cpu_check(void)
|
static __attribute__((constructor)) void cpu_check()
|
||||||
{
|
{
|
||||||
# ifdef __x86_64
|
# ifdef __x86_64
|
||||||
if (!cpu_supports_sse42()) {
|
if (!cpu_supports_sse42()) {
|
||||||
|
|
Loading…
Reference in New Issue