|
From: | Dr . Jürgen Sauermann |
Subject: | Re: [Bug-apl] Patch for building svn r1138 on macOS |
Date: | Thu, 25 Apr 2019 13:33:24 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
Hi Xiao-Yong, thanks. I made most of the changes in SVN 1140. The reinterpret_cast<APL_Integer> failed on my machine, so I used a slighly different approach. The reason seems to be that pthread_t is integer on some platforms and a pointer on others. Best Regards, /// Jürgen On 4/25/19 3:51 AM, Xiao-Yong Jin
wrote:
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; |
[Prev in Thread] | Current Thread | [Next in Thread] |