summaryrefslogtreecommitdiff
blob: 3ad3c7df3e3c28e5956da878b7ea686e46bcb386 (plain)
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
diff -urbB picptk-0.5a.old/IfParPort.C picptk-0.5a/IfParPort.C
--- picptk-0.5a.old/IfParPort.C	1998-12-30 17:40:31.000000000 -0800
+++ picptk-0.5a/IfParPort.C	2003-10-20 02:42:14.000000000 -0700
@@ -27,6 +27,9 @@
  *    Byte wide transfers GetByte()
  *    Support bidiriectional pins 
  */
+
+using namespace std;
+
 #include <IfParPort.h>
 #include <stdio.h>
 #include <unistd.h>
@@ -72,7 +75,8 @@
     { out, 1, 2, 0x08 },	/* pin 17	(out)	!SI	*/
     {  nc, 0, 1, 0x00 },	/* pin 18	GND		*/
   };
-  cPinInfo = pinfo;
+  //cPinInfo = pinfo;
+  for(uint i = 0; i < kMaxPins; i++) cPinInfo[i] = pinfo[i];
   if(port >= kMaxPorts) 
     throw("Bad printer port number");
   cPort = ports[port];
diff -urbB picptk-0.5a.old/IfParPort.h picptk-0.5a/IfParPort.h
--- picptk-0.5a.old/IfParPort.h	1998-12-30 17:40:31.000000000 -0800
+++ picptk-0.5a/IfParPort.h	2003-10-20 02:42:14.000000000 -0700
@@ -32,6 +32,7 @@
 #ifndef _ParPort_h_
 #define _ParPort_h_
 
+using namespace std;
 #include <stdlib.h>		// for uint
 #include <UtEnvLite.h>
 
@@ -45,12 +46,14 @@
   uint cState[kPortSize];	// in bytes...
 
   typedef enum { nc, in, out, } Dir_t;
-  struct PinInfo_t {
+  typedef struct PinInfo_t {
     Dir_t dir;
     char sense;
     char offset;
     char mask;
-  } cPinInfo[kMaxPins];
+  };
+
+  PinInfo_t cPinInfo[kMaxPins];
 
 
   // Gain access to parallel port, return 0 on success...
diff -urbB picptk-0.5a.old/IoIntel.C picptk-0.5a/IoIntel.C
--- picptk-0.5a.old/IoIntel.C	1998-12-30 17:40:32.000000000 -0800
+++ picptk-0.5a/IoIntel.C	2003-10-20 02:42:14.000000000 -0700
@@ -22,6 +22,7 @@
  * Intel Hex file I/O formatting and such...
  *
  */
+using namespace std;
 #include <IoIntel.h>
 #include <stdio.h>		// for sscanf
 // ParseLine(...) - parse one line of Intel Hex8 format
@@ -65,7 +66,7 @@
 // If length is zero, writes end of file marker...
 // This should be smarter about supressing zeros, maybe?
 bool
-IntelHex::OutputLine(ostream &os, int len, uint addr = 0, char *buffer = 0) {
+IntelHex::OutputLine(ostream &os, int len, uint addr, char *buffer) {
   char line[200];
   int sum = 0;
   int type = (len) ? 0 : 1;
diff -urbB picptk-0.5a.old/IoIntel.h picptk-0.5a/IoIntel.h
--- picptk-0.5a.old/IoIntel.h	1998-12-30 17:40:32.000000000 -0800
+++ picptk-0.5a/IoIntel.h	2003-10-20 02:43:00.000000000 -0700
@@ -24,10 +24,11 @@
 
 #ifndef IntelHex_h
 #define IntelHex_h
+using namespace std;
 
 #include <stdlib.h>		// for uint
-#include <fstream.h>
-#include <iostream.h>
+#include <fstream>
+#include <iostream>
 
 // This probably should be more general and read multiple formats...
 class IntelHex {
diff -urbB picptk-0.5a.old/Makefile.am picptk-0.5a/Makefile.am
--- picptk-0.5a.old/Makefile.am	1998-12-30 18:23:05.000000000 -0800
+++ picptk-0.5a/Makefile.am	2003-10-20 02:42:14.000000000 -0700
@@ -24,7 +24,7 @@
 		.picprc          \
 		picptk.itk
 
-INCLUDES = -I . -I /usr/include/tcl8.0-int/generic/
+INCLUDES = -I. -I/usr/include/tcl8.0-int/generic/ -I/usr/lib/tcl8.3/include/generic -I/usr/lib/tcl8.4/include/generic 
 
 ##dnl info_TEXINFOS = picptk.texi
 
diff -urbB picptk-0.5a.old/PicCore.C picptk-0.5a/PicCore.C
--- picptk-0.5a.old/PicCore.C	1998-12-30 17:40:32.000000000 -0800
+++ picptk-0.5a/PicCore.C	2003-10-20 02:42:14.000000000 -0700
@@ -19,6 +19,7 @@
  *
  * $Id: picptk-0.5a-headerfix.patch,v 1.1 2003/10/20 09:51:31 robbat2 Exp $
  */
+using namespace std;
 #include <PicCore.h>
 #include <IoIntel.h>
 #include <string.h>		// for strcat()
@@ -504,7 +505,7 @@
   SetPin(pin_do, 0);
 }
  // SetPin() - Hook to the driver's set pin...
-void Pic::SetPin(Pin_t pin, int val = 1) {
+void Pic::SetPin(Pin_t pin, int val) {
   if(!cDriver) throw (cDriver);	// Get the hint?
   cDriver->SetPin(pin, val);
 }
diff -urbB picptk-0.5a.old/PicCore.h picptk-0.5a/PicCore.h
--- picptk-0.5a.old/PicCore.h	1998-12-30 17:40:32.000000000 -0800
+++ picptk-0.5a/PicCore.h	2003-10-20 02:43:17.000000000 -0700
@@ -21,8 +21,9 @@
  */
 #ifndef Pic_h
 #define Pic_h
+using namespace std;
 
-#include <fstream.h>
+#include <fstream>
 #include <stdio.h>
 #include <stdlib.h>
 #include <UtEnvLite.h>		// for Environment
@@ -130,7 +131,7 @@
   int VerifySegment(Segment &seg, ProgressCb_t cb=0, void *arg=0);
   int EraseSegment (Segment &seg, ProgressCb_t cb=0, void *arg=0);
   int InitSegment  (Segment &seg, ProgressCb_t cb=0, void *arg=0) { seg.Init(); return(0); }
-  int DumpSegment  (Segment &seg, ProgressCb_t cb=0, void *arg=0) { seg.Dump((ostream &)*arg); return(0); }
+  int DumpSegment  (Segment &seg, ProgressCb_t cb=0, void *arg=0) { seg.Dump((ostream &)arg); return(0); }
   int BlankCheckSegment (Segment &seg, ProgressCb_t cb=0, void *arg=0);
 
   // Set/Get based on Pin name
@@ -149,13 +150,13 @@
   const char *GetPref(const char *attr) { return(cEnv.Get(attr)); }
 
   // Make user functions apply to all segments...
-  int Read  (ProgressCb_t cb = 0, void *obj = 0) { return(EachSegment(&ReadSegment,   cb, obj)); }
-  int Write (ProgressCb_t cb = 0, void *obj = 0) { return(EachSegment(&WriteSegment,  cb, obj)); }
-  int Verify(ProgressCb_t cb = 0, void *obj = 0) { return(EachSegment(&VerifySegment, cb, obj)); }
-  int Erase (ProgressCb_t cb = 0, void *obj = 0) { return(EachSegment(&EraseSegment,  cb, obj)); }
-  int DumpRam (ostream &os)                        { return(EachSegment(&DumpSegment,    0, &os, false)); }
+  int Read  (ProgressCb_t cb = 0, void *obj = 0) { return(EachSegment(&Pic::ReadSegment,   cb, obj)); }
+  int Write (ProgressCb_t cb = 0, void *obj = 0) { return(EachSegment(&Pic::WriteSegment,  cb, obj)); }
+  int Verify(ProgressCb_t cb = 0, void *obj = 0) { return(EachSegment(&Pic::VerifySegment, cb, obj)); }
+  int Erase (ProgressCb_t cb = 0, void *obj = 0) { return(EachSegment(&Pic::EraseSegment,  cb, obj)); }
+  int DumpRam (ostream &os)                        { return(EachSegment(&Pic::DumpSegment,    0, &os, false)); }
   int LoadRam (const char *file);
-  int InitRam ()                                 { return(EachSegment(&InitSegment,    0, 0, false)); }
+  int InitRam ()                                 { return(EachSegment(&Pic::InitSegment,    0, 0, false)); }
 
   // Configuration functions...
   virtual const char **Chips();		// What chip types we support...
diff -urbB picptk-0.5a.old/PicDriver.h picptk-0.5a/PicDriver.h
--- picptk-0.5a.old/PicDriver.h	1998-12-30 17:40:32.000000000 -0800
+++ picptk-0.5a/PicDriver.h	2003-10-20 02:43:19.000000000 -0700
@@ -25,6 +25,7 @@
  */
 #ifndef _PicDriver_h_
 #define _PicDriver_h_
+using namespace std;
 
 #include <stdlib.h>		// for uint
 #include <termios.h>		// for serial port support
diff -urbB picptk-0.5a.old/PicMem.h picptk-0.5a/PicMem.h
--- picptk-0.5a.old/PicMem.h	1998-12-30 17:40:32.000000000 -0800
+++ picptk-0.5a/PicMem.h	2003-10-20 02:43:22.000000000 -0700
@@ -21,9 +21,10 @@
  */
 #ifndef Segment_h
 #define Segment_h
+using namespace std;
 
 #include <stdlib.h>		// for uint
-#include <iostream.h>
+#include <iostream>
 #include <stdio.h>		// for sprintf()
 #include <string.h>		// for strcat()
 
diff -urbB picptk-0.5a.old/PicParallel.C picptk-0.5a/PicParallel.C
--- picptk-0.5a.old/PicParallel.C	1998-12-30 17:40:32.000000000 -0800
+++ picptk-0.5a/PicParallel.C	2003-10-20 02:42:14.000000000 -0700
@@ -27,6 +27,7 @@
  * into actions...  
  */
 
+using namespace std;
 #include <PicParallel.h>
 #include <unistd.h>		// for open(), close(), ...
 
@@ -82,7 +83,7 @@
 }
 
 // Set specified pin...
-void ParallelDriver::SetPin(Pic::Pin_t pin, int val = 1) {
+void ParallelDriver::SetPin(Pic::Pin_t pin, int val) {
   int pinnum = cPinMap[pin];
   if(pinnum < 0) cPort->SetPin(-pinnum, val^1);
   else cPort->SetPin(pinnum, val);
diff -urbB picptk-0.5a.old/PicParallel.h picptk-0.5a/PicParallel.h
--- picptk-0.5a.old/PicParallel.h	1998-12-30 17:40:32.000000000 -0800
+++ picptk-0.5a/PicParallel.h	2003-10-20 02:43:24.000000000 -0700
@@ -26,6 +26,7 @@
  */
 #ifndef _PicParallel_h_
 #define _PicParallel_h_
+using namespace std;
 
 #include <PicDriver.h>
 #include <IfParPort.h>
diff -urbB picptk-0.5a.old/PicPersonality.C picptk-0.5a/PicPersonality.C
--- picptk-0.5a.old/PicPersonality.C	1998-12-30 17:40:33.000000000 -0800
+++ picptk-0.5a/PicPersonality.C	2003-10-20 02:42:14.000000000 -0700
@@ -24,6 +24,7 @@
  * ToDo:
  *    Place this information in a config file rather than in code...
  */
+using namespace std;
 #include <PicCore.h>
 
  // Pic::cAllPics - Description of all supported Pic members
diff -urbB picptk-0.5a.old/PicSerial.C picptk-0.5a/PicSerial.C
--- picptk-0.5a.old/PicSerial.C	1998-12-30 17:40:33.000000000 -0800
+++ picptk-0.5a/PicSerial.C	2003-10-20 02:42:14.000000000 -0700
@@ -34,6 +34,7 @@
  * and they need a non-standard tty driver to hold TX low indefinately.
  * The driver appears to be a seperate kernel patch...
  */
+using namespace std;
 
 #include <PicSerial.h>
 #include <unistd.h>		// for open(), close(), ...
@@ -54,18 +55,18 @@
 SerialDriver::SerialDriver(Environment &env) : Driver(env) {
   
 #ifndef TIOCCBRK
-  throw("No TIOCCBRK ioctl?!
-You probably can't use a serial port
-programmer unless you install a kernel
+  throw("No TIOCCBRK ioctl?!\n\
+You probably can't use a serial port\n\
+programmer unless you install a kernel\n\
 patch.");
 
   // That'll get user's attention, now let compile it anyway...
 #define TIOCCBRK 0
 #endif
 #ifndef TIOSCBRK
-  throw("No TIOCCBRK ioctl?!
-You probably can't use a serial port
-programmer unless you install a kernel
+  throw("No TIOCCBRK ioctl?!\n\
+You probably can't use a serial port\n\
+programmer unless you install a kernel\n\
 patch.");
 #define TIOSCBRK 0
 #endif // TIOSCBRK
@@ -94,7 +95,7 @@
 }
 
 // Set specified pin...
-void SerialDriver::SetPin(Pic::Pin_t pin, int val = 1) {
+void SerialDriver::SetPin(Pic::Pin_t pin, int val) {
   int tmp;
   val &= 1;
   switch(pin) {
diff -urbB picptk-0.5a.old/PicSerial.h picptk-0.5a/PicSerial.h
--- picptk-0.5a.old/PicSerial.h	1998-12-30 17:40:33.000000000 -0800
+++ picptk-0.5a/PicSerial.h	2003-10-20 02:43:25.000000000 -0700
@@ -26,6 +26,7 @@
  */
 #ifndef _PicSerial_h_
 #define _PicSerial_h_
+using namespace std;
 
 #include <PicDriver.h>
 /* Serial port programmer...
diff -urbB picptk-0.5a.old/UiItk.C picptk-0.5a/UiItk.C
--- picptk-0.5a.old/UiItk.C	1998-12-31 08:33:53.000000000 -0800
+++ picptk-0.5a/UiItk.C	2003-10-20 02:42:50.000000000 -0700
@@ -27,6 +27,7 @@
  * a the need...)
  *
  */
+using namespace std;
 
 #include <UiItk.h>
 
@@ -34,7 +35,7 @@
 #include <itk.h>
 #endif
 
-#include <strstream.h>		// for ostrstream
+#include <strstream>		// for ostrstream
 
 
 /* Gui dispatch table for TCL commands...
diff -urbB picptk-0.5a.old/UiItk.h picptk-0.5a/UiItk.h
--- picptk-0.5a.old/UiItk.h	1998-12-30 17:40:33.000000000 -0800
+++ picptk-0.5a/UiItk.h	2003-10-20 02:43:27.000000000 -0700
@@ -30,6 +30,7 @@
 
 // Even though the interface may be incrTk, 
 // <tk.h> contains what we need here...
+using namespace std;
 #include <tk.h>
 #include <PicCore.h>
 
diff -urbB picptk-0.5a.old/UtEnvLite.h picptk-0.5a/UtEnvLite.h
--- picptk-0.5a.old/UtEnvLite.h	1998-12-30 17:40:33.000000000 -0800
+++ picptk-0.5a/UtEnvLite.h	2003-10-20 02:43:31.000000000 -0700
@@ -27,8 +27,9 @@
  */
 #ifndef _Environment_h_
 #define _Environment_h_
+using namespace std;
 
-#include <fstream.h>
+#include <fstream>
 #include <stdio.h>
 #include <stdlib.h>
 
diff -urbB picptk-0.5a.old/UtRealTime.h picptk-0.5a/UtRealTime.h
--- picptk-0.5a.old/UtRealTime.h	1998-12-30 17:40:33.000000000 -0800
+++ picptk-0.5a/UtRealTime.h	2003-10-20 02:43:33.000000000 -0700
@@ -25,6 +25,7 @@
 
 #ifndef RealTime_h
 #define RealTime_h
+using namespace std;
 
 #include <time.h>		// for uint
 #include <sched.h>		// for sched_setscheduler()
diff -urbB picptk-0.5a.old/configure.in picptk-0.5a/configure.in
--- picptk-0.5a.old/configure.in	1998-12-31 08:46:54.000000000 -0800
+++ picptk-0.5a/configure.in	2003-10-20 02:42:14.000000000 -0700
@@ -7,12 +7,12 @@
 AC_PROG_INSTALL
 
 dnl Checks for libraries.
-AC_CHECK_LIB(itk3.0, Itk_Init)
-AC_CHECK_LIB(itk3.0, Itk_Init, cp picptk.itk picptk, cp picptk.tcl picptk)
+AC_CHECK_LIB(itk3.2, Itk_Init)
+AC_CHECK_LIB(itk3.2, Itk_Init, cp picptk.itk picptk, cp picptk.tcl picptk)
 
 dnl The following isn't totally true, but let's force the issue...
-AC_CHECK_LIB(itk3.0, Itk_Init,,AC_MSG_ERROR([
-**** picptk now requires itcl3.0
+AC_CHECK_LIB(itk3.2, Itk_Init,,AC_MSG_ERROR([
+**** picptk now requires itcl3.2
 **** See the README file for more info.
 ]))