Skip to content

Commit c578c3e

Browse files
author
twouters
committed
Mass ANSIfication.
Work around intrcheck.c's desire to pass 'PyErr_CheckSignals' to 'Py_AddPendingCall' by providing a (static) wrapper function that has the right number of arguments. git-svn-id: http://svn.python.org/projects/python/trunk@16422 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 04dcb07 commit c578c3e

16 files changed

Lines changed: 123 additions & 330 deletions

Parser/acceler.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ static void fixdfa(grammar *, dfa *);
3030
static void fixstate(grammar *, state *);
3131

3232
void
33-
PyGrammar_AddAccelerators(g)
34-
grammar *g;
33+
PyGrammar_AddAccelerators(grammar *g)
3534
{
3635
dfa *d;
3736
int i;
@@ -48,8 +47,7 @@ PyGrammar_AddAccelerators(g)
4847
}
4948

5049
void
51-
PyGrammar_RemoveAccelerators(g)
52-
grammar *g;
50+
PyGrammar_RemoveAccelerators(grammar *g)
5351
{
5452
dfa *d;
5553
int i;
@@ -68,9 +66,7 @@ PyGrammar_RemoveAccelerators(g)
6866
}
6967

7068
static void
71-
fixdfa(g, d)
72-
grammar *g;
73-
dfa *d;
69+
fixdfa(grammar *g, dfa *d)
7470
{
7571
state *s;
7672
int j;
@@ -80,9 +76,7 @@ fixdfa(g, d)
8076
}
8177

8278
static void
83-
fixstate(g, s)
84-
grammar *g;
85-
state *s;
79+
fixstate(grammar *g, state *s)
8680
{
8781
arc *a;
8882
int k;

Parser/bitset.c

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
1414
#include "bitset.h"
1515

1616
bitset
17-
newbitset(nbits)
18-
int nbits;
17+
newbitset(int nbits)
1918
{
2019
int nbytes = NBYTES(nbits);
2120
bitset ss = PyMem_NEW(BYTE, nbytes);
@@ -30,16 +29,13 @@ newbitset(nbits)
3029
}
3130

3231
void
33-
delbitset(ss)
34-
bitset ss;
32+
delbitset(bitset ss)
3533
{
3634
PyMem_DEL(ss);
3735
}
3836

3937
int
40-
addbit(ss, ibit)
41-
bitset ss;
42-
int ibit;
38+
addbit(bitset ss, int ibit)
4339
{
4440
int ibyte = BIT2BYTE(ibit);
4541
BYTE mask = BIT2MASK(ibit);
@@ -52,18 +48,14 @@ addbit(ss, ibit)
5248

5349
#if 0 /* Now a macro */
5450
int
55-
testbit(ss, ibit)
56-
bitset ss;
57-
int ibit;
51+
testbit(bitset ss, int ibit)
5852
{
5953
return (ss[BIT2BYTE(ibit)] & BIT2MASK(ibit)) != 0;
6054
}
6155
#endif
6256

6357
int
64-
samebitset(ss1, ss2, nbits)
65-
bitset ss1, ss2;
66-
int nbits;
58+
samebitset(bitset ss1, bitset ss2, int nbits)
6759
{
6860
int i;
6961

@@ -74,9 +66,7 @@ samebitset(ss1, ss2, nbits)
7466
}
7567

7668
void
77-
mergebitset(ss1, ss2, nbits)
78-
bitset ss1, ss2;
79-
int nbits;
69+
mergebitset(bitset ss1, bitset ss2, int nbits)
8070
{
8171
int i;
8272

Parser/firstsets.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ extern int Py_DebugFlag;
2020
static void calcfirstset(grammar *, dfa *);
2121

2222
void
23-
addfirstsets(g)
24-
grammar *g;
23+
addfirstsets(grammar *g)
2524
{
2625
int i;
2726
dfa *d;
@@ -35,9 +34,7 @@ addfirstsets(g)
3534
}
3635

3736
static void
38-
calcfirstset(g, d)
39-
grammar *g;
40-
dfa *d;
37+
calcfirstset(grammar *g, dfa *d)
4138
{
4239
int i, j;
4340
state *s;

Parser/grammar.c

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
2121
extern int Py_DebugFlag;
2222

2323
grammar *
24-
newgrammar(start)
25-
int start;
24+
newgrammar(int start)
2625
{
2726
grammar *g;
2827

@@ -39,10 +38,7 @@ newgrammar(start)
3938
}
4039

4140
dfa *
42-
adddfa(g, type, name)
43-
grammar *g;
44-
int type;
45-
char *name;
41+
adddfa(grammar *g, int type, char *name)
4642
{
4743
dfa *d;
4844

@@ -60,8 +56,7 @@ adddfa(g, type, name)
6056
}
6157

6258
int
63-
addstate(d)
64-
dfa *d;
59+
addstate(dfa *d)
6560
{
6661
state *s;
6762

@@ -79,9 +74,7 @@ addstate(d)
7974
}
8075

8176
void
82-
addarc(d, from, to, lbl)
83-
dfa *d;
84-
int lbl;
77+
addarc(dfa *d, int from, int to, int lbl)
8578
{
8679
state *s;
8780
arc *a;
@@ -99,10 +92,7 @@ addarc(d, from, to, lbl)
9992
}
10093

10194
int
102-
addlabel(ll, type, str)
103-
labellist *ll;
104-
int type;
105-
char *str;
95+
addlabel(labellist *ll, int type, char *str)
10696
{
10797
int i;
10898
label *lb;
@@ -124,10 +114,7 @@ addlabel(ll, type, str)
124114
/* Same, but rather dies than adds */
125115

126116
int
127-
findlabel(ll, type, str)
128-
labellist *ll;
129-
int type;
130-
char *str;
117+
findlabel(labellist *ll, int type, char *str)
131118
{
132119
int i;
133120

@@ -145,8 +132,7 @@ findlabel(ll, type, str)
145132
static void translabel(grammar *, label *);
146133

147134
void
148-
translatelabels(g)
149-
grammar *g;
135+
translatelabels(grammar *g)
150136
{
151137
int i;
152138

@@ -159,9 +145,7 @@ translatelabels(g)
159145
}
160146

161147
static void
162-
translabel(g, lb)
163-
grammar *g;
164-
label *lb;
148+
translabel(grammar *g, label *lb)
165149
{
166150
int i;
167151

Parser/grammar1.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
1818
/* Return the DFA for the given type */
1919

2020
dfa *
21-
PyGrammar_FindDFA(g, type)
22-
grammar *g;
23-
register int type;
21+
PyGrammar_FindDFA(grammar *g, register int type)
2422
{
2523
register dfa *d;
2624
#if 1
@@ -42,8 +40,7 @@ PyGrammar_FindDFA(g, type)
4240
}
4341

4442
char *
45-
PyGrammar_LabelRepr(lb)
46-
label *lb;
43+
PyGrammar_LabelRepr(label *lb)
4744
{
4845
static char buf[100];
4946

Parser/intrcheck.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ int Py_AddPendingCall(int (*func)(ANY *), ANY *arg);
3030
#include <io.h>
3131

3232
void
33-
PyOS_InitInterrupts()
33+
PyOS_InitInterrupts(void)
3434
{
3535
}
3636

3737
void
38-
PyOS_FiniInterrupts()
38+
PyOS_FiniInterrupts(void)
3939
{
4040
}
4141

4242
int
43-
PyOS_InterruptOccurred()
43+
PyOS_InterruptOccurred(void)
4444
{
4545
_wyield();
4646
}
@@ -66,18 +66,18 @@ PyOS_InterruptOccurred()
6666
#include <go32.h>
6767

6868
void
69-
PyOS_InitInterrupts()
69+
PyOS_InitInterrupts(void)
7070
{
7171
_go32_want_ctrl_break(1 /* TRUE */);
7272
}
7373

7474
void
75-
PyOS_FiniInterrupts()
75+
PyOS_FiniInterrupts(void)
7676
{
7777
}
7878

7979
int
80-
PyOS_InterruptOccurred()
80+
PyOS_InterruptOccurred(void)
8181
{
8282
return _go32_was_ctrl_break_hit();
8383
}
@@ -87,17 +87,17 @@ PyOS_InterruptOccurred()
8787
/* This might work for MS-DOS (untested though): */
8888

8989
void
90-
PyOS_InitInterrupts()
90+
PyOS_InitInterrupts(void)
9191
{
9292
}
9393

9494
void
95-
PyOS_FiniInterrupts()
95+
PyOS_FiniInterrupts(void)
9696
{
9797
}
9898

9999
int
100-
PyOS_InterruptOccurred()
100+
PyOS_InterruptOccurred(void)
101101
{
102102
int interrupted = 0;
103103
while (kbhit()) {
@@ -136,21 +136,21 @@ PyOS_InterruptOccurred()
136136
static int interrupted;
137137

138138
void
139-
PyErr_SetInterrupt()
139+
PyErr_SetInterrupt(void)
140140
{
141141
interrupted = 1;
142142
}
143143

144-
extern int PyErr_CheckSignals();
144+
extern int PyErr_CheckSignals(void);
145+
146+
static int
147+
checksignals_witharg(void * arg)
148+
{
149+
return PyErr_CheckSignals();
150+
}
145151

146-
/* ARGSUSED */
147152
static RETSIGTYPE
148-
#if defined(_M_IX86) && !defined(__QNX__)
149-
intcatcher(int sig) /* So the C compiler shuts up */
150-
#else /* _M_IX86 */
151-
intcatcher(sig)
152-
int sig; /* Not used by required by interface */
153-
#endif /* _M_IX86 */
153+
intcatcher(int sig)
154154
{
155155
extern void Py_Exit(int);
156156
static char message[] =
@@ -167,13 +167,13 @@ intcatcher(sig)
167167
break;
168168
}
169169
signal(SIGINT, intcatcher);
170-
Py_AddPendingCall(PyErr_CheckSignals, NULL);
170+
Py_AddPendingCall(checksignals_witharg, NULL);
171171
}
172172

173-
static RETSIGTYPE (*old_siginthandler)() = SIG_DFL;
173+
static RETSIGTYPE (*old_siginthandler)(int) = SIG_DFL;
174174

175175
void
176-
PyOS_InitInterrupts()
176+
PyOS_InitInterrupts(void)
177177
{
178178
if ((old_siginthandler = signal(SIGINT, SIG_IGN)) != SIG_IGN)
179179
signal(SIGINT, intcatcher);
@@ -189,13 +189,13 @@ PyOS_InitInterrupts()
189189
}
190190

191191
void
192-
PyOS_FiniInterrupts()
192+
PyOS_FiniInterrupts(void)
193193
{
194194
signal(SIGINT, old_siginthandler);
195195
}
196196

197197
int
198-
PyOS_InterruptOccurred()
198+
PyOS_InterruptOccurred(void)
199199
{
200200
if (!interrupted)
201201
return 0;
@@ -206,6 +206,6 @@ PyOS_InterruptOccurred()
206206
#endif /* !OK */
207207

208208
void
209-
PyOS_AfterFork()
209+
PyOS_AfterFork(void)
210210
{
211211
}

0 commit comments

Comments
 (0)