Commit 6d497cc5 authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Merge branch 'coverity_debug' into 'master'

Fix Coverity issues

See merge request !33
parents c633f491 f220a9f1
......@@ -272,7 +272,7 @@ int Core::get_options(int &argc, char **argv)
/* Ignore any -psn_%d_%d argument, which is Mac OS specific */
largc = 0;
largv = (char**)calloc(argc+1, sizeof(char**));
largv = (char**)calloc(argc+1, sizeof(char*));
for(c = 0; c < argc; c++) {
if( strncmp(argv[c], "-psn", 4) )
largv[largc++] = argv[c];
......
......@@ -191,11 +191,6 @@ protected:
*/
Element_pos _ruler_y;
/*!
* Width of the ruler.
*/
Element_pos _ruler_width;
/*!
* \brief The percentage taken by container display in the render area.
*/
......
......@@ -126,7 +126,7 @@ Render_alternate::Render_alternate(Core* core, QWidget *parent, const QGLFormat&
_r(0.0),
_g(0.0),
_b(0.0),
_modelview(glm::mat4(1.0)),
_modelview(glm::mat4(1.0)),
_projection(glm::mat4(1.0)),
_containers(nullptr),
_arrows3(nullptr),
......@@ -154,11 +154,11 @@ Render_alternate::~Render_alternate(){
}
QWidget* Render_alternate::get_render_widget() {
return this;
return this;
}
QImage Render_alternate::grab_frame_buffer() {
return grabFrameBuffer(true); /* true = with alpha channel */
return grabFrameBuffer(true); /* true = with alpha channel */
}
/***********************************
......@@ -674,7 +674,7 @@ void Render_alternate::paintGL(){
buf_txt.str("");
buf_txt << Ruler::get_common_part_string(Info::Render::_x_min_visible, coeff_prefix) << "-- ";
renderText(render_to_screen_x(trace_to_render_x((Info::Render::_x_min_visible +
Info::Render::_x_max_visible) / 2)),
render_to_screen_y(3),
......@@ -689,7 +689,7 @@ void Render_alternate::paintGL(){
Info::Render::_x_max_visible) / 4)),
render_to_screen_y(3),
buf_txt.str().c_str(),
arial_font);
arial_font);
for (Element_pos i = Info::Render::_x_min_visible ;
i < Info::Render::_x_max_visible ;
......@@ -775,7 +775,7 @@ bool Render_alternate::unbuild(){
* Init render area attributes
*
*****************************/
_state = DRAWING_STATE_WAITING;/* change the drawing state */
......
......@@ -134,7 +134,7 @@ private:
Vbo _selection;
Vbo _time_line;
Vbo *_current;
GLuint _textureID;
GLuint _textureID = 0;
std::map<EntityValue*, Vbo*> _states;
//std::map<EntityValue*, Shader*> _states_shaders;
//first element of the pair contains the points, second contains the lines
......
......@@ -53,7 +53,7 @@ class Container;
*/
struct Entity {
private:
Container *_container;
Container *_container = nullptr;
std::map<std::string, Value *> *_extra_fields {nullptr};
public:
......
......@@ -56,7 +56,8 @@ public:
private:
Date _time;
State *_left, *_right;
State *_left = nullptr;
State *_right = nullptr;
public:
StateChange();
......
......@@ -412,14 +412,16 @@ Trace::start_link(Date &time, LinkType *type,
if(!is_in_loaded_interval(time))
return;
EntityValue *EV = search_entity_value( type->get_alias(), type );
assert(EV);
if (ancestor && type && source)
{
EntityValue *EV = search_entity_value( type->get_alias(), type );
assert(EV);
ancestor->start_link(time, type, source, EV, key, opt);
if (time > _max_date)
_max_date = time;
if (time > _max_date)
_max_date = time;
}
}
void
......
......@@ -72,9 +72,9 @@ Color::check_value( double v, const string &spectrum )
return v;
}
Color::Color() : _r((rand()%256)/255),
_g((rand()%256)/255),
_b((rand()%256)/255) {
Color::Color() : _r((rand()%256)/255.),
_g((rand()%256)/255.),
_b((rand()%256)/255.) {
_is_correct = true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment