A few reformats; no logic changes.
This commit is contained in:
parent
8628206b95
commit
1c73323d6f
|
@ -639,12 +639,12 @@ Win32 MS routine to get next line.
|
||||||
|
|
||||||
Under MSVC 6:
|
Under MSVC 6:
|
||||||
|
|
||||||
+ MS threadsafe getc is very slow (multiple layers of function calls
|
+ MS threadsafe getc is very slow (multiple layers of function calls before+
|
||||||
before+after each character, to lock+unlock the stream).
|
after each character, to lock+unlock the stream).
|
||||||
+ The stream-locking functions are MS-internal -- can't access them
|
+ The stream-locking functions are MS-internal -- can't access them from user
|
||||||
from user code.
|
code.
|
||||||
+ There's nothing Tim could find in the MS C or platform SDK libraries
|
+ There's nothing Tim could find in the MS C or platform SDK libraries that
|
||||||
that can worm around this.
|
can worm around this.
|
||||||
+ MS fgets locks/unlocks only once per line; it's the only hook we have.
|
+ MS fgets locks/unlocks only once per line; it's the only hook we have.
|
||||||
|
|
||||||
So we use fgets for speed(!), despite that it's painful.
|
So we use fgets for speed(!), despite that it's painful.
|
||||||
|
@ -731,12 +731,11 @@ ms_getline_hack(FILE *fp)
|
||||||
}
|
}
|
||||||
/* yuck: fgets overwrote all the newlines, i.e. the entire buffer.
|
/* yuck: fgets overwrote all the newlines, i.e. the entire buffer.
|
||||||
* So this line isn't over yet, or maybe it is but we're exactly at
|
* So this line isn't over yet, or maybe it is but we're exactly at
|
||||||
*EOF; in either case, we're tired <wink>.
|
* EOF; in either case, we're tired <wink>.
|
||||||
*/
|
*/
|
||||||
assert(msbuf[INITBUFSIZE-1] == '\0');
|
assert(msbuf[INITBUFSIZE-1] == '\0');
|
||||||
total_v_size = INITBUFSIZE + INCBUFSIZE;
|
total_v_size = INITBUFSIZE + INCBUFSIZE;
|
||||||
v = PyString_FromStringAndSize((char*)NULL,
|
v = PyString_FromStringAndSize((char*)NULL, (int)total_v_size);
|
||||||
(int)total_v_size);
|
|
||||||
if (v == NULL)
|
if (v == NULL)
|
||||||
return v;
|
return v;
|
||||||
/* copy over everything except the last null byte */
|
/* copy over everything except the last null byte */
|
||||||
|
|
Loading…
Reference in New Issue