bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-apl] Patch for building svn r1138 on macOS


From: Xiao-Yong Jin
Subject: [Bug-apl] Patch for building svn r1138 on macOS
Date: Wed, 24 Apr 2019 20:51:55 -0500

Hi,

I just updated my install to the svn r1138.
Below is what I needed to change for building on macOS.
I believe that those `delete[]` should be applied for other systems, too.

% svn diff
Index: src/PrimitiveFunction.cc
===================================================================
--- src/PrimitiveFunction.cc    (revision 1138)
+++ src/PrimitiveFunction.cc    (working copy)
@@ -2950,7 +2950,7 @@
 
         Value_P Z(len_Z, LOC);
         loop(z, len_Z)   Z->next_ravel()->init(*cells_Z[z], Z.getref(), LOC);
-        delete cells_B;
+        delete[] cells_B;
         Z->check_value(LOC);
         return Token(TOK_APL_VALUE1, Z);
       }
@@ -3029,7 +3029,7 @@
 
         Z->set_default(*B, LOC);
         Z->check_value(LOC);
-        delete cells_A;
+        delete[] cells_A;
         return Token(TOK_APL_VALUE1, Z);
       }
     else
@@ -3054,7 +3054,7 @@
 
         Z->set_default(*B, LOC);
         Z->check_value(LOC);
-        delete cells_Z;
+        delete[] cells_Z;
         return Token(TOK_APL_VALUE1, Z);
       }
 }
Index: src/Quad_PLOT.cc
===================================================================
--- src/Quad_PLOT.cc    (revision 1138)
+++ src/Quad_PLOT.cc    (working copy)
@@ -795,7 +795,7 @@
       }
    else                           // use float arithmetic for 10^expo
       {
-        const double expo_val = exp10(expo);
+        const double expo_val = pow(10, expo);
         if (val <= 2.0)   return  expo < 0 ? 2.0/expo_val : 2.0*expo_val;
         if (val <= 5.0)   return  expo < 0 ? 5.0/expo_val : 5.0*expo_val;
         return  expo < 0 ? 10.0/expo_val : 10.0*expo_val;
@@ -1556,7 +1556,7 @@
    sem_wait(&Quad_PLOT::plot_threads_sema);
       plot_threads.append(thread);
    sem_post(&Quad_PLOT::plot_threads_sema);
-   return IntScalar(thread, LOC);
+   return IntScalar(reinterpret_cast<APL_Integer>(thread), LOC);
 }
 //-----------------------------------------------------------------------------
 void
Index: src/ScalarFunction.cc
===================================================================
--- src/ScalarFunction.cc       (revision 1138)
+++ src/ScalarFunction.cc       (working copy)
@@ -1155,7 +1155,7 @@
 
    loop(z, len_Z)   Z->next_ravel()->init(*cells_Z[z], Z.getref(), LOC);
 
-   delete cells_A;   // incl. cells_Z and cells_B
+   delete[] cells_A;   // incl. cells_Z and cells_B
 
    Z->check_value(LOC);
    return Z;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]