Commit 216ae065 authored by Vitaly Lipatov's avatar Vitaly Lipatov

iocalibr: fix compile warnings

parent c67bc691
#include <cstdlib> #include <cstdlib>
#include <string>
#include <cstring> #include <cstring>
#include <comedilib.h>
#include <getopt.h> #include <getopt.h>
#include <time.h> #include <time.h>
#include <string>
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
#include <map> #include <map>
#include <algorithm> #include <algorithm>
#include <list> #include <list>
#include "UniXML.h"
#include <comedilib.h>
#include <UniXML.h>
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
using namespace std; using namespace std;
...@@ -72,7 +74,7 @@ static struct option longopts[] = { ...@@ -72,7 +74,7 @@ static struct option longopts[] = {
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
comedi_t* card; comedi_t* card;
char* dev = "/dev/comedi0"; const char* dev = "/dev/comedi0";
lsampl_t data = 0; lsampl_t data = 0;
int optindex = 0; int optindex = 0;
int opt = 0; int opt = 0;
...@@ -121,11 +123,11 @@ int main(int argc, char* argv[]) ...@@ -121,11 +123,11 @@ int main(int argc, char* argv[])
break; break;
case 'o': case 'o':
openFileXml=optarg; openFileXml=optarg;
break; break;
case 'f': case 'f':
saveFileXml=optarg; saveFileXml=optarg;
break; break;
case 'n': case 'n':
...@@ -133,16 +135,16 @@ int main(int argc, char* argv[]) ...@@ -133,16 +135,16 @@ int main(int argc, char* argv[])
break; break;
case 'i': case 'i':
sort_rise=optarg=="1"?true:false; sort_rise=atoi(optarg);
break; break;
case 'c': case 'c':
sort_cal=optarg=="1"?true:false; sort_cal=atoi(optarg);
break; break;
case '?': case '?':
default: default:
printf("? argumnet\n"); printf("? argument\n");
return 0; return 0;
} }
} }
...@@ -189,7 +191,7 @@ int main(int argc, char* argv[]) ...@@ -189,7 +191,7 @@ int main(int argc, char* argv[])
string str; string str;
str.clear(); str.clear();
cout<<"\nQuiting... Are You shure?(y/n)"<<endl; cout<<"\nQuiting... Are You shure?(y/n)"<<endl;
getline(cin,str); getline(cin, str);
if( str == "y") if( str == "y")
return 0; return 0;
break; break;
...@@ -203,22 +205,22 @@ int main(int argc, char* argv[]) ...@@ -203,22 +205,22 @@ int main(int argc, char* argv[])
<<" (d) on calibrated value decrease"<<endl; <<" (d) on calibrated value decrease"<<endl;
getline(cin,str); getline(cin,str);
cout<<" "<<str<<endl; cout<<" "<<str<<endl;
if(str.c_str()[0]=='a') if(str == "a")
{ {
sort_rise=true; sort_rise=true;
sort_cal=false; sort_cal=false;
} }
else if(str.c_str()[0]=='b') else if(str == "b")
{ {
sort_rise=false; sort_rise=false;
sort_cal=false; sort_cal=false;
} }
else if(str.c_str()[0]=='c') else if(str == "c")
{ {
sort_rise=true; sort_rise=true;
sort_cal=true; sort_cal=true;
} }
else if(str.c_str()[0]=='d') else if(str == "d")
{ {
sort_rise=false; sort_rise=false;
sort_cal=true; sort_cal=true;
...@@ -231,8 +233,8 @@ int main(int argc, char* argv[]) ...@@ -231,8 +233,8 @@ int main(int argc, char* argv[])
{ {
string str; string str;
str.clear(); str.clear();
cout<<"\nClearing... Are You shure?(y/n)"<<endl; cout<<"\nClearing... Are You sure?(y/n)"<<endl;
getline(cin,str); getline(cin,str);
if( str == "y") if( str == "y")
massDat.clear(); massDat.clear();
break; break;
...@@ -335,7 +337,7 @@ void saveXML() ...@@ -335,7 +337,7 @@ void saveXML()
if(nodeXml.length()<1) if(nodeXml.length()<1)
nodeXml="MyCalibration"; nodeXml="MyCalibration";
fprintf(fp,"<Calibration>\n <diagram name=\""); fprintf(fp,"<Calibration>\n <diagram name=\"");
fprintf(fp,nodeXml.c_str()); fprintf(fp,"%s",nodeXml.c_str());
fprintf(fp,"\">\n"); fprintf(fp,"\">\n");
sortData(sort_rise,sort_cal); sortData(sort_rise,sort_cal);
......
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