mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 15:17:29 +09:00
Avoid using memset on a not-trivial type like nsTabSizes
nsTabSizes is non-trivial only because of the user-defined constructor. The idea desired here is certainly to zero all the members without listing them -- but the very act of doing so with a user-defined constructor, makes the idea impossible. Arguably this is something that is permissible in the language, and that the warning should be tailored to permit. I don't think this falls afoul of any of the issues flagged in https://gcc.gnu.org/ml/gcc-patches/2017-06/msg01527.html for example. In the meantime, just explicitly zeroing the three member fields is easy and fixes the warnings.
This commit is contained in:
parent
4c5dd3bcf8
commit
eb09900afe
1 changed files with 6 additions and 1 deletions
|
|
@ -18,7 +18,12 @@ public:
|
||||||
Other // Everything else.
|
Other // Everything else.
|
||||||
};
|
};
|
||||||
|
|
||||||
nsTabSizes() { mozilla::PodZero(this); }
|
nsTabSizes()
|
||||||
|
: mDom(0)
|
||||||
|
, mStyle(0)
|
||||||
|
, mOther(0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void add(Kind kind, size_t n)
|
void add(Kind kind, size_t n)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue