File: scoping.dpatch

package info (click to toggle)
simulpic 19960826-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 256 kB
  • ctags: 374
  • sloc: cpp: 2,493; perl: 1,330; makefile: 22
file content (103 lines) | stat: -rw-r--r-- 2,972 bytes parent folder | download | duplicates (2)
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
#PATCHOPTIONS: -p0
--- tparser.cc.orig	Mon Sep 13 14:31:13 1999
+++ tparser.cc	Mon Sep 13 14:32:54 1999
@@ -59,7 +59,7 @@
 
    for (int i=0; i<=4; i++)
      Inputs.Next_Inputs.RA[i]=OUT;
-   for (i=0; i<=7; i++)
+   for (int i=0; i<=7; i++)
      Inputs.Next_Inputs.RB[i]=OUT;
    Inputs.Next_Inputs.MCLR=IN_1;
 
@@ -111,7 +111,7 @@
             fprintf(Report.File(),(Pic.Regs.PORTA & (1 << i)) ? "1" : "0" );
    }
    fprintf(Report.File()," ");
-   for (i=7; i>=0; i--) {
+   for (int i=7; i>=0; i--) {
          if (Pic.Regs.TRISB & (1 << i))
             fprintf(Report.File(),".");
          else
@@ -124,11 +124,12 @@
 void TParser::Graphic_Out()
 {
    char buf[128];
-   char *s, *p=buf;
+   const char *s;
+   char *p=buf;
    int i;
 
    if (!(Graphic.Opened())) return;
-   for (i=4; i>=0; i--) {
+   for (int i=4; i>=0; i--) {
          if (Pic.Regs.TRISA & (1 << i))
 	    s=" x  ";
          else
@@ -138,7 +139,7 @@
       }
    strcpy(p,"  ");
    p += 2;
-   for (i=7; i>=0; i--) {
+   for (int i=7; i>=0; i--) {
          if (Pic.Regs.TRISB & (1 << i))
             s=" x  ";
          else
@@ -157,10 +158,10 @@
 
    if (!Report.Opened()) return;
    fprintf(Report.File(),"T");
-   for (i=4; i>=0; i--)
+   for (int i=4; i>=0; i--)
       fprintf(Report.File(),(Pic.Regs.TRISA & (1 << i)) ? "i" : "o" );
    fprintf(Report.File()," ");
-   for (i=7; i>=0; i--)
+   for (int i=7; i>=0; i--)
       fprintf(Report.File(),(Pic.Regs.TRISB & (1 << i)) ? "i" : "o" );
    fprintf(Report.File(),"   %6.4lf\n",TIME);
 }
@@ -181,7 +182,7 @@
      }
    }
    printf("   RB:");
-   for (i=7; i>=0; i--)
+   for (int i=7; i>=0; i--)
      switch(Pic.New_Input_State.RB[i])
      {
        case IN_0:putchar('0');
@@ -308,7 +309,7 @@
 	     Pic.Program_Memory.Read(i++));
       }
       i=a;
-      for (eecol=0; eecol<8; eecol++) {
+      for (int eecol=0; eecol<8; eecol++) {
 	 int c=Pic.Program_Memory.Read(i++) & 0xff;
 	 if (c<' ' || c>0x7e ) c='.';
          printf("%s %c",
@@ -378,7 +379,7 @@
          case 4:
             Inputs.Next_Time=New_Time;
             int i;
-            for (i=4; i>=0; i--)
+            for (int i=4; i>=0; i--)
                switch (New_A[4-i]) {
                   case '0': Inputs.Next_Inputs.RA[i]=IN_0;
                             break;
@@ -388,7 +389,7 @@
                             break;
                   case 'u': break;
                }
-            for (i=7; i>=0; i--)
+            for (int i=7; i>=0; i--)
                switch (New_B[7-i]) {
                   case '0': Inputs.Next_Inputs.RB[i]=IN_0;
                             break;
@@ -481,7 +482,7 @@
          printf("\nOk: reading pin state from <%s>\n\n", Inputs.File_Name);
          for (int i=0; i<=4; i++)
             Inputs.Next_Inputs.RA[i]=OUT;
-         for (i=0; i<=7; i++)
+         for (int i=0; i<=7; i++)
             Inputs.Next_Inputs.RB[i]=OUT;
          Inputs.Next_Inputs.MCLR=IN_1;
          Inputs.Next_Time=-1;