From 05f085c9055fa5bd13bdba40fc40fb3f00d69fab Mon Sep 17 00:00:00 2001 From: Amlal Date: Sat, 26 Oct 2024 07:59:10 +0200 Subject: IMP: Fixes and improvements. Signed-off-by: Amlal --- dev/zka/src/GUIDWizard.cc | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'dev/zka/src/GUIDWizard.cc') diff --git a/dev/zka/src/GUIDWizard.cc b/dev/zka/src/GUIDWizard.cc index a904696f..d72c77eb 100644 --- a/dev/zka/src/GUIDWizard.cc +++ b/dev/zka/src/GUIDWizard.cc @@ -2,7 +2,7 @@ Copyright ZKA Web Services Co. - File: GUIDWizard.cxx + File: GUIDWizard.cc Purpose: GUID helper code Revision History: @@ -13,53 +13,53 @@ #include // begin of ascii 'readable' characters. (A, C, C, 1, 2) -#define kAsciiBegin 47 +#define kUUIDAsciiBegin 47 // @brief Size of UUID. #define kUUIDSize 37 namespace CFKit::XRN::Version1 { - auto cf_make_sequence(const ArrayList& uuidSeq) -> Ref + auto cf_make_sequence(const ArrayList& uuidSeq) -> Ref { GUIDSequence* seq = new GUIDSequence(); MUST_PASS(seq); - Ref seq_ref{*seq}; + Ref seq_ref{seq}; - seq_ref.Leak().fMs1 = uuidSeq[0]; - seq_ref.Leak().fMs2 = uuidSeq[1]; - seq_ref.Leak().fMs3 = uuidSeq[2]; - seq_ref.Leak().fMs4[0] = uuidSeq[3]; - seq_ref.Leak().fMs4[1] = uuidSeq[4]; - seq_ref.Leak().fMs4[2] = uuidSeq[5]; - seq_ref.Leak().fMs4[3] = uuidSeq[6]; - seq_ref.Leak().fMs4[4] = uuidSeq[7]; - seq_ref.Leak().fMs4[5] = uuidSeq[8]; - seq_ref.Leak().fMs4[6] = uuidSeq[9]; - seq_ref.Leak().fMs4[7] = uuidSeq[10]; + seq_ref.Leak()->fMs1 = uuidSeq[0]; + seq_ref.Leak()->fMs2 = uuidSeq[1]; + seq_ref.Leak()->fMs3 = uuidSeq[2]; + seq_ref.Leak()->fMs4[0] = uuidSeq[3]; + seq_ref.Leak()->fMs4[1] = uuidSeq[4]; + seq_ref.Leak()->fMs4[2] = uuidSeq[5]; + seq_ref.Leak()->fMs4[3] = uuidSeq[6]; + seq_ref.Leak()->fMs4[4] = uuidSeq[7]; + seq_ref.Leak()->fMs4[5] = uuidSeq[8]; + seq_ref.Leak()->fMs4[6] = uuidSeq[9]; + seq_ref.Leak()->fMs4[7] = uuidSeq[10]; return seq_ref; } // @brief Tries to make a guid out of a string. // This function is not complete for now - auto cf_try_guid_to_string(Ref& seq) -> ErrorOr> + auto cf_try_guid_to_string(Ref& seq) -> ErrorOr> { Char buf[kUUIDSize]; for (SizeT index = 0; index < 16; ++index) { - buf[index] = seq.Leak().u8[index] + kAsciiBegin; + buf[index] = seq.Leak()->u8[index] + kUUIDAsciiBegin; } for (SizeT index = 16; index < 24; ++index) { - buf[index] = seq.Leak().u16[index] + kAsciiBegin; + buf[index] = seq.Leak()->u16[index] + kUUIDAsciiBegin; } for (SizeT index = 24; index < 28; ++index) { - buf[index] = seq.Leak().u32[index] + kAsciiBegin; + buf[index] = seq.Leak()->u32[index] + kUUIDAsciiBegin; } auto view = StringBuilder::Construct(buf); -- cgit v1.2.3