[Scummvm-git-logs] scummvm master -> 5953a20a7434f43dcee8d518db8976f508ae17d9
digitall
547637+digitall at users.noreply.github.com
Sun Mar 21 23:01:40 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
5953a20a74 GLK: Fix Memset on Non-Trivial Structure GCC Compiler Warnings
Commit: 5953a20a7434f43dcee8d518db8976f508ae17d9
https://github.com/scummvm/scummvm/commit/5953a20a7434f43dcee8d518db8976f508ae17d9
Author: D G Turner (digitall at scummvm.org)
Date: 2021-03-21T23:01:04Z
Commit Message:
GLK: Fix Memset on Non-Trivial Structure GCC Compiler Warnings
Changed paths:
engines/glk/window_text_buffer.cpp
engines/glk/windows.cpp
engines/glk/windows.h
diff --git a/engines/glk/window_text_buffer.cpp b/engines/glk/window_text_buffer.cpp
index 870ea999b1..9809997a7d 100644
--- a/engines/glk/window_text_buffer.cpp
+++ b/engines/glk/window_text_buffer.cpp
@@ -1606,8 +1606,8 @@ void TextBufferWindow::scrollResize() {
_lines[i]._rHyper = 0;
_lines[i]._len = 0;
_lines[i]._newLine = 0;
- memset(_lines[i]._chars, ' ', sizeof _lines[i]._chars);
- memset(_lines[i]._attrs, 0, sizeof _lines[i]._attrs);
+ *(_lines[i]._chars) = 0;
+ _lines[i]._attrs->clear();
}
_scrollBack += SCROLLBACK;
diff --git a/engines/glk/windows.cpp b/engines/glk/windows.cpp
index 44defed166..6ab72abbdb 100644
--- a/engines/glk/windows.cpp
+++ b/engines/glk/windows.cpp
@@ -773,11 +773,12 @@ WindowStyle::WindowStyle(const WindowStyleStatic &src) : font(src.font), reverse
void Attributes::clear() {
fgset = false;
bgset = false;
+ reverse = false;
+ unused = false;
+ style = 0;
fgcolor = 0;
bgcolor = 0;
- reverse = false;
hyper = 0;
- style = 0;
}
uint Attributes::attrBg(const WindowStyle *styles) {
diff --git a/engines/glk/windows.h b/engines/glk/windows.h
index 0192204075..b2d2cf1795 100644
--- a/engines/glk/windows.h
+++ b/engines/glk/windows.h
@@ -324,7 +324,7 @@ struct Attributes {
bool fgset : 1;
bool bgset : 1;
bool reverse : 1;
- unsigned : 1;
+ unsigned unused : 1; // needed to pad structure
unsigned style : 4;
uint fgcolor;
uint bgcolor;
More information about the Scummvm-git-logs
mailing list