From ebd4657adccfe5c5330ffbff752b8d3b7741a3b0 Mon Sep 17 00:00:00 2001 From: Andreas Falkenhahn Date: Sun, 19 May 2024 19:33:58 +0200 Subject: [PATCH] Do not depend on bool being one byte The size of the bool data type is implemented-defined. I'm using a platform where gcc defaults to bool being 4 bytes, not 1. Thus we should use u8 here instead of bool to make sure the code is portable. --- lib/otf/clm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/otf/clm.cpp b/lib/otf/clm.cpp index bfc0eeae..670271fe 100644 --- a/lib/otf/clm.cpp +++ b/lib/otf/clm.cpp @@ -120,7 +120,7 @@ class BinaryDataReader : public BinaryReader { void CLMReader::readMeta(Otf& font, BinaryReader& reader) { font._name = std::string(reader.readString()); font._family = std::string(reader.readString()); - font._isMathFont = reader.read(); + font._isMathFont = reader.read(); font._style = reader.read(); font._em = reader.read(); font._xHeight = reader.read(); @@ -225,7 +225,7 @@ Variants* CLMReader::readVariants(BinaryReader& reader) { } GlyphAssembly* CLMReader::readGlyphAssembly(BinaryReader& reader) { - const bool isPresent = reader.read(); + const bool isPresent = reader.read(); if (!isPresent) return nullptr; const u16 partCount = reader.read(); auto* assembly = new GlyphAssembly(partCount);