Mercurial > hg > octave-max
changeset 3613:0a93682f89c8
[project @ 2000-03-17 10:58:25 by jwe]
author | jwe |
---|---|
date | Fri, 17 Mar 2000 11:03:52 +0000 |
parents | fcdf0897e705 |
children | b1b831947caa |
files | liboctave/Array.h liboctave/ChangeLog liboctave/Makefile.in liboctave/lo-cutils.c liboctave/lo-utils.h src/ChangeLog src/Makefile.in |
diffstat | 7 files changed, 62 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/Array.h +++ b/liboctave/Array.h @@ -29,7 +29,8 @@ #endif #include <cassert> -#include <cstdlib> + +#include "lo-utils.h" class idx_vector; @@ -84,7 +85,7 @@ void qsort (int (*compare) (const void *, const void *)) { - ::qsort (data, static_cast<size_t> (len), sizeof (T), compare); + octave_qsort (data, static_cast<size_t> (len), sizeof (T), compare); } };
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,12 @@ +2000-03-17 John W. Eaton <jwe@bevo.che.wisc.edu> + + * Makefile.in: (objects): New target. + + * lo-cutils.c: New file. + * Makefile.in (SOURCES): Add it to the list. + * lo-utils.h: Declare octave_qsort here. + * Array.h (Array::qsort): Use it here. + 2000-03-08 John W. Eaton <jwe@bevo.che.wisc.edu> * oct-time.cc: Include <sys/types.h> and <unistd.h>, if available.
--- a/liboctave/Makefile.in +++ b/liboctave/Makefile.in @@ -88,7 +88,7 @@ LPsolve.cc LSODE.cc NLEqn.cc Quad.cc Range.cc cmd-edit.cc \ cmd-hist.cc data-conv.cc dir-ops.cc f2c-main.c file-ops.cc \ file-stat.cc filemode.c getopt.c getopt1.c glob-match.cc \ - idx-vector.cc lo-ieee.cc lo-mappers.cc lo-specfun.cc \ + idx-vector.cc lo-cutils.c lo-ieee.cc lo-mappers.cc lo-specfun.cc \ lo-sysdep.cc lo-utils.cc mach-info.cc mkdir.c oct-alloc.cc \ oct-env.cc oct-getopt.c oct-group.cc oct-kpse.c oct-passwd.cc \ oct-rl-edit.c oct-rl-hist.c oct-shlib.cc oct-syscalls.cc \ @@ -128,6 +128,8 @@ all: libraries .PHONY: all +objects: $(OBJECTS) + stmp-pic: pic @if [ -f stmp-pic ]; then \ true; \
new file mode 100644 --- /dev/null +++ b/liboctave/lo-cutils.c @@ -0,0 +1,40 @@ +/* + +Copyright (C) 2000 John W. Eaton + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdlib.h> + +void +octave_qsort (void *base, size_t n, size_t size, + int (*cmp) (const void *, const void *)) +{ + qsort (base, n, size, cmp); +} + +/* +;;; Local Variables: *** +;;; mode: C++ *** +;;; End: *** +*/
--- a/liboctave/lo-utils.h +++ b/liboctave/lo-utils.h @@ -36,6 +36,9 @@ extern std::string octave_fgets (std::FILE *); +extern "C" void octave_qsort (void *base, size_t n, size_t size, + int (*cmp) (const void *, const void *)); + #endif /*
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2000-03-17 John W. Eaton <jwe@bevo.che.wisc.edu> + * Makefile.in (objects): New target + * c_file_ptr_stream.h, c_file_ptr_stream.cc: New files. * oct-stdstrm.h, oct-stdstrm.cc, oct-prcstrm.cc: Use c_file_ptr_buf, i_c_file_ptr_stream, and o_c_fie_ptr_stream