[Scummvm-git-logs] scummvm master -> a6b888739cb14130bd3f42c44b96566bda8507c8
bluegr
noreply at scummvm.org
Mon Apr 6 20:35:52 UTC 2026
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
53f54e00c6 GLK: Replace use of deprecated U32String methods
a6b888739c COMMON: Remove deprecated U32String methods
Commit: 53f54e00c6ed5c809e6f4c1bc8b39141172dca9f
https://github.com/scummvm/scummvm/commit/53f54e00c6ed5c809e6f4c1bc8b39141172dca9f
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2026-04-06T23:35:47+03:00
Commit Message:
GLK: Replace use of deprecated U32String methods
Changed paths:
engines/glk/adrift/os_glk.cpp
engines/glk/advsys/glk_interface.cpp
engines/glk/comprehend/comprehend.cpp
engines/glk/glk_api.cpp
engines/glk/glk_api.h
engines/glk/scott/scott.cpp
engines/glk/window_text_buffer.cpp
engines/glk/window_text_grid.cpp
engines/glk/zcode/processor.h
engines/glk/zcode/processor_buffer.cpp
engines/glk/zcode/processor_text.cpp
engines/glk/zcode/zcode.cpp
diff --git a/engines/glk/adrift/os_glk.cpp b/engines/glk/adrift/os_glk.cpp
index 4e70b822a23..b0af749813c 100644
--- a/engines/glk/adrift/os_glk.cpp
+++ b/engines/glk/adrift/os_glk.cpp
@@ -2812,7 +2812,7 @@ static int gsc_startup_code(Common::SeekableReadStream *game_stream, int restore
* Display a brief loading game message; here we have to use a timeout
* to ensure that the text is flushed to Glk.
*/
- g_vm->glk_put_string_uni(_("Loading game...\n").u32_str());
+ g_vm->glk_put_string_uni(_("Loading game...\n"));
if (g_vm->glk_gestalt(gestalt_Timer, 0)) {
event_t event;
diff --git a/engines/glk/advsys/glk_interface.cpp b/engines/glk/advsys/glk_interface.cpp
index 993b3613e9d..83fb8a6322b 100644
--- a/engines/glk/advsys/glk_interface.cpp
+++ b/engines/glk/advsys/glk_interface.cpp
@@ -40,7 +40,7 @@ void GlkInterface::print(const Common::U32String &msg) {
// Don't print out text if loading a savegame directly from the launcher, since we don't
// want any of the intro text displayed by the startup code to show
if (_saveSlot == -1)
- glk_put_string_stream_uni(glk_window_get_stream(_window), msg.u32_str());
+ glk_put_string_stream_uni(glk_window_get_stream(_window), msg);
}
void GlkInterface::print(int number) {
diff --git a/engines/glk/comprehend/comprehend.cpp b/engines/glk/comprehend/comprehend.cpp
index 58b424cc448..fc539324633 100644
--- a/engines/glk/comprehend/comprehend.cpp
+++ b/engines/glk/comprehend/comprehend.cpp
@@ -140,7 +140,7 @@ void Comprehend::print_u32_internal(const Common::U32String *fmt, ...) {
Common::U32String::vformat(fmt->begin(), fmt->end(), outputMsg, argp);
va_end(argp);
- glk_put_string_stream_uni(glk_window_get_stream(_bottomWindow), outputMsg.u32_str());
+ glk_put_string_stream_uni(glk_window_get_stream(_bottomWindow), outputMsg);
}
void Comprehend::printRoomDesc(const Common::String &desc) {
diff --git a/engines/glk/glk_api.cpp b/engines/glk/glk_api.cpp
index 61878cfb877..b4a7a2edc0b 100644
--- a/engines/glk/glk_api.cpp
+++ b/engines/glk/glk_api.cpp
@@ -59,7 +59,7 @@ GlkAPI::GlkAPI(OSystem *syst, const GlkGameDescription &gameDesc) :
}
void GlkAPI::glk_exit(void) {
- glk_put_string_uni(_("[ press any key to exit ]").u32_str());
+ glk_put_string_uni(_("[ press any key to exit ]"));
_events->waitForPress();
// Trigger a ScumMVM shutdown of game
@@ -798,6 +798,10 @@ void GlkAPI::glk_put_string_uni(const uint32 *s) {
_streams->getCurrent()->putBufferUni(s, strlen_uni(s));
}
+void GlkAPI::glk_put_string_uni(const Common::U32String &s) {
+ _streams->getCurrent()->putBufferUni((const uint32 *)s.c_str(), s.size());
+}
+
void GlkAPI::glk_put_buffer_uni(const uint32 *buf, uint len) {
_streams->getCurrent()->putBufferUni(buf, len);
}
@@ -818,6 +822,14 @@ void GlkAPI::glk_put_string_stream_uni(strid_t str, const uint32 *s) {
}
}
+void GlkAPI::glk_put_string_stream_uni(strid_t str, const Common::U32String &s) {
+ if (str) {
+ str->putBufferUni((const uint32 *)s.c_str(), s.size());
+ } else {
+ warning("put_string_stream_uni: invalid ref");
+ }
+}
+
void GlkAPI::glk_put_buffer_stream_uni(strid_t str, const uint32 *buf, uint len) {
if (str) {
str->putBufferUni(buf, len);
diff --git a/engines/glk/glk_api.h b/engines/glk/glk_api.h
index f2bbb2b816c..49b2c9cd617 100644
--- a/engines/glk/glk_api.h
+++ b/engines/glk/glk_api.h
@@ -169,9 +169,11 @@ public:
void glk_put_char_uni(uint32 ch);
void glk_put_string_uni(const uint32 *s);
+ void glk_put_string_uni(const Common::U32String &s);
void glk_put_buffer_uni(const uint32 *buf, uint len);
void glk_put_char_stream_uni(strid_t str, uint32 ch);
void glk_put_string_stream_uni(strid_t str, const uint32 *s);
+ void glk_put_string_stream_uni(strid_t str, const Common::U32String &s);
void glk_put_buffer_stream_uni(strid_t str, const uint32 *buf, uint len);
int glk_get_char_stream_uni(strid_t str);
diff --git a/engines/glk/scott/scott.cpp b/engines/glk/scott/scott.cpp
index 870a56c35d3..895a478e938 100644
--- a/engines/glk/scott/scott.cpp
+++ b/engines/glk/scott/scott.cpp
@@ -250,9 +250,9 @@ void Scott::display_u32_internal(winid_t w, const Common::U32String *fmt, ...) {
Common::U32String::vformat(fmt->begin(), fmt->end(), msg, ap);
va_end(ap);
- glk_put_string_stream_uni(glk_window_get_stream(w), msg.u32_str());
+ glk_put_string_stream_uni(glk_window_get_stream(w), msg);
if (_G(_transcript))
- glk_put_string_stream_uni(_G(_transcript), msg.u32_str());
+ glk_put_string_stream_uni(_G(_transcript), msg);
}
void Scott::updateSettings() {
diff --git a/engines/glk/window_text_buffer.cpp b/engines/glk/window_text_buffer.cpp
index ad1e81261f9..86372bcf226 100644
--- a/engines/glk/window_text_buffer.cpp
+++ b/engines/glk/window_text_buffer.cpp
@@ -992,7 +992,7 @@ void TextBufferWindow::redraw() {
link = ln._attrs[a].hyper;
font = ln._attrs[a].attrFont(_styles);
color = ln._attrs[a].attrBg(_styles);
- w = screen.stringWidthUni(font, Common::U32String(ln._chars + a, b - a), spw);
+ w = screen.stringWidthUni(font, Common::U32String((const char32_t *)ln._chars + a, b - a), spw);
screen.fillRect(Rect::fromXYWH(x / GLI_SUBPIX, y, w / GLI_SUBPIX, _font._leading),
color);
if (link) {
@@ -1009,7 +1009,7 @@ void TextBufferWindow::redraw() {
link = ln._attrs[a].hyper;
font = ln._attrs[a].attrFont(_styles);
color = ln._attrs[a].attrBg(_styles);
- w = screen.stringWidthUni(font, Common::U32String(ln._chars + a, b - a), spw);
+ w = screen.stringWidthUni(font, Common::U32String((const char32_t *)ln._chars + a, b - a), spw);
screen.fillRect(Rect::fromXYWH(x / GLI_SUBPIX, y, w / GLI_SUBPIX, _font._leading), color);
if (link) {
screen.fillRect(Rect::fromXYWH(x / GLI_SUBPIX + 1, y + _font._baseLine + 1,
@@ -1045,14 +1045,14 @@ void TextBufferWindow::redraw() {
font = ln._attrs[a].attrFont(_styles);
color = link ? _font._linkColor : ln._attrs[a].attrFg(_styles);
x = screen.drawStringUni(Point(x, y + _font._baseLine),
- font, color, Common::U32String(ln._chars + a, b - a), spw);
+ font, color, Common::U32String((const char32_t *)ln._chars + a, b - a), spw);
a = b;
}
}
link = ln._attrs[a].hyper;
font = ln._attrs[a].attrFont(_styles);
color = link ? _font._linkColor : ln._attrs[a].attrFg(_styles);
- screen.drawStringUni(Point(x, y + _font._baseLine), font, color, Common::U32String(ln._chars + a, linelen - a), spw);
+ screen.drawStringUni(Point(x, y + _font._baseLine), font, color, Common::U32String((const char32_t *)ln._chars + a, linelen - a), spw);
}
/*
@@ -1173,7 +1173,7 @@ void TextBufferWindow::redraw() {
if (selBuf && _copyPos) {
Windows::_claimSelect = true;
- g_vm->_clipboard->clipboardStore(Common::U32String(_copyBuf, _copyPos));
+ g_vm->_clipboard->clipboardStore(Common::U32String((const char32_t *)_copyBuf, _copyPos));
for (i = 0; i < _copyPos; i++)
_copyBuf[i] = 0;
_copyPos = 0;
@@ -1302,7 +1302,7 @@ void TextBufferWindow::acceptReadLine(uint32 arg) {
len = _numChars - _inFence;
if (len > 0)
- s = Common::U32String(&(_chars[_inFence]), len);
+ s = Common::U32String((const char32_t *)&(_chars[_inFence]), len);
_history[_historyPos] = s;
}
@@ -1310,7 +1310,7 @@ void TextBufferWindow::acceptReadLine(uint32 arg) {
if (_historyPos < 0)
_historyPos += HISTORYLEN;
s = _history[_historyPos];
- putTextUni(s.u32_str(), s.size(), _inFence, _numChars - _inFence);
+ putTextUni((const uint32 *)s.c_str(), s.size(), _inFence, _numChars - _inFence);
break;
case keycode_Down:
@@ -1320,7 +1320,7 @@ void TextBufferWindow::acceptReadLine(uint32 arg) {
if (_historyPos >= HISTORYLEN)
_historyPos -= HISTORYLEN;
s = _history[_historyPos];
- putTextUni(s.u32_str(), s.size(), _inFence, _numChars - _inFence);
+ putTextUni((const uint32 *)s.c_str(), s.size(), _inFence, _numChars - _inFence);
break;
// Cursor movement keys, during line input.
@@ -1432,7 +1432,7 @@ void TextBufferWindow::acceptLine(uint32 keycode) {
* A history entry should not repeat the string from the entry before it.
*/
if (len) {
- s = Common::U32String(_chars + _inFence, len);
+ s = Common::U32String((const char32_t *)_chars + _inFence, len);
_history[_historyPresent].clear();
o = _history[(_historyPresent == 0 ? HISTORYLEN : _historyPresent) - 1];
@@ -1627,12 +1627,12 @@ int TextBufferWindow::calcWidth(const uint32 *chars, const Attributes *attrs, in
for (b = startchar; b < numChars; b++) {
if (attrs[a] != attrs[b]) {
w += screen.stringWidthUni(attrs[a].attrFont(_styles),
- Common::U32String(chars + a, b - a), spw);
+ Common::U32String((const char32_t *)chars + a, b - a), spw);
a = b;
}
}
- w += screen.stringWidthUni(attrs[a].attrFont(_styles), Common::U32String(chars + a, b - a), spw);
+ w += screen.stringWidthUni(attrs[a].attrFont(_styles), Common::U32String((const char32_t *)chars + a, b - a), spw);
return w;
}
diff --git a/engines/glk/window_text_grid.cpp b/engines/glk/window_text_grid.cpp
index 6d9237128b6..f07bd8ec03a 100644
--- a/engines/glk/window_text_grid.cpp
+++ b/engines/glk/window_text_grid.cpp
@@ -664,7 +664,7 @@ void TextGridWindow::redraw() {
for (k = a, o = x; k < b; k++, o += _font._cellW) {
screen.drawStringUni(Point(o * GLI_SUBPIX, y + _font._baseLine), font,
- fgcolor, Common::U32String(&ln->_chars[k], 1), -1);
+ fgcolor, Common::U32String(ln->_chars[k]), -1);
}
if (link) {
screen.fillRect(Rect::fromXYWH(x, y + _font._baseLine + 1, w,
@@ -693,7 +693,7 @@ void TextGridWindow::redraw() {
// Write out the text
for (k = a, o = x; k < b; k++, o += _font._cellW) {
screen.drawStringUni(Point(o * GLI_SUBPIX, y + _font._baseLine), font,
- fgcolor, Common::U32String(&ln->_chars[k], 1));
+ fgcolor, Common::U32String(ln->_chars[k]));
}
if (link) {
screen.fillRect(Rect::fromXYWH(x, y + _font._baseLine + 1, w, _font._linkStyle), _font._linkColor);
diff --git a/engines/glk/zcode/processor.h b/engines/glk/zcode/processor.h
index 7c95c61edf6..d9e5bf5af91 100644
--- a/engines/glk/zcode/processor.h
+++ b/engines/glk/zcode/processor.h
@@ -181,7 +181,7 @@ protected:
/*
* Print a unicode string.
*/
- void print_string_uni(const uint32 *s);
+ void print_string_uni(const Common::U32String &str);
/**
* Print an unsigned 32bit number in decimal or hex.
diff --git a/engines/glk/zcode/processor_buffer.cpp b/engines/glk/zcode/processor_buffer.cpp
index 746f80a20a5..51ae6d6253e 100644
--- a/engines/glk/zcode/processor_buffer.cpp
+++ b/engines/glk/zcode/processor_buffer.cpp
@@ -131,7 +131,8 @@ void Processor::print_string(const char *s) {
}
}
-void Processor::print_string_uni(const uint32 *s) {
+void Processor::print_string_uni(const Common::U32String &str) {
+ const uint32 *s = (const uint32 *)str.c_str();
uint32 c;
while ((c = *s++) != 0) {
if (c == '\n')
diff --git a/engines/glk/zcode/processor_text.cpp b/engines/glk/zcode/processor_text.cpp
index bfea314156e..732fe07a2c5 100644
--- a/engines/glk/zcode/processor_text.cpp
+++ b/engines/glk/zcode/processor_text.cpp
@@ -565,7 +565,7 @@ void Processor::handleAbbreviations() {
int wordSize = 0;
while (wordSize < (_resolution * 3) && _decoded[wordSize])
++wordSize;
- Common::U32String word(_decoded, _decoded + wordSize);
+ Common::U32String word((const char32_t *)_decoded, wordSize);
// Check for standard abbreviations
if (word == "g")
diff --git a/engines/glk/zcode/zcode.cpp b/engines/glk/zcode/zcode.cpp
index 2df3dc3d3ac..f4981267942 100644
--- a/engines/glk/zcode/zcode.cpp
+++ b/engines/glk/zcode/zcode.cpp
@@ -141,7 +141,7 @@ Common::Error ZCode::saveGameState(int slot, const Common::String &desc, bool is
file->close();
if (!success)
- print_string_uni(_("Error writing save file\n").u32_str());
+ print_string_uni(_("Error writing save file\n"));
return Common::kNoError;
Commit: a6b888739cb14130bd3f42c44b96566bda8507c8
https://github.com/scummvm/scummvm/commit/a6b888739cb14130bd3f42c44b96566bda8507c8
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2026-04-06T23:35:47+03:00
Commit Message:
COMMON: Remove deprecated U32String methods
Changed paths:
common/ustr.h
diff --git a/common/ustr.h b/common/ustr.h
index a6a3942c6b5..2a91a3d8f26 100644
--- a/common/ustr.h
+++ b/common/ustr.h
@@ -67,13 +67,6 @@ public:
/** Construct a new string containing exactly @p len characters read from address @p str. */
U32String(const value_type *str, uint32 len) : BaseString<u32char_type_t>(str, len) {}
- WARN_DEPRECATED("Use u32char_type_t instead of uint32")
- explicit U32String(const uint32 *str) : BaseString<u32char_type_t>((const value_type *) str) {}
- WARN_DEPRECATED("Use u32char_type_t instead of uint32")
- U32String(const uint32 *str, uint32 len) : BaseString<u32char_type_t>((const value_type *) str, len) {}
- WARN_DEPRECATED("Use u32char_type_t instead of uint32")
- U32String(const uint32 *beginP, const uint32 *endP) : BaseString<u32char_type_t>((const value_type *) beginP, (const value_type *) endP) {}
-
/** Construct a new string containing the characters between @p beginP (including) and @p endP (excluding). */
U32String(const value_type *beginP, const value_type *endP) : BaseString<u32char_type_t>(beginP, endP) {}
@@ -171,11 +164,6 @@ public:
/** Return a substring of this string */
U32String substr(size_t pos = 0, size_t len = npos) const;
- WARN_DEPRECATED("Use c_str() instead")
- const uint32 *u32_str() const { /*!< Return the string as a UTF-32 pointer. */
- return (const uint32 *) _str;
- }
-
/** Decode a big endian UTF-16 string into a U32String. */
static Common::U32String decodeUTF16BE(const uint16 *start, uint len);
More information about the Scummvm-git-logs
mailing list