Commit 3774ecf8 authored by Johnny Jazeix's avatar Johnny Jazeix

visual c++ compilation ok (include of string and not cstring). Some warnings removed.

parent d098243b
......@@ -94,7 +94,10 @@ double convert_to_double(const string arg){
double clockGet (void)
{
#if (defined X_ARCHalpha_compaq_osf1) || (defined X_ARCHi686_mac)
#ifdef _MSC_VER
// TODO
return 0.;
#elif (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) +
......
......@@ -101,4 +101,8 @@ typedef double Element_col;
*/
typedef double Times;
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#endif /* COMMON_H */
......@@ -41,7 +41,7 @@
**
*/
#include <cstring>
#include <string>
#include <iostream>
#include <fstream>
#include <map>
......@@ -355,11 +355,11 @@ void ParserDefinitionPaje::store_definition(const PajeLine_t *line){
}
// We start a definition
if (token == "EventDef"){
if (token.compare("EventDef") == 0){
enter_definition(line);
}
// We stop a definition
else if (token == "EndEventDef") {
else if (token.compare("EndEventDef") == 0) {
leave_definition(line);
if(line->_nbtks > 2){
Error::set(Error::_EXTRA_TOKEN, line->_id, Error::_WARNING);
......
......@@ -212,7 +212,7 @@ public:
* \brief Closes the container display list.
*/
inline void end_draw_containers(){
float j = 0.6;
float j = 0.6f;
// std::cout << __FILE__ << " ~~ " << __LINE__ << " " << Info::Container::y_max << " " << Info::Container::y_min << std::endl;
/* Before calling start_draw_container(), Info::Container::y_max should have a correct value */
......
......@@ -178,13 +178,13 @@ Element_pos Ruler::get_coeff_for_common_prefix(Element_pos min, Element_pos max)
/* TODO: use cmath::modf() */
float Ruler::get_common_part(const Element_pos n, const Element_pos coeff_for_common_prefix){
int common_part = floor(n*coeff_for_common_prefix);
float common_part = floor(n*coeff_for_common_prefix);
float common_part_without_coeff = common_part/coeff_for_common_prefix;
if ( (floor(common_part_without_coeff) != common_part_without_coeff) )/* there is a comma */
return common_part_without_coeff;
else
return (float)common_part;
return common_part;
}
float Ruler::get_variable_part(const Element_pos n, const Element_pos coeff_for_common_prefix, const int nb_digit_after_comma){
......@@ -199,7 +199,8 @@ float 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, common_part;
int i;
float common_part;
Element_pos buf;
ostringstream buf_txt, result_txt;
......@@ -232,7 +233,7 @@ string Ruler::get_common_part_string(const Element_pos n, Element_pos coeff_for_
}
for (i=0 ; common_part > 0 ; common_part = floor(common_part/10.)){
buf_txt << common_part%10;
buf_txt << ((int)common_part)%10;
if (coeff_for_common_prefix < 1)
coeff_for_common_prefix *= 10.0;
......
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