Hello community,

here is the log from the commit of package matio for openSUSE:Factory checked 
in at 2012-12-21 10:24:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/matio (Old)
 and      /work/SRC/openSUSE:Factory/.matio.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "matio", Maintainer is ""

Changes:
--------
--- /work/SRC/openSUSE:Factory/matio/matio.changes      2012-09-17 
14:00:26.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.matio.new/matio.changes 2012-12-21 
10:24:17.000000000 +0100
@@ -1,0 +2,10 @@
+Thu Dec 20 16:43:12 UTC 2012 - [email protected]
+
+- Fix Big Endian issues in mat4. (mat4_bigendian.patch) 
+
+-------------------------------------------------------------------
+Thu Dec 20 14:59:20 UTC 2012 - [email protected]
+
+- Fix failing 684 686 test (matvar_struct.patch)
+
+-------------------------------------------------------------------

New:
----
  mat4_bigendian.patch
  matvar_struct.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ matio.spec ++++++
--- /var/tmp/diff_new_pack.Hyb6QG/_old  2012-12-21 10:24:17.000000000 +0100
+++ /var/tmp/diff_new_pack.Hyb6QG/_new  2012-12-21 10:24:17.000000000 +0100
@@ -19,15 +19,19 @@
 Name:           matio
 %define libname lib%{name}
 Version:        1.5.0
-%define major   2
 Release:        0
-License:        BSD-2-Clause
+%define major   2
 Summary:        Open-source library for reading and writing MATLAB MAT files
-Url:            http://sourceforge.net/projects/matio
+License:        BSD-2-Clause
 Group:          System/Libraries
+Url:            http://sourceforge.net/projects/matio
 Source0:        %{name}-%{version}.tar.gz
 # PATCH-FIX-UPSTREAM gcc-warnings-fix.patch
 Patch0:         gcc-warnings-fix.patch
+# PATCH-FIX-UPSTREAM upstream commit 09f5c87438a5883361b38cc98b4848acfcb65d97
+Patch1:         matvar_struct.patch
+# PATCH-FIX-UPSTREAM patch from upsream developer. Will hit git repo soon.
+Patch2:         mat4_bigendian.patch
 BuildRequires:  hdf5-devel >= 1.8
 BuildRequires:  pkgconfig
 BuildRequires:  zlib-devel >= 1.2.3
@@ -73,6 +77,8 @@
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
 
 %build
 %configure \

++++++ mat4_bigendian.patch ++++++
diff --git a/src/mat4.c b/src/mat4.c
index bf2aaae..b1d7194 100644
--- a/src/mat4.c
+++ b/src/mat4.c
@@ -193,6 +193,10 @@ Mat_VarReadNextInfo4(mat_t *mat)
     long      nBytes;
     size_t    err;
     matvar_t *matvar = NULL;
+    union {
+        mat_uint32_t u;
+        mat_uint8_t  c[4];
+    } endian;
 
     if ( mat == NULL || mat->fp == NULL )
         return NULL;
@@ -208,6 +212,8 @@ Mat_VarReadNextInfo4(mat_t *mat)
         return NULL;
     }
 
+    endian.u = 0x01020304;
+
     /* See if MOPT may need byteswapping */
     if ( tmp < 0 || tmp > 4052 ) {
         if ( Mat_int32Swap(&tmp) > 4052 ) {
@@ -224,7 +230,16 @@ Mat_VarReadNextInfo4(mat_t *mat)
     tmp -= data_type*10;
     class_type = floor(tmp);
 
-    mat->byteswap = (M == 1) ? 1 : 0;
+    switch ( M ) {
+        case 0:
+            /* IEEE little endian */
+            mat->byteswap = (endian.c[0] != 4);
+            break;
+        case 1:
+            /* IEEE big endian */
+            mat->byteswap = (endian.c[0] != 1);
+            break;
+    }
     /* Convert the V4 data type */
     switch ( data_type ) {
         case 0:
++++++ matvar_struct.patch ++++++
>From 4636dfab4012b7468ff338e1de2b77db701f4107 Mon Sep 17 00:00:00 2001
From: Christopher Hulbert <[email protected]>
Date: Wed, 19 Dec 2012 07:46:36 -0500
Subject: [PATCH 1/2] Initialize fields of structure to NULL

* src/matvar_struct.c (Mat_VarCreateStruct): Initialize the pointer to each
      field to NULL after allocation
---
 src/matvar_struct.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/matvar_struct.c b/src/matvar_struct.c
index af23fee..88a2a8a 100644
--- a/src/matvar_struct.c
+++ b/src/matvar_struct.c
@@ -88,8 +88,12 @@ Mat_VarCreateStruct(const char *name,int rank,size_t 
*dims,const char **fields,
             }
         }
         if ( NULL != matvar && nmemb > 0 && nfields > 0 ) {
+            matvar_t **field_vars;
             matvar->nbytes = nmemb*nfields*matvar->data_size;
             matvar->data = malloc(matvar->nbytes);
+            field_vars = (matvar_t**)matvar->data;
+            for ( i = 0; i < nfields*nmemb; i++ )
+                field_vars[i] = NULL;
         }
     }
 
-- 
1.7.12.2


>From 09f5c87438a5883361b38cc98b4848acfcb65d97 Mon Sep 17 00:00:00 2001
From: Christopher Hulbert <[email protected]>
Date: Wed, 19 Dec 2012 07:48:05 -0500
Subject: [PATCH 2/2] Fix NULL argument test for Mat_VarGetNumberOfFields

* test/test_mat.c (test_struct_api_getfieldnames): Pass NULL rather than
      matvar to Mat_VarGetNumberOfFields when testing behavior of NULL
      argument
---
 test/test_mat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/test_mat.c b/test/test_mat.c
index 8f2b236..fe87f65 100644
--- a/test/test_mat.c
+++ b/test/test_mat.c
@@ -2173,7 +2173,7 @@ test_struct_api_getfieldnames(void)
     }
     Mat_VarFree(matvar);
 
-    nfields     = Mat_VarGetNumberOfFields(matvar);
+    nfields     = Mat_VarGetNumberOfFields(NULL);
     fieldnames2 = Mat_VarGetStructFieldnames(NULL);
     printf("Fieldnames of \"NULL\":\n");
     if ( nfields < 1 ) {
-- 
1.7.12.2
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to