Merge branch 'master' into jgrpp

Remove 'byte' typedef
This commit is contained in:
Jonathan G Rennison
2024-05-07 17:21:50 +01:00
376 changed files with 2220 additions and 2152 deletions

View File

@@ -258,7 +258,7 @@ const Sprite *CoreTextFontCache::InternalGetGlyph(GlyphID key, bool use_aa)
/* We only need the alpha channel, as we apply our own colour constants to the sprite. */
int pitch = Align(bb_width, 16);
byte *bmp = CallocT<byte>(bb_height * pitch);
uint8_t *bmp = CallocT<uint8_t>(bb_height * pitch);
CFAutoRelease<CGContextRef> context(CGBitmapContextCreate(bmp, bb_width, bb_height, 8, pitch, nullptr, kCGImageAlphaOnly));
/* Set antialias according to requirements. */
CGContextSetAllowsAntialiasing(context.get(), use_aa);
@@ -294,7 +294,7 @@ const Sprite *CoreTextFontCache::InternalGetGlyph(GlyphID key, bool use_aa)
GlyphEntry new_glyph;
new_glyph.sprite = BlitterFactory::GetCurrentBlitter()->Encode(spritecollection, SimpleSpriteAlloc);
new_glyph.width = (byte)std::round(CTFontGetAdvancesForGlyphs(this->font.get(), kCTFontOrientationDefault, &glyph, nullptr, 1));
new_glyph.width = (uint8_t)std::round(CTFontGetAdvancesForGlyphs(this->font.get(), kCTFontOrientationDefault, &glyph, nullptr, 1));
this->SetGlyphPtr(key, &new_glyph);
return new_glyph.sprite;

View File

@@ -310,11 +310,11 @@ static const char *GetAccessViolationTypeString(uint type)
buffer += seprintf(buffer, last, "\n Bytes at instruction pointer:\n");
#ifdef _M_AMD64
byte *b = (byte*)ep->ContextRecord->Rip;
uint8_t *b = (uint8_t*)ep->ContextRecord->Rip;
#elif defined(_M_IX86)
byte *b = (byte*)ep->ContextRecord->Eip;
uint8_t *b = (uint8_t*)ep->ContextRecord->Eip;
#elif defined(_M_ARM64)
byte *b = (byte*)ep->ContextRecord->Pc;
uint8_t *b = (uint8_t*)ep->ContextRecord->Pc;
#endif
for (int i = 0; i != 24; i++) {
if (IsBadReadPtr(b, 1)) {

View File

@@ -224,7 +224,7 @@ void Win32FontCache::ClearFontCache()
if (width > MAX_GLYPH_DIM || height > MAX_GLYPH_DIM) usererror("Font glyph is too large");
/* Call GetGlyphOutline again with size to actually render the glyph. */
byte *bmp = AllocaM(byte, size);
uint8_t *bmp = AllocaM(uint8_t, size);
GetGlyphOutline(this->dc, key, GGO_GLYPH_INDEX | (aa ? GGO_GRAY8_BITMAP : GGO_BITMAP), &gm, size, bmp, &mat);
/* GDI has rendered the glyph, now we allocate a sprite and copy the image into it. */
@@ -339,11 +339,11 @@ static bool TryLoadFontFromFile(const std::string &font_name, LOGFONT &logfont)
/* Try to query an array of LOGFONTs that describe the file. */
DWORD len = 0;
if (GetFontResourceInfo(fontPath, &len, nullptr, 2) && len >= sizeof(LOGFONT)) {
LOGFONT *buf = (LOGFONT *)new byte[len];
LOGFONT *buf = (LOGFONT *)new uint8_t[len];
if (GetFontResourceInfo(fontPath, &len, buf, 2)) {
logfont = *buf; // Just use first entry.
}
delete[](byte *)buf;
delete[](uint8_t *)buf;
}
}