Mercurial > hg > octave-lojdl
changeset 2445:6577af9f7504
[project @ 1996-10-30 19:01:57 by jwe]
author | jwe |
---|---|
date | Wed, 30 Oct 1996 19:06:04 +0000 |
parents | ccb101b39cf4 |
children | b241766f293a |
files | ChangeLog config.h.bot src/ChangeLog src/oct-strstrm.h src/octave.cc src/tMap.cc src/terminals.cc |
diffstat | 7 files changed, 21 insertions(+), 208 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ Wed Oct 30 01:04:13 1996 John W. Eaton <jwe@bevo.che.wisc.edu> + * config.h.bot (GCC_ATTR_NORETURN): Rename from NORETURN. + (GCC_ATTR_UNUSED): Rename from GCC_ATTRIBUTE_UNUSED. + (NPOS): Define if using gcc 2.8.x or later. + * octMakefile.in (DIRS_TO_MAKE): Add localarchlibdir to list. * configure.in (localarchlibdir): New variable.
--- a/config.h.bot +++ b/config.h.bot @@ -1,10 +1,14 @@ -#if defined __GNUC__ -#define NORETURN __attribute__ ((__noreturn__)) -#define GCC_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +#if defined (__GNUC__) +#define GCC_ATTR_NORETURN __attribute__ ((__noreturn__)) +#define GCC_ATTR_UNUSED __attribute__ ((__unused__)) #else -#define NORETURN -#define GCC_ATTRIBUTE_UNUSED +#define GCC_ATTR_NORETURN +#define GCC_ATTR_UNUSED +#endif + +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 7) +#define NPOS string::npos #endif #define STATIC_CAST(T, E) (T) (E)
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ Wed Oct 30 01:06:19 1996 John W. Eaton <jwe@bevo.che.wisc.edu> + * octave.cc: Only include pwd.h if HAVE_PWD_H. + + * oct-strstrm.h: Include <string>, not <string.h>. + * defaults.cc, dirfns.cc, file-io.cc, help.cc, input.cc, oct-hist.cc, oct-procbuf.cc, oct-procbuf.h, octave.cc, pager.h, procstream.h, pt-misc.cc, pt-plot.cc, sighandlers.cc, strftime.c,
--- a/src/oct-strstrm.h +++ b/src/oct-strstrm.h @@ -23,7 +23,8 @@ #if !defined (octave_octave_strstream_h) #define octave_octave_strstream_h 1 -#include <string.h> +#include <string> + #include <strstream.h> #include "oct-stream.h"
--- a/src/octave.cc +++ b/src/octave.cc @@ -43,7 +43,9 @@ #include <unistd.h> #endif +#ifdef HAVE_PWD_H #include <pwd.h> +#endif #include "lo-error.h" #include "str-vec.h"
deleted file mode 100644 --- a/src/tMap.cc +++ /dev/null @@ -1,91 +0,0 @@ -#include <iostream.h> -#include <assert.h> -#include <builtin.h> - -#include "Map.h" - -int SIZE; - -char **keys; -double *values; - -void -add (char *x[], double y[], Map<double>& a) -{ - for (int i = 0; i < SIZE; ++i) - a[x[i]] = y[i]; -} - -void -makekeys (void) -{ - for (int i = 0; i < SIZE; ++i) - { - char *tmp = new char [10]; - sprintf (tmp, "index_%d", i); - keys[i] = tmp; - } -} - -void -makevalues (void) -{ - for (int i = 0; i < SIZE; ++i) - values[i] = i + 1; -} - -void -printMap (Map<double>& a) -{ - int maxprint = 1000; - cout << "["; - int k = 0; - for (Pix i = a.first (); i != 0 && k < maxprint; a.next (i), ++k) - cout << "(" << a.key (i) << ", " << a.contents (i) << ") "; - - if (i != 0) - cout << "...]\n"; - else - cout << "]\n"; -} - -void -CHtest (void) -{ - CHMap<double> a (-1.0, SIZE); - add (keys, values, a); - - cout << "a: "; - printMap (a); - - assert (a.length () == SIZE); - - for (int j = 0; j < SIZE; ++j) - assert (a.contains (keys[j])); - -// assert (a[SIZE+1] = -1); - - for (j = 0; j < SIZE; ++j) - a.del (keys[j]); - - assert (a.empty ()); - - assert (a.OK ()); -} - -int -main (int argv, char** argc) -{ - SIZE = 100; - - keys = new char *[SIZE]; - makekeys (); - - values = new double [SIZE]; - makevalues (); - - cout << "CHtest\n"; - CHtest(); - - return 0; -}
deleted file mode 100644 --- a/src/terminals.cc +++ /dev/null @@ -1,111 +0,0 @@ -// terminals.cc -*- C++ -*- -/* - -Copyright (C) 1992, 1993 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, 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#ifdef __GNUG__ -#pragma implementation -#endif - -#include <stddef.h> -#include <strings.h> -#include "terminals.h" - -/* - * It would be nice to be able to get these directly from gnuplot - * during the configuration/build procedure. - */ -static char *valid_terminals[] = -{ - "unknown", - "table", - "dumb", - "aed512", - "aed767", - "bitgraph", - "dxy800a", - "eepic", - "emtex", - "epson_60dpi", - "epson_lx800", - "fig", - "bfig", - "hp2623A", - "hp2648", - "hp7580B", - "hpgl", - "hpljii", - "hpdj", - "pcl5_port", - "pcl5_land", - "imagen", - "kc_tek40", - "km_tek40", - "latex", - "nec_cp6m", - "nec_cp6c", - "nec_cp6d", - "pbm", - "pgm", - "ppm", - "postscript", - "prescribe", - "kyo", - "qms", - "regis", - "selanar", - "starc", - "tandy_60dpi", - "tek410", - "tek40", - "unixplot", - "vx384", - "vttek", - "x11", - "X11", - (char *) NULL, -}; - -/* - * Is the given terminal named in the list above? - */ -int -valid_terminal (char *term) -{ - if (term == (char *) NULL) - return 0; - - for (char **t_list = valid_terminals; *t_list != (char *) NULL; t_list++) - { - char *t = *t_list; - int len = strlen (t); - if (strncmp (term, t, len) == 0) - return 1; - } - return 0; -} - -/* -;;; Local Variables: *** -;;; mode: C++ *** -;;; page-delimiter: "^/\\*" *** -;;; End: *** -*/