Commit 626b8c85 authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Apply patch 7 from issue #13 - gcc wall

parent d7a891c8
......@@ -46,8 +46,8 @@ MatrixGLWidget::MatrixGLWidget(QWidget* parent, symbol_matrix_t* matrix, QLabel*
#else
QGLWidget(parent)
#endif
, m_label(label)
, m_frameCount(0)
, m_label(label)
{
this->setFixedSize(MATRIX_WINDOW_LENGTH, MATRIX_WINDOW_HEIGHT);
......
......@@ -155,7 +155,7 @@ extern "C" {
void - in all cases.
*/
void memAllocTraceReset ();
};
}
/*
Function: operator new
......
......@@ -95,10 +95,7 @@ bool convert_to_double(const std::string &arg, double *val) {
double clockGet (void)
{
#ifdef _MSC_VER
// TODO
return 0.;
#elif (defined X_ARCHalpha_compaq_osf1) || (defined X_ARCHi686_mac)
#if (defined X_ARCHalpha_compaq_osf1) || (defined X_ARCHi686_mac)
struct rusage data;
getrusage (RUSAGE_SELF, &data);
return (((double) data.ru_utime.tv_sec + (double) data.ru_stime.tv_sec) +
......@@ -110,5 +107,7 @@ double clockGet (void)
clock_gettime (CLOCK_REALTIME, &tp); /* Elapsed time */
return ((double) tp.tv_sec + (double) tp.tv_nsec * (double)1.0e-9L);
#else
return 0.;
#endif
}
......@@ -75,7 +75,7 @@
#include <iostream>
#include "interface/Node_select.hpp"
Q_DECLARE_METATYPE( Container * );
Q_DECLARE_METATYPE( Container * )
using namespace std;
......
......@@ -320,7 +320,6 @@ Settings_tab::update_table_from_palette( const string &pname )
Session &S = Session::getSession();
Palette *p = S.get_palette(_ecname, pname);
map<string, EntityValue*> *ev_list;
map<string, EntityValue*>::const_iterator ev;
int rownbr = content->rowCount();
......@@ -459,9 +458,6 @@ void
Settings_tab::on_btn_cancel_clicked()
{
if (_changed) {
Session &S = Session::getSession();
map<string, EntityValue*> *ev_list;
map<string, EntityValue*>::iterator ev;
std::map<std::string, int>::iterator it;
......
......@@ -67,7 +67,7 @@ class EntityValue;
*/
class Settings_tab : public QWidget {
Q_OBJECT;
Q_OBJECT
public:
QVBoxLayout *background;
......
......@@ -153,6 +153,6 @@ namespace PajeDef {
void print (std::vector<PajeFieldName>* fields, PajeDefinition *def);
std::string print_string (std::vector<PajeFieldName>* fields, PajeDefinition *def);
bool check_definition(PajeDefinition *def);
};
}
#endif // DEFINITION_HPP
......@@ -185,7 +185,7 @@ ParserDefinitionPaje::~ParserDefinitionPaje() {
void ParserDefinitionPaje::enter_definition(const PajeLine_t *line){
PajeDefinition def;
int evtdefid, trid;
int trid;
char *defname = line->_tokens[2];
char *tridstr = line->_tokens[3];
......
......@@ -252,7 +252,7 @@ int mt_PajeFileManager::get_line(PajeLine *lineptr) {
return -1;
}
if((i==_filesize)){
if(i==_filesize){
_eof=true;
throw "Overflow";
return -1;
......@@ -287,7 +287,7 @@ int mt_PajeFileManager::get_line(PajeLine *lineptr) {
return -1;
}
if((i==_filesize)){
if(i==_filesize){
_eof=true;
throw "Overflow";
return -1;
......@@ -309,7 +309,7 @@ int mt_PajeFileManager::get_line(PajeLine *lineptr) {
_line[i] = '\0';
i++;
}
if((i==_filesize)){
if(i==_filesize){
_eof=true;
throw "Overflow";
return -1;
......@@ -326,7 +326,6 @@ int mt_PajeFileManager::get_line(PajeLine *lineptr) {
}
}
if(itks==0){
i+=sizeof(char); //we read one char but no token : empty line, advance the offset of one char, in order not to loop
}
......@@ -341,7 +340,6 @@ int mt_PajeFileManager::get_line(PajeLine *lineptr) {
lineptr->_nbtks = _nbtks;
lineptr->_tokens = _tokens;
#ifdef WIN32
if (_filesize>MAX_SIZE_UNCUT){
......
......@@ -459,12 +459,7 @@ public:
inline void end_draw()
{
std::ostringstream buf_txt;
Element_pos graduation_diff;
//Element_pos coeff_prefix;
const Element_pos offset_x = 0;
const Element_pos offset_y = 0;
graduation_diff = Ruler::get_graduation_diff(Info::Render::_x_min_visible, Info::Render::_x_max_visible);
/* Now, draw ruler */
/*Rendering is done in paintGL because we need to recalculate graduations each time paintGL is called, not just when launching the program*/
......
......@@ -90,7 +90,6 @@ using namespace std;
extern "C" {
void checkGlError(){
int rc = glGetError();
assert(rc == GL_NO_ERROR );
}
}
......@@ -119,15 +118,15 @@ static bool _draw_counter;
Render_alternate::Render_alternate(Core* core, QWidget *parent, const QGLFormat& format)
: Hook_event(this, core, parent, format),
_glsl(0),
_container_height(_DRAWING_CONTAINER_HEIGHT_DEFAULT),
_modelview(glm::mat4(1.0)), _projection(glm::mat4(1.0)),
_containers(nullptr),
_counters(nullptr),
_arrows3(nullptr),
_counters(nullptr),
_ruler(nullptr),
_wait(nullptr),
_selection(nullptr),
_time_line(nullptr),
_modelview(glm::mat4(1.0)), _projection(glm::mat4(1.0)),
_container_height(_DRAWING_CONTAINER_HEIGHT_DEFAULT)
_time_line(nullptr)
{
_texts.clear();
_variable_texts.clear();
......@@ -816,7 +815,6 @@ void Render_alternate::call_ruler(){
Element_pos graduation_diff;
//Element_pos coeff_prefix;
const Element_pos offset_x = _default_entity_x_translate;
const Element_pos offset_y = _ruler_y + _ruler_height+3.5;
update_visible_interval_value();
......@@ -1430,7 +1428,7 @@ void Render_alternate::reload_links(){
it->first->reload_file_color();
it->first->set_visible(true);
it->second.first->delete_shader();
Shader* s = s = new Shader(_glsl, it->first->get_used_color()->get_red(),
Shader* s = new Shader(_glsl, it->first->get_used_color()->get_red(),
it->first->get_used_color()->get_green(),
it->first->get_used_color()->get_blue(),
false);
......@@ -1449,7 +1447,7 @@ void Render_alternate::reload_events(){
it->first->reload_file_color();
it->first->set_visible(true);
it->second.first->delete_shader();
Shader* s = s = new Shader(_glsl, it->first->get_used_color()->get_red(),
Shader* s = new Shader(_glsl, it->first->get_used_color()->get_red(),
it->first->get_used_color()->get_green(),
it->first->get_used_color()->get_blue(),
false);
......
......@@ -183,7 +183,6 @@ double Ruler::get_variable_part(const Element_pos n, const Element_pos coeff_for
string Ruler::get_common_part_string(const Element_pos n, Element_pos coeff_for_common_prefix){
int i;
double common_part;
Element_pos buf;
ostringstream buf_txt, result_txt;
......@@ -220,7 +219,7 @@ string Ruler::get_common_part_string(const Element_pos n, Element_pos coeff_for_
buf *= 10;
}
for (i=0 ; common_part > 0 ; common_part = floor(common_part/10.)){
for (; common_part > 0 ; common_part = floor(common_part/10.)){
buf_txt << ((int)common_part)%10;
......
......@@ -105,7 +105,7 @@ Container::Container(Name name,
template <class T>
void MyDelete(T *ptr){
delete ptr;
};
}
Container::~Container()
{
......
......@@ -391,12 +391,9 @@ public:
Variable *var;
const std::list<std::pair<Date, Double> > *variable_values;
Element_pos position;
const Color *color;
std::map<std::string, Value *>::const_iterator field;
Element_pos lvl_zoom;
color = nullptr;
if(zoom>=0)
lvl_zoom = zoom;
else
......
......@@ -60,7 +60,6 @@ EntityValue::EntityValue(const Name &name, EntityType *type, map<std::string, Va
{
Palette *sp = nullptr;
Color *color = nullptr;
Color *new_color;
std::string palette_name = "default";
// Search opt field for color to set the default (random if not provided within the trace file)
......
......@@ -342,10 +342,10 @@ bool IntervalOfContainer::add_link(Date start, Date end, LinkType *type, Contain
QT_TRY {
oa << *this;
}
QT_CATCH(eos::portable_archive_exception e) {
QT_CATCH(const eos::portable_archive_exception &e) {
printf("fail while dumping serialized file ! %s %s\n", e.what(), filename);
return false;
}QT_CATCH(exception e) {
}QT_CATCH(const exception &e) {
printf("fail while dumping serialized file ! %s %s\n", e.what(), filename);
return false;
......
......@@ -45,7 +45,7 @@ using namespace boost::serialization;
l.set_correct(t);
}
BOOST_SERIALIZATION_ASSUME_ABSTRACT(Value);//this type can be inherited by other serialized classes*/
BOOST_SERIALIZATION_ASSUME_ABSTRACT(Value) //this type can be inherited by other serialized classes*/
//telle the compiler not to be stupid when serializing these objects
......
......@@ -114,7 +114,7 @@ Trace::Trace(): _max_date(0.0) {
template <class T>
void MyDelete(T *ptr){
delete ptr;
};
}
Trace::~Trace()
......@@ -982,6 +982,9 @@ Trace::get_all_entityvalues(const string &type)
else if (type == "link_types") {
return get_all_entityvalues( _EntityClass_Link );
}
assert( 0 );
return nullptr;
}
bool Trace::load_config_from_xml(const QString &filename){
......
......@@ -87,12 +87,10 @@ const double Variable::get_value_at(double d) const {
list<pair<Date, Double> >::const_iterator it= _values.begin();
const list<pair<Date, Double> >::const_iterator it_end= _values.end();
if(it==it_end)return 0.0;
const Date* previous=&((*it).first);
const Double * val = &((*it).second);
it++;
while ((it!=it_end)){
if(((*it).first.get_value())>d)break;
previous=&((*it).first);
val = &((*it).second);
it++;
}
......
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