Skip to content

Commit

Permalink
fix -Wmaybe-uninitialized
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Mar 3, 2019
1 parent 34e09b9 commit 519849d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
22 changes: 11 additions & 11 deletions src/Mod/Draft/App/dxf.cpp
Expand Up @@ -164,12 +164,15 @@ void CDxfWrite::WriteEllipse(const double* c, double major_radius, double minor_
CDxfRead::CDxfRead(const char* filepath)
{
// start the file
memset( m_str, '\0', sizeof(m_str) );
memset( m_unused_line, '\0', sizeof(m_unused_line) );
m_fail = false;
m_aci = 0;
m_eUnits = eMillimeters;
m_measurement_inch = false;
strcpy(m_layer_name, "0"); // Default layer name
memset( m_section_name, '\0', sizeof(m_section_name) );
memset( m_block_name, '\0', sizeof(m_block_name) );
m_ignore_errors = true;

m_ifs = new ifstream(filepath);
Expand Down Expand Up @@ -406,7 +409,7 @@ bool CDxfRead::ReadArc()
double start_angle = 0.0;// in degrees
double end_angle = 0.0;
double radius = 0.0;
double c[3]; // centre
double c[3] = {0,0,0}; // centre
double z_extrusion_dir = 1.0;
bool hidden = false;

Expand Down Expand Up @@ -946,7 +949,7 @@ static bool poly_prev_found = false;
static double poly_prev_x;
static double poly_prev_y;
static double poly_prev_z;
static double poly_prev_bulge_found;
static bool poly_prev_bulge_found = false;
static double poly_prev_bulge;
static bool poly_first_found = false;
static double poly_first_x;
Expand Down Expand Up @@ -1318,13 +1321,10 @@ void CDxfRead::OnReadEllipse(const double* c, const double* m, double ratio, dou

bool CDxfRead::ReadInsert()
{
double c[3]; // coordinate
double s[3]; // scale
double c[3] = {0,0,0}; // coordinate
double s[3] = {1,1,1}; // scale
double rot = 0.0; // rotation
char name[1024];
s[0] = 1.0;
s[1] = 1.0;
s[2] = 1.0;
char name[1024] = {0};

while(!((*m_ifs).eof()))
{
Expand Down Expand Up @@ -1413,9 +1413,9 @@ bool CDxfRead::ReadInsert()

bool CDxfRead::ReadDimension()
{
double s[3]; // startpoint
double e[3]; // endpoint
double p[3]; // dimpoint
double s[3] = {0,0,0}; // startpoint
double e[3] = {0,0,0}; // endpoint
double p[3] = {0,0,0}; // dimpoint
double rot = -1.0; // rotation

while(!((*m_ifs).eof()))
Expand Down
12 changes: 6 additions & 6 deletions src/Mod/Import/App/dxf.cpp
Expand Up @@ -1663,12 +1663,15 @@ void CDxfWrite::writeObjectsSection(void)
CDxfRead::CDxfRead(const char* filepath)
{
// start the file
memset( m_str, '\0', sizeof(m_str) );
memset( m_unused_line, '\0', sizeof(m_unused_line) );
m_fail = false;
m_aci = 0;
m_eUnits = eMillimeters;
m_measurement_inch = false;
strcpy(m_layer_name, "0"); // Default layer name
memset( m_section_name, '\0', sizeof(m_section_name) );
memset( m_block_name, '\0', sizeof(m_block_name) );
m_ignore_errors = true;

m_ifs = new ifstream(filepath);
Expand Down Expand Up @@ -2445,7 +2448,7 @@ static bool poly_prev_found = false;
static double poly_prev_x;
static double poly_prev_y;
static double poly_prev_z;
static double poly_prev_bulge_found;
static bool poly_prev_bulge_found = false;
static double poly_prev_bulge;
static bool poly_first_found = false;
static double poly_first_x;
Expand Down Expand Up @@ -2818,12 +2821,9 @@ void CDxfRead::OnReadEllipse(const double* c, const double* m, double ratio, dou
bool CDxfRead::ReadInsert()
{
double c[3] = {0,0,0}; // coordinate
double s[3] = {0,0,0}; // scale
double s[3] = {1,1,1}; // scale
double rot = 0.0; // rotation
char name[1024];
s[0] = 1.0;
s[1] = 1.0;
s[2] = 1.0;
char name[1024] = {0};

while(!((*m_ifs).eof()))
{
Expand Down
16 changes: 8 additions & 8 deletions src/Mod/Path/libarea/dxf.cpp
Expand Up @@ -166,10 +166,13 @@ CDxfRead::CDxfRead(const char* filepath)
{
m_aci = 0;
// start the file
memset( m_str, '\0', sizeof(m_str) );
memset( m_unused_line, '\0', sizeof(m_unused_line) );
m_fail = false;
m_eUnits = eMillimeters;
strcpy(m_layer_name, "0"); // Default layer name
memset( m_section_name, '\0', sizeof(m_section_name) );
memset( m_block_name, '\0', sizeof(m_block_name) );
m_ignore_errors = true;

m_ifs = new ifstream(filepath);
Expand Down Expand Up @@ -908,7 +911,7 @@ static bool poly_prev_found = false;
static double poly_prev_x;
static double poly_prev_y;
static double poly_prev_z;
static double poly_prev_bulge_found;
static bool poly_prev_bulge_found = false;
static double poly_prev_bulge;
static bool poly_first_found = false;
static double poly_first_x;
Expand Down Expand Up @@ -1155,7 +1158,7 @@ bool CDxfRead::ReadPolyLine()
bool closed = false;
int flags;
bool first_vertex_section_found = false;
double first_vertex[3];
double first_vertex[3] = {0};
bool bulge_found;
double bulge;

Expand Down Expand Up @@ -1256,13 +1259,10 @@ void CDxfRead::OnReadEllipse(const double* c, const double* m, double ratio, dou

bool CDxfRead::ReadInsert()
{
double c[3]; // coordinate
double s[3]; // scale
double c[3] = {0,0,0}; // coordinate
double s[3] = {1,1,1}; // scale
double rot = 0.0; // rotation
char name[1024];
s[0] = 1.0;
s[1] = 1.0;
s[2] = 1.0;
char name[1024] = {0};

while(!((*m_ifs).eof()))
{
Expand Down

0 comments on commit 519849d

Please sign in to comment.