[m-rev.] diff: fix compilation of profdeep runtime with MSVC
Julien Fischer
juliensf at csse.unimelb.edu.au
Sat Nov 12 22:41:16 AEDT 2011
Branches: main
Fix problems that prevent the runtime compiling in profdeep grades with MSVC.
runtime/mercury_deep_profiling.c
Make sure automatic variable declarations precede any code since
MSVC does allow them to be mixed in the C99 style.
Fix a mismatch in a function prototype and its definition.
Julien.
Index: runtime/mercury_deep_profiling.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_deep_profiling.c,v
retrieving revision 1.37
diff -u -r1.37 mercury_deep_profiling.c
--- runtime/mercury_deep_profiling.c 5 Jan 2011 03:15:18 -0000 1.37
+++ runtime/mercury_deep_profiling.c 12 Nov 2011 11:36:16 -0000
@@ -295,7 +295,7 @@
static void MR_write_out_coverage_points_dynamic(FILE *fp,
const MR_ProcDynamic *pd);
#endif
-static void MR_write_ptr(FILE *fp, MR_NodeKind kind, const int node_id);
+static void MR_write_ptr(FILE *fp, MR_NodeKind kind, int node_id);
static void MR_write_kind(FILE *fp, MR_CallSiteKind kind);
static void MR_write_byte(FILE *fp, const char byte);
static void MR_write_num(FILE *fp, unsigned long num);
@@ -1429,13 +1429,16 @@
MR_write_out_coverage_points_static(FILE *fp, const MR_ProcStatic *ps)
{
const MR_CoveragePointStatic *cps_static;
- cps_static = ps->MR_ps_coverage_points_static;
#ifdef MR_DEEP_PROFILING_COVERAGE_STATIC
const MR_Unsigned *cps;
- cps = ps->MR_ps_coverage_points;
#endif
unsigned int i;
+ cps_static = ps->MR_ps_coverage_points_static;
+#ifdef MR_DEEP_PROFILING_COVERAGE_STATIC
+ cps = ps->MR_ps_coverage_points;
+#endif
+
MR_write_num(fp, ps->MR_ps_num_coverage_points);
for (i = 0; i < ps->MR_ps_num_coverage_points; i++) {
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list