# HG changeset patch # User John W. Eaton # Date 1216143262 14400 # Node ID 30b952e90c294c6601e8f812e8a746024f91fd5a # Parent f728089c9543b46a178a9cb2107d54eaa615e871 misc 64-bit fixes diff -r f728089c9543 -r 30b952e90c29 liboctave/ChangeLog --- a/liboctave/ChangeLog Tue Jul 15 09:47:34 2008 -0400 +++ b/liboctave/ChangeLog Tue Jul 15 13:34:22 2008 -0400 @@ -1,3 +1,9 @@ +2008-07-15 John W. Eaton + + * oct-sort.cc, oct-sort.h (octave_sort::count_run): Declare + descending arg as bool&. + (octave_sort::sort): Pass bool to count_run for descending arg. + 2008-07-11 John W. Eaton * dDiagMatrix.cc (DiagMatrix::diag): Return empty ColumnVector if diff -r f728089c9543 -r 30b952e90c29 liboctave/oct-sort.cc --- a/liboctave/oct-sort.cc Tue Jul 15 09:47:34 2008 -0400 +++ b/liboctave/oct-sort.cc Tue Jul 15 13:34:22 2008 -0400 @@ -180,7 +180,7 @@ lo[0] > lo[1] > lo[2] > ... -Boolean *descending is set to 0 in the former case, or to 1 in the latter. +DESCENDING is set to false in the former case, or to true in the latter. For its intended use in a stable mergesort, the strictness of the defn of "descending" is needed so that the caller can safely reverse a descending sequence without violating stability (strict > ensures there are no equal @@ -190,11 +190,11 @@ */ template octave_idx_type -octave_sort::count_run (T *lo, T *hi, int *descending) +octave_sort::count_run (T *lo, T *hi, bool& descending) { octave_idx_type n; - *descending = 0; + descending = false; ++lo; if (lo == hi) return 1; @@ -203,7 +203,7 @@ IFLT (*lo, *(lo-1)) { - *descending = 1; + descending = true; for (lo = lo+1; lo < hi; ++lo, ++n) { IFLT (*lo, *(lo-1)) @@ -943,11 +943,11 @@ octave_idx_type minrun = merge_compute_minrun (nremaining); do { - int descending; + bool descending; octave_idx_type n; /* Identify next run. */ - n = count_run (lo, hi, &descending); + n = count_run (lo, hi, descending); if (n < 0) goto fail; if (descending) diff -r f728089c9543 -r 30b952e90c29 liboctave/oct-sort.h --- a/liboctave/oct-sort.h Tue Jul 15 09:47:34 2008 -0400 +++ b/liboctave/oct-sort.h Tue Jul 15 13:34:22 2008 -0400 @@ -164,7 +164,7 @@ void binarysort (T *lo, T *hi, T *start); - octave_idx_type count_run (T *lo, T *hi, octave_idx_type *descending); + octave_idx_type count_run (T *lo, T *hi, bool& descending); octave_idx_type gallop_left (T key, T *a, octave_idx_type n, octave_idx_type hint); diff -r f728089c9543 -r 30b952e90c29 src/ChangeLog --- a/src/ChangeLog Tue Jul 15 09:47:34 2008 -0400 +++ b/src/ChangeLog Tue Jul 15 13:34:22 2008 -0400 @@ -1,3 +1,8 @@ +2008-07-15 John W. Eaton + + * DLD-FUNCTIONS/__convn__.cc (convn): Cast second arg to + octave_idx_type in call to std::max. + 2008-07-14 John W. Eaton * Makefile.in (convhulln.oct, __delaunayn__.oct, __voronoi__.oct, diff -r f728089c9543 -r 30b952e90c29 src/DLD-FUNCTIONS/__convn__.cc --- a/src/DLD-FUNCTIONS/__convn__.cc Tue Jul 15 09:47:34 2008 -0400 +++ b/src/DLD-FUNCTIONS/__convn__.cc Tue Jul 15 13:34:22 2008 -0400 @@ -81,7 +81,8 @@ // Allocate output dim_vector out_size (a_size); for (octave_idx_type n = 0; n < ndims; n++) - out_size(n) = std::max (a_size(n) - b_size(n) + 1, 0); + out_size(n) = std::max (a_size(n) - b_size(n) + 1, + static_cast (0)); typedef typename octave_convn_traits::TR MTout;