changeset 26419:2d7615a07002

maint: merge stable to default.
author Rik <rik@octave.org>
date Thu, 03 Jan 2019 17:25:36 -0800
parents c3c9b9dc5cf6 (current diff) 7bdeaa38f2b8 (diff)
children 31d5eb44368a db5c5e6c2371
files libinterp/corefcn/graphics.cc libinterp/octave-value/ov-bool.cc libinterp/octave-value/ov-struct.cc
diffstat 16 files changed, 260 insertions(+), 221 deletions(-) [+]
line wrap: on
line diff
--- a/bootstrap	Thu Jan 03 13:25:06 2019 -0500
+++ b/bootstrap	Thu Jan 03 17:25:36 2019 -0800
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Print a version string.
-scriptversion=2018-03-30.12; # UTC
+scriptversion=2018-10-13.05; # UTC
 
 # Bootstrap this package from checked-out sources.
 
-# Copyright (C) 2003-2016 Free Software Foundation, Inc.
+# Copyright (C) 2003-2018 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -32,7 +32,7 @@
 nl='
 '
 
-# Ensure filenames are sorted consistently across platforms.
+# Ensure file names are sorted consistently across platforms.
 LC_ALL=C
 export LC_ALL
 
@@ -42,11 +42,13 @@
 
 local_gl_dir=gl
 
-# Honour $PERL, but work even if there is none
+# Honor $PERL, but work even if there is none.
 PERL="${PERL-perl}"
 
 me=$0
 
+default_gnulib_url=git://git.sv.gnu.org/gnulib
+
 usage() {
   cat <<EOF
 Usage: $me [OPTION]...
@@ -76,6 +78,37 @@
 For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR
 are honored.
 
+Gnulib sources can be fetched in various ways:
+
+ * If this package is in a git repository with a 'gnulib' submodule
+   configured, then that submodule is initialized and updated and sources
+   are fetched from there.  If \$GNULIB_SRCDIR is set (directly or via
+   --gnulib-srcdir) and is a git repository, then it is used as a reference.
+
+ * Otherwise, if \$GNULIB_SRCDIR is set (directly or via --gnulib-srcdir),
+   then sources are fetched from that local directory.  If it is a git
+   repository and \$GNULIB_REVISION is set, then that revision is checked
+   out.
+
+ * Otherwise, if this package is in a git repository with a 'gnulib'
+   submodule configured, then that submodule is initialized and updated and
+   sources are fetched from there.
+
+ * Otherwise, if the 'gnulib' directory does not exist, Gnulib sources are
+   cloned into that directory using git from \$GNULIB_URL, defaulting to
+   $default_gnulib_url.
+   If \$GNULIB_REVISION is set, then that revision is checked out.
+
+ * Otherwise, the existing Gnulib sources in the 'gnulib' directory are
+   used.  If it is a git repository and \$GNULIB_REVISION is set, then that
+   revision is checked out.
+
+If you maintain a package and want to pin a particular revision of the
+Gnulib sources that has been tested with your package, then there are two
+possible approaches: either configure a 'gnulib' submodule with the
+appropriate revision, or set \$GNULIB_REVISION (and if necessary
+\$GNULIB_URL) in $me.conf.
+
 Running without arguments will suffice in most cases.
 EOF
 }
@@ -129,19 +162,12 @@
 # Override it via your own definition in bootstrap.conf.
 bootstrap_epilogue() { :; }
 
-# The command to download all .po files for a specified domain into
-# a specified directory.  Fill in the first %s is the domain name, and
-# the second with the destination directory.  Use rsync's -L and -r
-# options because the latest/%s directory and the .po files within are
-# all symlinks.
+# The command to download all .po files for a specified domain into a
+# specified directory.  Fill in the first %s with the destination
+# directory and the second with the domain name.
 po_download_command_format=\
-"rsync --delete --exclude '*.s1' -Lrtvz \
- 'translationproject.org::tp/latest/%s/' '%s'"
-
-# Fallback for downloading .po files (if rsync fails).
-po_download_command_format2=\
-"wget --mirror -nd -q -np -A.po -P '%s' \
- http://translationproject.org/latest/%s/"
+"wget --mirror --level=1 -nd -q -A.po -P '%s' \
+ https://translationproject.org/latest/%s/"
 
 # Prefer a non-empty tarname (4th argument of AC_INIT if given), else
 # fall back to the package name (1st argument with munging)
@@ -170,7 +196,15 @@
 m4_base=m4
 doc_base=doc
 tests_base=tests
-gnulib_extra_files=''
+gnulib_extra_files="
+        build-aux/install-sh
+        build-aux/mdate-sh
+        build-aux/texinfo.tex
+        build-aux/depcomp
+        build-aux/config.guess
+        build-aux/config.sub
+        doc/INSTALL
+"
 
 # Additional gnulib-tool options to use.  Use "\newline" to break lines.
 gnulib_tool_option_extras=
@@ -264,24 +298,18 @@
   *) test -r "$0.conf" && . ./"$0.conf" ;;
 esac
 
-# Extra files from gnulib, which override files from other sources.
-test -z "${gnulib_extra_files}" && \
-  gnulib_extra_files="
-        build-aux/install-sh
-        build-aux/mdate-sh
-        build-aux/texinfo.tex
-        build-aux/depcomp
-        build-aux/config.guess
-        build-aux/config.sub
-        doc/INSTALL
-"
-
 if test "$vc_ignore" = auto; then
   vc_ignore=
   test -d .git && vc_ignore=.gitignore
   test -d CVS && vc_ignore="$vc_ignore .cvsignore"
 fi
 
+if test x"$gnulib_modules$gnulib_files$gnulib_extra_files" = x; then
+  use_gnulib=false
+else
+  use_gnulib=true
+fi
+
 # Translate configuration into internal form.
 
 # Parse options.
@@ -418,28 +446,30 @@
   done
 }
 
+get_version_sed='
+# Move version to start of line.
+s/.*[v ]\([0-9]\)/\1/
+
+# Skip lines that do not start with version.
+/^[0-9]/!d
+
+# Remove characters after the version.
+s/[^.a-z0-9-].*//
+
+# The first component must be digits only.
+s/^\([0-9]*\)[a-z-].*/\1/
+
+#the following essentially does s/5.005/5.5/
+s/\.0*\([1-9]\)/.\1/g
+p
+q'
+
 get_version() {
   app=$1
 
   $app --version >/dev/null 2>&1 || { $app --version; return 1; }
 
-  $app --version 2>&1 |
-  sed -n '# Move version to start of line.
-          s/.*[v ]\([0-9]\)/\1/
-
-          # Skip lines that do not start with version.
-          /^[0-9]/!d
-
-          # Remove characters after the version.
-          s/[^.a-z0-9-].*//
-
-          # The first component must be digits only.
-          s/^\([0-9]*\)[a-z-].*/\1/
-
-          #the following essentially does s/5.005/5.5/
-          s/\.0*\([1-9]\)/.\1/g
-          p
-          q'
+  $app --version 2>&1 | sed -n "$get_version_sed"
 }
 
 check_versions() {
@@ -610,95 +640,101 @@
   test -f .gitmodules && git config --file .gitmodules "$@"
 }
 
-if $use_git; then
-  gnulib_path=$(git_modules_config submodule.gnulib.path)
-  test -z "$gnulib_path" && gnulib_path=gnulib
-fi
-
-# Get gnulib files.  Populate $GNULIB_SRCDIR, possibly updating a
-# submodule, for use in the rest of the script.
+if $use_gnulib; then
+  if $use_git; then
+    gnulib_path=$(git_modules_config submodule.gnulib.path)
+    test -z "$gnulib_path" && gnulib_path=gnulib
+  fi
 
-case ${GNULIB_SRCDIR--} in
--)
-  # Note that $use_git is necessarily true in this case.
-  if git_modules_config submodule.gnulib.url >/dev/null; then
-    echo "$0: getting gnulib files..."
-    git submodule init -- "$gnulib_path" || exit $?
-    git submodule update -- "$gnulib_path" || exit $?
-
-  elif [ ! -d "$gnulib_path" ]; then
-    echo "$0: getting gnulib files..."
-
-    trap cleanup_gnulib 1 2 13 15
-
-    shallow=
-    git clone -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2'
-    git clone $shallow git://git.sv.gnu.org/gnulib "$gnulib_path" ||
-      cleanup_gnulib
+  # Get gnulib files.  Populate $GNULIB_SRCDIR, possibly updating a
+  # submodule, for use in the rest of the script.
 
-    trap - 1 2 13 15
-  fi
-  GNULIB_SRCDIR=$gnulib_path
-  ;;
-*)
-  # Use GNULIB_SRCDIR directly or as a reference.
-  if $use_git && test -d "$GNULIB_SRCDIR"/.git && \
-        git_modules_config submodule.gnulib.url >/dev/null; then
-    echo "$0: getting gnulib files..."
-    if git submodule -h|grep -- --reference > /dev/null; then
-      # Prefer the one-liner available in git 1.6.4 or newer.
-      git submodule update --init --reference "$GNULIB_SRCDIR" \
-        "$gnulib_path" || exit $?
-    else
-      # This fallback allows at least git 1.5.5.
-      if test -f "$gnulib_path"/gnulib-tool; then
-        # Since file already exists, assume submodule init already complete.
-        git submodule update -- "$gnulib_path" || exit $?
-      else
-        # Older git can't clone into an empty directory.
-        rmdir "$gnulib_path" 2>/dev/null
-        git clone --reference "$GNULIB_SRCDIR" \
-          "$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \
-          && git submodule init -- "$gnulib_path" \
-          && git submodule update -- "$gnulib_path" \
-          || exit $?
+  case ${GNULIB_SRCDIR--} in
+  -)
+    # Note that $use_git is necessarily true in this case.
+    if git_modules_config submodule.gnulib.url >/dev/null; then
+      echo "$0: getting gnulib files..."
+      git submodule init -- "$gnulib_path" || exit $?
+      git submodule update -- "$gnulib_path" || exit $?
+
+    elif [ ! -d "$gnulib_path" ]; then
+      echo "$0: getting gnulib files..."
+
+      trap cleanup_gnulib 1 2 13 15
+
+      shallow=
+      if test -z "$GNULIB_REVISION"; then
+        git clone -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2'
       fi
+      git clone $shallow ${GNULIB_URL:-$default_gnulib_url} "$gnulib_path" \
+        || cleanup_gnulib
+
+      trap - 1 2 13 15
     fi
     GNULIB_SRCDIR=$gnulib_path
-  fi
-  ;;
-esac
-
-# $GNULIB_SRCDIR now points to the version of gnulib to use, and
-# we no longer need to use git or $gnulib_path below here.
+    ;;
+  *)
+    # Use GNULIB_SRCDIR directly or as a reference.
+    if $use_git && test -d "$GNULIB_SRCDIR"/.git && \
+          git_modules_config submodule.gnulib.url >/dev/null; then
+      echo "$0: getting gnulib files..."
+      if git submodule -h|grep -- --reference > /dev/null; then
+        # Prefer the one-liner available in git 1.6.4 or newer.
+        git submodule update --init --reference "$GNULIB_SRCDIR" \
+          "$gnulib_path" || exit $?
+      else
+        # This fallback allows at least git 1.5.5.
+        if test -f "$gnulib_path"/gnulib-tool; then
+          # Since file already exists, assume submodule init already complete.
+          git submodule update -- "$gnulib_path" || exit $?
+        else
+          # Older git can't clone into an empty directory.
+          rmdir "$gnulib_path" 2>/dev/null
+          git clone --reference "$GNULIB_SRCDIR" \
+            "$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \
+            && git submodule init -- "$gnulib_path" \
+            && git submodule update -- "$gnulib_path" \
+            || exit $?
+        fi
+      fi
+      GNULIB_SRCDIR=$gnulib_path
+    fi
+    ;;
+  esac
 
-if $bootstrap_sync; then
-  cmp -s "$0" "$GNULIB_SRCDIR/build-aux/bootstrap" || {
-    echo "$0: updating bootstrap and restarting..."
-    case $(sh -c 'echo "$1"' -- a) in
-      a) ignored=--;;
-      *) ignored=ignored;;
-    esac
-    exec sh -c \
-      'cp "$1" "$2" && shift && exec "${CONFIG_SHELL-/bin/sh}" "$@"' \
-      $ignored "$GNULIB_SRCDIR/build-aux/bootstrap" \
-      "$0" "$@" --no-bootstrap-sync
-  }
+  if test -d "$GNULIB_SRCDIR"/.git && test -n "$GNULIB_REVISION" \
+     && ! git_modules_config submodule.gnulib.url >/dev/null; then
+    (cd "$GNULIB_SRCDIR" && git checkout "$GNULIB_REVISION") || cleanup_gnulib
+  fi
+
+  # $GNULIB_SRCDIR now points to the version of gnulib to use, and
+  # we no longer need to use git or $gnulib_path below here.
+
+  if $bootstrap_sync; then
+    cmp -s "$0" "$GNULIB_SRCDIR/build-aux/bootstrap" || {
+      echo "$0: updating bootstrap and restarting..."
+      case $(sh -c 'echo "$1"' -- a) in
+        a) ignored=--;;
+        *) ignored=ignored;;
+      esac
+      exec sh -c \
+        'cp "$1" "$2" && shift && exec "${CONFIG_SHELL-/bin/sh}" "$@"' \
+        $ignored "$GNULIB_SRCDIR/build-aux/bootstrap" \
+        "$0" "$@" --no-bootstrap-sync
+    }
+  fi
+
+  gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
+  <$gnulib_tool || exit $?
 fi
 
-gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
-<$gnulib_tool || exit $?
-
 # Get translations.
 
 download_po_files() {
   subdir=$1
   domain=$2
   echo "$me: getting translations into $subdir for $domain..."
-  cmd=$(printf "$po_download_command_format" "$domain" "$subdir")
-  eval "$cmd" && return
-  # Fallback to HTTP.
-  cmd=$(printf "$po_download_command_format2" "$subdir" "$domain")
+  cmd=$(printf "$po_download_command_format" "$subdir" "$domain")
   eval "$cmd"
 }
 
@@ -788,9 +824,9 @@
       # Leave any existing symlink alone, if it already points to the source,
       # so that broken build tools that care about symlink times
       # aren't confused into doing unnecessary builds.  Conversely, if the
-      # existing symlink's time stamp is older than the source, make it afresh,
+      # existing symlink's timestamp is older than the source, make it afresh,
       # so that broken tools aren't confused into skipping needed builds.  See
-      # <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00326.html>.
+      # <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00326.html>.
       test -h "$dst" &&
       src_ls=$(ls -diL "$src" 2>/dev/null) && set $src_ls && src_i=$1 &&
       dst_ls=$(ls -diL "$dst" 2>/dev/null) && set $dst_ls && dst_i=$1 &&
@@ -896,32 +932,33 @@
 
 # Import from gnulib.
 
-gnulib_tool_options="\
- --import\
- --no-changelog\
- --aux-dir $build_aux\
- --doc-base $doc_base\
- --lib $gnulib_name\
- --m4-base $m4_base/\
- --source-base $source_base/\
- --tests-base $tests_base\
- --local-dir $local_gl_dir\
- $gnulib_tool_option_extras\
-"
-if test $use_libtool = 1; then
-  case "$gnulib_tool_options " in
-    *' --libtool '*) ;;
-    *) gnulib_tool_options="$gnulib_tool_options --libtool" ;;
-  esac
+if $use_gnulib; then
+  gnulib_tool_options="\
+   --no-changelog\
+   --aux-dir=$build_aux\
+   --doc-base=$doc_base\
+   --lib=$gnulib_name\
+   --m4-base=$m4_base/\
+   --source-base=$source_base/\
+   --tests-base=$tests_base\
+   --local-dir=$local_gl_dir\
+   $gnulib_tool_option_extras\
+  "
+  if test $use_libtool = 1; then
+    case "$gnulib_tool_options " in
+      *' --libtool '*) ;;
+      *) gnulib_tool_options="$gnulib_tool_options --libtool" ;;
+    esac
+  fi
+  echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
+  $gnulib_tool $gnulib_tool_options --import $gnulib_modules \
+    || die "gnulib-tool failed"
+
+  for file in $gnulib_files; do
+    symlink_to_dir "$GNULIB_SRCDIR" $file \
+      || die "failed to symlink $file"
+  done
 fi
-echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
-$gnulib_tool $gnulib_tool_options --import $gnulib_modules \
-  || die "gnulib-tool failed"
-
-for file in $gnulib_files; do
-  symlink_to_dir "$GNULIB_SRCDIR" $file \
-    || die "failed to symlink $file"
-done
 
 bootstrap_post_import_hook \
   || die "bootstrap_post_import_hook failed"
@@ -944,9 +981,8 @@
 
 # Some systems (RHEL 5) are using ancient autotools, for which the
 # --no-recursive option had not been invented.  Detect that lack and
-# omit the option when it's not supported.
-# FIXME: in 2017, remove this hack when RHEL 5 autotools are updated,
-# or when they become irrelevant.
+# omit the option when it's not supported.  FIXME in 2017: remove this
+# hack when RHEL 5 autotools are updated, or when they become irrelevant.
 case $($AUTORECONF --help) in
   *--no-recursive*) AUTORECONFFLAGS="$AUTORECONFFLAGS --no-recursive";;
 esac
@@ -1019,9 +1055,9 @@
 echo "$0: done.  Now you can run './configure'."
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
--- a/libgui/src/documentation.cc	Thu Jan 03 13:25:06 2019 -0500
+++ b/libgui/src/documentation.cc	Thu Jan 03 17:25:36 2019 -0800
@@ -538,6 +538,11 @@
 
   void documentation::notice_settings (const QSettings *settings)
   {
+    // If m_help_engine is not defined, the object accessed by this method
+    // are not valid. Thus, just return in this case
+    if (! m_help_engine)
+      return;
+
     // Icon size in the toolbar.
     int size_idx = settings->value (global_icon_size.key,
                                     global_icon_size.def).toInt ();
--- a/libinterp/corefcn/find.cc	Thu Jan 03 13:25:06 2019 -0500
+++ b/libinterp/corefcn/find.cc	Thu Jan 03 17:25:36 2019 -0800
@@ -398,7 +398,7 @@
       double val = args(1).xscalar_value ("find: N must be an integer");
 
       if (val < 0 || (! octave::math::isinf (val)
-                      && val != octave::math::round (val)))
+                      && val != octave::math::fix (val)))
         error ("find: N must be a non-negative integer");
       else if (! octave::math::isinf (val))
         n_to_find = val;
--- a/libinterp/corefcn/gl-render.cc	Thu Jan 03 13:25:06 2019 -0500
+++ b/libinterp/corefcn/gl-render.cc	Thu Jan 03 17:25:36 2019 -0800
@@ -152,11 +152,14 @@
 
     opengl_texture& operator = (const opengl_texture& tx)
     {
-      if (--rep->count == 0)
-        delete rep;
-
-      rep = tx.rep;
-      rep->count++;
+      if (&tx != this)
+        {
+          if (--rep->count == 0)
+            delete rep;
+
+          rep = tx.rep;
+          rep->count++;
+        }
 
       return *this;
     }
@@ -429,11 +432,14 @@
 
     vertex_data& operator = (const vertex_data& v)
     {
-      if (--rep->count == 0)
-        delete rep;
-
-      rep = v.rep;
-      rep->count++;
+      if (&v != this)
+        {
+          if (--rep->count == 0)
+            delete rep;
+
+          rep = v.rep;
+          rep->count++;
+        }
 
       return *this;
     }
@@ -4480,23 +4486,33 @@
 #endif
   }
 
+  std::string
+  opengl_renderer::get_string (unsigned int id) const
+  {
 #if defined (HAVE_OPENGL)
 
-  std::string
-  opengl_renderer::get_string (GLenum id) const
-  {
     // This is kind of ugly, but glGetString returns a pointer to GLubyte
     // and there is no std::string constructor that matches.  Is there a
     // better way?
 
     std::ostringstream buf;
 
-    buf << m_glfcns.glGetString (id);
+    buf << m_glfcns.glGetString (static_cast<GLenum> (id));
 
     return std::string (buf.str ());
-  }
+
+#else
+
+    octave_unused_parameter (id);
+
+    // This shouldn't happen because construction of opengl_renderer
+    // objects is supposed to be impossible if OpenGL is not available.
+
+    panic_impossible ();
+    return std::string ();
 
 #endif
+  }
 
   void
   opengl_renderer::set_normal (int bfl_mode, const NDArray& n, int j, int i)
--- a/libinterp/corefcn/gl-render.h	Thu Jan 03 13:25:06 2019 -0500
+++ b/libinterp/corefcn/gl-render.h	Thu Jan 03 17:25:36 2019 -0800
@@ -26,11 +26,12 @@
 #include "octave-config.h"
 
 #include "graphics.h"
-#include "oct-opengl.h"
 #include "text-renderer.h"
 
 namespace octave
 {
+  class opengl_functions;
+
   class
   OCTINTERP_API
   opengl_renderer
@@ -168,9 +169,7 @@
 
     void init_maxlights (void);
 
-#if defined (HAVE_OPENGL)
-    std::string get_string (GLenum id) const;
-#endif
+    std::string get_string (unsigned int id) const;
 
     bool is_nan_or_inf (double x, double y, double z) const
     {
--- a/libinterp/corefcn/gl2ps-print.h	Thu Jan 03 13:25:06 2019 -0500
+++ b/libinterp/corefcn/gl2ps-print.h	Thu Jan 03 17:25:36 2019 -0800
@@ -27,11 +27,12 @@
 
 #include <string>
 
-#include "oct-opengl.h"
 #include "graphics.h"
 
 namespace octave
 {
+  class opengl_functions;
+
   extern OCTINTERP_API void
   gl2ps_print (opengl_functions& glfcns, const graphics_object& fig,
                const std::string& stream, const std::string& term);
--- a/libinterp/corefcn/graphics.cc	Thu Jan 03 13:25:06 2019 -0500
+++ b/libinterp/corefcn/graphics.cc	Thu Jan 03 17:25:36 2019 -0800
@@ -117,7 +117,7 @@
       error ("%s: ambiguous %s property name %s; possible matches:\n\n%s",
              who.c_str (), what.c_str (), pname.c_str (), match_list.c_str ());
     }
-  else if (num_matches == 1)
+  else  // num_matches == 1
     {
       // Exact match was handled above.
       std::string possible_match = *(matches.begin ());
@@ -2838,12 +2838,10 @@
           const std::string& pname, const graphics_handle& new_parent,
           bool adopt = true)
 {
-  graphics_handle h = octave::numeric_limits<double>::NaN ();
-
   double hv = ov.xdouble_value ("%s: %s must be a graphics handle",
                                 who.c_str (), pname.c_str ());
 
-  h = gh_manager::lookup (hv);
+  graphics_handle h = gh_manager::lookup (hv);
 
   if (! h.ok ())
     error ("%s: invalid graphics handle (= %g) for %s",
@@ -3247,14 +3245,10 @@
 base_properties::set_parent (const octave_value& val)
 {
   double hp = val.xdouble_value ("set: parent must be a graphics handle");
-
-  graphics_handle new_parent = octave::numeric_limits<double>::NaN ();
-
   if (hp == __myhandle__)
     error ("set: can not set object parent to be object itself");
 
-  new_parent = gh_manager::lookup (hp);
-
+  graphics_handle new_parent = gh_manager::lookup (hp);
   if (! new_parent.ok ())
     error ("set: invalid graphics handle (= %g) for parent", hp);
 
@@ -5817,7 +5811,7 @@
   Matrix x_view = xform_matrix ();
   Matrix x_projection = xform_matrix ();
   Matrix x_viewport = xform_matrix ();
-  Matrix x_normrender = xform_matrix ();
+  Matrix x_normrender;
   Matrix x_pre = xform_matrix ();
 
   x_render = xform_matrix ();
@@ -11236,9 +11230,7 @@
 {
   graphics_handle h = get_handle (integer_figure_handle);
 
-  base_graphics_object *bgo = nullptr;
-
-  bgo = make_graphics_object_from_type (go_name, h, p);
+  base_graphics_object *bgo = make_graphics_object_from_type (go_name, h, p);
 
   if (! bgo)
     error ("gh_manager::do_make_graphics_handle: invalid object type '%s'",
@@ -12227,7 +12219,6 @@
       else
         {
           go.set (args.splice (0, 1));
-          request_drawnow = true;
         }
 
       request_drawnow = true;
@@ -13419,7 +13410,6 @@
 {
   gh_manager::auto_lock guard;
 
-  int ret = false;
   graphics_object go = gh_manager::get_object (handle);
 
   if (! go)
@@ -13427,9 +13417,7 @@
 
   go.set (caseless_str (property), arg);
 
-  ret = true;
-
-  return ret;
+  return true;
 }
 
 static bool
--- a/libinterp/corefcn/ls-mat-ascii.cc	Thu Jan 03 13:25:06 2019 -0500
+++ b/libinterp/corefcn/ls-mat-ascii.cc	Thu Jan 03 17:25:36 2019 -0800
@@ -96,7 +96,7 @@
             }
         }
     }
-  while (! (have_data || is.eof ()));
+  while (! (have_data || is.eof () || is.fail ()));
 
   return retval;
 }
--- a/libinterp/corefcn/ls-oct-text.cc	Thu Jan 03 13:25:06 2019 -0500
+++ b/libinterp/corefcn/ls-oct-text.cc	Thu Jan 03 17:25:36 2019 -0800
@@ -308,8 +308,6 @@
                 const std::string& name, bool mark_global,
                 int precision)
 {
-  bool success = true;
-
   if (! name.empty ())
     os << "# name: " << name << "\n";
 
@@ -326,7 +324,7 @@
   long old_precision = os.precision ();
   os.precision (precision);
 
-  success = val.save_ascii (os);
+  bool success = val.save_ascii (os);
 
   // Insert an extra pair of newline characters after the data so that
   // multiple data elements may be handled separately by gnuplot (see
--- a/libinterp/corefcn/oct-stream.cc	Thu Jan 03 13:25:06 2019 -0500
+++ b/libinterp/corefcn/oct-stream.cc	Thu Jan 03 17:25:36 2019 -0800
@@ -4607,7 +4607,6 @@
     bool all_char_conv = fmt_list.all_character_conversions ();
 
     Matrix mval;
-    double *data = nullptr;
     octave_idx_type max_size = 0;
     octave_idx_type max_conv = 0;
 
@@ -4665,7 +4664,7 @@
         max_size = 32;
       }
 
-    data = mval.fortran_vec ();
+    double *data = mval.fortran_vec ();
 
     if (isp)
       {
@@ -5616,7 +5615,7 @@
       {
         double dval = val.double_value (true);
 
-        if (dval == math::round (dval) && dval <= limit)
+        if (dval == math::fix (dval) && dval <= limit)
           return true;
       }
 
@@ -5643,7 +5642,7 @@
 
         uint64_t limit = std::numeric_limits<uint64_t>::max ();
 
-        if (dval == math::round (dval) && dval >= 0 && dval <= limit)
+        if (dval == math::fix (dval) && dval >= 0 && dval <= limit)
           return true;
       }
 
--- a/libinterp/octave-value/ov-bool.cc	Thu Jan 03 13:25:06 2019 -0500
+++ b/libinterp/octave-value/ov-bool.cc	Thu Jan 03 17:25:36 2019 -0800
@@ -194,7 +194,7 @@
 bool
 octave_bool::load_ascii (std::istream& is)
 {
-  scalar = (octave_read_value<double> (is) != 0.);
+  scalar = (octave_read_value<double> (is) != 0.0);
 
   if (! is)
     error ("load: failed to load scalar constant");
@@ -294,7 +294,7 @@
       return false;
     }
 
-  scalar = (dtmp != 0.);
+  scalar = (dtmp != 0.0);
 
   H5Dclose (data_hid);
 
--- a/libinterp/octave-value/ov-struct.cc	Thu Jan 03 13:25:06 2019 -0500
+++ b/libinterp/octave-value/ov-struct.cc	Thu Jan 03 17:25:36 2019 -0800
@@ -2024,7 +2024,7 @@
       if (! args(2).is_real_scalar ())
         error ("cell2struct: DIM must be a real scalar");
 
-      dim = (nargin == 2 ? 0 : args(2).int_value () - 1);
+      dim = args(2).int_value () - 1;
     }
 
   if (dim < 0)
--- a/libinterp/octave-value/ov-usr-fcn.cc	Thu Jan 03 13:25:06 2019 -0500
+++ b/libinterp/octave-value/ov-usr-fcn.cc	Thu Jan 03 17:25:36 2019 -0800
@@ -824,7 +824,7 @@
 
 static bool isargout1 (int nargout, const Matrix& ignored, double k)
 {
-  if (k != octave::math::round (k) || k <= 0)
+  if (k != octave::math::fix (k) || k <= 0)
     error ("isargout: K must be a positive integer");
 
   return (k == 1 || k <= nargout) && ! val_in_table (ignored, k);
--- a/liboctave/array/Array.cc	Thu Jan 03 13:25:06 2019 -0500
+++ b/liboctave/array/Array.cc	Thu Jan 03 17:25:36 2019 -0800
@@ -2037,7 +2037,7 @@
   octave_idx_type n = numel ();
 
   if (n <= 1)
-    return mode ? mode : ASCENDING;
+    return (mode == UNSORTED) ? ASCENDING : mode;
 
   if (mode == UNSORTED)
     {
@@ -2051,13 +2051,10 @@
         mode = ASCENDING;
     }
 
-  if (mode != UNSORTED)
-    {
-      lsort.set_compare (safe_comparator (mode, *this, false));
-
-      if (! lsort.issorted (data (), n))
-        mode = UNSORTED;
-    }
+  lsort.set_compare (safe_comparator (mode, *this, false));
+
+  if (! lsort.issorted (data (), n))
+    mode = UNSORTED;
 
   return mode;
 
@@ -2091,7 +2088,7 @@
   octave_idx_type c = cols ();
 
   if (r <= 1 || c == 0)
-    return mode ? mode : ASCENDING;
+    return (mode == UNSORTED) ? ASCENDING : mode;
 
   if (mode == UNSORTED)
     {
--- a/liboctave/array/idx-vector.cc	Thu Jan 03 13:25:06 2019 -0500
+++ b/liboctave/array/idx-vector.cc	Thu Jan 03 17:25:36 2019 -0800
@@ -152,7 +152,7 @@
           // find first non-integer, then gripe about it
           double b = r.base ();
           double inc = r.inc ();
-          octave::err_invalid_index (b != std::floor (b) ? b : b + inc);
+          octave::err_invalid_index (b != std::trunc (b) ? b : b + inc);
         }
     }
 }
--- a/liboctave/util/oct-inttypes.cc	Thu Jan 03 13:25:06 2019 -0500
+++ b/liboctave/util/oct-inttypes.cc	Thu Jan 03 17:25:36 2019 -0800
@@ -579,7 +579,7 @@
 OCTAVE_API octave_uint64
 operator * (const octave_uint64& x, const double& y)
 {
-  if (y >= 0 && y < octave_uint64::max () && y == octave::math::round (y))
+  if (y >= 0 && y < octave_uint64::max () && y == octave::math::fix (y))
     return x * octave_uint64 (static_cast<uint64_t> (y));
   else if (y == 0.5)
     return x / octave_uint64 (static_cast<uint64_t> (2));
@@ -614,7 +614,7 @@
 OCTAVE_API octave_int64
 operator * (const octave_int64& x, const double& y)
 {
-  if (fabs (y) < octave_int64::max () && y == octave::math::round (y))
+  if (fabs (y) < octave_int64::max () && y == octave::math::fix (y))
     return x * octave_int64 (static_cast<int64_t> (y));
   else if (fabs (y) == 0.5)
     return x / octave_int64 (static_cast<uint64_t> (4*y));
@@ -664,7 +664,7 @@
 OCTAVE_API octave_uint64
 operator / (const octave_uint64& x, const double& y)
 {
-  if (y >= 0 && y < octave_uint64::max () && y == octave::math::round (y))
+  if (y >= 0 && y < octave_uint64::max () && y == octave::math::fix (y))
     return x / octave_uint64 (y);
   else
     return x * (1.0/y);
@@ -674,7 +674,7 @@
 OCTAVE_API octave_int64
 operator / (const octave_int64& x, const double& y)
 {
-  if (fabs (y) < octave_int64::max () && y == octave::math::round (y))
+  if (fabs (y) < octave_int64::max () && y == octave::math::fix (y))
     return x / octave_int64 (y);
   else
     return x * (1.0/y);
@@ -751,7 +751,7 @@
 pow (const octave_int<T>& a, const double& b)
 {
   return ((b >= 0 && b < std::numeric_limits<T>::digits
-           && b == octave::math::round (b))
+           && b == octave::math::fix (b))
           ? pow (a, octave_int<T> (static_cast<T> (b)))
           : octave_int<T> (std::pow (a.double_value (), b)));
 }
@@ -766,7 +766,7 @@
 pow (const octave_int<T>& a, const float& b)
 {
   return ((b >= 0 && b < std::numeric_limits<T>::digits
-           && b == octave::math::round (b))
+           && b == octave::math::fix (b))
           ? pow (a, octave_int<T> (static_cast<T> (b)))
           : octave_int<T> (std::pow (a.double_value (),
                                      static_cast<double> (b))));
@@ -784,7 +784,7 @@
 powf (const octave_int<T>& a, const float& b)
 {
   return ((b >= 0 && b < std::numeric_limits<T>::digits
-           && b == octave::math::round (b))
+           && b == octave::math::fix (b))
           ? pow (a, octave_int<T> (static_cast<T> (b)))
           : octave_int<T> (std::pow (a.double_value (),
                                      static_cast<double> (b))));