aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/include
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2025-11-01 14:04:35 +0100
committerGitHub Enterprise <[email protected]>2025-11-01 14:04:35 +0100
commita58da97f98697580bf128ed5723ba720cc30f0dc (patch)
tree798e392ddf76128a506293dc0803aaf852203dcd /src/zencore/include
parentfix use-after-free in TEST_CASE("compactcas.threadedinsert") (#620) (diff)
downloadzen-a58da97f98697580bf128ed5723ba720cc30f0dc.tar.xz
zen-a58da97f98697580bf128ed5723ba720cc30f0dc.zip
Various fixes to address issues flagged by gcc / non-UE toolchain build (#621)
* gcc: avoid using memset on nontrivial struct * redundant `return std::move` * fixed various compilation issues flagged by gcc * fix issue in xmake.lua detecting whether we are building with the UE toolchain or not * add GCC ignore -Wundef (comment is inaccurate) * remove redundant std::move * don't catch exceptions by value * unreferenced variables * initialize "by the book" instead of memset * remove unused exception reference * add #include <cstring> to fix gcc build * explicitly poulate KeyValueMap by traversing input spans fixes gcc compilation * remove unreferenced variable * eliminate redundant `std::move` which gcc complains about * fix gcc compilation by including <cstring> * tag unreferenced variable to fix gcc compilation * fixes for various cases of naming members the same as their type
Diffstat (limited to 'src/zencore/include')
-rw-r--r--src/zencore/include/zencore/compactbinaryutil.h2
-rw-r--r--src/zencore/include/zencore/jobqueue.h14
2 files changed, 8 insertions, 8 deletions
diff --git a/src/zencore/include/zencore/compactbinaryutil.h b/src/zencore/include/zencore/compactbinaryutil.h
index eecc3344b..2617c749f 100644
--- a/src/zencore/include/zencore/compactbinaryutil.h
+++ b/src/zencore/include/zencore/compactbinaryutil.h
@@ -57,7 +57,7 @@ namespace compactbinary_helpers {
inline void WriteArray(std::span<const Type> Values, std::string_view ArrayName, CbWriter& Output)
{
Output.BeginArray(ArrayName);
- for (const Type Value : Values)
+ for (const Type& Value : Values)
{
Output << Value;
}
diff --git a/src/zencore/include/zencore/jobqueue.h b/src/zencore/include/zencore/jobqueue.h
index 470ed3fc6..d348bd021 100644
--- a/src/zencore/include/zencore/jobqueue.h
+++ b/src/zencore/include/zencore/jobqueue.h
@@ -48,7 +48,7 @@ public:
virtual bool CancelJob(JobId Id) = 0;
virtual void Stop() = 0;
- enum class Status : uint32_t
+ enum class JobStatus : uint32_t
{
Queued,
Running,
@@ -56,7 +56,7 @@ public:
Completed
};
- struct State
+ struct JobState
{
std::string CurrentOp;
std::string CurrentOpDetails;
@@ -68,8 +68,8 @@ public:
struct JobInfo
{
- JobId Id;
- Status Status;
+ JobId Id;
+ JobStatus Status;
};
virtual std::vector<JobInfo> GetJobs() = 0;
@@ -77,8 +77,8 @@ public:
struct JobDetails
{
std::string Name;
- Status Status;
- State State;
+ JobStatus Status;
+ JobState State;
std::chrono::system_clock::time_point CreateTime;
std::chrono::system_clock::time_point StartTime;
std::chrono::system_clock::time_point EndTime;
@@ -89,7 +89,7 @@ public:
// Will only respond once when status is Complete or Aborted
virtual std::optional<JobDetails> Get(JobId Id) = 0;
- static std::string_view ToString(Status Status);
+ static std::string_view ToString(JobStatus Status);
};
std::unique_ptr<JobQueue> MakeJobQueue(int WorkerCount, std::string_view QueueName);