summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2010-08-11 17:31:17 (GMT)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2010-08-11 17:31:17 (GMT)
commitf0f45142d52436d26ce8ed888c73496949caae90 (patch)
tree53a4f3c197b87cb8afa33b87de48b06d5859513d /Python
parent3a879e8a277e61195f5379862ef47f3ca9c69f4b (diff)
downloadcpython-f0f45142d52436d26ce8ed888c73496949caae90.zip
cpython-f0f45142d52436d26ce8ed888c73496949caae90.tar.gz
cpython-f0f45142d52436d26ce8ed888c73496949caae90.tar.bz2
Issue #2443: Added a new macro, Py_VA_COPY, which is equivalent to C99
va_copy, but available on all python platforms. Untabified a few unrelated files.
Diffstat (limited to 'Python')
-rw-r--r--Python/getargs.c40
-rw-r--r--Python/modsupport.c10
2 files changed, 5 insertions, 45 deletions
diff --git a/Python/getargs.c b/Python/getargs.c
index e4bd50d..abf55ce 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -105,15 +105,7 @@ PyArg_VaParse(PyObject *args, const char *format, va_list va)
{
va_list lva;
-#ifdef VA_LIST_IS_ARRAY
- memcpy(lva, va, sizeof(va_list));
-#else
-#ifdef __va_copy
- __va_copy(lva, va);
-#else
- lva = va;
-#endif
-#endif
+ Py_VA_COPY(lva, va);
return vgetargs1(args, format, &lva, 0);
}
@@ -123,15 +115,7 @@ _PyArg_VaParse_SizeT(PyObject *args, char *format, va_list va)
{
va_list lva;
-#ifdef VA_LIST_IS_ARRAY
- memcpy(lva, va, sizeof(va_list));
-#else
-#ifdef __va_copy
- __va_copy(lva, va);
-#else
- lva = va;
-#endif
-#endif
+ Py_VA_COPY(lva, va);
return vgetargs1(args, format, &lva, FLAG_SIZE_T);
}
@@ -1376,15 +1360,7 @@ PyArg_VaParseTupleAndKeywords(PyObject *args,
return 0;
}
-#ifdef VA_LIST_IS_ARRAY
- memcpy(lva, va, sizeof(va_list));
-#else
-#ifdef __va_copy
- __va_copy(lva, va);
-#else
- lva = va;
-#endif
-#endif
+ Py_VA_COPY(lva, va);
retval = vgetargskeywords(args, keywords, format, kwlist, &lva, 0);
return retval;
@@ -1408,15 +1384,7 @@ _PyArg_VaParseTupleAndKeywords_SizeT(PyObject *args,
return 0;
}
-#ifdef VA_LIST_IS_ARRAY
- memcpy(lva, va, sizeof(va_list));
-#else
-#ifdef __va_copy
- __va_copy(lva, va);
-#else
- lva = va;
-#endif
-#endif
+ Py_VA_COPY(lva, va);
retval = vgetargskeywords(args, keywords, format,
kwlist, &lva, FLAG_SIZE_T);
diff --git a/Python/modsupport.c b/Python/modsupport.c
index 5f5d842..85b0d66 100644
--- a/Python/modsupport.c
+++ b/Python/modsupport.c
@@ -456,15 +456,7 @@ va_build_value(const char *format, va_list va, int flags)
int n = countformat(f, '\0');
va_list lva;
-#ifdef VA_LIST_IS_ARRAY
- memcpy(lva, va, sizeof(va_list));
-#else
-#ifdef __va_copy
- __va_copy(lva, va);
-#else
- lva = va;
-#endif
-#endif
+ Py_VA_COPY(lva, va);
if (n < 0)
return NULL;