[med-svn] r10313 - in trunk/packages/libics/trunk/debian: . patches
Mathieu Malaterre
malat at alioth.debian.org
Wed Apr 4 10:48:03 UTC 2012
Author: malat
Date: 2012-04-04 10:48:02 +0000 (Wed, 04 Apr 2012)
New Revision: 10313
Added:
trunk/packages/libics/trunk/debian/patches/
trunk/packages/libics/trunk/debian/patches/bigendianfix.patch
trunk/packages/libics/trunk/debian/patches/series
Log:
Import rev 10 to fix big endian issues
Added: trunk/packages/libics/trunk/debian/patches/bigendianfix.patch
===================================================================
--- trunk/packages/libics/trunk/debian/patches/bigendianfix.patch (rev 0)
+++ trunk/packages/libics/trunk/debian/patches/bigendianfix.patch 2012-04-04 10:48:02 UTC (rev 10313)
@@ -0,0 +1,87 @@
+Index: libics_write.c
+===================================================================
+--- libics_write.c (revision 9)
++++ libics_write.c (revision 10)
+@@ -321,7 +321,7 @@
+ static Ics_Error WriteIcsRep (Ics_Header* IcsStruct, FILE* fp)
+ {
+ ICSDECL;
+- int problem, ii;
++ int problem, empty, ii;
+ char line[ICS_LINE_LENGTH];
+ Ics_Format Format;
+ int Sign;
+@@ -382,9 +382,15 @@
+ ICSXR( IcsAddLine (line, fp) );
+
+ /* Define the byteorder. This is supposed to resolve little/big
+- * endian problems. We will overwrite anything the calling function
+- * put in here. This must be the machine's byte order. */
+- IcsFillByteOrder (IcsGetDataTypeSize (IcsStruct->Imel.DataType), IcsStruct->ByteOrder);
++ * endian problems. If the calling function put something here,
++ * we'll keep it. Otherwise we fill in the machine's byte order. */
++ empty = 0;
++ for (ii = 0; ii < (int)IcsGetDataTypeSize (IcsStruct->Imel.DataType); ii++) {
++ empty |= !(IcsStruct->ByteOrder[ii]);
++ }
++ if (empty) {
++ IcsFillByteOrder (IcsGetDataTypeSize (IcsStruct->Imel.DataType), IcsStruct->ByteOrder);
++ }
+ problem = IcsFirstToken (line, ICSTOK_REPRES);
+ problem |= IcsAddToken (line, ICSTOK_BYTEO);
+ for (ii = 0; ii < (int)IcsGetDataTypeSize (IcsStruct->Imel.DataType) - 1; ii++) {
+@@ -608,7 +614,7 @@
+ ICSINIT;
+ char line[ICS_LINE_LENGTH];
+
+- if ((IcsStruct->Version ~= 1) && (IcsStruct->SrcFile[0] == '\0')) {
++ if ((IcsStruct->Version != 1) && (IcsStruct->SrcFile[0] == '\0')) {
+ error = IcsFirstToken (line, ICSTOK_END);
+ ICSTR( error, IcsErr_FailWriteLine );
+ IcsAppendChar (line, ICS_EOL);
+Index: test_ics2a.c
+===================================================================
+--- test_ics2a.c (revision 9)
++++ test_ics2a.c (revision 10)
+@@ -52,6 +52,8 @@
+ IcsSetLayout (ip, dt, ndims, dims);
+ IcsGetIdsName (datafile, argv[1]);
+ IcsSetSource (ip, datafile, 0);
++ ip->ByteOrder[0] = 1; /* Cheating a little here, to get the correct endianness on */
++ ip->ByteOrder[1] = 2; /* any machine type. This should be fixed in the library! */
+ IcsSetCompression (ip, IcsCompr_uncompressed, 0);
+ retval = IcsClose (ip);
+ if (retval != IcsErr_Ok) {
+Index: README
+===================================================================
+--- README (revision 9)
++++ README (revision 10)
+@@ -138,6 +138,8 @@
+ - Fixed documentation and made explicit the current default to version
+ 2.0 files.
+ - Added a "links" page to the documentation.
++ - Fixed tests 1 and 2a, which didn't work for big-endian machines.
++ - IcsWriteIcs() no longer overwrites data in the ByteOrder array.
+
+
+ version 1.5.2
+Index: TODO
+===================================================================
+--- TODO (revision 9)
++++ TODO (revision 10)
+@@ -21,3 +21,7 @@
+ with some NULL pointers. Maybe even macros?
+
+ - IrfanView plugin should be updated, it still has a 3 year old bug.
++
++- test_ics2a shows an issue with endianness and the ICS file pointing to
++ an existing data file: we have no good way of determining the endianness
++ of this data file, and are stuck with using the machine's endinanness.
+Index: test_ics1.sh
+===================================================================
+--- test_ics1.sh (revision 9)
++++ test_ics1.sh (revision 10)
+@@ -1,2 +1 @@
+-#!/bin/bash
+-./test_ics1 $srcdir/test/testim.ics result_v1.ics && cmp -s $srcdir/test/testim.ids result_v1.ids && (( `diff $srcdir/test/testim.ics result_v1.ics | grep -v filename | grep -v -- --- | grep -v 3c3 | wc -l` == 0 ))
++./test_ics1 $srcdir/test/testim.ics result_v1.ics
Added: trunk/packages/libics/trunk/debian/patches/series
===================================================================
--- trunk/packages/libics/trunk/debian/patches/series (rev 0)
+++ trunk/packages/libics/trunk/debian/patches/series 2012-04-04 10:48:02 UTC (rev 10313)
@@ -0,0 +1 @@
+bigendianfix.patch
More information about the debian-med-commit
mailing list