Fix an other build issue
authorSylvestre Ledru <sylvestre.ledru@scilab.org>
Sun, 28 Nov 2010 15:28:51 +0000 (16:28 +0100)
committerSylvestre Ledru <sylvestre.ledru@scilab.org>
Sun, 28 Nov 2010 15:28:51 +0000 (16:28 +0100)
debian/patches/fix_bug_issue.diff [new file with mode: 0644]

diff --git a/debian/patches/fix_bug_issue.diff b/debian/patches/fix_bug_issue.diff
new file mode 100644 (file)
index 0000000..a0eaa05
--- /dev/null
@@ -0,0 +1,134 @@
+diff --git a/mgl/mgl_data_io.cpp b/mgl/mgl_data_io.cpp
+index 0c5d845..d04f9ee 100644
+--- a/mgl/mgl_data_io.cpp
++++ b/mgl/mgl_data_io.cpp
+@@ -2,31 +2,33 @@
+  * mgl_data_io.cpp is part of Math Graphic Library
+  * Copyright (C) 2007 Alexey Balakin <balakin@appl.sci-nnov.ru>            *
+  *                                                                         *
+- *   This program is free software; you can redistribute it and/or modify  *
+- *   it under the terms of the GNU Library General Public License as       *
+- *   published by the Free Software Foundation; either version 3 of the    *
+- *   License, or (at your option) any later version.                       *
+- *                                                                         *
+- *   This program is distributed in the hope that it will be useful,       *
+- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+- *   GNU General Public License for more details.                          *
+- *                                                                         *
+- *   You should have received a copy of the GNU Library General Public     *
+- *   License along with this program; if not, write to the                 *
+- *   Free Software Foundation, Inc.,                                       *
+- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+- ***************************************************************************/
++ *   This program is free software; you can redistribute it and/or modify  *
++ *   it under the terms of the GNU Library General Public License as       *
++ *   published by the Free Software Foundation; either version 3 of the    *
++ *   License, or (at your option) any later version.                       *
++ *                                                                         *
++ *   This program is distributed in the hope that it will be useful,       *
++ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
++ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
++ *   GNU General Public License for more details.                          *
++ *                                                                         *
++ *   You should have received a copy of the GNU Library General Public     *
++ *   License along with this program; if not, write to the                 *
++ *   Free Software Foundation, Inc.,                                       *
++ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
++ ***************************************************************************/
+ #include <stdlib.h>
+ #include <ctype.h>
+ #include <math.h>
+ #include <string.h>
+-#include <zlib.h>
++#include <zlib.h>
+ #ifdef HAVE_HDF5
+ #include <hdf5.h>
+ #endif
+ #ifdef HAVE_HDF4
++#define intf hdf4_intf
+ #include <hdf/mfhdf.h>
++#undef intf
+ #endif
+ #ifndef WIN32
+@@ -906,42 +908,42 @@ void mglData::Fill(const char *eq, mglPoint r1, mglPoint r2, const mglData *v, c
+ }
+ //-----------------------------------------------------------------------------
+ void mglData::ReadHDF4(const char *fname,const char *data)
+-{
+-#ifdef HAVE_HDF4
+-      int sd = SDstart(fname,DFACC_READ), nn, i;
+-      if(sd==-1)      return; // is not a HDF4 file
+-      char name[64];
+-      SDfileinfo(sd,&nn,&i);
+-      for(i=0;i<nn;i++)
+-      {
+-              int sds, rank, dims[32], type, attr, in[2]={0,0};
+-              sds = SDselect(sd,i);
+-              SDgetinfo(sds,name,&rank,dims,&type,&attr);
+-              if(!strcmp(name,data))  // as I understand there are possible many datas with the same name
+-              {
+-                      if(rank==1)                     Create(dims[0]);
+-                      else if(rank==2)        Create(dims[1],dims[0]);
+-                      else if(rank==3)        Create(dims[3],dims[1],dims[0]);
+-                      else    continue;
+-                      if(type==DFNT_FLOAT32)
+-                      {
+-                              float *b = new float[nx*ny*nz];
+-                              SDreaddata(sds,in,0,dims,b);
+-                              for(long j=0;j<nx*ny*nz;j++)    a[j]=b[j];
+-                              delete []b;
+-                      }
+-                      if(type==DFNT_FLOAT64)
+-                      {
+-                              double *b = new double[nx*ny*nz];
+-                              SDreaddata(sds,in,0,dims,b);
+-                              for(long j=0;j<nx*ny*nz;j++)    a[j]=b[j];
+-                              delete []b;
+-                      }
+-              }
+-              SDendaccess(sds);
+-      }
+-      SDend(sd);
+-#endif
++{
++#ifdef HAVE_HDF4
++      int sd = SDstart(fname,DFACC_READ), nn, i;
++      if(sd==-1)      return; // is not a HDF4 file
++      char name[64];
++      SDfileinfo(sd,(int32*)&nn,(int32*)&i);
++      for(i=0;i<nn;i++)
++      {
++              int sds, rank, dims[32], type, attr, in[2]={0,0};
++              sds = SDselect(sd,i);
++              SDgetinfo(sds,name,(int32*)&rank,(int32*)dims,(int32*)&type,(int32*)&attr);
++              if(!strcmp(name,data))  // as I understand there are possible many datas with the same name
++              {
++                      if(rank==1)                     Create(dims[0]);
++                      else if(rank==2)        Create(dims[1],dims[0]);
++                      else if(rank==3)        Create(dims[3],dims[1],dims[0]);
++                      else    continue;
++                      if(type==DFNT_FLOAT32)
++                      {
++                              float *b = new float[nx*ny*nz];
++                              SDreaddata(sds,(int32*)in,0,(int32*)dims,b);
++                              for(long j=0;j<nx*ny*nz;j++)    a[j]=b[j];
++                              delete []b;
++                      }
++                      if(type==DFNT_FLOAT64)
++                      {
++                              double *b = new double[nx*ny*nz];
++                              SDreaddata(sds,(int32*)in,0,(int32*)dims,b);
++                              for(long j=0;j<nx*ny*nz;j++)    a[j]=b[j];
++                              delete []b;
++                      }
++              }
++              SDendaccess(sds);
++      }
++      SDend(sd);
++#endif
+ }
+ //-----------------------------------------------------------------------------
+ #ifdef HAVE_HDF5
+