mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-17 07:07:10 +00:00
GLK: TADS: Fix Memset on Non-Trivial Structure GCC Compiler Warnings
This commit is contained in:
parent
9166871942
commit
5814df1022
@ -1541,7 +1541,9 @@ int re_compile_and_search(re_context *ctx,
|
||||
re_save_search_str(ctx, searchstr, searchlen);
|
||||
|
||||
/* clear the group registers */
|
||||
memset(ctx->regs, 0, sizeof(ctx->regs));
|
||||
for (uint i = 0; i < ARRAYSIZE(ctx->regs); i++) {
|
||||
ctx->regs[i].clear();
|
||||
}
|
||||
|
||||
/*
|
||||
* search for the pattern in our copy of the string - use the copy
|
||||
@ -1573,7 +1575,9 @@ int re_compile_and_match(re_context *ctx,
|
||||
re_save_search_str(ctx, searchstr, searchlen);
|
||||
|
||||
/* clear the group registers */
|
||||
memset(ctx->regs, 0, sizeof(ctx->regs));
|
||||
for (uint i = 0; i < ARRAYSIZE(ctx->regs); i++) {
|
||||
ctx->regs[i].clear();
|
||||
}
|
||||
|
||||
/* match the string */
|
||||
return re_match(ctx, ctx->strbuf, ctx->strbuf, ctx->curlen,
|
||||
|
@ -52,6 +52,11 @@ typedef struct _re_group_register
|
||||
const char *end_ofs;
|
||||
|
||||
_re_group_register() : start_ofs(nullptr), end_ofs(nullptr) {}
|
||||
|
||||
void clear() {
|
||||
start_ofs = nullptr;
|
||||
end_ofs = nullptr;
|
||||
}
|
||||
} re_group_register;
|
||||
|
||||
/* number of group registers we keep */
|
||||
|
Loading…
Reference in New Issue
Block a user