changeset 6119:fabb1be5fd84

[project @ 2006-10-28 00:13:58 by jwe]
author jwe
date Sat, 28 Oct 2006 00:13:59 +0000
parents 2803c70d8d01
children ba9db42a1fe0
files ChangeLog aclocal.m4 liboctave/ChangeLog liboctave/mk-ops.awk liboctave/mx-op-defs.h liboctave/mx-ops liboctave/oct-time.cc src/ChangeLog src/load-path.cc
diffstat 9 files changed, 185 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Oct 27 23:19:17 2006 +0000
+++ b/ChangeLog	Sat Oct 28 00:13:59 2006 +0000
@@ -3,11 +3,8 @@
 	* aclocal.m4 (OCTAVE_PROG_TEXI2PDF): Require OCTAVE_PROG_TEXI2DVI.
 	If texi2pdf is not found but texi2dvi is available, set TEXI2PDF
 	to "$TEXI2DVI --pdf".
-	(OCTAVE_PROG_GPERF, OCTAVE_PROG_GHOSTSCRIPT, OCTAVE_PROG_MAKEINFO,
-	OCTAVE_PROG_TEXI2DVI, OCTAVE_PROG_TEXI2PDF, OCTAVE_PROG_PERL,
-	OCTAVE_PROG_PYTHON, OCTAVE_PROG_DESKTOP_FILE_INSTALL): Simplify
-	calls to AC_CHECK_PROG.
 	(OCTAVE_PROG_GHOSTSCRIPT): Also check for gswin32 on Windows systems.
+
 	* Makeconf.in (UNSETCOMSPEC): Define if COMSPEC is defined.
 	From Michael Goffioul <michael.goffioul@swing.be>.
 
--- a/aclocal.m4	Fri Oct 27 23:19:17 2006 +0000
+++ b/aclocal.m4	Sat Oct 28 00:13:59 2006 +0000
@@ -538,7 +538,7 @@
 dnl
 dnl OCTAVE_PROG_GPERF
 AC_DEFUN(OCTAVE_PROG_GPERF, [
-  AC_CHECK_PROG(GPERF, gperf)
+  AC_CHECK_PROG(GPERF, gperf, gperf, [])
   if test -n "$GPERF"; then
     if echo "%{
 enum octave_kw_id { a_kw };
@@ -585,7 +585,7 @@
 dnl
 dnl OCTAVE_PROG_MAKEINFO
 AC_DEFUN(OCTAVE_PROG_MAKEINFO, [
-  AC_CHECK_PROG(MAKEINFO, makeinfo)
+  AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, [])
   if test -z "$MAKEINFO"; then
     MAKEINFO='$(top_srcdir)/missing makeinfo'
     warn_makeinfo="I didn't find makeinfo, but it's only a problem if you need to reconstruct the Info version of the manual"
@@ -598,7 +598,7 @@
 dnl
 dnl OCTAVE_PROG_TEXI2DVI
 AC_DEFUN(OCTAVE_PROG_TEXI2DVI, [
-  AC_CHECK_PROG(TEXI2DVI, texi2dvi)
+  AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, [])
   if test -z "$TEXI2DVI"; then
     TEXI2DVI='$(top_srcdir)/missing texi2dvi'
     warn_texi2dvi="I didn't find texi2dvi, but it's only a problem if you need to reconstruct the DVI version of the manual"
@@ -612,7 +612,7 @@
 dnl OCTAVE_PROG_TEXI2PDF
 AC_DEFUN(OCTAVE_PROG_TEXI2PDF, [
   AC_REQUIRE([OCTAVE_PROG_TEXI2DVI])
-  AC_CHECK_PROG(TEXI2PDF, texi2pdf)
+  AC_CHECK_PROG(TEXI2PDF, texi2pdf, texi2pdf, [])
   if test -z "$TEXI2PDF"; then
     missing=true;
     if test -n "$TEXI2DVI"; then
@@ -883,7 +883,7 @@
 dnl
 dnl OCTAVE_PROG_PERL
 AC_DEFUN(OCTAVE_PROG_PERL,
-[AC_CHECK_PROG(PERL, perl)
+[AC_CHECK_PROG(PERL, perl, perl, [])
   AC_SUBST(PERL)
 ])
 dnl
@@ -891,7 +891,7 @@
 dnl
 dnl OCTAVE_PROG_PYTHON
 AC_DEFUN(OCTAVE_PROG_PYTHON,
-[AC_CHECK_PROG(PYTHON, python)
+[AC_CHECK_PROG(PYTHON, python, python, [])
   AC_SUBST(PYTHON)
 ])
 dnl
@@ -899,7 +899,7 @@
 dnl
 dnl OCTAVE_PROG_DESKTOP_FILE_INSTALL
 AC_DEFUN(OCTAVE_PROG_DESKTOP_FILE_INSTALL,
-[AC_CHECK_PROG(DESKTOP_FILE_INSTALL, desktop-file-install)
+[AC_CHECK_PROG(DESKTOP_FILE_INSTALL, desktop-file-install, desktop-file-install, [])
   AC_SUBST(DESKTOP_FILE_INSTALL)
 ])
 dnl
--- a/liboctave/ChangeLog	Fri Oct 27 23:19:17 2006 +0000
+++ b/liboctave/ChangeLog	Sat Oct 28 00:13:59 2006 +0000
@@ -1,10 +1,17 @@
 2006-10-27  John W. Eaton  <jwe@octave.org>
 
-	* oct-time.cc: Undefine min and max after including windows.h.
-	From Michael Goffioul  <michael.goffioul@swing.be>.
+	* oct-time.cc [! HAVE_STRFTIME]: Declare strftime.
+
+2006-10-26  Michael Goffioul  <michael.goffioul@swing.be>
+
+	* mx-op-defs.h (NDS_CMP_OP1, NDS_CMP_OPS1, NDS_CMP_OP2,
+	NDS_CMP_OPS2): New macros.
 
 2006-10-26  John W. Eaton  <jwe@octave.org>
 
+	* mx-ops (core-type): New field for integer types.
+	* mk-ops.awk: Handle core-type for integer comparison ops.
+
 	* lo-cutils.c (octave_strcasecmp, octave-strncasecmp):
 	Move here from src/cutils.c.
 	* lo-utils.h: Provide decls.
--- a/liboctave/mk-ops.awk	Fri Oct 27 23:19:17 2006 +0000
+++ b/liboctave/mk-ops.awk	Sat Oct 28 00:13:59 2006 +0000
@@ -26,8 +26,11 @@
     {
       ntypes++;
 
-      if (NF == 6)
+      if (NF == 6 || NF == 7)
         {
+	  if (NF == 7)
+	    core_type[ntypes] = $7;
+
           scalar_zero_val[ntypes] = $6;
           fwd_decl_ok[ntypes] = $5 == "YES";
           header[ntypes] = $4 == "NONE" ? "" : $4;
@@ -98,6 +101,9 @@
 	  lhs_type = type[lhs_num];
           rhs_type = type[rhs_num];
 
+	  lhs_core_type = core_type[lhs_num];
+	  rhs_core_type = core_type[rhs_num];
+
 	  result_scalar_zero_val = scalar_zero_val[result_num];
           lhs_scalar_zero_val = scalar_zero_val[lhs_num];
           rhs_scalar_zero_val = scalar_zero_val[rhs_num];
@@ -196,8 +202,38 @@
             }
 
           if (cmp_ops)
-            printf ("%s%s_CMP_OPS (%s, %s, %s, %s)\n", lhs_class, rhs_class,
-	            lhs_type, lhs_conv, rhs_type, rhs_conv) >> cc_file
+	    {
+	      if (lhs_class == "S" || rhs_class == "S")
+	        {
+		  if (lhs_core_type)
+		    {
+		      if (rhs_core_type)
+			printf ("%s%s_CMP_OPS2 (%s, %s, %s, %s, %s, %s)\n",
+				lhs_class, rhs_class, lhs_type, lhs_conv,
+				rhs_type, rhs_conv,
+				lhs_core_type, rhs_core_type) >> cc_file
+		      else
+			printf ("%s%s_CMP_OPS1 (%s, %s, %s, %s, %s)\n",
+				lhs_class, rhs_class, lhs_type, lhs_conv,
+				rhs_type, rhs_conv, lhs_core_type) >> cc_file
+		    }
+		  else
+		    {
+		      if (rhs_core_type)
+			printf ("%s%s_CMP_OPS1 (%s, %s, %s, %s, %s)\n",
+				lhs_class, rhs_class, lhs_type, lhs_conv,
+				rhs_type, rhs_conv, rhs_core_type) >> cc_file
+		      else
+			printf ("%s%s_CMP_OPS (%s, %s, %s, %s)\n",
+				lhs_class, rhs_class, lhs_type, lhs_conv,
+				rhs_type, rhs_conv) >> cc_file
+		    }
+		}
+	      else
+		printf ("%s%s_CMP_OPS (%s, %s, %s, %s)\n",
+			lhs_class, rhs_class, lhs_type, lhs_conv,
+			rhs_type, rhs_conv) >> cc_file
+	    }
 
           if (bool_ops)
             printf ("%s%s_BOOL_OPS2 (%s, %s, %s, %s)\n", lhs_class, rhs_class,
--- a/liboctave/mx-op-defs.h	Fri Oct 27 23:19:17 2006 +0000
+++ b/liboctave/mx-op-defs.h	Sat Oct 28 00:13:59 2006 +0000
@@ -541,6 +541,54 @@
   NDS_CMP_OP (mx_el_eq, ==, ND,    , S,   ) \
   NDS_CMP_OP (mx_el_ne, !=, ND,    , S,   )
 
+#define NDS_CMP_OP1(F, OP, ND, NDC, S, SC, SPEC) \
+  boolNDArray \
+  F (const ND& m, const S& s) \
+  { \
+    boolNDArray r; \
+ \
+    int len = m.length (); \
+ \
+    r.resize (m.dims ()); \
+ \
+    for (int i = 0; i < len; i++) \
+      r.elem(i) = operator OP <SPEC> (NDC (m.elem(i)), SC (s)); \
+ \
+    return r; \
+  }
+
+#define NDS_CMP_OPS1(ND, NDC, S, SC, SPEC) \
+  NDS_CMP_OP1 (mx_el_lt, <,  ND, NDC, S, SC, SPEC) \
+  NDS_CMP_OP1 (mx_el_le, <=, ND, NDC, S, SC, SPEC) \
+  NDS_CMP_OP1 (mx_el_ge, >=, ND, NDC, S, SC, SPEC) \
+  NDS_CMP_OP1 (mx_el_gt, >,  ND, NDC, S, SC, SPEC) \
+  NDS_CMP_OP1 (mx_el_eq, ==, ND,    , S,   , SPEC) \
+  NDS_CMP_OP1 (mx_el_ne, !=, ND,    , S,   , SPEC)
+
+#define NDS_CMP_OP2(F, OP, ND, NDC, S, SC, SPEC1, SPEC2) \
+  boolNDArray \
+  F (const ND& m, const S& s) \
+  { \
+    boolNDArray r; \
+ \
+    int len = m.length (); \
+ \
+    r.resize (m.dims ()); \
+ \
+    for (int i = 0; i < len; i++) \
+      r.elem(i) = operator OP <SPEC1,SPEC2> (NDC (m.elem(i)), SC (s)); \
+ \
+    return r; \
+  }
+
+#define NDS_CMP_OPS2(ND, NDC, S, SC, SPEC1, SPEC2) \
+  NDS_CMP_OP2 (mx_el_lt, <,  ND, NDC, S, SC, SPEC1, SPEC2) \
+  NDS_CMP_OP2 (mx_el_le, <=, ND, NDC, S, SC, SPEC1, SPEC2) \
+  NDS_CMP_OP2 (mx_el_ge, >=, ND, NDC, S, SC, SPEC1, SPEC2) \
+  NDS_CMP_OP2 (mx_el_gt, >,  ND, NDC, S, SC, SPEC1, SPEC2) \
+  NDS_CMP_OP2 (mx_el_eq, ==, ND,    , S,   , SPEC1, SPEC2) \
+  NDS_CMP_OP2 (mx_el_ne, !=, ND,    , S,   , SPEC1, SPEC2)
+
 #define NDS_BOOL_OP_DECLS(ND, S) \
   NDBOOL_OP_DECL (mx_el_and, ND, S); \
   NDBOOL_OP_DECL (mx_el_or,  ND, S);
@@ -636,6 +684,54 @@
   SND_CMP_OP (mx_el_eq, ==, S,   , ND,    ) \
   SND_CMP_OP (mx_el_ne, !=, S,   , ND,    )
 
+#define SND_CMP_OP1(F, OP, S, SC, ND, NDC, SPEC) \
+  boolNDArray \
+  F (const S& s, const ND& m) \
+  { \
+    boolNDArray r; \
+ \
+    int len = m.length (); \
+ \
+    r.resize (m.dims ()); \
+ \
+    for (int i = 0; i < len; i++) \
+      r.elem(i) = operator OP <SPEC> (SC (s), NDC (m.elem(i))); \
+ \
+    return r; \
+  }
+
+#define SND_CMP_OPS1(S, CS, ND, CND, SPEC) \
+  SND_CMP_OP1 (mx_el_lt, <,  S, CS, ND, CND, SPEC) \
+  SND_CMP_OP1 (mx_el_le, <=, S, CS, ND, CND, SPEC) \
+  SND_CMP_OP1 (mx_el_ge, >=, S, CS, ND, CND, SPEC) \
+  SND_CMP_OP1 (mx_el_gt, >,  S, CS, ND, CND, SPEC) \
+  SND_CMP_OP1 (mx_el_eq, ==, S,   , ND,    , SPEC) \
+  SND_CMP_OP1 (mx_el_ne, !=, S,   , ND,    , SPEC)
+
+#define SND_CMP_OP2(F, OP, S, SC, ND, NDC, SPEC1, SPEC2) \
+  boolNDArray \
+  F (const S& s, const ND& m) \
+  { \
+    boolNDArray r; \
+ \
+    int len = m.length (); \
+ \
+    r.resize (m.dims ()); \
+ \
+    for (int i = 0; i < len; i++) \
+      r.elem(i) = operator OP <SPEC1, SPEC2> (SC (s), NDC (m.elem(i))); \
+ \
+    return r; \
+  }
+
+#define SND_CMP_OPS2(S, CS, ND, CND, SPEC1, SPEC2) \
+  SND_CMP_OP2 (mx_el_lt, <,  S, CS, ND, CND, SPEC1, SPEC2) \
+  SND_CMP_OP2 (mx_el_le, <=, S, CS, ND, CND, SPEC1, SPEC2) \
+  SND_CMP_OP2 (mx_el_ge, >=, S, CS, ND, CND, SPEC1, SPEC2) \
+  SND_CMP_OP2 (mx_el_gt, >,  S, CS, ND, CND, SPEC1, SPEC2) \
+  SND_CMP_OP2 (mx_el_eq, ==, S,   , ND,    , SPEC1, SPEC2) \
+  SND_CMP_OP2 (mx_el_ne, !=, S,   , ND,    , SPEC1, SPEC2)
+
 #define SND_BOOL_OP_DECLS(S, ND) \
   NDBOOL_OP_DECL (mx_el_and, S, ND); \
   NDBOOL_OP_DECL (mx_el_or,  S, ND);
--- a/liboctave/mx-ops	Fri Oct 27 23:19:17 2006 +0000
+++ b/liboctave/mx-ops	Sat Oct 28 00:13:59 2006 +0000
@@ -1,6 +1,6 @@
 # types
 #
-# key typename object-type header fwd-decl-ok scalar-zero
+# key typename object-type header fwd-decl-ok scalar-zero core-type
 #
 # object-type is one of
 #
@@ -9,6 +9,9 @@
 #   DM: diagonal matrix
 #   ND: N-d array
 #
+# core-type is only used for the octave_int types, and is the template
+# parameter: octave_int8 is octave_int<int8_t>
+#
 x NONE NONE NONE NO 0
 b bool S NONE NO false
 bm boolMatrix ND boolMatrix.h YES false
@@ -21,22 +24,22 @@
 m Matrix M dMatrix.h YES 0.0
 nda NDArray ND dNDArray.h YES 0.0
 s double S NONE NO 0.0
-i8 octave_int8 S oct-inttypes.h YES octave_int8(0)
-ui8 octave_uint8 S oct-inttypes.h YES octave_uint8(0)
-i16 octave_int16 S oct-inttypes.h YES octave_int16(0)
-ui16 octave_uint16 S oct-inttypes.h YES octave_uint16(0)
-i32 octave_int32 S oct-inttypes.h YES octave_int32(0)
-ui32 octave_uint32 S oct-inttypes.h YES octave_uint32(0)
-i64 octave_int64 S oct-inttypes.h YES octave_int64(0)
-ui64 octave_uint64 S oct-inttypes.h YES octave_uint64(0)
-i8nda int8NDArray ND int8NDArray.h YES octave_int8(0)
-ui8nda uint8NDArray ND uint8NDArray.h YES octave_uint8(0)
-i16nda int16NDArray ND int16NDArray.h YES octave_int16(0)
-ui16nda uint16NDArray ND uint16NDArray.h YES octave_uint16(0)
-i32nda int32NDArray ND int32NDArray.h YES octave_int32(0)
-ui32nda uint32NDArray ND uint32NDArray.h YES octave_uint32(0)
-i64nda int64NDArray ND int64NDArray.h YES octave_int64(0)
-ui64nda uint64NDArray ND uint64NDArray.h YES octave_uint64(0)
+i8 octave_int8 S oct-inttypes.h YES octave_int8(0) int8_t
+ui8 octave_uint8 S oct-inttypes.h YES octave_uint8(0) uint8_t
+i16 octave_int16 S oct-inttypes.h YES octave_int16(0) int16_t
+ui16 octave_uint16 S oct-inttypes.h YES octave_uint16(0) uint16_t
+i32 octave_int32 S oct-inttypes.h YES octave_int32(0) int32_t
+ui32 octave_uint32 S oct-inttypes.h YES octave_uint32(0) uint32_t
+i64 octave_int64 S oct-inttypes.h YES octave_int64(0) int64_t
+ui64 octave_uint64 S oct-inttypes.h YES octave_uint64(0) uint64_t
+i8nda int8NDArray ND int8NDArray.h YES octave_int8(0) int8_t
+ui8nda uint8NDArray ND uint8NDArray.h YES octave_uint8(0) uint8_t
+i16nda int16NDArray ND int16NDArray.h YES octave_int16(0) int16_t
+ui16nda uint16NDArray ND uint16NDArray.h YES octave_uint16(0) uint16_t
+i32nda int32NDArray ND int32NDArray.h YES octave_int32(0) int32_t
+ui32nda uint32NDArray ND uint32NDArray.h YES octave_uint32(0) uint32_t
+i64nda int64NDArray ND int64NDArray.h YES octave_int64(0) int64_t
+ui64nda uint64NDArray ND uint64NDArray.h YES octave_uint64(0) uint64_t
 # ops
 # result_t lhs_t rhs_t op-type lhs_conv rhs_conv headers ...
 #
--- a/liboctave/oct-time.cc	Fri Oct 27 23:19:17 2006 +0000
+++ b/liboctave/oct-time.cc	Sat Oct 28 00:13:59 2006 +0000
@@ -45,6 +45,12 @@
 #include "lo-utils.h"
 #include "oct-time.h"
 
+#ifndef HAVE_STRFTIME
+// Override any previous definition and use local version.
+extern "C" size_t
+strftime (char *s, size_t maxsize, const char *format, const struct tm *tp);
+#endif
+
 octave_time::octave_time (const octave_base_tm& tm)
 {
   struct tm t;
--- a/src/ChangeLog	Fri Oct 27 23:19:17 2006 +0000
+++ b/src/ChangeLog	Sat Oct 28 00:13:59 2006 +0000
@@ -1,5 +1,9 @@
 2006-10-27  John W. Eaton  <jwe@octave.org>
 
+	* load-path.cc (load_path::do_initialize):
+	Use dir_path::path_sep_str instead of ":".
+	Don't append ":::" to xpath when calling do_set.
+
 	* dirfns.cc (Fls, cleanup_iprocstream): Delete.
 
 	* sysdep.cc (Ftilde_expand): If arg is cellstr, return cellstr.
--- a/src/load-path.cc	Fri Oct 27 23:19:17 2006 +0000
+++ b/src/load-path.cc	Sat Oct 28 00:13:59 2006 +0000
@@ -354,7 +354,7 @@
 void
 load_path::do_initialize (void)
 {
-  Vsystem_path = ":";
+  Vsystem_path = dir_path::path_sep_str;
 
   maybe_add_path_elts (Vsystem_path, Vlocal_ver_oct_file_dir);
   maybe_add_path_elts (Vsystem_path, Vlocal_api_oct_file_dir);
@@ -375,10 +375,10 @@
   if (! tpath.empty ())
     xpath += dir_path::path_sep_str + tpath;
 
-  if (Vsystem_path != ":")
+  if (Vsystem_path != dir_path::path_sep_str)
     xpath += Vsystem_path;
 
-  do_set (xpath + ":::", false);
+  do_set (xpath, false);
 }
 
 void