Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package inchi for openSUSE:Factory checked 
in at 2022-09-25 15:35:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/inchi (Old)
 and      /work/SRC/openSUSE:Factory/.inchi.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "inchi"

Sun Sep 25 15:35:38 2022 rev:2 rq:1005812 version:1.06

Changes:
--------
--- /work/SRC/openSUSE:Factory/inchi/inchi.changes      2022-08-24 
15:11:43.000536566 +0200
+++ /work/SRC/openSUSE:Factory/.inchi.new.2275/inchi.changes    2022-09-25 
15:36:04.883735407 +0200
@@ -1,0 +2,6 @@
+Sat Sep 24 23:11:29 UTC 2022 - Antoine Belvire <antoine.belv...@opensuse.org>
+
+- Add inchi-1.06-big-endian.patch: Fix build on big-endian
+  architectures (rh#1930943).
+
+-------------------------------------------------------------------

New:
----
  inchi-1.06-big-endian.patch

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

Other differences:
------------------
++++++ inchi.spec ++++++
--- /var/tmp/diff_new_pack.6cwPdb/_old  2022-09-25 15:36:05.411736679 +0200
+++ /var/tmp/diff_new_pack.6cwPdb/_new  2022-09-25 15:36:05.415736689 +0200
@@ -29,6 +29,8 @@
 Source2:        https://www.inchi-trust.org/download/%{urlver}/INCHI-1-TEST.zip
 # PATCH-FIX-UPSTREAM inchi-1.06-optflags.patch -- Pass optflags to compiler 
and don't require gcc-c++ (picked from Fedora)
 Patch0:         inchi-1.06-optflags.patch
+# PATCH-FIX-UPSTREAM inchi-1.06-big-endian.patch -- Fix tests on big-endian 
architectures (rh#1930943)
+Patch1:         inchi-1.06-big-endian.patch
 BuildRequires:  dos2unix
 BuildRequires:  gcc
 BuildRequires:  unzip
@@ -76,9 +78,9 @@
 and InChI library API reference for developers.
 
 %prep
-# Extract Source0 then cd into extracted directory then extract Source 1 then 
extract Source2
+# Extract Source0 then cd into extracted directory then extract Source1 then 
extract Source2
 %setup -q -n INCHI-1-SRC -a 1 -a 2
-%patch0 -p1
+%autopatch -p1
 dos2unix -k readme.txt
 
 # Remove files from INCHI-1-DOC that are already present in ICHI-1-SRC so that 
they are not listed twice




++++++ inchi-1.06-big-endian.patch ++++++
>From 26351733bde20eb16aedd62b4b64a2417615020e Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA <mtas...@fedoraproject.org>
Date: Thu, 25 Nov 2021 23:07:31 +0900
Subject: [PATCH] MolfileReadCountsLine: fix storing n_atoms, n_bonds members
 after reading short size

In MolfileReadCountsLine() (in INCHI_BASE/src/mol_fmt1.c), currently
ctab->n_atoms and ctab->n_bonds, which have int type (as defined in 
src/mol_fmt.h),
are passed to be MolfileReadField(), and to be treated there as if they have
short size (as MOL_FMT_SHORT_INT_DATA is also passed to the argument of
MolfileReadField(), and also the comment shows).

This causes a error on big endian system such as s390x, where for example
reading the line:

1  0  0  0  0  0  0  0  0  0999 V2000

On little endian (64bit) system, ctab->n_atoms is correctly stored as 1, but on
s390x (big endian 64bit) system, ctab->n_atoms gets 65536 (= 1<<16), which is
unexpected.

To fix this, once store the read value to short size local variable, then
copy the value to ctab->n_atoms or so later.
---
 INCHI_BASE/src/mol_fmt1.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/INCHI_BASE/src/mol_fmt1.c b/INCHI_BASE/src/mol_fmt1.c
index 41ed15e..c2ad11a 100644
--- a/INCHI_BASE/src/mol_fmt1.c
+++ b/INCHI_BASE/src/mol_fmt1.c
@@ -572,6 +572,7 @@ int MolfileReadCountsLine( MOL_FMT_CTAB* ctab,
     char line[MOL_FMT_INPLINELEN];
     const int line_len = sizeof( line );
     int   err = 0, len;
+    short n_atoms, n_bonds;
 
     p = inchi_fgetsLf( line, line_len, inp_file );
 
@@ -588,8 +589,8 @@ int MolfileReadCountsLine( MOL_FMT_CTAB* ctab,
         TREAT_ERR( err, 0, "Too long counts line" );  /* too long input file 
line */
     }
 
-    if (0 > MolfileReadField( &ctab->n_atoms, 3, MOL_FMT_SHORT_INT_DATA, &p ) 
/* V2000 only: short int */
-         || 0 > MolfileReadField( &ctab->n_bonds, 3, MOL_FMT_SHORT_INT_DATA, 
&p ) /* V2000 only: short int */
+    if (0 > MolfileReadField( &n_atoms, 3, MOL_FMT_SHORT_INT_DATA, &p ) /* 
V2000 only: short int */
+         || 0 > MolfileReadField( &n_bonds, 3, MOL_FMT_SHORT_INT_DATA, &p ) /* 
V2000 only: short int */
 
 #if ( MOL_FMT_QUERY == MOL_FMT_PRESENT )
          || 0 > MolfileReadField( &ctab->n_atom_lists, 3, 
MOL_FMT_SHORT_INT_DATA, &p )
@@ -621,6 +622,8 @@ int MolfileReadCountsLine( MOL_FMT_CTAB* ctab,
         AddErrorMessage( pStrErr, line );
         goto err_fin;
     }
+    ctab->n_atoms = n_atoms;
+    ctab->n_bonds = n_bonds;
 
     /* Get CTFile version (V2000 or other) */
     len = MolfileReadField( ctab->version_string,
-- 
2.33.1

Reply via email to