[svn:parrot] r44489 - trunk/src

whiteknight at svn.parrot.org whiteknight at svn.parrot.org
Fri Feb 26 02:06:52 UTC 2010


Author: whiteknight
Date: Fri Feb 26 02:06:50 2010
New Revision: 44489
URL: https://trac.parrot.org/parrot/changeset/44489

Log:
fix a build warning in src/main.c pointed out by Coke++. GCC doesn't like directly casting the output of a function. Instead, we break it up onto multiple lines, storing the return value THEN casting it.

Modified:
   trunk/src/main.c

Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c	Fri Feb 26 01:11:27 2010	(r44488)
+++ trunk/src/main.c	Fri Feb 26 02:06:50 2010	(r44489)
@@ -476,8 +476,11 @@
             /* Handled in parseflags_minimal */
             break;
           case 't':
-            if (opt.opt_arg && is_all_hex_digits(opt.opt_arg))
-                *trace = (Parrot_trace_flags)strtoul(opt.opt_arg, NULL, 16);
+            if (opt.opt_arg && is_all_hex_digits(opt.opt_arg)) {
+                const unsigned long _temp = strtoul(opt.opt_arg, NULL, 16);
+                const Parrot_trace_flags _temp_flag = (Parrot_trace_flags)_temp;
+                *trace = _temp_flag;
+            }
             else
                 *trace = PARROT_TRACE_OPS_FLAG;
             break;


More information about the parrot-commits mailing list