summaryrefslogtreecommitdiff
path: root/games/znibbles/files/patch-src::Options.C
blob: 9eee992734707ffaab34ea8998aefebaf70a16f5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
--- src/Options.C	Wed May 12 11:40:13 1999
+++ src/Options.C	Sat Oct 26 00:41:03 2002
@@ -35,7 +35,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <iostream.h>
+#include <iostream>
 
 #include "Options.H"
 
@@ -150,7 +150,7 @@
 	case 'p':
 	  _port = atoi(optarg);
 	  if (_port == 0) { // cannot be 0
-	    cerr << *argv << ": port: invalid argument: " <<  optarg << endl;
+	    std::cerr << *argv << ": port: invalid argument: " <<  optarg << std::endl;
 	    bad_params = true;
 	  }
 	  break;
@@ -160,7 +160,7 @@
 	  if (2 != (ooo = sscanf(optarg, "%dx%d", &_width, &_height)) ||
 	      _height == 0 ||
 	      _width  == 0) {
-	    cerr << *argv << ": size: invalid argument: " <<  optarg << endl;
+	    std::cerr << *argv << ": size: invalid argument: " <<  optarg << std::endl;
 	    bad_params = true;
 	  }
 	  break;
@@ -168,8 +168,8 @@
 	case 'g': // height (server only)
 	  _height = atoi(optarg);
 	  if (_height == 0) { // cannot be 0
-	    cerr << *argv << ": height: invalid argument: " <<  optarg \
-		 << endl;
+	    std::cerr << *argv << ": height: invalid argument: " <<  optarg \
+		 << std::endl;
 	    bad_params = true;
 	  }
 	  break;
@@ -177,8 +177,8 @@
 	case 'w': // width (server only)
 	  _width = atoi(optarg);
 	  if (_width == 0) { // cannot be 0
-	    cerr << *argv << ": width: invalid argument: " <<  optarg \
-		 << endl;
+	    std::cerr << *argv << ": width: invalid argument: " <<  optarg \
+		 << std::endl;
 	    bad_params = true;
 	  }
 	  break;
@@ -194,7 +194,7 @@
 
   if (_set == OPTIONS_CLIENT_SET) {
     if (argv[optind] == NULL) {
-      cerr << *argv << ": missing player name" << endl;
+      std::cerr << *argv << ": missing player name" << std::endl;
       bad_params = true;
     }
     else {
@@ -208,7 +208,7 @@
       if (p != 0)
 	_port = p;
       else {
-	cerr << *argv << ": too many parameters: " << argv[optind] << endl;
+	std::cerr << *argv << ": too many parameters: " << argv[optind] << std::endl;
 	bad_params = true;
       }
     }
@@ -227,34 +227,34 @@
   options.set_option_set(0);
   
   if (!options.parse(argc, argv)) {
-    cout << "usage: .... " << endl;
+    std::cout << "usage: .... " << std::endl;
     delete &options;
     return 1;
   }
 
   if (options.is_help()) {
-    cout << "help: ..." << endl;
+    std::cout << "help: ..." << std::endl;
     delete &options;
     return 0;
   }
 
   if (options.is_version()) {
-    cout << "... version ... " << endl;
+    std::cout << "... version ... " << std::endl;
     delete &options;
     return 0;
   }
     
-  cout << "host:  " << options.get_host_name() << ":" \
-       << options.get_port() << endl;
-  cout << "message_file: " << options.get_message_file() << endl;
-  cout << "twokey(" << options.is_twokey() << ")  debug(" \
-       << options.is_debug() <<")" << endl;
+  std::cout << "host:  " << options.get_host_name() << ":" \
+       << options.get_port() << std::endl;
+  std::cout << "message_file: " << options.get_message_file() << std::endl;
+  std::cout << "twokey(" << options.is_twokey() << ")  debug(" \
+       << options.is_debug() <<")" << std::endl;
   
   int i = options.get_nonoption_index();
-  cout << "argv left = " << endl;
+  std::cout << "argv left = " << std::endl;
   argv += i;
   while (*argv) {
-    cout << "   " << *argv++ << endl;
+    std::cout << "   " << *argv++ << std::endl;
   }
 
   delete &options;