Hi, I attched a patch.
Cheers, Gonéri Le Bouder
diff -ru ltp-full-20060918.orig/testcases/ballista/ballista/ballista.cpp ltp-full-20060918/testcases/ballista/ballista/ballista.cpp --- ltp-full-20060918.orig/testcases/ballista/ballista/ballista.cpp 2008-04-09 17:57:10.000000000 +0200 +++ ltp-full-20060918/testcases/ballista/ballista/ballista.cpp 2008-04-09 19:09:38.000000000 +0200 @@ -17,10 +17,10 @@ #include <errno.h> -#include <iostream.h> +#include <iostream> #include <stdio.h> #include <stdlib.h> -#include <fstream.h> +#include <fstream> #include <signal.h> #include <string.h> #include <sys/stat.h> @@ -87,7 +87,7 @@ Server_communication *server = NULL; Test_case_iterator *biterator = NULL; -vector<line> vec[MAXP]; //contains array of all setting for each arg +std::vector<line> vec[MAXP]; //contains array of all setting for each arg int parameterize(b_param param[],line l); @@ -106,7 +106,7 @@ } // for (int ii=0;ii<numParam;ii++) // cout<<LCVs[ii]<<" - "; -// cout<<endl; +// cout<<std::endl; return max_found; } @@ -221,7 +221,7 @@ int timeout, double sample_size, int number_arguments, - vector<line> myvec[MAXP]) + std::vector<line> myvec[MAXP]) { two_dim *parameter_list = NULL; MARSHAL_DATA_TYPE marshalled_data; @@ -293,10 +293,10 @@ for (i=0;i<number_arguments;i++) { j=parameterize(marshalled_data[i],vec[i][LCVs[i]]); - cout <<"#param:"; + std::cout <<"#param:"; for (int jj=0;jj<j;jj++) - cout<<marshalled_data[i][jj]<<"\t"; - cout<<endl; + std::cout<<marshalled_data[i][jj]<<"\t"; + std::cout<<std::endl; } // remove template Log File FILE* filePtr = NULL; @@ -317,9 +317,9 @@ sizeof(mut_return)); if (!test_results) { - cout<<"rval:" << mut_return << endl; - cout<<pass_status; - cout<<"\t"<<call_ret<<endl; + std::cout<<"rval:" << mut_return << std::endl; + std::cout<<pass_status; + std::cout<<"\t"<<call_ret<<std::endl; if((call_ret!=-1) && (call_ret!=0)) { if (call_ret == 99) //problem in setup @@ -331,7 +331,7 @@ { if (fgets(str,254,filePtr)) { - cout << str << endl; + std::cout << str << std::endl; } } fclose (filePtr); @@ -339,32 +339,32 @@ } else { - cout <<sys_err<<endl; + std::cout <<sys_err<<std::endl; } } else { //intentionally changed for ostest - push button - //cerr <<sys_err<<endl; - cout <<sys_err<<endl; + //cerr <<sys_err<<std::endl; + std::cout <<sys_err<<std::endl; } } } // if test succeeded else { - cerr <<"Error in the test manager" << endl << sys_err << endl; + std::cerr <<"Error in the test manager" << std::endl << sys_err << std::endl; return -1; } if (MAXIMUM_TEST_CASES < (test_total*sample_size/100.0)) { - cout<<"------- "<<test_count<<" of ~"<<MAXIMUM_TEST_CASES<<" Combination #"<<comb_number - <<" of "<<test_total<<"----"<<endl; + std::cout<<"------- "<<test_count<<" of ~"<<MAXIMUM_TEST_CASES<<" Combination #"<<comb_number + <<" of "<<test_total<<"----"<<std::endl; } else { - cout<<"------- "<<test_count<<" of ~"<< test_total * sample_size/100.0 <<" Combination #"<<comb_number - <<" of "<<test_total<<"----"<<endl; + std::cout<<"------- "<<test_count<<" of ~"<< test_total * sample_size/100.0 <<" Combination #"<<comb_number + <<" of "<<test_total<<"----"<<std::endl; } } @@ -374,7 +374,7 @@ } // try catch (Ballistic_error be) { - cerr << be.get_error_message(); + std::cerr << be.get_error_message(); return -1; } #else //running with server @@ -384,14 +384,14 @@ server = new Server_communication(server_name); if(!server) { - cerr << "Error: Out of memory while allocating server "; - cerr << "communication objects." << endl; + std::cerr << "Error: Out of memory while allocating server "; + std::cerr << "communication objects." << std::endl; return -1; } } catch (Ballistic_error be) { - cerr << be.get_error_message() << endl; + std::cerr << be.get_error_message() << std::endl; return -1; } @@ -401,7 +401,7 @@ number_arguments,myvec); if(!biterator) { - cerr << "Error: Out of memory while allocating iterator." << endl; + std::cerr << "Error: Out of memory while allocating iterator." <<std::endl; return -1; } test_count = 0; @@ -419,7 +419,7 @@ { cout<<marshalled_data[i][j]<<"\t"; } - cout<<endl; + cout<<std::endl; } // remove template Log File FILE* filePtr = NULL; @@ -439,9 +439,9 @@ if(!test_results) { - cout<<"rval:" << mut_return << endl; + cout<<"rval:" << mut_return <<std::endl; cout<<pass_status; - cout<<"\t"<<call_ret<<endl; + cout<<"\t"<<call_ret<<std::endl; if((call_ret!=-1) && (call_ret!=0)) { if (call_ret == 99) //problem in setup @@ -453,7 +453,7 @@ { if (fgets(str,254,filePtr)) { - cout << str << endl; + cout << str <<std::endl; } } fclose (filePtr); @@ -461,14 +461,14 @@ } else { - cout <<sys_err<<endl; + cout <<sys_err<<std::endl; } } else { //intentionally changed for ostest - push button - //cerr <<sys_err<<endl; - cout <<sys_err<<endl; + //cerr <<sys_err<<std::endl; + cout <<sys_err<<std::endl; } } @@ -507,11 +507,11 @@ } // if test succeeded else { - cerr <<"Error in the test manager" << endl << sys_err << endl; + cerr <<"Error in the test manager" <<std::endl << sys_err <<std::endl; return -1; } - cout<<"----"<<endl; + cout<<"----"<<std::endl; /* char dummy; printf("Press return to continue..."); @@ -532,16 +532,16 @@ void lineVecTest() //test the line vector template { - vector <line> lineVec; + std::vector <line> lineVec; - vector<line>::iterator i; + std::vector<line>::iterator i; lineVec.push_back( line("This is")); lineVec.push_back( line(" a")); lineVec.push_back( line(" test.\n")); for (i=lineVec.begin();i!=lineVec.end();i++) - cout<<*i; + std::cout<<*i; } @@ -568,7 +568,7 @@ creating .param files by hand for testing Ballistic * ************************/ -int lineIn(istream& ins,vector<line> &v) +int lineIn(std::istream& ins,std::vector<line> &v) //this function reads in a string and stores it in the linevector //read in from ins, store in v @@ -601,7 +601,7 @@ return (ins.gcount()); } -void getVec(istream& ins,vector<line> &v) +void getVec(std::istream& ins,std::vector<line> &v) // This function reads an entire file (ins) and stores it // line by line in vector v { @@ -615,22 +615,22 @@ { //just run a few short tests - vector<line> v; + std::vector<line> v; int i; line l; char *t=NULL; lineVecTest(); - getVec(cin,v); + getVec(std::cin,v); for (i=0;i<v.size();i++) - cout<<v[i].p<<endl; + std::cout<<v[i].p<<std::endl; - cout<<"\n\nTokenization of:\n"<<v[1]<<"\n\n"; + std::cout<<"\n\nTokenization of:\n"<<v[1]<<"\n\n"; t=strtok(v[1].p,"\t"); while (t!=NULL) { - cout<<t<<endl; + std::cout<<t<<std::endl; t=strtok(NULL,"\t"); } @@ -655,8 +655,8 @@ if (i==MAXP) { - cerr<<"Error, attempted to parameterize string with more than <<"<<MAXD - <<" dial components\n"<<l<<endl; + std::cerr<<"Error, attempted to parameterize string with more than <<"<<MAXD + <<" dial components\n"<<l<<std::endl; exit(1); } t=strtok(NULL,"\t"); @@ -689,46 +689,46 @@ assert(executable_name != NULL); #ifdef B_VXWORKS - cerr<<"Usage: "<<executable_name; - cerr<<" server function_name [-r percent][-t timeout] "; - cerr<<"-i target_address -n target_name [-m number | -c {yes,no}] "; - cerr<<"<param file>..." << endl; - cerr<<"Where" << endl; + std::cerr<<"Usage: "<<executable_name; + std::cerr<<" server function_name [-r percent][-t timeout] "; + std::cerr<<"-i target_address -n target_name [-m number | -c {yes,no}] "; + std::cerr<<"<param file>..." <<std::endl; + std::cerr<<"Where" <<std::endl; - cerr<<" server is the ballista server" << endl; - cerr<<" function_name is the function to be tested" << endl; - cerr<<" -r percent is the percent of tests to be run." << endl; - cerr<<" valid range -- 1 to 100 (default 100)" << endl; + std::cerr<<" server is the ballista server" <<std::endl; + std::cerr<<" function_name is the function to be tested" <<std::endl; + std::cerr<<" -r percent is the percent of tests to be run." <<std::endl; + std::cerr<<" valid range -- 1 to 100 (default 100)" <<std::endl; - cerr<<" -t timeout is maximum time in microseconds for restarts " << endl; - cerr<<" and catastrophics failures" << endl; - cerr<<" valid range -- 100000 to 100000000 (default 10,000,000)" << endl; + std::cerr<<" -t timeout is maximum time in microseconds for restarts " <<std::endl; + std::cerr<<" and catastrophics failures" <<std::endl; + std::cerr<<" valid range -- 100000 to 100000000 (default 10,000,000)" <<std::endl; - cerr<<" -i target_address is the IP address of the target machine" << endl; - cerr<<" * This is required. *" << endl; + std::cerr<<" -i target_address is the IP address of the target machine" <<std::endl; + std::cerr<<" * This is required. *" <<std::endl; - cerr<<" -n target_name is the target's name that is registered "; - cerr<<"with Tornado." << endl; - cerr<<" * This is required. *"<<endl; + std::cerr<<" -n target_name is the target's name that is registered "; + std::cerr<<"with Tornado." <<std::endl; + std::cerr<<" * This is required. *"<<std::endl; - cerr<<" -m number is the maximum number of reboots. " << endl; - cerr<<" Use -1 (default) for unlimited rebooting."<<endl; + std::cerr<<" -m number is the maximum number of reboots. " <<std::endl; + std::cerr<<" Use -1 (default) for unlimited rebooting."<<std::endl; - cerr<<" -c {yes,no} - Specify a clean test each time or not. " << endl; - cerr<<" yes will reboot the target after each test."<<endl; + std::cerr<<" -c {yes,no} - Specify a clean test each time or not. " <<std::endl; + std::cerr<<" yes will reboot the target after each test."<<std::endl; - cerr<<" param file is the data type defined by file."<<endl; + std::cerr<<" param file is the data type defined by file."<<std::endl; #else - cerr<<"Usage: "<<executable_name<<" server function_name "; - cerr<<"[-r percent] [-t timeout] "; - cerr<<"<type file>..."<<endl; - cerr<<"Where"<<endl; - cerr<<" server is the ballista server"<<endl; - cerr<<" function_name is the function to be tested" << endl; - cerr<<" percent is between 1 and 100 (default 100)"<<endl; - cerr<<" timeout is maximum time in microseconds for restarts "; - cerr<<"(default 10,000,000)"<<endl; - cerr<<" type is the data type defined by file."<<endl; + std::cerr<<"Usage: "<<executable_name<<" server function_name "; + std::cerr<<"[-r percent] [-t timeout] "; + std::cerr<<"<type file>..."<<std::endl; + std::cerr<<"Where"<<std::endl; + std::cerr<<" server is the ballista server"<<std::endl; + std::cerr<<" function_name is the function to be tested" <<std::endl; + std::cerr<<" percent is between 1 and 100 (default 100)"<<std::endl; + std::cerr<<" timeout is maximum time in microseconds for restarts "; + std::cerr<<"(default 10,000,000)"<<std::endl; + std::cerr<<" type is the data type defined by file."<<std::endl; #endif } @@ -778,7 +778,7 @@ void catch_signal (int signal_number) { - cerr << "Caught signal "<< signal_number<< ", cleaning up..." << endl; + std::cerr << "Caught signal "<< signal_number<< ", cleaning up..." <<std::endl; clean_up(2); } @@ -849,7 +849,7 @@ if(arguments->get_and_validate_float(&sample,"r",100.0,0.0,100.0)) { - cout<<"Start random sample - ~ "<<sample<<"% of space." << endl; + std::cout<<"Start random sample - ~ "<<sample<<"% of space." << std::endl; } if(arguments->get_and_validate_integer(&timeout, @@ -858,14 +858,14 @@ 100000, 100000000)) { - cout <<"Timeout set to " << timeout << endl; + std::cout <<"Timeout set to " << timeout <<std::endl; } - cout.flush(); + std::cout.flush(); if (stat(MUT_OUT, &tmp_stat_struct)) { - cerr << "Could not find test execution file " << MUT_OUT << endl; + std::cerr << "Could not find test execution file " << MUT_OUT <<std::endl; clean_up(1); } @@ -878,21 +878,21 @@ if(arguments->get_argument("i",ip_address,sizeof(ip_address))) { - cout << "Target IP address is " << ip_address << endl; + cout << "Target IP address is " << ip_address <<std::endl; } else { - cerr << "Target IP address was not specified. Use -i option." << endl; + cerr << "Target IP address was not specified. Use -i option." <<std::endl; clean_up(1); } if(arguments->get_argument("n",target_name,sizeof(target_name))) { - cout << "Target name is " << target_name << endl; + cout << "Target name is " << target_name <<std::endl; } else { - cerr << "Target name was not specified. Use -n option." << endl; + cerr << "Target name was not specified. Use -n option." <<std::endl; clean_up(1); } @@ -903,11 +903,11 @@ if(!strcasecmp(clean_temp,"yes")) { // if case insensitive equal reboot_after_each_test = BOOL_TRUE; - cout << "Rebooting after each test" << endl; + cout << "Rebooting after each test" <<std::endl; } else { - cout << "Not rebooting after each test" << endl; + cout << "Not rebooting after each test" <<std::endl; } } @@ -919,12 +919,12 @@ { if(maximum_number_of_reboots == -1) { - cout << "Unlimited number of reboots allowed." << endl; + cout << "Unlimited number of reboots allowed." <<std::endl; } else { cout << "Maximum number of reboots is " << - maximum_number_of_reboots << endl; + maximum_number_of_reboots <<std::endl; } } @@ -933,7 +933,7 @@ if((reboot_after_each_test) && (maximum_number_of_reboots != -1)) { cerr << "Error: cannot specify maximum number of reboots and "; - cerr << "reboot after each test options together" << endl; + cerr << "reboot after each test options together" <<std::endl; clean_up(1); } @@ -953,7 +953,7 @@ reboot_after_each_test); if(!test_manager_obj) { - cerr << "Error: could not create test manager."<<endl; + cerr << "Error: could not create test manager."<<std::endl; clean_up(1); } #else @@ -972,14 +972,14 @@ } catch (Ballistic_error be) { - cerr << "Error in creating the test manager:" << endl; - cerr << be.get_error_message() << endl; - cerr << "Exiting" << endl; + std::cerr << "Error in creating the test manager:" <<std::endl; + std::cerr << be.get_error_message() <<std::endl; + std::cerr << "Exiting" <<std::endl; clean_up(1); } if(!test_manager_obj) { - cerr<< "Error: could not create test manager. Exiting..."<<endl; + std::cerr<< "Error: could not create test manager. Exiting..."<<std::endl; clean_up(1); } @@ -988,11 +988,11 @@ numArg = argc-startArg; for (int i=startArg;i<argc;i++) { - ifstream is; + std::ifstream is; is.open(argv[i]); if(is.bad()) { - cerr<<"Could not open the file "<<argv[i]<<".\n"; + std::cerr<<"Could not open the file "<<argv[i]<<".\n"; clean_up(1); } getVec(is,vec [i-startArg]); @@ -1000,14 +1000,14 @@ numParam++; if (numParam==MAXP) { - cerr<<"Error, only "<<MAXP<<" parameters supported.\n"; + std::cerr<<"Error, only "<<MAXP<<" parameters supported.\n"; clean_up(1); } } //numP=parameterize(b,vec[0][2]); - vector<line>::iterator iter[MAXP]; + std::vector<line>::iterator iter[MAXP]; for (int ji=0;ji<numArg;ji++) iter[ji]= vec[ji].begin(); diff -ru ltp-full-20060918.orig/testcases/ballista/ballista/ballistaUtil.cpp ltp-full-20060918/testcases/ballista/ballista/ballistaUtil.cpp --- ltp-full-20060918.orig/testcases/ballista/ballista/ballistaUtil.cpp 2008-04-09 17:57:10.000000000 +0200 +++ ltp-full-20060918/testcases/ballista/ballista/ballistaUtil.cpp 2008-04-09 18:56:54.000000000 +0200 @@ -19,7 +19,7 @@ #include <assert.h> #include <string.h> #include <sys/time.h> //for get_time_in_microseconds -#include <iostream.h> +#include <iostream> #include <stdlib.h> #include "ballistaUtil.h" @@ -82,7 +82,7 @@ long long time; if(gettimeofday(&timeofday,&tz) != 0) { - cerr << "Error getting time." << endl; + std::cerr << "Error getting time." << std::endl; exit(-100); } time = timeofday.tv_sec; diff -ru ltp-full-20060918.orig/testcases/ballista/ballista/callGen.cpp ltp-full-20060918/testcases/ballista/ballista/callGen.cpp --- ltp-full-20060918.orig/testcases/ballista/ballista/callGen.cpp 2008-04-09 17:57:10.000000000 +0200 +++ ltp-full-20060918/testcases/ballista/ballista/callGen.cpp 2008-04-09 18:38:06.000000000 +0200 @@ -17,8 +17,8 @@ #include <stdio.h> #include <stdlib.h> -#include <iostream.h> -#include <fstream.h> +#include <iostream> +#include <fstream> #include <string.h> #define qt (char)34 @@ -32,28 +32,28 @@ char rt[1024]; char ft[64]; //function type - function or constructor char fname[255]; - ofstream os("callInclude.cpp",ios::out); - ofstream def("vardefs.cpp",ios::out); + std::ofstream os("callInclude.cpp",std::ios::out); + std::ofstream def("vardefs.cpp",std::ios::out); int rval=0; int argnum=0; int extras=0; if (argc==1) { - cout<<"Usage: "<<argv[0]<<" <callName>"<<endl; - cout<<"Where callname is the name fo the function to test.\n"; + std::cout<<"Usage: "<<argv[0]<<" <callName>"<<std::endl; + std::cout<<"Where callname is the name fo the function to test.\n"; exit(1); } sprintf(s,"grep -w %s callTable > %s",argv[1],temp); if (system(s)) { - cout<<"Error - could not locate"<<argv[1]<<" in the calltable.\n"; + std::cout<<"Error - could not locate"<<argv[1]<<" in the calltable.\n"; exit(1); } - cout<<s<<endl; + std::cout<<s<<std::endl; - ifstream is(temp,ios::in); + std::ifstream is(temp,std::ios::in); is>>s; //get the include file @@ -97,7 +97,7 @@ os<<"ref["<<argnum<<"] = (void **)"<<" param"<<argnum<<".access(params["<<argnum-1<<"]);\n"; //find the real type of the parameter - ifstream ins("dataTypes"); + std::ifstream ins("dataTypes"); char z[255]; int flag=0; while (!ins.eof()&&!flag) @@ -112,7 +112,7 @@ if (!flag) //didn't find it { - cerr<<"Error, could not find type associated with "<<s<<" in dataType file\n"; + std::cerr<<"Error, could not find type associated with "<<s<<" in dataType file\n"; exit(1); } @@ -173,7 +173,7 @@ } //finish try-catch framework - os<<"\n//replacetoken\n#include "<<qt<<"userCatches.cpp"<<qt<<endl<<endl; + os<<"\n//replacetoken\n#include "<<qt<<"userCatches.cpp"<<qt<<std::endl<<std::endl; is.close(); os.close(); diff -ru ltp-full-20060918.orig/testcases/ballista/ballista/callGen_standAlone.cpp ltp-full-20060918/testcases/ballista/ballista/callGen_standAlone.cpp --- ltp-full-20060918.orig/testcases/ballista/ballista/callGen_standAlone.cpp 2008-04-09 17:57:10.000000000 +0200 +++ ltp-full-20060918/testcases/ballista/ballista/callGen_standAlone.cpp 2008-04-09 18:42:16.000000000 +0200 @@ -17,8 +17,8 @@ #include <stdio.h> #include <stdlib.h> -#include <iostream.h> -#include <fstream.h> +#include <iostream> +#include <fstream> #include <string.h> #define qt (char)34 @@ -32,28 +32,28 @@ char rt[1024]; char ft[64]; //function type - function or constructor char fname[255]; - ofstream os("callInclude.cpp",ios::out); - ofstream def("vardefs.cpp",ios::out); + std::ofstream os("callInclude.cpp",std::ios::out); + std::ofstream def("vardefs.cpp",std::ios::out); int rval=0; int argnum=0; int extras=0; if (argc==1) { - cout<<"Usage: "<<argv[0]<<" <callName>"<<endl; - cout<<"Where callname is the name fo the function to test.\n"; + std::cout<<"Usage: "<<argv[0]<<" <callName>"<<std::endl; + std::cout<<"Where callname is the name fo the function to test.\n"; exit(1); } sprintf(s,"grep -w %s callTable > %s",argv[1],temp); if (system(s)) { - cout<<"Error - could not locate"<<argv[1]<<" in the calltable.\n"; + std::cout<<"Error - could not locate"<<argv[1]<<" in the calltable.\n"; exit(1); } - cout<<s<<endl; + std::cout<<s<<std::endl; - ifstream is(temp,ios::in); + std::ifstream is(temp,std::ios::in); is>>s; //get the include file @@ -109,7 +109,7 @@ os<<"ref["<<argnum<<"] = (void **)"<<" param"<<argnum<<".access(params["<<argnum-1<<"]);\n"; //find the real type of the parameter - ifstream ins("dataTypes"); + std::ifstream ins("dataTypes"); char z[255]; int flag=0; while (!ins.eof()&&!flag) @@ -118,14 +118,14 @@ if (strcmp(s,z)==0) //found it? { ins>>z; - cout<<"found it: "<<s<<" = "<<z<<endl; + std::cout<<"found it: "<<s<<" = "<<z<<std::endl; flag=1; } } if (!flag) //didn't find it { - cerr<<"Error, could not find type associated with "<<s<<" in dataType file\n"; + std::cerr<<"Error, could not find type associated with "<<s<<" in dataType file\n"; exit(1); } @@ -178,7 +178,7 @@ os<<"cout<<"<<qt<<"rval:"<<qt<<"<<rval<<endl;\n"; //finish try-catch framework - os<<"\n//replacetoken\n#include "<<qt<<"userCatches.cpp"<<qt<<endl<<endl; + os<<"\n//replacetoken\n#include "<<qt<<"userCatches.cpp"<<qt<<std::endl<<std::endl; is.close(); os.close(); diff -ru ltp-full-20060918.orig/testcases/ballista/ballista/genCodeCreator.cpp ltp-full-20060918/testcases/ballista/ballista/genCodeCreator.cpp --- ltp-full-20060918.orig/testcases/ballista/ballista/genCodeCreator.cpp 2008-04-09 17:57:10.000000000 +0200 +++ ltp-full-20060918/testcases/ballista/ballista/genCodeCreator.cpp 2008-04-09 18:44:45.000000000 +0200 @@ -23,8 +23,8 @@ // is useful for bug reports. //------------------------------------------------------------------------------------------- -#include <iostream.h> -#include <fstream.h> +#include <iostream> +#include <fstream> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -34,21 +34,21 @@ { if (argc < 5) { - cout <<"Usage for genCodeCreator is: genCodeCreator <function Name> <input File Name>" - <<" <number of parameters> <output File Name>" << endl; - cout <<" where <input File Name> is the results file created by running ballista " - <<"or ostest" << endl; - cout <<" <output File Name> is the file containing the .createCode commands" - << endl; + std::cout <<"Usage for genCodeCreator is: genCodeCreator <function Name> <input File Name>" + <<" <number of parameters> <output File Name>" << std::endl; + std::cout <<" where <input File Name> is the results file created by running ballista " + <<"or ostest" << std::endl; + std::cout <<" <output File Name> is the file containing the .createCode commands" + << std::endl; return 1; } char buf[1024]; int fileExists = 0; - ifstream os; - ifstream instr(argv[2],ios::in); - ifstream tempStr(argv[4],ios::in|ios::in); + std::ifstream os; + std::ifstream instr(argv[2],std::ios::in); + std::ifstream tempStr(argv[4],std::ios::in|std::ios::in); if (tempStr) { @@ -56,7 +56,7 @@ tempStr.close(); } - ofstream outstr(argv[4],ios::out|ios::app); + std::ofstream outstr(argv[4],std::ios::out|std::ios::app); char* paramType[MAXP]; char* paramValue[MAXP]; @@ -65,8 +65,8 @@ if (!fileExists) { - outstr << "#!/bin/csh" << endl; - outstr << "cd .." << endl; + outstr << "#!/bin/csh" << std::endl; + outstr << "cd .." << std::endl; } while (!instr.eof()) @@ -90,8 +90,8 @@ if ((paramType[count] == NULL) || (paramValue[count] == NULL)) { - outstr <<"# OUT OF MEMORY - INCOMPLETE" <<endl; - cout <<" ERROR: Ran out of memory running genCodeCreate" << endl; + outstr <<"# OUT OF MEMORY - INCOMPLETE" <<std::endl; + std::cout <<" ERROR: Ran out of memory running genCodeCreate" << std::endl; return 1; } strcpy(paramType[count], &(buf[6])); @@ -142,7 +142,7 @@ instr.getline(buf,1024,'\n'); //ignore fail bit being set when 1023+ chars read - if (instr.rdstate() == ios::failbit) + if (instr.rdstate() == std::ios::failbit) { instr.clear(); } @@ -181,7 +181,7 @@ { outstr<<"_"<<paramType[i] <<paramValue[i]; } - outstr << ".cpp" << endl; + outstr << ".cpp" << std::endl; } } } diff -ru ltp-full-20060918.orig/testcases/ballista/ballista/line.cpp ltp-full-20060918/testcases/ballista/ballista/line.cpp --- ltp-full-20060918.orig/testcases/ballista/ballista/line.cpp 2008-04-09 17:57:10.000000000 +0200 +++ ltp-full-20060918/testcases/ballista/ballista/line.cpp 2008-04-09 18:55:39.000000000 +0200 @@ -15,9 +15,9 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -#include <iostream.h> +#include <iostream> #include <stdlib.h> -#include <stream.h> +#include <fstream> #include <string.h> #include "line.h" @@ -62,10 +62,10 @@ line l2="a test"; line l3(l2); l2 = " is "; - cout<<l1<<l2<<l3<<endl; + std::cout<<l1<<l2<<l3<<std::endl; } -ostream& operator<< (ostream& os,line l) +std::ostream& operator<< (std::ostream& os,line l) { os<<l.p; return os; diff -ru ltp-full-20060918.orig/testcases/ballista/ballista/line.h ltp-full-20060918/testcases/ballista/ballista/line.h --- ltp-full-20060918.orig/testcases/ballista/ballista/line.h 2008-04-09 17:57:10.000000000 +0200 +++ ltp-full-20060918/testcases/ballista/ballista/line.h 2008-04-09 18:55:25.000000000 +0200 @@ -18,8 +18,8 @@ #ifndef _LINE_H_ #define _LINE_H_ -#include <iostream.h> -#include <stream.h> +#include <iostream> +#include <fstream> class line { @@ -34,6 +34,6 @@ void test(); }; -ostream& operator<< (ostream& os,line l); +std::ostream& operator<< (std::ostream& os,line l); #endif // _LINE_H_ diff -ru ltp-full-20060918.orig/testcases/ballista/ballista/match.cpp ltp-full-20060918/testcases/ballista/ballista/match.cpp --- ltp-full-20060918.orig/testcases/ballista/ballista/match.cpp 2008-04-09 17:57:10.000000000 +0200 +++ ltp-full-20060918/testcases/ballista/ballista/match.cpp 2008-04-09 18:48:09.000000000 +0200 @@ -21,7 +21,8 @@ #include <regex.h> #include <sys/types.h> #include <sys/stat.h> -#include <fstream.h> +#include <fstream> +#include <iostream> #include "match.h" @@ -47,7 +48,7 @@ { struct stat file_info; char *file_buffer = NULL; - ifstream is; + std::ifstream is; // first get the size of the file if(stat(file_name,&file_info) != 0) { diff -ru ltp-full-20060918.orig/testcases/ballista/ballista/parseArguments.cpp ltp-full-20060918/testcases/ballista/ballista/parseArguments.cpp --- ltp-full-20060918.orig/testcases/ballista/ballista/parseArguments.cpp 2008-04-09 17:57:10.000000000 +0200 +++ ltp-full-20060918/testcases/ballista/ballista/parseArguments.cpp 2008-04-09 19:02:13.000000000 +0200 @@ -17,7 +17,7 @@ */ #include <stdlib.h> -#include <iostream.h> +#include <iostream> #include <ctype.h> #include <assert.h> #include "parseArguments.h" @@ -83,13 +83,13 @@ while(i < argc && argv[i][0] == '-') { if(number_of_arguments == MAXIMUM_NUMBER_OF_ARGUMENTS) { - cerr << "Error: Too many command line options." << endl; + std::cerr << "Error: Too many command line options." << std::endl; exit(1); } if(i + 1 == argc) { - cerr << "Error: " << argv[i]; - cerr << " flag was used with invalid argument." << endl; + std::cerr << "Error: " << argv[i]; + std::cerr << " flag was used with invalid argument." << std::endl; exit(1); } @@ -97,8 +97,8 @@ j = 0; while(j < number_of_arguments) { if(!strcasecmp(argv[i]+1,data[j].name)) { - cerr << "Error: " << argv[i]; - cerr << " flag is repeated." << endl; + std::cerr << "Error: " << argv[i]; + std::cerr << " flag is repeated." << std::endl; exit(1); } j++; @@ -200,18 +200,18 @@ j = 0; // check to insure numbers for argument while (j < strlen(arg_buf)) { if (!(isdigit(arg_buf[j]) || (arg_buf[j] == '-' && j == 0))) { - cerr << "Error: -" << argument_name; - cerr << " flag used with invalid nondigit value: " << arg_buf << endl; - cerr << "Valid range is " << min_range << " to " << max_range << endl; + std::cerr << "Error: -" << argument_name; + std::cerr << " flag used with invalid nondigit value: " << arg_buf << std::endl; + std::cerr << "Valid range is " << min_range << " to " << max_range << std::endl; exit(1); } j++; } value = atoi(arg_buf); // check for proper range if (value < min_range || value > max_range){ - cerr << "Error: -" << argument_name; - cerr << " flag used with invalid value: " << arg_buf << endl; - cerr << "Valid range is " << min_range << " to " << max_range << endl; + std::cerr << "Error: -" << argument_name; + std::cerr << " flag used with invalid value: " << arg_buf << std::endl; + std::cerr << "Valid range is " << min_range << " to " << max_range << std::endl; exit(1); } *return_value = value; @@ -307,18 +307,18 @@ j = 0; // check to insure numbers for argument while (j < strlen(arg_buf)) { if (!(isdigit(arg_buf[j]) || (arg_buf[j] == '-' && j == 0)||arg_buf[j]=='.')) { - cerr << "Error: -" << argument_name; - cerr << " flag used with invalid nondigit value: " << arg_buf << endl; - cerr << "Valid range is " << min_range << " to " << max_range << endl; + std::cerr << "Error: -" << argument_name; + std::cerr << " flag used with invalid nondigit value: " << arg_buf << std::endl; + std::cerr << "Valid range is " << min_range << " to " << max_range << std::endl; exit(1); } j++; } value = atof(arg_buf); // check for proper range if (value <= min_range || value > max_range){ - cerr << "Error: -" << argument_name; - cerr << " flag used with invalid value: " << arg_buf << endl; - cerr << "Valid range is " << min_range << " to " << max_range << endl; + std::cerr << "Error: -" << argument_name; + std::cerr << " flag used with invalid value: " << arg_buf << std::endl; + std::cerr << "Valid range is " << min_range << " to " << max_range << std::endl; exit(1); } *return_value = value; diff -ru ltp-full-20060918.orig/testcases/ballista/ballista/replacer.cpp ltp-full-20060918/testcases/ballista/ballista/replacer.cpp --- ltp-full-20060918.orig/testcases/ballista/ballista/replacer.cpp 2008-04-09 17:57:10.000000000 +0200 +++ ltp-full-20060918/testcases/ballista/ballista/replacer.cpp 2008-04-09 18:46:42.000000000 +0200 @@ -15,8 +15,8 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -#include <iostream.h> -#include <fstream.h> +#include <iostream> +#include <fstream> #include <stdio.h> #include <string.h> #include <stdlib.h> @@ -35,73 +35,73 @@ int main() { char buf[1024]; - ifstream os; + std::ifstream os; - while (!cin.eof()) + while (!std::cin.eof()) { - cin.getline(buf,1024,'\n'); + std::cin.getline(buf,1024,'\n'); if (strcmp(buf,"//replacekey")==0) { - cout<<"//inlining userSetup, callInclude, and userShutdown\n"; + std::cout<<"//inlining userSetup, callInclude, and userShutdown\n"; - os.open("userSetup.cpp",ios::in); + os.open("userSetup.cpp",std::ios::in); while (!os.eof()) { os.getline(buf,1024,'\n'); - cout<<buf<<endl; + std::cout<<buf<<std::endl; } os.close(); - os.open("callInclude.cpp",ios::in); + os.open("callInclude.cpp",std::ios::in); while (!os.eof()) { os.getline(buf,1024,'\n'); - cout<<buf<<endl; + std::cout<<buf<<std::endl; } os.close(); - os.open("userShutdown.cpp",ios::in); + os.open("userShutdown.cpp",std::ios::in); while (!os.eof()) { os.getline(buf,1024,'\n'); - cout<<buf<<endl; + std::cout<<buf<<std::endl; } os.close(); - cin.getline(buf,1024,'\n'); - cin.getline(buf,1024,'\n'); - cin.getline(buf,1024,'\n'); + std::cin.getline(buf,1024,'\n'); + std::cin.getline(buf,1024,'\n'); + std::cin.getline(buf,1024,'\n'); } else if (strcmp(buf,"//replacetoken")==0) { - cout<<"//inlining userCatches\n"; + std::cout<<"//inlining userCatches\n"; - os.open("userCatches.cpp",ios::in); + os.open("userCatches.cpp",std::ios::in); while (!os.eof()) { os.getline(buf,1024,'\n'); - cout<<buf<<endl; + std::cout<<buf<<std::endl; } os.close(); - cin.getline(buf,1024,'\n'); + std::cin.getline(buf,1024,'\n'); } else if (strcmp(buf,"//placeVariables")==0) { - cout<<"//inlining variable instantiations\n"; + std::cout<<"//inlining variable instantiations\n"; - os.open("vardefs.cpp",ios::in); + os.open("vardefs.cpp",std::ios::in); while (!os.eof()) { os.getline(buf,1024,'\n'); - cout<<buf<<endl; + std::cout<<buf<<std::endl; } os.close(); - cin.getline(buf,1024,'\n'); + std::cin.getline(buf,1024,'\n'); } else - cout<<buf<<endl; + std::cout<<buf<<std::endl; } diff -ru ltp-full-20060918.orig/testcases/ballista/ballista/selfHost.cpp ltp-full-20060918/testcases/ballista/ballista/selfHost.cpp --- ltp-full-20060918.orig/testcases/ballista/ballista/selfHost.cpp 2008-04-09 17:57:10.000000000 +0200 +++ ltp-full-20060918/testcases/ballista/ballista/selfHost.cpp 2008-04-09 18:56:32.000000000 +0200 @@ -18,7 +18,7 @@ #include <assert.h> //for asserts in manage_test #include <dlfcn.h> //for dynamic loading in constructor -#include <iostream.h> //for cout and cerr +#include <iostream> //for std::cout and std::cerr #include <signal.h> //for SIGKILL #include <stdio.h> //generally needed #include <stdlib.h> //generally needed @@ -103,7 +103,7 @@ * ************************/ Selfhost_test_manager::~Selfhost_test_manager() { - cout << "Cleaning up test manager." << endl; + std::cout << "Cleaning up test manager." << std::endl; if (pid != 0) { // clean up child process @@ -186,13 +186,13 @@ //set up pipe for communication between parent and child processes if (pipe (pipe_file_desc) < 0) { - cerr << "Pipe Failed" << endl; + std::cerr << "Pipe Failed" << std::endl; return PIPE_FAILED; } // Fork off a process and check for errors if ((pid = fork()) < 0) { - cerr << "Fork Failed." << endl; + std::cerr << "Fork Failed." << std::endl; return FORK_FAILED; } @@ -223,9 +223,9 @@ //check if waitpid error if (wait_pid_return < 0) { - cerr << "Error waiting for child process. Child %d " << pid; - cerr << "does not exist, its group does not exist," << endl; - cerr << "or the process is not a child of the Test Manager." << endl; + std::cerr << "Error waiting for child process. Child %d " << pid; + std::cerr << "does not exist, its group does not exist," << std::endl; + std::cerr << "or the process is not a child of the Test Manager." << std::endl; return WAITPID_FAILED; } // check if process terminated @@ -264,7 +264,7 @@ mut_output); if((bytes_read < 0) || (bytes_read > max_mut_return-1)) { - cerr << "Error reading from pipe." << endl; + std::cerr << "Error reading from pipe." << std::endl; return READING_PIPE_FAILED; } mut_return[bytes_read] = '\0'; // null terminate @@ -311,7 +311,7 @@ safe_strncpy(pass_status, "Done - Stopped", max_pass_status); } else { //something has gone wrong, we should never fall through here - cerr << "Test is not an Abort, Restart, or Pass" << endl; + std::cerr << "Test is not an Abort, Restart, or Pass" << std::endl; return UNDEFINED_RESULT; } } //end if process termination ended loop diff -ru ltp-full-20060918.orig/testcases/ballista/ballista/serverCommunication.cpp ltp-full-20060918/testcases/ballista/ballista/serverCommunication.cpp --- ltp-full-20060918.orig/testcases/ballista/ballista/serverCommunication.cpp 2008-04-09 17:57:10.000000000 +0200 +++ ltp-full-20060918/testcases/ballista/ballista/serverCommunication.cpp 2008-04-09 19:01:31.000000000 +0200 @@ -58,9 +58,9 @@ * Notes: * ************************/ -#include <iostream.h> +#include <iostream> #include <netdb.h> -#include <fstream.h> +#include <fstream> #include <signal.h> #include <string.h> @@ -112,7 +112,7 @@ hp = gethostbyname(name); if (hp==NULL) { - cerr<<"Error: could not locate host "<<server_name<<".\n"; + std::cerr<<"Error: could not locate host "<<server_name<<".\n"; assert(0); } diff -ru ltp-full-20060918.orig/testcases/ballista/ballista/testCaseIterator.cpp ltp-full-20060918/testcases/ballista/ballista/testCaseIterator.cpp --- ltp-full-20060918.orig/testcases/ballista/ballista/testCaseIterator.cpp 2008-04-09 17:57:10.000000000 +0200 +++ ltp-full-20060918/testcases/ballista/ballista/testCaseIterator.cpp 2008-04-09 19:01:01.000000000 +0200 @@ -43,7 +43,7 @@ Test_case_iterator::Test_case_iterator(Server_communication *server_comm, double sample_size_val, int number_arguments, - vector<line> vec[MAXP]) + std::vector<line> vec[MAXP]) { char server_name[255]; int i; @@ -54,7 +54,7 @@ // here we print out the server name. This is only done to keep the output // of BallistIC the same as Ballista server->get_name(server_name,sizeof(server_name)); - cout<<server_name<<endl; + std::cout<<server_name<<std::endl; //even though RPC is supposed to be beautiful.... its not so @@ -116,11 +116,11 @@ { return_info *result_temp; - cout<<"Fetching tests to do from server...."<<endl; + std::cout<<"Fetching tests to do from server...."<<std::endl; result_temp = server->get_test_set(data); - cout<<"Got the data"<<endl; - cout.flush(); + std::cout<<"Got the data"<<std::endl; + std::cout.flush(); result_1=&(result_temp->my_three_dim); total=result_temp->total; diff -ru ltp-full-20060918.orig/testcases/ballista/ballista/testCaseIterator.h ltp-full-20060918/testcases/ballista/ballista/testCaseIterator.h --- ltp-full-20060918.orig/testcases/ballista/ballista/testCaseIterator.h 2008-04-09 17:57:10.000000000 +0200 +++ ltp-full-20060918/testcases/ballista/ballista/testCaseIterator.h 2008-04-09 19:00:18.000000000 +0200 @@ -22,7 +22,7 @@ #include "ballistaRPC.h" -#include <vector.h> +#include <vector> #include "line.h" #include "serverCommunication.h" @@ -35,7 +35,7 @@ Server_communication *server; public: Test_case_iterator(Server_communication *server_com, double sample_size_val, - int NumArg, vector<line> vec[MAXP]); + int NumArg, std::vector<line> vec[MAXP]); two_dim *next(); virtual ~Test_case_iterator(); private:
signature.asc
Description: Digital signature