[BACK]Return to patch-libgnu_fseeko.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / math / octave / patches

File: [cvs.NetBSD.org] / pkgsrc / math / octave / patches / patch-libgnu_fseeko.c (download)

Revision 1.1, Wed Dec 15 17:20:57 2021 UTC (13 months, 2 weeks ago) by adam
Branch: MAIN
CVS Tags: pkgsrc-2022Q4-base, pkgsrc-2022Q4, pkgsrc-2022Q3-base, pkgsrc-2022Q3, pkgsrc-2022Q2-base, pkgsrc-2022Q2, pkgsrc-2022Q1-base, pkgsrc-2022Q1, pkgsrc-2021Q4-base, pkgsrc-2021Q4, HEAD

octave: updated to 6.4.0

Summary of bugs fixed for version 6.4.0 (2021-10-30)
----------------------------------------------------

Improvements and fixes

- Reduce memory usage in BISTs for `copyobj`, `hgsave`.
- `hgsave.m`, `copyobj.m`: Use `'qt'` graphics toolkit in BISTs.
- `main.cc`: Use `getopt` to parse command line arguments.
- `main.cc`: Remove invalid case.
- Disable `getopt` error reporting in wrapper program.
- `interp1.m`: Don't interpret later numeric input as `xi`.
- `pkg`: Improve similar package name suggestion.
- Store parent name in function object when caching parents in scope.
- Avoid internal error and segfault with `eval` and scripts.
- `rmpath`: Prevent removing the current directory from the load path.

GUI

- Fix missing interpreter event in `octave-scintilla`.
- Fix opening a file in a custom editor.

Documentation

- Improve docstring for `disable_diagonal_matrix`, `disable_diagonal_matrix`,
  and `disable_range`.
- `cbrt`: Clarify that function errors for non-real input.
- `dsearchn.m`: Added optional distance output description.
- Add Hungarian translation for project description files.
- Document fsolve output "info" -2.

Build system

- Correct error message for incompatible CXSparse.


Summary of bugs fixed for version 6.3.0 (2021-07-11)
----------------------------------------------------

Important notice

- This bug fix release breaks ABI compatiblity with Octave 6.2.0. Re-build
  binaries (like .oct or .mex files) when updating to this version.

Improvements and fixes

- `ls-hdf5.cc`: Avoid throwing inside HDF5 function.
- `ls-hdf5.cc`: Handle non-zero terminated type strings.
- Fix occasional segfault in `symbfact`.
- `fsolve.m`: Fix undefined output error when using `Output` function.
- Fix compilation error with `iconv_t` on Solaris.
- build: Check for `stropts.h`.
- Avoid ambiguous call to `pow`.
- Fix context link when creating handle to nested function.
- `print.m`: Warn when figure is too large to be printed to output page.
- Defer clearing function vars until stack frame is deleted.
- Avoid memory leaks when returning handles to nested functions.
- Hold references to closure frames in anon functions if needed.
- `eigs`: Prevent possible segmentation fault at exit.
- Issue warning when gnuplot graphics toolkit is initialized.
- mpoles.m: Fix detection of pole multiplicity.
- Perform shutdown actions in interpreter destructor.
- build: Make relocation of dependencies with Octave optional.
- `qz.cc`: Return correct number of eigenvalues.
- `qz.cc`: Let test pass with LAPACK 3.9.1 and earlier versions.
- `pkg.m`: Use default prefixes unless otherwise set previously.
- `betaincinv.m`: Correctly handle small inputs.
- `betaincinv.m`: Correctly handle inputs very close to 1.0.
- `unistd-wrappers.c`: Allocate sufficient memory for `new_argv`.
- Mark system functions correctly if `OCTAVE_HOME` is non-canonical.
- Mark compiled system functions correctly if `OCTAVE_HOME` is non-canonical.
- Fix error if test suite is run before Octave is installed.
- `lo-array-errwarn.cc`: Include `<limits>`.
- Use `std::size_t` and `std::ptrdiff_t` in C++ code.
- Use `std::size_t` in more instances.
- Return proper number of stack frames for `dbstack (N)` call.
- Avoid ambiguous match of overloaded function.
- `lscov.m`: Relax BIST tolerance to pass with OpenBLAS.
- `print`: Fix error when `"px"` word is present in a figure.
- `logm.m`: Fix check for real negative values in complex vector.
- build: Set necessary flags to allow execution on Windows Vista.
- Declare base_parser destructor virtual.
- `hist.m`: Improve handling and docstring for third parameter "norm".
- `logm.m`: Allow tolerance in check for real negative values in complex vector.
- `expm.m`, `logm.m`: Use function `isdiag` to detect if input is a diagonal matrix.
- tests: Relax tolerance for some tests on macOS.
- `logspace.m`: Mark tests as known to fail on macOS.
- `hist.m`: Use deterministic test.
- `rgb2ind.m`: Reduce memory usage and eliminate randomness in test.
- `logm.m`: Allow larger tolerance for test on macOS.
- build: Use correct path to `octave` binary in build tree on macOS.
- build: Fix typo in folder to libraries when building `.oct` or `.mex` files.
- build: Set DL_LDFLAGS in the build rules for .oct or .mex files.
- `rgb2ind.m`: Suppress output in test.
- Improve documentation for `log2` function.
- `ind2sub`: Fix typo in "see also" section of docstring.
- `mrdivide`, `mldivide`: Document that functions might return minimum norm solutions.
- Fix scoping issue for handles to sibling nested functions.
- `ls-mat5.cc`: Avoid integer overflow in calculation of buffer size for zlib.
- Move top-level REPL from interpreter to evaluator.
- Avoid crash with `dbquit` when executing command in terminal from GUI.

GUI

- Fix calling external editor.
- Fix missing file suffix .m when saving a new script.
- Do not run files that are not saved as Octave files.
- Fix confirm overwrite for native editor file "save as" dialogs.
- Fix crash when GUI tries to restore missing previous Octave dir.
- Fix restoring the horizontal position of docked GUI widgets.
- Prevent floating widgets from re-opening after restart.
- Avoid crash in GUI for `rmdir("")`.
- Fix EOL mode when saving files under new names.
- Fix auto indentation of switch-structure in GUI editor.
- Avoid crash when closing GUI with open editor tabs.
- `octave-qscintilla.cc` (`contextmenu_run`): Fix keyboard command handling.

Documentation

- Improve Differential Equations chapter and example for lsode.
- Clarify usage of "Depends" keyword in package `DESCRIPTION` file.
- Add note that wildcard patterns for `save` are glob patterns.
- Change example for Delaunay triangulation to match the generating code.
- Document single precision issues with OpenGL graphics toolkits.
- Minor changes to documentation of single precision issues with OpenGL.
- Expand on documentation for command syntax.
- `isprop.m`: Document that function only works on graphics objects in Octave 6.X.
- Explain how to write dual-purpose executable scripts and Octave functions.
- Update keyword docstrings.
- Use Texinfo commands to improve `transpose()` docstring rendering.
- `betainc.m`, `betaincinv.m`: Correct non-TeX definition of beta incomplete integral.
- Grammarcheck documentation ahead of 6.3 release.
- Spellcheck documentation ahead of 6.3 release.

$NetBSD: patch-libgnu_fseeko.c,v 1.1 2021/12/15 17:20:57 adam Exp $

--- libgnu/fseeko.c.orig	2015-05-23 14:36:16.000000000 +0000
+++ libgnu/fseeko.c
@@ -22,6 +22,9 @@
 /* Get off_t, lseek, _POSIX_VERSION.  */
 #include <unistd.h>
 
+/* mem* */
+#include <string.h>
+
 #include "stdio-impl.h"
 
 int
@@ -132,19 +135,12 @@ fseeko (FILE *fp, off_t offset, int when
       /* fp_->_offset is typed as an integer.  */
       fp_->_offset = pos;
 # else
-      /* fp_->_offset is an fpos_t.  */
-      {
-        /* Use a union, since on NetBSD, the compilation flags
-           determine whether fpos_t is typedef'd to off_t or a struct
-           containing a single off_t member.  */
-        union
-          {
-            fpos_t f;
-            off_t o;
-          } u;
-        u.o = pos;
-        fp_->_offset = u.f;
-      }
+      /*
+       * fp_->_offset is an fpos_t or off_t
+       * in either case the off_t part is the first member of it.
+       */
+      memset(&fp_->_offset, 0, sizeof(fp_->_offset));
+      memcpy(&fp_->_offset, &pos, sizeof(pos));
 # endif
       fp_->_flags |= __SOFF;
       fp_->_flags &= ~__SEOF;