diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-04-14 20:18:16 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-04-14 20:18:16 -0700 |
commit | 12b74f698287f2fb4b5d6b20d02f810d808a45f6 (patch) | |
tree | d7b4546de3aada774946c3ebe1b2d58f67ba94c2 | |
parent | 5ac1fae2af79eeafeb1ab9b51021af50b514bad2 (diff) | |
download | txr-12b74f698287f2fb4b5d6b20d02f810d808a45f6.tar.gz txr-12b74f698287f2fb4b5d6b20d02f810d808a45f6.tar.bz2 txr-12b74f698287f2fb4b5d6b20d02f810d808a45f6.zip |
* stream.c (get_line, get_char, get_byte): Fix outdated, incorrect
optional argument defaulting logic.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | stream.c | 9 |
2 files changed, 8 insertions, 6 deletions
@@ -1,3 +1,8 @@ +2014-04-14 Kaz Kylheku <kaz@kylheku.com> + + * stream.c (get_line, get_char, get_byte): Fix outdated, incorrect + optional argument defaulting logic. + 2014-04-13 Kaz Kylheku <kaz@kylheku.com> * eval.c, gc.c, rand.c, regex.c, signal.c: Remove inclusion of unneeded @@ -1321,8 +1321,7 @@ val close_stream(val stream, val throw_on_error) val get_line(val stream) { - if (!stream) - stream = std_input; + stream = default_arg(stream, std_input); type_check (stream, COBJ); type_assert (stream->co.cls == stream_s, (lit("~a is not a stream"), @@ -1336,8 +1335,7 @@ val get_line(val stream) val get_char(val stream) { - if (!stream) - stream = std_input; + stream = default_arg(stream, std_input); type_check (stream, COBJ); type_assert (stream->co.cls == stream_s, (lit("~a is not a stream"), @@ -1351,8 +1349,7 @@ val get_char(val stream) val get_byte(val stream) { - if (!stream) - stream = std_input; + stream = default_arg(stream, std_input); type_check (stream, COBJ); type_assert (stream->co.cls == stream_s, (lit("~a is not a stream"), |