Skip to content

Commit e43df4c

Browse files
author
nowonder
committed
ANSI-fication git-svn-id: http://svn.python.org/projects/python/trunk@16258 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent c4e3875 commit e43df4c

File tree

4 files changed

+43
-124
lines changed

4 files changed

+43
-124
lines changed

Modules/binascii.c

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,7 @@ static unsigned short crctab_hqx[256] = {
187187
static char doc_a2b_uu[] = "(ascii) -> bin. Decode a line of uuencoded data";
188188

189189
static PyObject *
190-
binascii_a2b_uu(self, args)
191-
PyObject *self;
192-
PyObject *args;
190+
binascii_a2b_uu(PyObject *self, PyObject *args)
193191
{
194192
unsigned char *ascii_data, *bin_data;
195193
int leftbits = 0;
@@ -264,9 +262,7 @@ binascii_a2b_uu(self, args)
264262
static char doc_b2a_uu[] = "(bin) -> ascii. Uuencode line of data";
265263

266264
static PyObject *
267-
binascii_b2a_uu(self, args)
268-
PyObject *self;
269-
PyObject *args;
265+
binascii_b2a_uu(PyObject *self, PyObject *args)
270266
{
271267
unsigned char *ascii_data, *bin_data;
272268
int leftbits = 0;
@@ -315,10 +311,7 @@ binascii_b2a_uu(self, args)
315311

316312

317313
static int
318-
binascii_find_valid(s, slen, num)
319-
char *s;
320-
int slen;
321-
int num;
314+
binascii_find_valid(unsigned char *s, int slen, int num)
322315
{
323316
/* Finds & returns the (num+1)th
324317
** valid character for base64, or -1 if none.
@@ -345,9 +338,7 @@ binascii_find_valid(s, slen, num)
345338
static char doc_a2b_base64[] = "(ascii) -> bin. Decode a line of base64 data";
346339

347340
static PyObject *
348-
binascii_a2b_base64(self, args)
349-
PyObject *self;
350-
PyObject *args;
341+
binascii_a2b_base64(PyObject *self, PyObject *args)
351342
{
352343
unsigned char *ascii_data, *bin_data;
353344
int leftbits = 0;
@@ -430,9 +421,7 @@ binascii_a2b_base64(self, args)
430421
static char doc_b2a_base64[] = "(bin) -> ascii. Base64-code line of data";
431422

432423
static PyObject *
433-
binascii_b2a_base64(self, args)
434-
PyObject *self;
435-
PyObject *args;
424+
binascii_b2a_base64(PyObject *self, PyObject *args)
436425
{
437426
unsigned char *ascii_data, *bin_data;
438427
int leftbits = 0;
@@ -483,9 +472,7 @@ binascii_b2a_base64(self, args)
483472
static char doc_a2b_hqx[] = "ascii -> bin, done. Decode .hqx coding";
484473

485474
static PyObject *
486-
binascii_a2b_hqx(self, args)
487-
PyObject *self;
488-
PyObject *args;
475+
binascii_a2b_hqx(PyObject *self, PyObject *args)
489476
{
490477
unsigned char *ascii_data, *bin_data;
491478
int leftbits = 0;
@@ -549,9 +536,7 @@ binascii_a2b_hqx(self, args)
549536
static char doc_rlecode_hqx[] = "Binhex RLE-code binary data";
550537

551538
static PyObject *
552-
binascii_rlecode_hqx(self, args)
553-
PyObject *self;
554-
PyObject *args;
539+
binascii_rlecode_hqx(PyObject *self, PyObject *args)
555540
{
556541
unsigned char *in_data, *out_data;
557542
PyObject *rv;
@@ -598,9 +583,7 @@ PyObject *args;
598583
static char doc_b2a_hqx[] = "Encode .hqx data";
599584

600585
static PyObject *
601-
binascii_b2a_hqx(self, args)
602-
PyObject *self;
603-
PyObject *args;
586+
binascii_b2a_hqx(PyObject *self, PyObject *args)
604587
{
605588
unsigned char *ascii_data, *bin_data;
606589
int leftbits = 0;
@@ -640,9 +623,7 @@ binascii_b2a_hqx(self, args)
640623
static char doc_rledecode_hqx[] = "Decode hexbin RLE-coded string";
641624

642625
static PyObject *
643-
binascii_rledecode_hqx(self, args)
644-
PyObject *self;
645-
PyObject *args;
626+
binascii_rledecode_hqx(PyObject *self, PyObject *args)
646627
{
647628
unsigned char *in_data, *out_data;
648629
unsigned char in_byte, in_repeat;
@@ -739,9 +720,7 @@ static char doc_crc_hqx[] =
739720
"(data, oldcrc) -> newcrc. Compute hqx CRC incrementally";
740721

741722
static PyObject *
742-
binascii_crc_hqx(self, args)
743-
PyObject *self;
744-
PyObject *args;
723+
binascii_crc_hqx(PyObject *self, PyObject *args)
745724
{
746725
unsigned char *bin_data;
747726
unsigned int crc;
@@ -879,9 +858,7 @@ static unsigned long crc_32_tab[256] = {
879858
};
880859

881860
static PyObject *
882-
binascii_crc32(self, args)
883-
PyObject *self;
884-
PyObject *args;
861+
binascii_crc32(PyObject *self, PyObject *args)
885862
{ /* By Jim Ahlstrom; All rights transferred to CNRI */
886863
unsigned char *bin_data;
887864
unsigned long crc = 0UL; /* initial value of CRC */

Modules/cryptmodule.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
/* Module crypt */
1010

1111

12-
static PyObject *crypt_crypt(self, args)
13-
PyObject *self, *args;
12+
static PyObject *crypt_crypt(PyObject *self, PyObject *args)
1413
{
1514
char *word, *salt;
1615
extern char * crypt();

Modules/readline.c

Lines changed: 15 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ extern char *(*PyOS_ReadlineFunctionPointer)(char *);
4545
/* Exported function to send one line to readline's init file parser */
4646

4747
static PyObject *
48-
parse_and_bind(self, args)
49-
PyObject *self;
50-
PyObject *args;
48+
parse_and_bind(PyObject *self, PyObject *args)
5149
{
5250
char *s, *copy;
5351
if (!PyArg_ParseTuple(args, "s:parse_and_bind", &s))
@@ -73,9 +71,7 @@ Parse and execute single line of a readline init file.\
7371
/* Exported function to parse a readline init file */
7472

7573
static PyObject *
76-
read_init_file(self, args)
77-
PyObject *self;
78-
PyObject *args;
74+
read_init_file(PyObject *self, PyObject *args)
7975
{
8076
char *s = NULL;
8177
if (!PyArg_ParseTuple(args, "|z:read_init_file", &s))
@@ -97,9 +93,7 @@ The default filename is the last filename used.\
9793
/* Exported function to load a readline history file */
9894

9995
static PyObject *
100-
read_history_file(self, args)
101-
PyObject *self;
102-
PyObject *args;
96+
read_history_file(PyObject *self, PyObject *args)
10397
{
10498
char *s = NULL;
10599
if (!PyArg_ParseTuple(args, "|z:read_history_file", &s))
@@ -121,9 +115,7 @@ The default filename is ~/.history.\
121115
/* Exported function to save a readline history file */
122116

123117
static PyObject *
124-
write_history_file(self, args)
125-
PyObject *self;
126-
PyObject *args;
118+
write_history_file(PyObject *self, PyObject *args)
127119
{
128120
char *s = NULL;
129121
if (!PyArg_ParseTuple(args, "|z:write_history_file", &s))
@@ -152,9 +144,7 @@ static PyObject *endidx = NULL;
152144

153145
/* get the beginning index for the scope of the tab-completion */
154146
static PyObject *
155-
get_begidx(self, args)
156-
PyObject *self;
157-
PyObject *args;
147+
get_begidx(PyObject *self, PyObject *args)
158148
{
159149
if(!PyArg_NoArgs(args)) {
160150
return NULL;
@@ -169,9 +159,7 @@ get the beginning index of the readline tab-completion scope";
169159

170160
/* get the ending index for the scope of the tab-completion */
171161
static PyObject *
172-
get_endidx(self, args)
173-
PyObject *self;
174-
PyObject *args;
162+
get_endidx(PyObject *self, PyObject *args)
175163
{
176164
if(!PyArg_NoArgs(args)) {
177165
return NULL;
@@ -188,9 +176,7 @@ get the ending index of the readline tab-completion scope";
188176
/* set the tab-completion word-delimiters that readline uses */
189177

190178
static PyObject *
191-
set_completer_delims(self, args)
192-
PyObject *self;
193-
PyObject *args;
179+
set_completer_delims(PyObject *self, PyObject *args)
194180
{
195181
char *break_chars;
196182

@@ -211,9 +197,7 @@ set the readline word delimiters for tab-completion";
211197
/* get the tab-completion word-delimiters that readline uses */
212198

213199
static PyObject *
214-
get_completer_delims(self, args)
215-
PyObject *self;
216-
PyObject *args;
200+
get_completer_delims(PyObject *self, PyObject *args)
217201
{
218202
if(!PyArg_NoArgs(args)) {
219203
return NULL;
@@ -226,9 +210,7 @@ get_completer_delims() -> string\n\
226210
get the readline word delimiters for tab-completion";
227211

228212
static PyObject *
229-
set_completer(self, args)
230-
PyObject *self;
231-
PyObject *args;
213+
set_completer(PyObject *self, PyObject *args)
232214
{
233215
PyObject *function = Py_None;
234216
if (!PyArg_ParseTuple(args, "|O:set_completer", &function))
@@ -265,9 +247,7 @@ It should return the next possible completion starting with 'text'.\
265247
/* Exported function to read the current line buffer */
266248

267249
static PyObject *
268-
get_line_buffer(self, args)
269-
PyObject *self;
270-
PyObject *args;
250+
get_line_buffer(PyObject *self, PyObject *args)
271251
{
272252
if (!PyArg_NoArgs(args))
273253
return NULL;
@@ -282,9 +262,7 @@ return the current contents of the line buffer.\
282262
/* Exported function to insert text into the line buffer */
283263

284264
static PyObject *
285-
insert_text(self, args)
286-
PyObject *self;
287-
PyObject *args;
265+
insert_text(PyObject *self, PyObject *args)
288266
{
289267
char *s;
290268
if (!PyArg_ParseTuple(args, "s:insert_text", &s))
@@ -325,9 +303,7 @@ static struct PyMethodDef readline_methods[] =
325303
/* C function to call the Python completer. */
326304

327305
static char *
328-
on_completion(text, state)
329-
char *text;
330-
int state;
306+
on_completion(char *text, int state)
331307
{
332308
char *result = NULL;
333309
if (completer != NULL) {
@@ -366,10 +342,7 @@ on_completion(text, state)
366342
* before calling the normal completer */
367343

368344
char **
369-
flex_complete(text, start, end)
370-
char *text;
371-
int start;
372-
int end;
345+
flex_complete(char *text, int start, int end)
373346
{
374347
Py_XDECREF(begidx);
375348
Py_XDECREF(endidx);
@@ -413,8 +386,7 @@ static jmp_buf jbuf;
413386

414387
/* ARGSUSED */
415388
static RETSIGTYPE
416-
onintr(sig)
417-
int sig;
389+
onintr(int sig)
418390
{
419391
longjmp(jbuf, 1);
420392
}
@@ -423,8 +395,7 @@ onintr(sig)
423395
/* Wrapper around GNU readline that handles signals differently. */
424396

425397
static char *
426-
call_readline(prompt)
427-
char *prompt;
398+
call_readline(char *prompt)
428399
{
429400
size_t n;
430401
char *p, *q;

0 commit comments

Comments
 (0)