From f5d6ef19a4a2ffadce991f65fe92bac0986bb195 Mon Sep 17 00:00:00 2001 From: Brett Date: Mon, 24 Jul 2023 02:55:03 -0400 Subject: [PATCH] remove format changes --- include/blt/std/format.h | 9 +++++---- include/blt/std/memory.h | 4 +--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/include/blt/std/format.h b/include/blt/std/format.h index 0fdd37a..5f0a18a 100755 --- a/include/blt/std/format.h +++ b/include/blt/std/format.h @@ -11,7 +11,6 @@ #include #include #include -#include namespace blt::string { @@ -64,12 +63,12 @@ namespace blt::string { } struct utf8_string { - blt::scoped_buffer characters; + char* characters; + unsigned int size; }; // taken from java, adapted for c++. static inline utf8_string createUTFString(const std::string& str) { - const auto strlen = (unsigned int) str.size(); unsigned int utflen = strlen; @@ -82,7 +81,9 @@ namespace blt::string { if (utflen > 65535 || /* overflow */ utflen < strlen) throw "UTF Error"; - utf8_string chars{scoped_buffer{utflen + 2}}; + utf8_string chars{}; + chars.size = utflen + 2; + chars.characters = new char[chars.size]; int count = 0; chars.characters[count++] = (char) ((utflen >> 0) & 0xFF); diff --git a/include/blt/std/memory.h b/include/blt/std/memory.h index be494a1..663a9b4 100755 --- a/include/blt/std/memory.h +++ b/include/blt/std/memory.h @@ -58,9 +58,7 @@ namespace blt { * Creates an encapsulation of a T array which will be automatically deleted when this object goes out of scope. * This is a simple buffer meant to be used only inside of a function and not moved around, with a few minor exceptions. * The internal buffer is allocated on the heap. - * The operator * has been overloaded to return the internal buffer. (or just use scoped_buffer.buffer if you wish to be explicit) - * The operator & was not used because I think it is stupid to do so. - * "*" on a reference is fine however since it isn't used to dereference in the case. + * The operator * has been overloaded to return the internal buffer. * @tparam T type that is stored in buffer eg char */ template