diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-10-20 20:10:01 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-10-20 20:10:01 -0700 |
commit | ca9d41f19051d34bad12ea3b703ae20ba1902773 (patch) | |
tree | 54b9fb085e2665b52622999504eb2086fac563b9 | |
parent | ced08a126bdc46dd3c5ee057ebc3bec4fece8a19 (diff) | |
download | txr-ca9d41f19051d34bad12ea3b703ae20ba1902773.tar.gz txr-ca9d41f19051d34bad12ea3b703ae20ba1902773.tar.bz2 txr-ca9d41f19051d34bad12ea3b703ae20ba1902773.zip |
obj_print: use of volatile.
* lib.c (obj_print): The ret variable doesn't have to be
volatile qualified, because it is never modified after
setting an exception handler, and then accessed in the
cleanup. On the other hand, the ctx variable is
manipulated this way and must be volatile.
-rw-r--r-- | lib.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -9427,11 +9427,12 @@ tail: val obj_print(val obj, val stream) { - volatile val ret = nil; + val ret = nil; val out = default_arg(stream, std_output); val save_mode = get_indent_mode(out); val save_indent = get_indent(out); - struct strm_ctx *ctx_orig = get_ctx(out), *ctx = ctx_orig, ctx_struct; + struct strm_ctx *ctx_orig = get_ctx(out); + struct strm_ctx *volatile ctx = ctx_orig, ctx_struct; uw_simple_catch_begin; @@ -9467,7 +9468,8 @@ val obj_pprint(val obj, val stream) val out = default_arg(stream, std_output); val save_mode = get_indent_mode(out); val save_indent = get_indent(out); - struct strm_ctx *ctx_orig = get_ctx(out), *ctx = ctx_orig, ctx_struct; + struct strm_ctx *ctx_orig = get_ctx(out); + struct strm_ctx *volatile ctx = ctx_orig, ctx_struct; uw_simple_catch_begin; |