Untabify C files. Will watch buildbots.
diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c
index f1f4abf..253a4dc 100644
--- a/Modules/_localemodule.c
+++ b/Modules/_localemodule.c
@@ -58,8 +58,8 @@
PyObject *result, *val = NULL;
if (s[0] == '\0')
- /* empty string: no grouping at all */
- return PyList_New(0);
+ /* empty string: no grouping at all */
+ return PyList_New(0);
for (i = 0; s[i] != '\0' && s[i] != CHAR_MAX; i++)
; /* nothing */
@@ -172,23 +172,23 @@
#endif
if (locale) {
- /* set locale */
- result = setlocale(category, locale);
- if (!result) {
- /* operation failed, no setting was changed */
- PyErr_SetString(Error, "unsupported locale setting");
- return NULL;
- }
- result_object = PyString_FromString(result);
- if (!result_object)
- return NULL;
- /* record changes to LC_CTYPE */
- if (category == LC_CTYPE || category == LC_ALL)
- fixup_ulcase();
+ /* set locale */
+ result = setlocale(category, locale);
+ if (!result) {
+ /* operation failed, no setting was changed */
+ PyErr_SetString(Error, "unsupported locale setting");
+ return NULL;
+ }
+ result_object = PyString_FromString(result);
+ if (!result_object)
+ return NULL;
+ /* record changes to LC_CTYPE */
+ if (category == LC_CTYPE || category == LC_ALL)
+ fixup_ulcase();
/* things that got wrong up to here are ignored */
PyErr_Clear();
} else {
- /* get locale */
+ /* get locale */
result = setlocale(category, NULL);
if (!result) {
PyErr_SetString(Error, "locale query failed");
@@ -276,7 +276,7 @@
{
#if !defined(HAVE_WCSCOLL) || !defined(Py_USING_UNICODE)
char *s1,*s2;
-
+
if (!PyArg_ParseTuple(args, "ss:strcoll", &s1, &s2))
return NULL;
return PyInt_FromLong(strcoll(s1, s2));
@@ -284,7 +284,7 @@
PyObject *os1, *os2, *result = NULL;
wchar_t *ws1 = NULL, *ws2 = NULL;
int rel1 = 0, rel2 = 0, len1, len2;
-
+
if (!PyArg_UnpackTuple(args, "strcoll", 2, 2, &os1, &os2))
return NULL;
/* If both arguments are byte strings, use strcoll. */
@@ -297,9 +297,9 @@
}
/* Convert the non-unicode argument to unicode. */
if (!PyUnicode_Check(os1)) {
- os1 = PyUnicode_FromObject(os1);
- if (!os1)
- return NULL;
+ os1 = PyUnicode_FromObject(os1);
+ if (!os1)
+ return NULL;
rel1 = 1;
}
if (!PyUnicode_Check(os2)) {
@@ -309,7 +309,7 @@
Py_DECREF(os1);
}
return NULL;
- }
+ }
rel2 = 1;
}
/* Convert the unicode strings to wchar[]. */
@@ -419,9 +419,9 @@
#ifdef HAVE_LANGINFO_H
#define LANGINFO(X) {#X, X}
static struct langinfo_constant{
- char* name;
- int value;
-} langinfo_constants[] =
+ char* name;
+ int value;
+} langinfo_constants[] =
{
/* These constants should exist on any langinfo implementation */
LANGINFO(DAY_1),
@@ -534,7 +534,7 @@
{
int item, i;
if (!PyArg_ParseTuple(args, "i:nl_langinfo", &item))
- return NULL;
+ return NULL;
/* Check whether this is a supported constant. GNU libc sometimes
returns numeric values in the char* return value, which would
crash PyString_FromString. */
@@ -559,10 +559,10 @@
static PyObject*
PyIntl_gettext(PyObject* self, PyObject *args)
{
- char *in;
- if (!PyArg_ParseTuple(args, "s", &in))
- return 0;
- return PyString_FromString(gettext(in));
+ char *in;
+ if (!PyArg_ParseTuple(args, "s", &in))
+ return 0;
+ return PyString_FromString(gettext(in));
}
PyDoc_STRVAR(dgettext__doc__,
@@ -572,10 +572,10 @@
static PyObject*
PyIntl_dgettext(PyObject* self, PyObject *args)
{
- char *domain, *in;
- if (!PyArg_ParseTuple(args, "zs", &domain, &in))
- return 0;
- return PyString_FromString(dgettext(domain, in));
+ char *domain, *in;
+ if (!PyArg_ParseTuple(args, "zs", &domain, &in))
+ return 0;
+ return PyString_FromString(dgettext(domain, in));
}
PyDoc_STRVAR(dcgettext__doc__,
@@ -585,11 +585,11 @@
static PyObject*
PyIntl_dcgettext(PyObject *self, PyObject *args)
{
- char *domain, *msgid;
- int category;
- if (!PyArg_ParseTuple(args, "zsi", &domain, &msgid, &category))
- return 0;
- return PyString_FromString(dcgettext(domain,msgid,category));
+ char *domain, *msgid;
+ int category;
+ if (!PyArg_ParseTuple(args, "zsi", &domain, &msgid, &category))
+ return 0;
+ return PyString_FromString(dcgettext(domain,msgid,category));
}
PyDoc_STRVAR(textdomain__doc__,
@@ -599,15 +599,15 @@
static PyObject*
PyIntl_textdomain(PyObject* self, PyObject* args)
{
- char *domain;
- if (!PyArg_ParseTuple(args, "z", &domain))
- return 0;
- domain = textdomain(domain);
- if (!domain) {
- PyErr_SetFromErrno(PyExc_OSError);
- return NULL;
- }
- return PyString_FromString(domain);
+ char *domain;
+ if (!PyArg_ParseTuple(args, "z", &domain))
+ return 0;
+ domain = textdomain(domain);
+ if (!domain) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ return PyString_FromString(domain);
}
PyDoc_STRVAR(bindtextdomain__doc__,
@@ -617,19 +617,19 @@
static PyObject*
PyIntl_bindtextdomain(PyObject* self,PyObject*args)
{
- char *domain, *dirname;
- if (!PyArg_ParseTuple(args, "sz", &domain, &dirname))
- return 0;
- if (!strlen(domain)) {
- PyErr_SetString(Error, "domain must be a non-empty string");
- return 0;
- }
- dirname = bindtextdomain(domain, dirname);
- if (!dirname) {
- PyErr_SetFromErrno(PyExc_OSError);
- return NULL;
- }
- return PyString_FromString(dirname);
+ char *domain, *dirname;
+ if (!PyArg_ParseTuple(args, "sz", &domain, &dirname))
+ return 0;
+ if (!strlen(domain)) {
+ PyErr_SetString(Error, "domain must be a non-empty string");
+ return 0;
+ }
+ dirname = bindtextdomain(domain, dirname);
+ if (!dirname) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ return PyString_FromString(dirname);
}
#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
@@ -640,28 +640,28 @@
static PyObject*
PyIntl_bind_textdomain_codeset(PyObject* self,PyObject*args)
{
- char *domain,*codeset;
- if (!PyArg_ParseTuple(args, "sz", &domain, &codeset))
- return NULL;
- codeset = bind_textdomain_codeset(domain, codeset);
- if (codeset)
- return PyString_FromString(codeset);
- Py_RETURN_NONE;
+ char *domain,*codeset;
+ if (!PyArg_ParseTuple(args, "sz", &domain, &codeset))
+ return NULL;
+ codeset = bind_textdomain_codeset(domain, codeset);
+ if (codeset)
+ return PyString_FromString(codeset);
+ Py_RETURN_NONE;
}
#endif
#endif
static struct PyMethodDef PyLocale_Methods[] = {
- {"setlocale", (PyCFunction) PyLocale_setlocale,
+ {"setlocale", (PyCFunction) PyLocale_setlocale,
METH_VARARGS, setlocale__doc__},
- {"localeconv", (PyCFunction) PyLocale_localeconv,
+ {"localeconv", (PyCFunction) PyLocale_localeconv,
METH_NOARGS, localeconv__doc__},
- {"strcoll", (PyCFunction) PyLocale_strcoll,
+ {"strcoll", (PyCFunction) PyLocale_strcoll,
METH_VARARGS, strcoll__doc__},
- {"strxfrm", (PyCFunction) PyLocale_strxfrm,
+ {"strxfrm", (PyCFunction) PyLocale_strxfrm,
METH_VARARGS, strxfrm__doc__},
-#if defined(MS_WINDOWS)
+#if defined(MS_WINDOWS)
{"_getdefaultlocale", (PyCFunction) PyLocale_getdefaultlocale, METH_NOARGS},
#endif
#ifdef HAVE_LANGINFO_H
@@ -683,7 +683,7 @@
{"bind_textdomain_codeset",(PyCFunction)PyIntl_bind_textdomain_codeset,
METH_VARARGS, bind_textdomain_codeset__doc__},
#endif
-#endif
+#endif
{NULL, NULL}
};
@@ -697,7 +697,7 @@
m = Py_InitModule("_locale", PyLocale_Methods);
if (m == NULL)
- return;
+ return;
d = PyModule_GetDict(m);
@@ -744,13 +744,13 @@
#ifdef HAVE_LANGINFO_H
for (i = 0; langinfo_constants[i].name; i++) {
- PyModule_AddIntConstant(m, langinfo_constants[i].name,
- langinfo_constants[i].value);
+ PyModule_AddIntConstant(m, langinfo_constants[i].name,
+ langinfo_constants[i].value);
}
#endif
}
-/*
+/*
Local variables:
c-basic-offset: 4
indent-tabs-mode: nil