Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f95a1b3

Browse filesBrowse files
committed
Recorded merge of revisions 81029 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
1 parent bd25030 commit f95a1b3
Copy full SHA for f95a1b3

File tree

248 files changed

+119625
-119625
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner

248 files changed

+119625
-119625
lines changed

‎Demo/embed/demo.c

Copy file name to clipboardExpand all lines: Demo/embed/demo.c
+43-43Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,44 @@ PyObject* PyInit_xyzzy(void); /* Forward */
66

77
main(int argc, char **argv)
88
{
9-
/* Ignore passed-in argc/argv. If desired, conversion
10-
should use mbstowcs to convert them. */
11-
wchar_t *args[] = {L"embed", L"hello", 0};
9+
/* Ignore passed-in argc/argv. If desired, conversion
10+
should use mbstowcs to convert them. */
11+
wchar_t *args[] = {L"embed", L"hello", 0};
1212

13-
/* Pass argv[0] to the Python interpreter */
14-
Py_SetProgramName(args[0]);
13+
/* Pass argv[0] to the Python interpreter */
14+
Py_SetProgramName(args[0]);
1515

16-
/* Add a static module */
17-
PyImport_AppendInittab("xyzzy", PyInit_xyzzy);
16+
/* Add a static module */
17+
PyImport_AppendInittab("xyzzy", PyInit_xyzzy);
1818

19-
/* Initialize the Python interpreter. Required. */
20-
Py_Initialize();
19+
/* Initialize the Python interpreter. Required. */
20+
Py_Initialize();
2121

22-
/* Define sys.argv. It is up to the application if you
23-
want this; you can also let it undefined (since the Python
24-
code is generally not a main program it has no business
25-
touching sys.argv...) */
26-
PySys_SetArgv(2, args);
22+
/* Define sys.argv. It is up to the application if you
23+
want this; you can also let it undefined (since the Python
24+
code is generally not a main program it has no business
25+
touching sys.argv...) */
26+
PySys_SetArgv(2, args);
2727

28-
/* Do some application specific code */
29-
printf("Hello, brave new world\n\n");
28+
/* Do some application specific code */
29+
printf("Hello, brave new world\n\n");
3030

31-
/* Execute some Python statements (in module __main__) */
32-
PyRun_SimpleString("import sys\n");
33-
PyRun_SimpleString("print(sys.builtin_module_names)\n");
34-
PyRun_SimpleString("print(sys.modules.keys())\n");
35-
PyRun_SimpleString("print(sys.executable)\n");
36-
PyRun_SimpleString("print(sys.argv)\n");
31+
/* Execute some Python statements (in module __main__) */
32+
PyRun_SimpleString("import sys\n");
33+
PyRun_SimpleString("print(sys.builtin_module_names)\n");
34+
PyRun_SimpleString("print(sys.modules.keys())\n");
35+
PyRun_SimpleString("print(sys.executable)\n");
36+
PyRun_SimpleString("print(sys.argv)\n");
3737

38-
/* Note that you can call any public function of the Python
39-
interpreter here, e.g. call_object(). */
38+
/* Note that you can call any public function of the Python
39+
interpreter here, e.g. call_object(). */
4040

41-
/* Some more application specific code */
42-
printf("\nGoodbye, cruel world\n");
41+
/* Some more application specific code */
42+
printf("\nGoodbye, cruel world\n");
4343

44-
/* Exit, cleaning up the interpreter */
45-
Py_Exit(0);
46-
/*NOTREACHED*/
44+
/* Exit, cleaning up the interpreter */
45+
Py_Exit(0);
46+
/*NOTREACHED*/
4747
}
4848

4949
/* A static module */
@@ -52,29 +52,29 @@ main(int argc, char **argv)
5252
static PyObject *
5353
xyzzy_foo(PyObject *self, PyObject* args)
5454
{
55-
return PyLong_FromLong(42L);
55+
return PyLong_FromLong(42L);
5656
}
5757

5858
static PyMethodDef xyzzy_methods[] = {
59-
{"foo", xyzzy_foo, METH_NOARGS,
60-
"Return the meaning of everything."},
61-
{NULL, NULL} /* sentinel */
59+
{"foo", xyzzy_foo, METH_NOARGS,
60+
"Return the meaning of everything."},
61+
{NULL, NULL} /* sentinel */
6262
};
6363

6464
static struct PyModuleDef xyzzymodule = {
65-
{}, /* m_base */
66-
"xyzzy", /* m_name */
67-
0, /* m_doc */
68-
0, /* m_size */
69-
xyzzy_methods, /* m_methods */
70-
0, /* m_reload */
71-
0, /* m_traverse */
72-
0, /* m_clear */
73-
0, /* m_free */
65+
{}, /* m_base */
66+
"xyzzy", /* m_name */
67+
0, /* m_doc */
68+
0, /* m_size */
69+
xyzzy_methods, /* m_methods */
70+
0, /* m_reload */
71+
0, /* m_traverse */
72+
0, /* m_clear */
73+
0, /* m_free */
7474
};
7575

7676
PyObject*
7777
PyInit_xyzzy(void)
7878
{
79-
return PyModule_Create(&xyzzymodule);
79+
return PyModule_Create(&xyzzymodule);
8080
}

‎Demo/embed/loop.c

Copy file name to clipboardExpand all lines: Demo/embed/loop.c
+19-19Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,28 @@
66

77
main(int argc, char **argv)
88
{
9-
int count = -1;
10-
char *command;
9+
int count = -1;
10+
char *command;
1111

12-
if (argc < 2 || argc > 3) {
13-
fprintf(stderr, "usage: loop <python-command> [count]\n");
14-
exit(2);
15-
}
16-
command = argv[1];
12+
if (argc < 2 || argc > 3) {
13+
fprintf(stderr, "usage: loop <python-command> [count]\n");
14+
exit(2);
15+
}
16+
command = argv[1];
1717

18-
if (argc == 3) {
19-
count = atoi(argv[2]);
20-
}
18+
if (argc == 3) {
19+
count = atoi(argv[2]);
20+
}
2121

22-
Py_SetProgramName(argv[0]);
22+
Py_SetProgramName(argv[0]);
2323

24-
/* uncomment this if you don't want to load site.py */
25-
/* Py_NoSiteFlag = 1; */
24+
/* uncomment this if you don't want to load site.py */
25+
/* Py_NoSiteFlag = 1; */
2626

27-
while (count == -1 || --count >= 0 ) {
28-
Py_Initialize();
29-
PyRun_SimpleString(command);
30-
Py_Finalize();
31-
}
32-
return 0;
27+
while (count == -1 || --count >= 0 ) {
28+
Py_Initialize();
29+
PyRun_SimpleString(command);
30+
Py_Finalize();
31+
}
32+
return 0;
3333
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.