[Pkg-octave-commit] [octave] 01/01: save-uint8-in-text-format.diff: new patch, fixes saving int8 and uint8 in plain text format

Rafael Laboissière rlaboiss-guest at moszumanska.debian.org
Sat Jan 11 12:28:26 UTC 2014


This is an automated email from the git hooks/post-receive script.

rlaboiss-guest pushed a commit to branch master
in repository octave.

commit a5a2f347b39110edb4f6459c0fae5176c892e42d
Author: Rafael Laboissiere <rafael at laboissiere.net>
Date:   Sat Jan 11 08:33:03 2014 +0100

    save-uint8-in-text-format.diff: new patch, fixes saving int8 and uint8 in plain text format
    
    Closes: #732659
---
 debian/patches/save-uint8-in-text-format.diff | 61 +++++++++++++++++++++++++++
 debian/patches/series                         |  1 +
 2 files changed, 62 insertions(+)

diff --git a/debian/patches/save-uint8-in-text-format.diff b/debian/patches/save-uint8-in-text-format.diff
new file mode 100644
index 0000000..5a803ea
--- /dev/null
+++ b/debian/patches/save-uint8-in-text-format.diff
@@ -0,0 +1,61 @@
+Description: Fix saving int8 and uint8 in plain text format
+Origin: upstream, http://hg.savannah.gnu.org/hgweb/octave/raw-rev/284e5c87f27b
+Bug: http://savannah.gnu.org/bugs/?40980
+Bug-Debian: http://bugs.debian.org/732659
+Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
+Reviewed-By: Rafael Laboissiere <rafael at laboissiere.net>
+Last-Update: 2014-01-11
+
+--- octave-3.8.0.orig/liboctave/util/oct-inttypes.h
++++ octave-3.8.0/liboctave/util/oct-inttypes.h
+@@ -1023,6 +1023,50 @@ operator >> (std::istream& is, octave_in
+   return is;
+ }
+ 
++// We need to specialise for char and unsigned char because
++// std::operator<< and std::operator>> are overloaded to input and
++// output the ASCII character values instead of a representation of
++// their numerical value (e.g. os << char(10) outputs a space instead
++// of outputting the characters '1' and '0')
++
++template <>
++inline std::ostream&
++operator << (std::ostream& os, const octave_int<int8_t>& ival)
++{
++  os << static_cast<int> (ival.value ());
++  return os;
++}
++
++template <>
++inline std::ostream&
++operator << (std::ostream& os, const octave_int<uint8_t>& ival)
++{
++  os << static_cast<unsigned int> (ival.value ());
++  return os;
++}
++
++
++template <>
++inline std::istream&
++operator >> (std::istream& is, octave_int<int8_t>& ival)
++{
++  int tmp = 0;
++  is >> tmp;
++  ival = static_cast<int8_t> (tmp);
++  return is;
++}
++
++template <>
++inline std::istream&
++operator >> (std::istream& is, octave_int<uint8_t>& ival)
++{
++  unsigned int tmp = 0;
++  is >> tmp;
++  ival = static_cast<uint8_t> (tmp);
++  return is;
++}
++
++
+ // Bitwise operations
+ 
+ #define OCTAVE_INT_BITCMP_OP(OP) \
diff --git a/debian/patches/series b/debian/patches/series
index 09fa632..47aa66b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -9,3 +9,4 @@ doc-compressed-info.diff
 dblquad-s390x.diff
 kfreebsd_tcgetattr.diff
 hurd_path_max.diff
+save-uint8-in-text-format.diff

-- 
Alioth's /home/groups/pkg-octave/bin/git-commit-notice on /srv/git.debian.org/git/pkg-octave/octave.git



More information about the Pkg-octave-commit mailing list