summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-10-26 14:36:29 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2009-10-26 14:36:29 (GMT)
commit3b38df24df7789c9a1b483708dcfa8335c40492c (patch)
tree7f17d2c1a8a9c575c70812bff0f4d966d38dd552 /Python
parent9acadc54e032e13421c8f3ca50e58e7169352891 (diff)
downloadcpython-3b38df24df7789c9a1b483708dcfa8335c40492c.zip
cpython-3b38df24df7789c9a1b483708dcfa8335c40492c.tar.gz
cpython-3b38df24df7789c9a1b483708dcfa8335c40492c.tar.bz2
Move some comments to more appropriate places
Diffstat (limited to 'Python')
-rw-r--r--Python/pystrtod.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/Python/pystrtod.c b/Python/pystrtod.c
index 95c0ff6..d1eb71d 100644
--- a/Python/pystrtod.c
+++ b/Python/pystrtod.c
@@ -3,11 +3,8 @@
#include <Python.h>
#include <locale.h>
-/* _Py_parse_inf_or_nan: Attempt to parse a string of the form "nan", "inf" or
- "infinity", with an optional leading sign of "+" or "-". On success,
- return the NaN or Infinity as a double and set *endptr to point just beyond
- the successfully parsed portion of the string. On failure, return -1.0 and
- set *endptr to point to the start of the string. */
+/* Case-insensitive string match used for nan and inf detection; t should be
+ lower-case. Returns 1 for a successful match, 0 otherwise. */
static int
case_insensitive_match(const char *s, const char *t)
@@ -19,6 +16,12 @@ case_insensitive_match(const char *s, const char *t)
return *t ? 0 : 1;
}
+/* _Py_parse_inf_or_nan: Attempt to parse a string of the form "nan", "inf" or
+ "infinity", with an optional leading sign of "+" or "-". On success,
+ return the NaN or Infinity as a double and set *endptr to point just beyond
+ the successfully parsed portion of the string. On failure, return -1.0 and
+ set *endptr to point to the start of the string. */
+
double
_Py_parse_inf_or_nan(const char *p, char **endptr)
{