summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-10-20 20:10:01 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-10-20 20:10:01 -0700
commite1106faa01d8881243a3e4dbd9effa3aebb9c9cc (patch)
tree54b9fb085e2665b52622999504eb2086fac563b9
parente745c49ba4869cf195f939587acf8c11c6cd7604 (diff)
downloadtxr-e1106faa01d8881243a3e4dbd9effa3aebb9c9cc.tar.gz
txr-e1106faa01d8881243a3e4dbd9effa3aebb9c9cc.tar.bz2
txr-e1106faa01d8881243a3e4dbd9effa3aebb9c9cc.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.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib.c b/lib.c
index 1b3996c9..834685b4 100644
--- a/lib.c
+++ b/lib.c
@@ -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;