Open Bug 1437202 Opened 7 years ago Updated 1 years ago

Replace instances of memset(this, 0 ....) with c++11 or other constructs

Categories

(Core :: General, defect)

58 Branch
defect

Tracking

()

People

(Reporter: jesup, Unassigned)

References

(Blocks 1 open bug)

Details

CC'd people in the areas listed below; you can spin off bugs like bug 1437088. Obviously only applies to our code, not imported code. See: http://en.cppreference.com/w/cpp/language/value_initialization One can use (bar{} and bar() are mostly interchangeable below; elided for compactness) class foo { blah bar{}; // or bar() ... } class foo { foo(): bar(0) {} // classic C++03 initializers ... blah bar; } class foo { foo(): bar{} {} ... blah bar; } class foo : public bar { foo() : bar{} {} } ./mozglue/linker/Zip.h: memset(this, 0, sizeof(z_stream)); ./dom/canvas/WebGLContext.h: memset(this, 0, sizeof(*this)); ./layout/generic/ReflowInput.h: ReflowInputFlags() { memset(this, 0, sizeof(*this)); } ./gfx/thebes/gfxFont.h: memset(this, 0, sizeof(gfxTextPerfMetrics)); ./gfx/gl/GLContextTypes.cpp: std::memset(this, 0, sizeof(GLFormats)); ./gfx/src/X11Util.h: memset(this, 0, sizeof(ErrorEvent)); ./gfx/vr/gfxVR.h: memset(this, 0, sizeof(VRHMDSensorState)); ./memory/replace/dmd/DMD.h: void Clear() { memset(this, 0, sizeof(Sizes)); } ./netwerk/streamconv/converters/ParseFTPList.h: memset(this, 0, sizeof(*this)); Also ./dom/workers/RuntimeService.cpp (patch in bug 1437088)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.