changeset 326:23d88658d3ca

Fix MSVC compilation
author goffioul
date Thu, 10 Apr 2008 09:24:51 +0000
parents 789dd43cfb4e
children 8c129d61dbec
files src/__bilateral__.cc src/__cordfltn__.cc
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/__bilateral__.cc
+++ b/src/__bilateral__.cc
@@ -53,7 +53,7 @@
   const octave_idx_type num_planes = (ndims == 2) ? 1 : size(2);
   
   // Build spatial kernel
-  const int s = MAX(round(3*sigma_d), 1);
+  const int s = MAX(xround(3*sigma_d), 1);
   Matrix kernel(2*s+1, 2*s+1);
   for (octave_idx_type r = 0; r < 2*s+1; r++)
     {
@@ -77,8 +77,8 @@
       for (octave_idx_type c = 0; c < out_size(1); c++)
         {
           // For each neighbour
-          double val[num_planes];
-          double sum[num_planes];
+          OCTAVE_LOCAL_BUFFER (double, val, num_planes);
+          OCTAVE_LOCAL_BUFFER (double, sum, num_planes);
           double k = 0;
           for (octave_idx_type i = 0; i < num_planes; i++)
             {
@@ -89,7 +89,7 @@
             {
               for (octave_idx_type kc = 0; kc < 2*s+1; kc++)
                 {
-                  double lval[num_planes];
+                  OCTAVE_LOCAL_BUFFER (double, lval, num_planes);
                   for (octave_idx_type i = 0; i < num_planes; i++) lval[i] = im(r+kr,c+kc,i);
                   const double w = kernel(kr,kc)*gauss(val, lval, sigma_r, ndims);
                   for (octave_idx_type i = 0; i < num_planes; i++) sum[i] += w*lval[i];
--- a/src/__cordfltn__.cc
+++ b/src/__cordfltn__.cc
@@ -137,7 +137,7 @@
     Array<octave_idx_type> out_idx(idx_dim, 0);
     for (octave_idx_type i = 0; i < out_numel; i++) {
         // For each neighbour
-        ET values[len];
+	OCTAVE_LOCAL_BUFFER (ET, values, len);
         int l = 0;
         for (int n = 0; n < ndims; n++) dom_idx(n) = 0;
         for (octave_idx_type j = 0; j < dom_numel; j++) {