diff --git a/ostd/filesystem.hh b/ostd/filesystem.hh index 667802f..445b619 100644 --- a/ostd/filesystem.hh +++ b/ostd/filesystem.hh @@ -33,9 +33,9 @@ enum class FileType { struct FileInfo; #ifdef OSTD_PLATFORM_WIN32 -static constexpr char PATH_SEPARATOR = '\\'; +static constexpr char PathSeparator = '\\'; #else -static constexpr char PATH_SEPARATOR = '/'; +static constexpr char PathSeparator = '/'; #endif #ifdef OSTD_PLATFORM_WIN32 @@ -148,7 +148,7 @@ private: p_path = path; ConstCharRange r = p_path.iter(); - ConstCharRange found = find_last(r, PATH_SEPARATOR); + ConstCharRange found = find_last(r, PathSeparator); if (found.empty()) p_slash = npos; else @@ -326,7 +326,7 @@ private: if (!p_de) return FileInfo(); String ap = p_path; - ap += PATH_SEPARATOR; + ap += PathSeparator; ap += (const char *)p_de->d_name; return FileInfo(ap); } @@ -464,7 +464,7 @@ private: if (empty()) return FileInfo(); String ap = p_path; - ap += PATH_SEPARATOR; + ap += PathSeparator; ap += (const char *)p_data.cFileName; return FileInfo(ap); } @@ -516,7 +516,7 @@ namespace detail { template static void join(String &s, const T &a, const A &...b) { s += a; - s += PATH_SEPARATOR; + s += PathSeparator; PathJoin::join(s, b...); } }; diff --git a/ostd/internal/hashtable.hh b/ostd/internal/hashtable.hh index 4792c84..c363b62 100644 --- a/ostd/internal/hashtable.hh +++ b/ostd/internal/hashtable.hh @@ -121,21 +121,21 @@ public: namespace detail { /* Use template metaprogramming to figure out a correct number * of elements to use per chunk for proper cache alignment - * (i.e. sizeof(Chunk) % CACHE_LINE_SIZE == 0). + * (i.e. sizeof(Chunk) % CacheLineSize == 0). * * If this is not possible, use the upper bound and pad the * structure with some extra bytes. */ - static constexpr Size CACHE_LINE_SIZE = 64; - static constexpr Size CHUNK_LOWER_BOUND = 32; - static constexpr Size CHUNK_UPPER_BOUND = 128; + static constexpr Size CacheLineSize = 64; + static constexpr Size ChunkLowerBound = 32; + static constexpr Size ChunkUpperBound = 128; template constexpr Size HashChainAlign - = (((sizeof(HashChain[N]) + sizeof(void *)) % CACHE_LINE_SIZE) == 0) + = (((sizeof(HashChain[N]) + sizeof(void *)) % CacheLineSize) == 0) ? N : HashChainAlign; template - constexpr Size HashChainAlign = CHUNK_UPPER_BOUND; + constexpr Size HashChainAlign = ChunkUpperBound; template struct HashChainPad; @@ -145,14 +145,14 @@ namespace detail { template struct HashChainPad { - byte pad[CACHE_LINE_SIZE - (N % CACHE_LINE_SIZE)]; + byte pad[CacheLineSize - (N % CacheLineSize)]; }; template - struct HashPad: HashChainPad {}; + struct HashPad: HashChainPad {}; - template, - bool P = (V == CHUNK_UPPER_BOUND) + template, + bool P = (V == ChunkUpperBound) > struct HashChunk; template