mirror of
https://github.com/PabloMK7/citra.git
synced 2025-09-11 05:10:05 +00:00
code: Use std::span where appropriate (#6658)
* code: Use std::span when possible * code: Prefix memcpy and memcmp with std::
This commit is contained in:
parent
4ccd9f24fb
commit
cf9bb90ae3
106 changed files with 362 additions and 329 deletions
|
@ -487,7 +487,7 @@ void GraphicsVertexShaderWidget::Reload(bool replace_vertex_data, void* vertex_d
|
|||
|
||||
if (replace_vertex_data) {
|
||||
if (vertex_data) {
|
||||
memcpy(&input_vertex, vertex_data, sizeof(input_vertex));
|
||||
std::memcpy(&input_vertex, vertex_data, sizeof(input_vertex));
|
||||
for (unsigned attr = 0; attr < 16; ++attr) {
|
||||
for (unsigned comp = 0; comp < 4; ++comp) {
|
||||
input_data[4 * attr + comp]->setText(
|
||||
|
|
|
@ -18,7 +18,7 @@ QString RecordDialog::FormatObject(const IPCDebugger::ObjectInfo& object) const
|
|||
.arg(object.id, 8, 16, QLatin1Char('0'));
|
||||
}
|
||||
|
||||
QString RecordDialog::FormatCmdbuf(const std::vector<u32>& cmdbuf) const {
|
||||
QString RecordDialog::FormatCmdbuf(std::span<const u32> cmdbuf) const {
|
||||
QString result;
|
||||
for (std::size_t i = 0; i < cmdbuf.size(); ++i) {
|
||||
result.append(
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <QDialog>
|
||||
|
@ -28,7 +29,7 @@ public:
|
|||
|
||||
private:
|
||||
QString FormatObject(const IPCDebugger::ObjectInfo& object) const;
|
||||
QString FormatCmdbuf(const std::vector<u32>& cmdbuf) const;
|
||||
QString FormatCmdbuf(std::span<const u32> cmdbuf) const;
|
||||
void UpdateCmdbufDisplay();
|
||||
|
||||
std::unique_ptr<Ui::RecordDialog> ui;
|
||||
|
|
|
@ -64,7 +64,7 @@ WaitTreeItem* WaitTreeItem::Parent() const {
|
|||
return parent;
|
||||
}
|
||||
|
||||
const std::vector<std::unique_ptr<WaitTreeItem>>& WaitTreeItem::Children() const {
|
||||
std::span<const std::unique_ptr<WaitTreeItem>> WaitTreeItem::Children() const {
|
||||
return children;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <span>
|
||||
#include <QAbstractItemModel>
|
||||
#include <QDockWidget>
|
||||
#include <QTreeView>
|
||||
|
@ -36,7 +37,7 @@ public:
|
|||
|
||||
void Expand();
|
||||
WaitTreeItem* Parent() const;
|
||||
const std::vector<std::unique_ptr<WaitTreeItem>>& Children() const;
|
||||
std::span<const std::unique_ptr<WaitTreeItem>> Children() const;
|
||||
std::size_t Row() const;
|
||||
static std::vector<std::unique_ptr<WaitTreeThread>> MakeThreadItemList();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue