Use headers defined in the C[++] standards:
[fw/sdcc] / sim / ucsim / gui.src / serio.src / main.cc
index 9589f5d6779d816813c21ea1d9b0d89fe67e0067..32e076f878351d33f4829ceba6bd9a15bcf5870c 100644 (file)
@@ -3,7 +3,7 @@
  * main.cc - the main stuff                                                   *
  ******************************************************************************/
 #include <sys/types.h>
-#include <iostream.h>
+#include <iostream>
 #include <stdlib.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -11,6 +11,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <signal.h>
+#include <getopt.h> // FIXME
 #include "fileio.hh"
 #include "frontend.hh"
 #include "posix_signal.hh"
@@ -29,11 +30,11 @@ void HandleSig(int info)
 // usage
 void PrintUsage(char *progname)
 {
-cout << "Usage: " << progname << " [-i <filename>] [-o <filename>] [-h]\n";
-cout << "-i <filename>\t<filename> is the pipe to the controllers' serial input\n";
-cout << "-o <filename>\t<filename> is the pipe to the controllers' serial output\n";
-cout << "-h\t\tshow the help\n";
-cout << "\nTim Hurman - t.hurman@virgin.net\n";
+std::cout << "Usage: " << progname << " [-i <filename>] [-o <filename>] [-h]\n";
+std::cout << "-i <filename>\t<filename> is the pipe to the controllers' serial input\n";
+std::cout << "-o <filename>\t<filename> is the pipe to the controllers' serial output\n";
+std::cout << "-h\t\tshow the help\n";
+std::cout << "\nTim Hurman - t.hurman@virgin.net\n";
 exit(0);
 }
 
@@ -44,7 +45,7 @@ int main(int argc, char **argv)
        char *string = new char[MAX_SIZ];
        extern char *optarg;
        int errflg=0;
-       char c;
+       int c;
        char *infile = DEF_INFILE;
        char *outfile = DEF_OUTFILE;
 
@@ -61,7 +62,7 @@ int main(int argc, char **argv)
                errflg++;
                break;
        default:
-               cerr << "Invalid or unknown switch\n";
+               std::cerr << "Invalid or unknown switch\n";
                errflg++;
                break;
        }
@@ -87,7 +88,7 @@ int main(int argc, char **argv)
 
                if(string[0] != 0)
                        fobj->SendByte(string[0]);
-               
+
                if(fobj->RecvStr(string) > 0)
                        view->AddStrOutWin(string);