Mercurial > hg > octave-nkf
changeset 16072:ac672925fc98
Merge in Julien's changes
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Wed, 20 Feb 2013 11:36:36 -0500 |
parents | 94e95309710c (current diff) 0486a29d780f (diff) |
children | 1c8234f0b642 |
files | |
diffstat | 28 files changed, 370 insertions(+), 353 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgsubstate +++ b/.hgsubstate @@ -1,1 +1,1 @@ -fea72d94801364b1bde7cdf83237a49fe4db508a gnulib-hg +0eef0a2a05e22ac8ef2aad06dda200f7def83396 gnulib-hg
--- a/.hgtags +++ b/.hgtags @@ -72,3 +72,6 @@ df1aceb8f0bc6b5b5062907931cc663467f57d93 ss-3-7-1 858cbf6fc2ec1c232f5cf1d75dc344439b39a89c rc-3-6-4-1 faefa1bea8ddae3cab170afdeab68d3d15c4e623 ss-3-7-2 +0000000000000000000000000000000000000000 ss-3-7-2 +23a7661e529ae9bfc91693618f8c314c31f695ca ss-3-7-2 +cc5a7d1233f3acea85648baeb754fc0e8f225225 rc-3-6-4-2
--- a/build-aux/common.mk +++ b/build-aux/common.mk @@ -113,7 +113,7 @@ DEPEND_FLAGS = @DEPEND_FLAGS@ DEPEND_EXTRA_SED_PATTERN = @DEPEND_EXTRA_SED_PATTERN@ INCLUDE_DEPS = @INCLUDE_DEPS@ -# ifeq ($(INCLUDE_DEPS),false) +# ifeq ($(INCLUDE_DEPS),no) # omit_deps = true; # endif
--- a/configure.ac +++ b/configure.ac @@ -180,24 +180,24 @@ ### matrix classes. This slows down some operations a bit, so it is turned off ### by default. -BOUNDS_CHECKING=false +BOUNDS_CHECKING=no AC_ARG_ENABLE([bounds-check], [AS_HELP_STRING([--enable-bounds-check], [enable bounds checking for indexing in internal array classes])], - [if test "$enableval" = yes; then BOUNDS_CHECKING=true; fi], []) -if $BOUNDS_CHECKING; then + [if test "$enableval" = yes; then BOUNDS_CHECKING=yes; fi], []) +if test $BOUNDS_CHECKING = yes; then AC_DEFINE(BOUNDS_CHECKING, 1, [Define to 1 to use internal bounds checking.]) fi ### Use Octave's built-in memory allocator rather than straightforward malloc. ### Disabled by default. -USE_OCTAVE_ALLOCATOR=false +USE_OCTAVE_ALLOCATOR=no AC_ARG_ENABLE([octave-allocator], [AS_HELP_STRING([--enable-octave-allocator], [use the obsolete octave_allocator class for many of Octave's objects (mostly octave_value types). You probably do NOT want to enable this feature.])], - [if test "$enableval" = yes; then USE_OCTAVE_ALLOCATOR=true; fi], []) -if $USE_OCTAVE_ALLOCATOR; then + [if test "$enableval" = yes; then USE_OCTAVE_ALLOCATOR=yes; fi], []) +if test $USE_OCTAVE_ALLOCATOR = yes; then AC_DEFINE(USE_OCTAVE_ALLOCATOR, 1, [Define to 1 to use octave_allocator class.]) fi @@ -206,12 +206,12 @@ ### for thread-safe behavior but incurs a significant slowdown, and is thus ### disabled by default. -USE_ATOMIC_REFCOUNT=false +USE_ATOMIC_REFCOUNT=no AC_ARG_ENABLE([atomic-refcount], [AS_HELP_STRING([--enable-atomic-refcount], [use atomic operations for internal reference counting. This is required for thread-safe behavior but does not by itself make Octave internals thread safe.])], - [if test "$enableval" = yes; then USE_ATOMIC_REFCOUNT=true; fi], []) -if $USE_ATOMIC_REFCOUNT; then + [if test "$enableval" = yes; then USE_ATOMIC_REFCOUNT=yes; fi], []) +if test $USE_ATOMIC_REFCOUNT = yes; then AC_DEFINE(USE_ATOMIC_REFCOUNT, 1, [Define to 1 to use atomic operations for reference counting.]) fi @@ -232,13 +232,13 @@ ### If possible, use a 64-bit integer type for array dimensions and indexing. -USE_64_BIT_IDX_T=false +USE_64_BIT_IDX_T=no OCTAVE_IDX_TYPE=int AC_ARG_ENABLE(64, [AS_HELP_STRING([--enable-64], [(EXPERIMENTAL) use 64-bit integers for array dimensions and indexing])], - [if test "$enableval" = yes; then USE_64_BIT_IDX_T=true; fi], []) -if $USE_64_BIT_IDX_T; then + [if test "$enableval" = yes; then USE_64_BIT_IDX_T=yes; fi], []) +if test $USE_64_BIT_IDX_T = yes; then AC_CHECK_SIZEOF([void *]) AC_CHECK_SIZEOF([int]) AC_CHECK_SIZEOF([long]) @@ -251,18 +251,18 @@ else warn_64_bit="no suitable type found for octave_idx_type so disabling 64-bit features" OCTAVE_CONFIGURE_WARNING([warn_64_bit]) - USE_64_BIT_IDX_T=false + USE_64_BIT_IDX_T=no fi else warn_64_bit="pointers are not 64-bits wide; disabling 64-bit features" OCTAVE_CONFIGURE_WARNING([warn_64_bit]) - USE_64_BIT_IDX_T=false + USE_64_BIT_IDX_T=no fi fi AC_SUBST(OCTAVE_IDX_TYPE) AC_DEFINE_UNQUOTED(OCTAVE_IDX_TYPE, [$OCTAVE_IDX_TYPE], [Define to the type of octave_idx_type (64 or 32 bit signed integer).]) -if $USE_64_BIT_IDX_T; then +if test $USE_64_BIT_IDX_T = yes; then AC_DEFINE(USE_64_BIT_IDX_T, 1, [Define to 1 if using 64-bit integers for array dimensions and indexing.]) fi @@ -350,7 +350,7 @@ ### Determine the compiler flag necessary to create dependencies ## Assume GCC. -INCLUDE_DEPS=true +INCLUDE_DEPS=yes DEPEND_FLAGS="-M" DEPEND_EXTRA_SED_PATTERN="" if test "$GCC" != yes; then @@ -363,11 +363,11 @@ ;; *-*-mingw*) if test $have_msvc = no; then - INCLUDE_DEPS=false + INCLUDE_DEPS=no fi ;; *) - INCLUDE_DEPS=false + INCLUDE_DEPS=no ;; esac fi @@ -466,12 +466,12 @@ ### Test whether the compiler supports OpenMP. This is experimental so disable ### it by default. Enable it with the flag --enable-openmp. -USE_OPENMP=false +USE_OPENMP=no AC_ARG_ENABLE([openmp], [AS_HELP_STRING([--enable-openmp], [(EXPERIMENTAL) use OpenMP SMP multi-threading])], - [if test "$enableval" = yes; then USE_OPENMP=true; fi], []) -if $USE_OPENMP; then + [if test "$enableval" = yes; then USE_OPENMP=yes; fi], []) +if test $USE_OPENMP = yes; then case $host_os in mingw* | cygwin* | *-gnu*) OCTAVE_CHECK_OPENMP(-fopenmp) @@ -538,18 +538,18 @@ AC_F77_DUMMY_MAIN AC_F77_WRAPPERS -F77_TOLOWER=true -F77_APPEND_UNDERSCORE=true -F77_APPEND_EXTRA_UNDERSCORE=true +F77_TOLOWER=yes +F77_APPEND_UNDERSCORE=yes +F77_APPEND_EXTRA_UNDERSCORE=yes case $ac_cv_f77_mangling in - "upper case") F77_TOLOWER=false ;; + "upper case") F77_TOLOWER=no ;; esac case $ac_cv_f77_mangling in - "no underscore") F77_APPEND_UNDERSCORE=false ;; + "no underscore") F77_APPEND_UNDERSCORE=no ;; esac case $ac_cv_f77_mangling in - "no extra underscore") F77_APPEND_EXTRA_UNDERSCORE=false ;; + "no extra underscore") F77_APPEND_EXTRA_UNDERSCORE=no ;; esac case $canonical_host_type in @@ -593,7 +593,7 @@ OCTAVE_CHECK_SIZEOF_FORTRAN_INTEGER if test $octave_cv_sizeof_fortran_integer = no; then - if $USE_64_BIT_IDX_T; then + if test $USE_64_BIT_IDX_T = yes; then case $F77 in *gfortran*) case $F77_INTEGER_8_FLAG in @@ -703,12 +703,12 @@ ### Check for the LLVM library -build_jit=false +build_jit=no AC_ARG_ENABLE([jit], [AS_HELP_STRING([--enable-jit], [(EXPERIMENTAL) enable JIT compiler])], [if test "$enableval" = yes; then - build_jit=true + build_jit=yes fi], []) @@ -717,7 +717,7 @@ LLVM_LDFLAGS= LLVM_LIBS= -if test $build_jit = true; then +if test $build_jit = yes; then ## Find llvm-config program from environment variable or by searching AC_ARG_VAR([LLVM_CONFIG], [path to llvm-config utility]) @@ -763,7 +763,7 @@ if test -z "$warn_llvm"; then AC_DEFINE(HAVE_LLVM, 1, [Define to 1 if LLVM is available.]) else - build_jit=false + build_jit=no LLVM_CPPFLAGS= LLVM_CXXFLAGS= LLVM_LDFLAGS= @@ -816,16 +816,16 @@ ## Check for the multithreaded FFTW library. ## Fallback to singlethreaded if not found or disabled -build_fftw_threads=true +build_fftw_threads=yes AC_ARG_ENABLE([fftw-threads], [AS_HELP_STRING([--disable-fftw-threads], [disable Multi-threaded FFTW])], [if test "$enableval" = no; then - build_fftw_threads=false + build_fftw_threads=no fi], []) -if test $build_fftw_threads = true; then +if test $build_fftw_threads = yes; then OCTAVE_CHECK_FFTW_THREADS(fftw3, fftw_plan_with_nthreads) OCTAVE_CHECK_FFTW_THREADS(fftw3f, fftwf_plan_with_nthreads) fi @@ -977,24 +977,24 @@ ### Check for list of libraries needed for native graphics renderer. -native_graphics=true +native_graphics=yes warn_freetype="" -check_opengl=false +check_opengl=no AC_ARG_WITH([opengl], [AS_HELP_STRING([--without-opengl], [don't use OpenGL libraries, disable native graphics])], [if test x"$withval" = x"no"; then - native_graphics=false + native_graphics=no warn_opengl="--without-opengl specified. Native graphics will be disabled." OCTAVE_CONFIGURE_WARNING([warn_opengl]) else - check_opengl=true + check_opengl=yes fi], - [check_opengl=true]) + [check_opengl=yes]) ## Check for OpenGL library -if $check_opengl; then +if test $check_opengl = yes; then OCTAVE_CHECK_LIB_OPENGL fi @@ -1002,8 +1002,8 @@ GRAPHICS_CFLAGS= if test -z "$OPENGL_LIBS"; then - if $check_opengl; then - native_graphics=false + if test $check_opengl = yes; then + native_graphics=no warn_fltk_opengl="OpenGL libs (GL and GLU) not found. Native graphics will be disabled." OCTAVE_CONFIGURE_WARNING([warn_fltk_opengl]) fi @@ -1030,7 +1030,7 @@ if test -n "$warn_freetype"; then OCTAVE_CONFIGURE_WARNING([warn_freetype]) - native_graphics=false + native_graphics=no fi ## Check for fontconfig library @@ -1047,7 +1047,7 @@ fi if test -n "$warn_fontconfig"; then - native_graphics=false + native_graphics=no OCTAVE_CONFIGURE_WARNING([warn_fontconfig]) fi @@ -1085,7 +1085,7 @@ warn_fltk_opengl="" if test "$FLTK_CONFIG" = no; then - native_graphics=false + native_graphics=no warn_fltk_config="FLTK config script not found. Native graphics will be disabled." OCTAVE_CONFIGURE_WARNING([warn_fltk_config]) else @@ -1121,7 +1121,7 @@ GRAPHICS_CFLAGS="$FLTK_CFLAGS" GRAPHICS_LIBS="$FLTK_LDFLAGS" else - native_graphics=false + native_graphics=no OCTAVE_CONFIGURE_WARNING([warn_fltk_opengl]) fi fi @@ -1154,15 +1154,15 @@ LT_INIT([disable-static dlopen win32-dll]) if test x"$enable_shared" = x"yes"; then - SHARED_LIBS=true + SHARED_LIBS=yes else - SHARED_LIBS=false + SHARED_LIBS=no fi if test x"$enable_static" = x"yes"; then - STATIC_LIBS=true + STATIC_LIBS=yes else - STATIC_LIBS=false + STATIC_LIBS=no fi XTRA_CRUFT_SH_LDFLAGS= @@ -1244,7 +1244,7 @@ fi if test $ax_blas_f77_func_ok = no; then - if $USE_64_BIT_IDX_T && test $ax_blas_integer_size_ok = no; then + if test $USE_64_BIT_IDX_T = yes && test $ax_blas_integer_size_ok = no; then ## Attempt to be more informative. AC_MSG_ERROR([BLAS doesn't seem to support 64-bit integers. This is incompatible with --enable-64.]) else @@ -1432,13 +1432,13 @@ [AS_HELP_STRING([--disable-dl], [disable loading of dynamically linked modules])], [case $enableval in - yes) ENABLE_DYNAMIC_LINKING=true ;; - no) ENABLE_DYNAMIC_LINKING=false ;; + yes) ENABLE_DYNAMIC_LINKING=yes ;; + no) ENABLE_DYNAMIC_LINKING=no ;; *) AC_MSG_ERROR([bad value $enableval for --enable-dl]) ;; esac], - [ENABLE_DYNAMIC_LINKING=true]) - -if ! $STATIC_LIBS && ! $SHARED_LIBS; then + [ENABLE_DYNAMIC_LINKING=no]) + +if test $STATIC_LIBS = no && test $SHARED_LIBS = no; then AC_MSG_ERROR([You can't disable building both static AND shared libraries!]) fi @@ -1462,7 +1462,7 @@ DL_LDFLAGS='$(SH_LDFLAGS)' MKOCTFILE_DL_LDFLAGS='$(DL_LDFLAGS)' SONAME_FLAGS= -NO_OCT_FILE_STRIP=false +NO_OCT_FILE_STRIP=no TEMPLATE_AR='$(AR)' TEMPLATE_ARFLAGS="$ARFLAGS" CRUFT_DLL_DEFS= @@ -1472,7 +1472,7 @@ OCTGRAPHICS_DLL_DEFS= library_path_var=LD_LIBRARY_PATH ldpreloadsep=" " -BUILD_COMPILED_AUX_PROGRAMS=false +BUILD_COMPILED_AUX_PROGRAMS=no case $canonical_host_type in *-*-386bsd* | *-*-netbsd*) SH_LD=ld @@ -1505,7 +1505,7 @@ SHLLIB='$(SHLEXT)' SHLEXT_VER='$(version).$(SHLEXT)' SHLLIB_VER='$(version).$(SHLLIB)' - NO_OCT_FILE_STRIP=true + NO_OCT_FILE_STRIP=yes SONAME_FLAGS='-install_name $(octlibdir)/$@' library_path_var=DYLD_LIBRARY_PATH ;; @@ -1525,7 +1525,7 @@ ldpreloadsep=":" ;; *-*-mingw*) - BUILD_COMPILED_AUX_PROGRAMS=true + BUILD_COMPILED_AUX_PROGRAMS=yes if test $have_msvc = yes; then DL_LDFLAGS="-shared" CPICFLAG= @@ -1543,9 +1543,8 @@ DL_LDFLAGS="$DL_LDFLAGS -g" SH_LDFLAGS="$SH_LDFLAGS -g" fi - NO_OCT_FILE_STRIP=true + NO_OCT_FILE_STRIP=yes library_path_var=PATH - NO_OCT_FILE_STRIP=true ## Extra compilation flags. CRUFT_DLL_DEFS="-DCRUFT_DLL" OCTAVE_DLL_DEFS="-DOCTAVE_DLL" @@ -1567,7 +1566,7 @@ ;; *-*-msdosmsvc) - BUILD_COMPILED_AUX_PROGRAMS=true + BUILD_COMPILED_AUX_PROGRAMS=yes DL_LDFLAGS="-shared" CPICFLAG= CXXPICFLAG= @@ -1584,9 +1583,8 @@ DL_LDFLAGS="$DL_LDFLAGS -g" SH_LDFLAGS="$SH_LDFLAGS -g" fi - NO_OCT_FILE_STRIP=true + NO_OCT_FILE_STRIP=yes library_path_var=PATH - NO_OCT_FILE_STRIP=true ## Extra compilation flags. CRUFT_DLL_DEFS="-DCRUFT_DLL" OCTAVE_DLL_DEFS="-DOCTAVE_DLL" @@ -1666,7 +1664,7 @@ esac AM_CONDITIONAL([AMCOND_BUILD_COMPILED_AUX_PROGRAMS], - [test x$BUILD_COMPILED_AUX_PROGRAMS = xtrue]) + [test $BUILD_COMPILED_AUX_PROGRAMS = yes]) AC_MSG_NOTICE([defining FPICFLAG to be $FPICFLAG]) AC_MSG_NOTICE([defining CPICFLAG to be $CPICFLAG]) @@ -1745,13 +1743,13 @@ [AS_HELP_STRING([--enable-link-all-dependencies], [link Octave and its shared libraries with all dependencies, not just those immediately referenced (should not be needed on most systems)])], [case $enableval in - yes) link_all_deps=true ;; - no) link_all_deps=false ;; + yes) link_all_deps=yes ;; + no) link_all_deps=no ;; *) AC_MSG_ERROR([bad value $enableval for --enable-link-all-depenencies]) ;; esac], - [link_all_deps=false]) -AM_CONDITIONAL([AMCOND_LINK_ALL_DEPS], [test $link_all_deps = true]) + [link_all_deps=no]) +AM_CONDITIONAL([AMCOND_LINK_ALL_DEPS], [test $link_all_deps = yes]) ## Dynamic linking is now enabled only if we are building shared ## libs and some API for dynamic linking has been detected. @@ -1762,35 +1760,35 @@ LD_CXX='$(CXX)' RDYNAMIC_FLAG= DL_API_MSG="" -dlopen_api=false -shl_load_api=false -loadlibrary_api=false -dyld_api=false - -if $SHARED_LIBS || $ENABLE_DYNAMIC_LINKING; then +dlopen_api=no +shl_load_api=no +loadlibrary_api=no +dyld_api=no + +if test $SHARED_LIBS = yes || test $ENABLE_DYNAMIC_LINKING = yes; then case $lt_cv_dlopen in dlopen) - dlopen_api=true + dlopen_api=yes DL_API_MSG="(dlopen)" AC_DEFINE(HAVE_DLOPEN_API, 1, [Define to 1 if your system has dlopen, dlsym, dlerror, and dlclose for dynamic linking.]) OCTAVE_CXX_FLAG([-rdynamic], [RDYNAMIC_FLAG=-rdynamic]) ;; shl_load) - shl_load_api=true + shl_load_api=yes DL_API_MSG="(shl_load)" AC_DEFINE(HAVE_SHL_LOAD_API, 1, [Define to 1 if your system has shl_load and shl_findsym for dynamic linking.]) ;; LoadLibrary) - loadlibrary_api=true + loadlibrary_api=yes DL_API_MSG="(LoadLibrary)" AC_DEFINE(HAVE_LOADLIBRARY_API, 1, [Define to 1 if your system has LoadLibrary for dynamic linking.]) ;; dyld) - dyld_api=true + dyld_api=yes DL_API_MSG="(dyld)" AC_DEFINE(HAVE_DYLD_API, 1, [Define to 1 if your system has dyld for dynamic linking.]) @@ -1801,21 +1799,25 @@ AC_SUBST(DL_LIBS) ## Disable dynamic linking if capability is not present. - if $dlopen_api || $shl_load_api || $loadlibrary_api || $dyld_api; then - : # some form of dynamic linking present + if test $dlopen_api = yes \ + || test $shl_load_api = yes \ + || test $loadlibrary_api = yes \ + || test $dyld_api = yes; then + # some form of dynamic linking present + ENABLE_DYNAMIC_LINKING=yes else - ENABLE_DYNAMIC_LINKING=false + ENABLE_DYNAMIC_LINKING=no fi fi -if $ENABLE_DYNAMIC_LINKING; then +if test $ENABLE_DYNAMIC_LINKING = yes; then AC_DEFINE(ENABLE_DYNAMIC_LINKING, 1, [Define to 1 if using dynamic linking.]) fi AM_CONDITIONAL([AMCOND_ENABLE_DYNAMIC_LINKING], - [test x"$ENABLE_DYNAMIC_LINKING" = x"true"]) - -if $SHARED_LIBS; then + [test $ENABLE_DYNAMIC_LINKING = yes]) + +if test $SHARED_LIBS = yes; then LIBOCTINTERP="-loctinterp$SHLLINKEXT" LIBOCTAVE="-loctave$SHLLINKEXT" else @@ -2211,17 +2213,17 @@ GXX_EXTRA_FLAGS="-Wall -W -Wshadow -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual" -try_extra_warning_flags=true +try_extra_warning_flags=yes AC_ARG_ENABLE([extra-warning-flags], [AS_HELP_STRING([--disable-extra-warning-flags], [don't add -Wall, -W, -Wshadow, and -Wold-style-cast options to CFLAGS and CXXFLAGS])], [if test "$enableval" = no; then - try_extra_warning_flags=false + try_extra_warning_flags=no fi], []) -if $try_extra_warning_flags; then +if test $try_extra_warning_flags = yes; then for flag in $GCC_EXTRA_FLAGS; do OCTAVE_CC_FLAG([$flag], [ WARN_CFLAGS="$WARN_CFLAGS $flag"; @@ -2238,17 +2240,17 @@ GXX_STRICT_FLAGS="-Wconversion -Weffc++" -try_strict_warning_flags=false +try_strict_warning_flags=no AC_ARG_ENABLE([strict-warning-flags], [AS_HELP_STRING([--enable-strict-warning-flags], [add extra strict warning options to CFLAGS and CXXFLAGS])], [if test "$enableval" = yes; then - try_strict_warning_flags=true + try_strict_warning_flags=yes fi], []) -if $try_strict_warning_flags; then +if test $try_strict_warning_flags = yes; then for flag in $GCC_STRICT_FLAGS; do OCTAVE_CC_FLAG([$flag], [ WARN_CFLAGS="$WARN_CFLAGS $flag"; @@ -2266,12 +2268,12 @@ ### Check for Java. -build_java=true +build_java=yes AC_ARG_ENABLE([java], [AS_HELP_STRING([--disable-java], [disable Java interface])], [if test "$enableval" = no; then - build_java=false + build_java=no fi], []) @@ -2302,10 +2304,10 @@ JAVA_LIBS= ## Fake loop so that "break" can be used to skip code blocks. -while test $build_java = true +while test $build_java = yes do ## Unset build_java. Variable is set only if all configuration tests pass. - build_java=false + build_java=no ## Warn if JAVA_HOME is unset. It is *strongly* advised to specify JAVA_HOME. if test -z "$JAVA_HOME"; then @@ -2384,7 +2386,7 @@ ## the required paths to compile and link against JDK. case $host_os in msdosmsvc) - build_java=true + build_java=yes JAVA_LIBS=-ladvapi32 AC_DEFINE(HAVE_JAVA, 1, [Define to 1 if Java is available and is at least version 1.5]) @@ -2392,7 +2394,7 @@ ;; mingw*) if test $have_msvc = yes; then - build_java=true + build_java=yes JAVA_LIBS=-ladvapi32 AC_DEFINE(HAVE_JAVA, 1, [Define to 1 if Java is available and is at least version 1.5]) @@ -2509,11 +2511,11 @@ ## Verify jni.h include file exists. JNI_PATH=`echo $JAVA_CPPFLAGS | sed -e 's/-I//g'` - have_jni=false + have_jni=no for dir in $JNI_PATH; do - if test -f "${dir}/jni.h"; then have_jni=true; break; fi + if test -f "${dir}/jni.h"; then have_jni=yes; break; fi done - if test $have_jni = true; then + if test $have_jni = yes; then AC_MSG_RESULT([$dir]) else AC_MSG_RESULT([not found]) @@ -2522,13 +2524,13 @@ fi ## Passed all configuration tests. A workable Java installation was found. - build_java=true + build_java=yes AC_DEFINE(HAVE_JAVA, 1, [Define to 1 if Java is available and is at least version 1.5]) break done -AM_CONDITIONAL([AMCOND_HAVE_JAVA], [test $build_java = true]) +AM_CONDITIONAL([AMCOND_HAVE_JAVA], [test $build_java = yes]) AC_SUBST(JAVA) AC_SUBST(JAVAC) AC_SUBST(JAR) @@ -2982,15 +2984,15 @@ OCTAVE_CONFIGURE_WARNING_SUMMARY -if $ENABLE_DYNAMIC_LINKING; then - if test $SHARED_LIBS = false; then +if test $ENABLE_DYNAMIC_LINKING = yes; then + if test $SHARED_LIBS = no; then AC_MSG_WARN([You used --enable-dl but not --enable-shared.]) AC_MSG_WARN([Are you sure that is what you want to do?]) warn_msg_printed=true fi fi -if $USE_64_BIT_IDX_T; then +if test $USE_64_BIT_IDX_T = yes; then AC_MSG_WARN([]) AC_MSG_WARN([You used the EXPERIMENTAL --enable-64 option.]) AC_MSG_WARN([Are you sure that is what you want to do?]) @@ -3007,7 +3009,7 @@ warn_msg_printed=true fi -if $USE_OPENMP; then +if test $USE_OPENMP = yes; then AC_MSG_WARN([]) AC_MSG_WARN([You used the EXPERIMENTAL --enable-openmp option.]) AC_MSG_WARN([Are you sure that is what you want to do?]) @@ -3020,7 +3022,7 @@ warn_msg_printed=true fi -if test $native_graphics = false; then +if test $native_graphics != yes; then AC_MSG_WARN([]) AC_MSG_WARN([I didn't find the necessary libraries to compile native]) AC_MSG_WARN([graphics. It isn't necessary to have native graphics,]) @@ -3031,7 +3033,7 @@ fi if test -n "$warn_gnuplot"; then - if $native_graphics; then + if test $native_graphics = yes; then AC_MSG_WARN([]) AC_MSG_WARN([I didn't find gnuplot. Plotting commands will use the]) AC_MSG_WARN([native graphics toolkit.]) @@ -3055,7 +3057,7 @@ warn_msg_printed=true fi -if $USE_ATOMIC_REFCOUNT; then +if test $USE_ATOMIC_REFCOUNT = yes; then AC_MSG_WARN([]) AC_MSG_WARN([Using atomic reference counting.]) AC_MSG_WARN([This feature allows access to Octave data safely from]) @@ -3063,7 +3065,7 @@ AC_MSG_WARN([results in a small performance penalty in the Octave]) AC_MSG_WARN([interpreter.]) AC_MSG_WARN([]) - if $USE_OCTAVE_ALLOCATOR; then + if test $USE_OCTAVE_ALLOCATOR = yes; then AC_MSG_WARN([Thread-safe behavior is not guaranteed unless you also]) AC_MSG_WARN([disable the use of the octave_allocator class.]) AC_MSG_WARN([])
--- a/libgui/src/files-dockwidget.cc +++ b/libgui/src/files-dockwidget.cc @@ -36,7 +36,7 @@ #include <QHeaderView> files_dock_widget::files_dock_widget (QWidget *p) - : QDockWidget (p) + : octave_dock_widget (p) { setObjectName ("FilesDockWidget"); setWindowIcon (QIcon(":/actions/icons/logo.png")); @@ -114,11 +114,6 @@ completer = new QCompleter (_file_system_model, this); _current_directory->setCompleter (completer); - connect (this, SIGNAL (visibilityChanged (bool)), - this, SLOT (handle_visibility_changed (bool))); - // topLevelChanged is emitted when floating property changes (floating = true) - connect (this, SIGNAL (topLevelChanged(bool)), this, SLOT(top_level_changed(bool))); - setFocusProxy (_current_directory); } @@ -203,28 +198,3 @@ //if (settings.value ("showHiddenFiles").toBool ()) // TODO: React on option for hidden files. } - -void -files_dock_widget::handle_visibility_changed (bool visible) -{ - if (visible) - emit active_changed (true); -} - -void -files_dock_widget::closeEvent (QCloseEvent *e) -{ - emit active_changed (false); - QDockWidget::closeEvent (e); -} - -// slot for signal that is emitted when floating property changes -void -files_dock_widget::top_level_changed (bool floating) -{ - if(floating) - { - setWindowFlags(Qt::Window); // make a window from the widget when floating - show(); // make it visible again since setWindowFlags hides it - } -}
--- a/libgui/src/files-dockwidget.h +++ b/libgui/src/files-dockwidget.h @@ -35,14 +35,14 @@ #include <QAction> #include <QTreeView> -#include <QDockWidget> #include <QLineEdit> +#include "octave-dock-widget.h" /** \class files_dock_widget \brief Dock widget to display files in the current directory. */ -class files_dock_widget : public QDockWidget +class files_dock_widget : public octave_dock_widget { Q_OBJECT public: @@ -51,6 +51,7 @@ ~files_dock_widget (); public slots: + /** Slot for handling a change in directory via double click. */ void item_double_clicked (const QModelIndex & index); @@ -68,12 +69,6 @@ /** Tells the widget to react on changed settings. */ void notice_settings (); - /** Slot to steer changing visibility from outside. */ - void handle_visibility_changed (bool visible); - - /** Slot when floating property changes */ - void top_level_changed (bool floating); - signals: /** Emitted, whenever the user requested to open a file. */ void open_file (const QString& fileName); @@ -81,11 +76,7 @@ /** Emitted, whenever the currently displayed directory changed. */ void displayed_directory_changed (const QString& directory); - /** Custom signal that tells if a user has clicke away that dock widget. */ - void active_changed (bool active); - protected: - void closeEvent (QCloseEvent *event); private: // TODO: Add toolbar with buttons for navigating the path, creating dirs, etc
--- a/libgui/src/history-dockwidget.cc +++ b/libgui/src/history-dockwidget.cc @@ -37,7 +37,7 @@ #include "octave-link.h" history_dock_widget::history_dock_widget (QWidget * p) - : QDockWidget (p) + : octave_dock_widget (p) { setObjectName ("HistoryDockWidget"); construct (); @@ -71,26 +71,15 @@ widget ()->setLayout (vbox_layout); - connect (_filter_line_edit, - SIGNAL (textEdited (QString)), - &_sort_filter_proxy_model, - SLOT (setFilterWildcard (QString))); - - connect (_history_list_view, - SIGNAL (doubleClicked (QModelIndex)), - this, - SLOT (handle_double_click (QModelIndex))); + connect (_filter_line_edit, SIGNAL (textEdited (QString)), + &_sort_filter_proxy_model, SLOT (setFilterWildcard (QString))); - connect (this, - SIGNAL (visibilityChanged (bool)), - this, - SLOT (handle_visibility_changed (bool))); + connect (_history_list_view, SIGNAL (doubleClicked (QModelIndex)), + this, SLOT (handle_double_click (QModelIndex))); - // topLevelChanged is emitted when floating property changes (floating = true) - connect (this, SIGNAL (topLevelChanged(bool)), this, SLOT(top_level_changed(bool))); - - _update_history_model_timer.setInterval (200); - _update_history_model_timer.setSingleShot (true); + _update_event_enabled = true; + _update_history_model_timer.setInterval (500); + _update_history_model_timer.setSingleShot (false); connect (&_update_history_model_timer, SIGNAL (timeout ()), @@ -142,16 +131,13 @@ } void -history_dock_widget::handle_visibility_changed (bool visible) -{ - if (visible) - emit active_changed (true); -} - -void history_dock_widget::request_history_model_update () { - octave_link::post_event (this, &history_dock_widget::update_history_callback); + if (_update_event_enabled) + { + _update_event_enabled = false; // no more update until this one is processed + octave_link::post_event (this, &history_dock_widget::update_history_callback); + } } void @@ -161,24 +147,6 @@ } void -history_dock_widget::closeEvent (QCloseEvent *e) -{ - emit active_changed (false); - QDockWidget::closeEvent (e); -} - -// slot for signal that is emitted when floating property changes -void -history_dock_widget::top_level_changed (bool floating) -{ - if(floating) - { - setWindowFlags(Qt::Window); // make a window from the widget when floating - show(); // make it visible again since setWindowFlags hides it - } -} - -void history_dock_widget::update_history_callback (void) { static bool scroll_window = false; @@ -218,7 +186,7 @@ _history_list_view->scrollToBottom (); } - // Post a new update event in a given time. This prevents flooding the - // event queue. - _update_history_model_timer.start (); + // update is processed, re-enable further updates events triggered by timer + _update_event_enabled = true; + }
--- a/libgui/src/history-dockwidget.h +++ b/libgui/src/history-dockwidget.h @@ -23,25 +23,22 @@ #ifndef HISTORYDOCKWIDGET_H #define HISTORYDOCKWIDGET_H -#include <QDockWidget> #include <QLineEdit> #include <QListView> #include <QSortFilterProxyModel> #include <QStringListModel> #include <QTimer> +#include "octave-dock-widget.h" -class history_dock_widget : public QDockWidget +class history_dock_widget : public octave_dock_widget { Q_OBJECT public: history_dock_widget (QWidget *parent = 0); public slots: - void handle_visibility_changed (bool visible); void request_history_model_update (); void reset_model (); - /** Slot when floating property changes */ - void top_level_changed (bool floating); signals: void information (const QString& message); @@ -49,10 +46,8 @@ /** Emitted, whenever the user double-clicked a command in the history. */ void command_double_clicked (const QString& command); - /** Custom signal that tells if a user has clicked away that dock widget. */ - void active_changed (bool active); protected: - void closeEvent (QCloseEvent *event); + private slots: void handle_double_click (QModelIndex modelIndex); void handle_contextmenu_copy(bool flag); @@ -71,6 +66,7 @@ QTimer _update_history_model_timer; void update_history_callback (void); + bool _update_event_enabled; }; #endif // HISTORYDOCKWIDGET_H
--- a/libgui/src/m-editor/file-editor-interface.h +++ b/libgui/src/m-editor/file-editor-interface.h @@ -23,22 +23,19 @@ #ifndef FILEEDITORINTERFACE_H #define FILEEDITORINTERFACE_H -#include <QDockWidget> #include <QMenu> #include <QToolBar> +#include "octave-dock-widget.h" -class file_editor_interface : public QDockWidget +class file_editor_interface : public octave_dock_widget { Q_OBJECT public: file_editor_interface (QWidget *p) - : QDockWidget (p) + : octave_dock_widget (p) { setObjectName ("FileEditor"); - - connect (this, SIGNAL (visibilityChanged (bool)), this, - SLOT (handle_visibility_changed (bool))); } virtual ~file_editor_interface () { } @@ -56,22 +53,12 @@ virtual void request_open_file () = 0; virtual void request_open_file (const QString& fileName) = 0; -signals: - void active_changed (bool active); +//signals: -protected: - void closeEvent (QCloseEvent *e) - { - emit active_changed (false); - QDockWidget::closeEvent (e); - } +//protected: -protected slots: - void handle_visibility_changed (bool visible) - { - if (visible) - emit active_changed (true); - } +//protected slots: + }; #endif // FILEEDITORINTERFACE_H
--- a/libgui/src/m-editor/file-editor.cc +++ b/libgui/src/m-editor/file-editor.cc @@ -517,17 +517,6 @@ emit fetab_settings_changed (); } -// slot for signal that is emitted when floating property changes -void -file_editor::top_level_changed (bool floating) -{ - if(floating) - { - setWindowFlags(Qt::Window); // make a window from the widget when floating - show(); // make it visible again since setWindowFlag hides it - } -} - void file_editor::construct () { @@ -751,8 +740,6 @@ SIGNAL (tabCloseRequested (int)), this, SLOT (handle_tab_close_request (int))); connect (_tab_widget, SIGNAL (currentChanged(int)), this, SLOT (active_tab_changed (int))); - // topLevelChanged is emitted when floating property changes (floating = true) - connect (this, SIGNAL (topLevelChanged(bool)), this, SLOT(top_level_changed(bool))); resize (500, 400); setWindowIcon (QIcon(":/actions/icons/logo.png"));
--- a/libgui/src/m-editor/file-editor.h +++ b/libgui/src/m-editor/file-editor.h @@ -123,9 +123,6 @@ void handle_mru_add_file (const QString& file_name); void check_conflict_save (const QString& fileName, bool remove_on_success); - /** Slot when floating property changes */ - void top_level_changed (bool floating); - /** Tells the editor to react on changed settings. */ void notice_settings ();
--- a/libgui/src/module.mk +++ b/libgui/src/module.mk @@ -73,7 +73,8 @@ src/moc-workspace-view.cc \ src/octave-adapter/moc-octave-main-thread.cc \ src/qtinfo/moc-parser.cc \ - src/qtinfo/moc-webinfo.cc + src/qtinfo/moc-webinfo.cc \ + src/moc-octave-dock-widget.cc octave_gui_RC = src/qrc-resource.cc @@ -86,6 +87,7 @@ BUILT_SOURCES += $(octave_gui_UI_H) noinst_HEADERS += \ + src/octave-dock-widget.h \ src/documentation-dockwidget.h \ src/files-dockwidget.h \ src/history-dockwidget.h \
new file mode 100644 --- /dev/null +++ b/libgui/src/octave-dock-widget.h @@ -0,0 +1,81 @@ +/* + +Copyright (C) 2012-2013 Richard Crozier + +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 3 of the License, 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, see +<http://www.gnu.org/licenses/>. + +*/ + +#ifndef OCTAVEDOCKWIDGET_H +#define OCTAVEDOCKWIDGET_H + +#include <QDockWidget> +//#include <QMenu> +//#include <QToolBar> + +class octave_dock_widget : public QDockWidget +{ + Q_OBJECT + + public: + octave_dock_widget (QWidget *p) + : QDockWidget (p) + { + connect (this, SIGNAL (visibilityChanged (bool)), + this, SLOT (handle_visibility_changed (bool))); + + connect (this, SIGNAL (topLevelChanged(bool)), + this, SLOT(top_level_changed(bool))); + } + + virtual ~octave_dock_widget () { } + +signals: + /** Custom signal that tells if a user has clicked away + * that dock widget, i.e the active dock widget has + * changed. */ + virtual void active_changed (bool active); + +protected: + virtual void closeEvent (QCloseEvent *e) + { + emit active_changed (false); + QDockWidget::closeEvent (e); + } + +protected slots: + + /** Slot to steer changing visibility from outside. */ + virtual void handle_visibility_changed (bool visible) + { + if (visible) + emit active_changed (true); + } + + /** Slot when floating property changes */ + virtual void top_level_changed (bool floating) + { + if(floating) + { + setWindowFlags(Qt::Window); // make a window from the widget when floating + show(); // make it visible again since setWindowFlags hides it + } + } + +}; + +#endif // OCTAVEDOCKWIDGET_H
--- a/libgui/src/terminal-dockwidget.cc +++ b/libgui/src/terminal-dockwidget.cc @@ -27,7 +27,7 @@ #include "terminal-dockwidget.h" terminal_dock_widget::terminal_dock_widget (QTerminal *terminal, QWidget *p) - : QDockWidget (p) + : octave_dock_widget (p) { setObjectName ("TerminalDockWidget"); setWindowIcon (QIcon(":/actions/icons/logo.png")); @@ -39,27 +39,3 @@ connect (this, SIGNAL (topLevelChanged(bool)), this, SLOT(top_level_changed(bool))); } -void -terminal_dock_widget::closeEvent (QCloseEvent *e) -{ - emit active_changed (false); - QDockWidget::closeEvent (e); -} - -void -terminal_dock_widget::handle_visibility_changed (bool visible) -{ - if (visible) - emit active_changed (true); -} - -// slot for signal that is emitted when floating property changes -void -terminal_dock_widget::top_level_changed (bool floating) -{ - if(floating) - { - setWindowFlags(Qt::Window); // make a window from the widget when floating - show(); // make it visible again since setWindowFlags hides it - } -}
--- a/libgui/src/terminal-dockwidget.h +++ b/libgui/src/terminal-dockwidget.h @@ -23,25 +23,21 @@ #ifndef TERMINALDOCKWIDGET_H #define TERMINALDOCKWIDGET_H -#include <QDockWidget> #include "QTerminal.h" +#include "octave-dock-widget.h" -class terminal_dock_widget : public QDockWidget +class terminal_dock_widget : public octave_dock_widget { Q_OBJECT public: terminal_dock_widget (QTerminal *terminal, QWidget *parent = 0); signals: - void active_changed (bool active); public slots: - void handle_visibility_changed (bool visible); - /** Slot when floating property changes */ - void top_level_changed (bool floating); protected: - void closeEvent (QCloseEvent *event); + };
--- a/libgui/src/workspace-model.cc +++ b/libgui/src/workspace-model.cc @@ -1,3 +1,4 @@ + /* Copyright (C) 2011-2012 Jacob Dawid @@ -51,8 +52,9 @@ this, SLOT (request_update_workspace())); + _update_event_enabled = true; _update_workspace_model_timer.setInterval (500); - _update_workspace_model_timer.setSingleShot (true); + _update_workspace_model_timer.setSingleShot (false); _update_workspace_model_timer.start (); } @@ -64,7 +66,11 @@ void workspace_model::request_update_workspace () { - octave_link::post_event (this, &workspace_model::update_workspace_callback); + if (_update_event_enabled) + { + _update_event_enabled = false; // no more update until this one is processed + octave_link::post_event (this, &workspace_model::update_workspace_callback); + } } QModelIndex @@ -222,8 +228,7 @@ endResetModel(); emit model_changed(); - // Post a new event in a given time. - // This prevents flooding the event queue when no events are being processed. - _update_workspace_model_timer.start (); + // update is processed, re-enable further updates events triggered by timer + _update_event_enabled = true; + } -
--- a/libgui/src/workspace-model.h +++ b/libgui/src/workspace-model.h @@ -140,6 +140,8 @@ private: + bool _update_event_enabled; + void update_workspace_callback (void); /** Timer for periodically updating the workspace model from the current
--- a/libinterp/Makefile.am +++ b/libinterp/Makefile.am @@ -356,7 +356,9 @@ DOCSTRINGS \ $(BUILT_NODISTFILES) \ $(OCT_FILES) \ - $(OCT_STAMP_FILES) + $(OCT_STAMP_FILES) \ + $(TST_FILES) MAINTAINERCLEANFILES = \ $(BUILT_DISTFILES) +
--- a/libinterp/interpfcn/input.cc +++ b/libinterp/interpfcn/input.cc @@ -843,8 +843,8 @@ DEFUN (input, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} input (@var{prompt})\n\ -@deftypefnx {Built-in Function} {} input (@var{prompt}, \"s\")\n\ +@deftypefn {Built-in Function} {@var{ans} =} input (@var{prompt})\n\ +@deftypefnx {Built-in Function} {@var{ans} =} input (@var{prompt}, \"s\")\n\ Print a prompt and wait for user input. For example,\n\ \n\ @example\n\ @@ -874,7 +874,8 @@ Because there may be output waiting to be displayed by the pager, it is\n\ a good idea to always call @code{fflush (stdout)} before calling\n\ @code{input}. This will ensure that all pending output is written to\n\ -the screen before your prompt. @xref{Input and Output}.\n\ +the screen before your prompt.\n\ +@seealso{yes_or_no, kbhit}\n\ @end deftypefn") { octave_value_list retval; @@ -909,12 +910,14 @@ DEFUN (yes_or_no, args, , "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} yes_or_no (@var{prompt})\n\ -Ask the user a yes-or-no question. Return 1 if the answer is yes.\n\ -Takes one argument, which is the string to display to ask the\n\ -question. It should end in a space; @samp{yes-or-no-p} adds\n\ -@samp{(yes or no) } to it. The user must confirm the answer with\n\ -RET and can edit it until it has been confirmed.\n\ +@deftypefn {Built-in Function} {@var{ans} =} yes_or_no (\"@var{prompt}\")\n\ +Ask the user a yes-or-no question. Return logical true if the answer is yes\n\ +or false if the answer is no. Takes one argument, @var{prompt}, which is\n\ +the string to display when asking the question. @var{prompt} should end in\n\ +a space; @code{yes-or-no} adds the string @samp{(yes or no) } to it. The\n\ +user must confirm the answer with @key{RET} and can edit it until it has\n\ +been confirmed.\n\ +@seealso{input}\n\ @end deftypefn") { octave_value retval; @@ -986,7 +989,7 @@ DEFUN (keyboard, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} keyboard ()\n\ -@deftypefnx {Built-in Function} {} keyboard (@var{prompt})\n\ +@deftypefnx {Built-in Function} {} keyboard (\"@var{prompt}\")\n\ This function is normally used for simple debugging. When the\n\ @code{keyboard} function is executed, Octave prints a prompt and waits\n\ for user input. The input strings are then evaluated and the results\n\
--- a/libinterp/interpfcn/oct-hist.cc +++ b/libinterp/interpfcn/oct-hist.cc @@ -377,7 +377,9 @@ int hist_count = hlist.length () - 1; // switch to zero-based indexing // The current command line is already part of the history list by - // the time we get to this point. Delete it from the list. + // the time we get to this point. Delete the cmd from the list when + // executing 'edit_history' so that it doesn't show up in the history + // but the actual commands performed will. if (! insert_curr) command_history::remove (hist_count); @@ -521,13 +523,15 @@ continue; } - if (first) - { - first = 0; - edit_history_repl_hist (line); - } - else - edit_history_add_hist (line); + // Command 'edit history' has already been removed in + // mk_tmp_hist_file () + //if (first) + // { + // first = 0; + // edit_history_repl_hist (line); + // } + //else + edit_history_add_hist (line); delete [] line; } @@ -638,27 +642,30 @@ DEFUN (history, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Command} history options\n\ -@deftypefnx {Built-in Function} {@var{h} = } history (@var{opt1}, @var{opt2}, @dots{})\n\ +@deftypefn {Command} {} history\n\ +@deftypefnx {Command} {} history @var{opt1} @dots{}\n\ +@deftypefnx {Built-in Function} {@var{h} =} history ()\n\ +@deftypefnx {Built-in Function} {@var{h} =} history (@var{opt1}, @dots{})\n\ If invoked with no arguments, @code{history} displays a list of commands\n\ that you have executed. Valid options are:\n\ \n\ @table @code\n\ -@item -w @var{file}\n\ -Write the current history to the file @var{file}. If the name is\n\ -omitted, use the default history file (normally @file{~/.octave_hist}).\n\ +@item @var{n}\n\ +@itemx -@var{n}\n\ +Display only the most recent @var{n} lines of history.\n\ +\n\ +@item -q\n\ +Don't number the displayed lines of history. This is useful for cutting\n\ +and pasting commands using the X Window System.\n\ \n\ @item -r @var{file}\n\ Read the file @var{file}, appending its contents to the current\n\ history list. If the name is omitted, use the default history file\n\ (normally @file{~/.octave_hist}).\n\ \n\ -@item @var{n}\n\ -Display only the most recent @var{n} lines of history.\n\ -\n\ -@item -q\n\ -Don't number the displayed lines of history. This is useful for cutting\n\ -and pasting commands using the X Window System.\n\ +@item -w @var{file}\n\ +Write the current history to the file @var{file}. If the name is\n\ +omitted, use the default history file (normally @file{~/.octave_hist}).\n\ @end table\n\ \n\ For example, to display the five most recent commands that you have\n\
--- a/libinterp/interpfcn/sysdep.cc +++ b/libinterp/interpfcn/sysdep.cc @@ -619,8 +619,9 @@ DEFUN (kbhit, args, , "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} kbhit ()\n\ -Read a single keystroke from the keyboard. If called with one\n\ +@deftypefn {Built-in Function} {} kbhit ()\n\ +@deftypefnx {Built-in Function} {} kbhit (1)\n\ +Read a single keystroke from the keyboard. If called with an\n\ argument, don't wait for a keypress. For example,\n\ \n\ @example\n\ @@ -636,8 +637,9 @@ @end example\n\ \n\ @noindent\n\ -identical to the above example, but don't wait for a keypress,\n\ +is identical to the above example, but doesn't wait for a keypress,\n\ returning the empty string if no key is available.\n\ +@seealso{input}\n\ @end deftypefn") { octave_value retval;
--- a/liboctave/Makefile.am +++ b/liboctave/Makefile.am @@ -135,5 +135,7 @@ nobase_liboctavetests_DATA = $(TST_FILES) -DISTCLEANFILES += $(BUILT_INCS) +DISTCLEANFILES += \ + $(BUILT_INCS) \ + $(TST_FILES)
--- a/liboctave/cruft/mkf77def.in +++ b/liboctave/cruft/mkf77def.in @@ -25,19 +25,19 @@ F77_APPEND_UNDERSCORE="@F77_APPEND_UNDERSCORE@" F77_APPEND_EXTRA_UNDERSCORE="@F77_APPEND_EXTRA_UNDERSCORE@" -if $F77_TOLOWER; then +if test x$F77_TOLOWER = xyes; then case_cmd="tolower"; else case_cmd="toupper"; fi -if $F77_APPEND_UNDERSCORE; then +if test x$F77_APPEND_UNDERSCORE = xyes; then uscore="_"; else uscore=""; fi -if $F77_APPEND_EXTRA_UNDERSCORE; then +if test x$F77_APPEND_EXTRA_UNDERSCORE = xyes; then awkcmd="$AWK '{ if (\$0 ~ /_/) extra = \"_\"; else extra = \"\"; printf (\"%s%s%s\n\", $case_cmd (\$0), \"$uscore\", extra); }'" else awkcmd="$AWK '{ printf (\"%s%s\n\", tolower (\$0), \"$uscore\"); }'"
--- a/m4/acinclude.m4 +++ b/m4/acinclude.m4 @@ -370,10 +370,10 @@ LDFLAGS="$m4_toupper([$1])_LDFLAGS $LDFLAGS" LIBS="$m4_toupper([$1])_LIBS $LIBS" m4_ifnblank([$6], [AC_LANG_PUSH($6)]) - ac_octave_$1_check_for_lib=false - m4_ifblank([$4], [ac_octave_$1_check_for_lib=true], - [AC_CHECK_HEADERS([$4], [ac_octave_$1_check_for_lib=true; break])]) - if $ac_octave_$1_check_for_lib; then + ac_octave_$1_check_for_lib=no + m4_ifblank([$4], [ac_octave_$1_check_for_lib=yes], + [AC_CHECK_HEADERS([$4], [ac_octave_$1_check_for_lib=yes; break])]) + if test $ac_octave_$1_check_for_lib = yes; then AC_CACHE_CHECK([for $5 in $m4_toupper([$1])_LIBS], [octave_cv_lib_$1], [AC_LINK_IFELSE([AC_LANG_CALL([], [$5])], @@ -1159,16 +1159,16 @@ dnl readline. dnl AC_DEFUN([OCTAVE_ENABLE_READLINE], [ - USE_READLINE=true + USE_READLINE=yes READLINE_LIBS= AC_ARG_ENABLE([readline], [AS_HELP_STRING([--disable-readline], [use readline library])], [if test "$enableval" = no; then - USE_READLINE=false + USE_READLINE=no warn_readline="command editing and history features require GNU Readline" fi]) - if $USE_READLINE; then + if test $USE_READLINE = yes; then dnl RHEL 5 and older systems require termlib set before enabling readline AC_REQUIRE([OCTAVE_CHECK_LIB_TERMLIB]) ac_octave_save_LIBS="$LIBS" @@ -1672,15 +1672,15 @@ AC_REQUIRE([OCTAVE_PROG_TEXI2DVI]) AC_CHECK_PROG(TEXI2PDF, texi2pdf, texi2pdf, []) if test -z "$TEXI2PDF"; then - ac_octave_missing=true; + ac_octave_texi2pdf_missing=yes; if test -n "$TEXI2DVI"; then TEXI2PDF="$TEXI2DVI --pdf" - ac_octave_missing=false; + ac_octave_texi2pdf_missing=no; fi else - ac_octave_missing=false; + ac_octave_texi2pdf_missing=no; fi - if $ac_octave_missing; then + if test $ac_octave_texi2pdf_missing = yes; then TEXI2PDF='$(top_srcdir)/build-aux/missing texi2pdf' warn_texi2pdf="
--- a/run-octave.in +++ b/run-octave.in @@ -63,7 +63,7 @@ shift elif [ "x$1" = "x-gud2" ]; then ## The latest version of gud needs -i=mi. There isn't a good way to check - ## this at configure time, so we just add a gdb2 flag + ## this at configure time, so we just add a gud2 flag driver="gdb -i=mi --args" shift elif [ "x$1" = "x-valgrind" ]; then
--- a/scripts/io/textread.m +++ b/scripts/io/textread.m @@ -1,4 +1,4 @@ -## Copyright (C) 2009-2012 Eric Chassande-Mottin, CNRS (France) +## Copyright (C) 2009-2013 Eric Chassande-Mottin, CNRS (France) ## ## This file is part of Octave. ## @@ -79,10 +79,22 @@ ## Skip header lines if requested headerlines = find (strcmpi (varargin, "headerlines"), 1); - ## Beware of zero valued headerline, fskipl would skip to EOF - if (! isempty (headerlines) && (varargin{headerlines + 1} > 0)) - fskipl (fid, varargin{headerlines + 1}); - varargin(headerlines:headerlines+1) = []; + if (! isempty (headerlines)) + ## Beware of missing or wrong headerline value + if (headerlines == numel (varargin) + || ! isnumeric (varargin{headerlines + 1})) + error ("missing or illegal value for 'headerlines'" ); + endif + ## Avoid conveying floats to fskipl + varargin{headerlines + 1} = round (varargin{headerlines + 1}); + ## Beware of zero valued headerline, fskipl would skip to EOF + if (varargin{headerlines + 1} > 0) + fskipl (fid, varargin{headerlines + 1}); + varargin(headerlines:headerlines+1) = []; + nargin = nargin - 2; + elseif (varargin{headerlines + 1} < 0) + warning ("textread: negative headerline value ignored"); + endif endif st_pos = ftell (fid); @@ -98,7 +110,7 @@ if (! isempty (endofline)) ## 'endofline' option set by user. if (! ischar (varargin{endofline + 1})); - error ("textread: character value required for EndOfLine"); + error ("character value required for EndOfLine"); endif else ## Determine EOL from file. Search for EOL candidates in first BUFLENGTH chars @@ -188,4 +200,6 @@ %!error textread (1) %!error <arguments must be strings> textread (1, "%f") %!error <arguments must be strings> textread ("fname", 1) - +%!error <missing or illegal value for> textread (file_in_loadpath ("textread.m"), "", "headerlines") +%!error <missing or illegal value for> textread (file_in_loadpath ("textread.m"), "", "headerlines", 'hh') +%!error <character value required for> textread (file_in_loadpath ("textread.m"), "%s", "endofline", true)
--- a/scripts/io/textscan.m +++ b/scripts/io/textscan.m @@ -1,4 +1,4 @@ -## Copyright (C) 2010-2012 Ben Abbott <bpabbott@mac.com> +## Copyright (C) 2010-2013 Ben Abbott <bpabbott@mac.com> ## ## This file is part of Octave. ## @@ -167,14 +167,23 @@ st_pos = ftell (fid); ## Skip header lines if requested headerlines = find (strcmpi (args, "headerlines"), 1); - ## Beware of zero valued headerline, fskipl would skip to EOF - if (! isempty (headerlines) && (args{headerlines + 1} > 0)) - fskipl (fid, args{headerlines + 1}); - args(headerlines:headerlines+1) = []; - st_pos = ftell (fid); + if (! isempty (headerlines)) + ## Beware of missing or wrong headerline value + if (headerlines == numel (args) + || ! isnumeric (args{headerlines + 1})) + error ("Missing or illegal value for 'headerlines'" ); + endif + ## Avoid conveying floats to fskipl + args{headerlines + 1} = round (args{headerlines + 1}); + if (args{headerlines + 1} > 0) + ## Beware of zero valued headerline, fskipl would skip to EOF + fskipl (fid, args{headerlines + 1}); + args(headerlines:headerlines+1) = []; + st_pos = ftell (fid); + elseif (args{headerlines + 1} < 0) + warning ("textscan.m: negative headerline value ignored"); + endif endif - ## Read a first file chunk. Rest follows after endofline processing - [str, count] = fscanf (fid, "%c", BUFLENGTH); endif ## Check for empty result @@ -497,3 +506,7 @@ %! rh = strtrim (rh); %! assert (strcmp (lh, rh)); %! end + +%!error <missing or illegal value for> textread (file_in_loadpath ("textscan.m"), "", "headerlines") +%!error <missing or illegal value for> textread (file_in_loadpath ("textscan.m"), "", "headerlines", 'hh') +%!error <character value required for> textread (file_in_loadpath ("textscan.m"), "", "endofline", true)
--- a/scripts/statistics/distributions/binopdf.m +++ b/scripts/statistics/distributions/binopdf.m @@ -64,6 +64,12 @@ + x(k).*log (p(k)) + (n(k)-x(k)).*log (1-p(k))); endif + ## Special case inputs + ksp = k & (p == 0) & (x == 0); + pdf(ksp) = 1; + ksp = k & (p == 1) & (x == n); + pdf(ksp) = 1; + endfunction @@ -82,6 +88,11 @@ %!assert (binopdf (x, 2, 0.5*[0 -1 NaN 3 1]), [0 NaN NaN NaN 0]) %!assert (binopdf ([x, NaN], 2, 0.5), [y, NaN], tol) +## Test Special input values +%!assert (binopdf (0, 3, 0), 1); +%!assert (binopdf (2, 2, 1), 1); +%!assert (binopdf (1, 2, 1), 0); + %% Test class of input preserved %!assert (binopdf (single ([x, NaN]), 2, 0.5), single ([y, NaN])) %!assert (binopdf ([x, NaN], single (2), 0.5), single ([y, NaN]))