mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-11-29 10:24:10 +01:00
[util] Replace countof with std::size
This commit is contained in:
parent
5f9d5f1053
commit
827c7a892c
@ -69,9 +69,9 @@ namespace dxvk {
|
||||
const char* desc = options.customDeviceDesc.empty() ? props.deviceName : options.customDeviceDesc.c_str();
|
||||
const char* driver = GetDriverDLL(DxvkGpuVendor(vendorId));
|
||||
|
||||
std::strncpy(pIdentifier->Description, desc, countof(pIdentifier->Description));
|
||||
std::strncpy(pIdentifier->DeviceName, device.DeviceName, countof(pIdentifier->DeviceName)); // The GDI device name. Not the actual device name.
|
||||
std::strncpy(pIdentifier->Driver, driver, countof(pIdentifier->Driver)); // This is the driver's dll.
|
||||
std::strncpy(pIdentifier->Description, desc, std::size(pIdentifier->Description));
|
||||
std::strncpy(pIdentifier->DeviceName, device.DeviceName, std::size(pIdentifier->DeviceName)); // The GDI device name. Not the actual device name.
|
||||
std::strncpy(pIdentifier->Driver, driver, std::size(pIdentifier->Driver)); // This is the driver's dll.
|
||||
|
||||
pIdentifier->DeviceIdentifier = guid;
|
||||
pIdentifier->DeviceId = deviceId;
|
||||
|
@ -6541,7 +6541,7 @@ namespace dxvk {
|
||||
});
|
||||
|
||||
auto UploadVertexBlendData = [&](auto data) {
|
||||
for (uint32_t i = 0; i < countof(data->WorldView); i++)
|
||||
for (uint32_t i = 0; i < std::size(data->WorldView); i++)
|
||||
data->WorldView[i] = m_state.transforms[GetTransformIndex(D3DTS_VIEW)] * m_state.transforms[GetTransformIndex(D3DTS_WORLDMATRIX(i))];
|
||||
};
|
||||
|
||||
|
@ -2404,7 +2404,7 @@ namespace dxvk {
|
||||
|
||||
std::hash<uint32_t> uint32hash;
|
||||
|
||||
for (uint32_t i = 0; i < countof(key.Data.Primitive); i++)
|
||||
for (uint32_t i = 0; i < std::size(key.Data.Primitive); i++)
|
||||
state.add(uint32hash(key.Data.Primitive[i]));
|
||||
|
||||
return state;
|
||||
@ -2417,7 +2417,7 @@ namespace dxvk {
|
||||
std::hash<uint32_t> uint32hash;
|
||||
|
||||
for (uint32_t i = 0; i < caps::TextureStageCount; i++) {
|
||||
for (uint32_t j = 0; j < countof(key.Stages[i].Primitive); j++)
|
||||
for (uint32_t j = 0; j < std::size(key.Stages[i].Primitive); j++)
|
||||
state.add(uint32hash(key.Stages[i].Primitive[j]));
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,6 @@
|
||||
#include "../util/util_likely.h"
|
||||
#include "../util/util_math.h"
|
||||
#include "../util/util_monitor.h"
|
||||
#include "../util/util_misc.h"
|
||||
#include "../util/util_string.h"
|
||||
|
||||
// Missed definitions in Wine/MinGW.
|
||||
|
@ -1,8 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
namespace dxvk {
|
||||
|
||||
template <typename T, size_t n>
|
||||
size_t countof(const T(&)[n]) { return n; }
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user