diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-12-17 14:01:15 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-12-17 14:01:15 +0200 |
commit | 0bd47c9287e93aeabb02fad82a00712bb2fdd023 (patch) | |
tree | 7f002d435341784cc617fbdb85273a11579ad40c /src/prefs.c | |
parent | 75291b4f8ff38dcc3fb2602783e8b7ef80a04fb0 (diff) |
Prefs: Assert that struct layout is as expected
Diffstat (limited to 'src/prefs.c')
-rw-r--r-- | src/prefs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/prefs.c b/src/prefs.c index 5d85f195..c4f71ed5 100644 --- a/src/prefs.c +++ b/src/prefs.c | |||
@@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |||
24 | 24 | ||
25 | #include <the_Foundation/fileinfo.h> | 25 | #include <the_Foundation/fileinfo.h> |
26 | 26 | ||
27 | static_assert(offsetof(iPrefs, plainTextWrap) == offsetof(iPrefs, bools[plainTextWrap_PrefsBool]), | ||
28 | "memory layout mismatch (needs struct packing?)"); | ||
29 | |||
27 | void init_Prefs(iPrefs *d) { | 30 | void init_Prefs(iPrefs *d) { |
28 | iForIndices(i, d->strings) { | 31 | iForIndices(i, d->strings) { |
29 | init_String(&d->strings[i]); | 32 | init_String(&d->strings[i]); |