[SCM] Packaging for mathgl branch, master, updated. debian/1.11.0.1-1-19-gd2a4c60

Dimitrios Eftaxiopoulos eftaxi12 at otenet.gr
Thu Dec 30 17:26:30 UTC 2010


The following commit has been merged in the master branch:
commit 997340bed2875f1d7ff2dce74552b052f8a7daa5
Author: Dimitrios Eftaxiopoulos <eftaxi12 at otenet.gr>
Date:   Thu Dec 30 15:54:26 2010 +0200

    Update debian/changelog

diff --git a/.pc/applied-patches b/.pc/applied-patches
index 18cd0d7..1287af9 100644
--- a/.pc/applied-patches
+++ b/.pc/applied-patches
@@ -4,3 +4,4 @@ dircategory-and-direntry-mgl-ru-texi.patch
 dircategory-and-direntry-mgl-en-texi.patch
 correct-spelling-error-in-nympy-i.patch
 createpngdirectory.patch
+mgl-mgl_data_io_cpp.patch
diff --git a/lang/INDEX b/.pc/correct-spelling-error-in-nympy-i.patch/.timestamp
similarity index 100%
copy from lang/INDEX
copy to .pc/correct-spelling-error-in-nympy-i.patch/.timestamp
diff --git a/lang/INDEX b/.pc/createpngdirectory.patch/.timestamp
similarity index 100%
copy from lang/INDEX
copy to .pc/createpngdirectory.patch/.timestamp
diff --git a/lang/INDEX b/.pc/dircategory-and-direntry-mathgl-en-texi.patch/.timestamp
similarity index 100%
copy from lang/INDEX
copy to .pc/dircategory-and-direntry-mathgl-en-texi.patch/.timestamp
diff --git a/lang/INDEX b/.pc/dircategory-and-direntry-mathgl-ru-texi.patch/.timestamp
similarity index 100%
copy from lang/INDEX
copy to .pc/dircategory-and-direntry-mathgl-ru-texi.patch/.timestamp
diff --git a/lang/INDEX b/.pc/dircategory-and-direntry-mgl-en-texi.patch/.timestamp
similarity index 100%
copy from lang/INDEX
copy to .pc/dircategory-and-direntry-mgl-en-texi.patch/.timestamp
diff --git a/lang/INDEX b/.pc/dircategory-and-direntry-mgl-ru-texi.patch/.timestamp
similarity index 100%
copy from lang/INDEX
copy to .pc/dircategory-and-direntry-mgl-ru-texi.patch/.timestamp
diff --git a/lang/INDEX b/.pc/mgl-mgl_data_io_cpp.patch/.timestamp
similarity index 100%
copy from lang/INDEX
copy to .pc/mgl-mgl_data_io_cpp.patch/.timestamp
diff --git a/mgl/mgl_data_io.cpp b/.pc/mgl-mgl_data_io_cpp.patch/mgl/mgl_data_io.cpp
similarity index 100%
copy from mgl/mgl_data_io.cpp
copy to .pc/mgl-mgl_data_io_cpp.patch/mgl/mgl_data_io.cpp
diff --git a/debian/changelog b/debian/changelog
index 9f4a9a3..cf54496 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+mathgl (1.11.0.1-2) experimental; urgency=low
+
+  * Apply upstream patch for FTBFS on i386 (Closes: #607539).
+  * Change debian/rules file.
+
+ -- Dimitrios Eftaxiopoulos <eftaxi12 at otenet.gr>  Sun, 12 Dec 2010 19:13:00 +0200
+
 mathgl (1.11.0.1-1) experimental; urgency=low
 
   * Correct debian/copyright file.
diff --git a/debian/patches/createpngdirectory.patch b/debian/patches/createpngdirectory.patch
index 0e08473..439dc25 100644
--- a/debian/patches/createpngdirectory.patch
+++ b/debian/patches/createpngdirectory.patch
@@ -1,9 +1,7 @@
 Create /png directory in the topmost source directory
-diff --git a/texinfo/png/Makefile.am b/texinfo/png/Makefile.am
-index 80e5143..1d28940 100644
 --- a/texinfo/png/Makefile.am
 +++ b/texinfo/png/Makefile.am
-@@ -7,5 +7,6 @@ CLEANFILES = $(png_images)
+@@ -7,5 +7,6 @@
  
  $(png_images): hotdogs.pts # $(top_builddir)/examples/mgl_example
  	$(top_builddir)/examples/mgl_example -kind=${@:.png=}
diff --git a/debian/patches/mgl-mgl_data_io_cpp.patch b/debian/patches/mgl-mgl_data_io_cpp.patch
new file mode 100644
index 0000000..10c17e9
--- /dev/null
+++ b/debian/patches/mgl-mgl_data_io_cpp.patch
@@ -0,0 +1,299 @@
+Upstream patch for FTBFS on i386
+--- a/mgl/mgl_data_io.cpp
++++ b/mgl/mgl_data_io.cpp
+@@ -2,33 +2,33 @@
+  * mgl_data_io.cpp is part of Math Graphic Library
+  * Copyright (C) 2007 Alexey Balakin <balakin at 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
++#define intf hdf4_intf
++#include <hdf/mfhdf.h>
++#undef intf
+ #endif
+ 
+ #ifndef WIN32
+@@ -302,17 +302,17 @@
+ 	}
+ 	fclose(fp);
+ }
+-//-----------------------------------------------------------------------------
+-char *mgl_read_gz(gzFile fp)
+-{
+-	long size=1024,n=0,m;
+-	char *buf=(char*)malloc(size);
+-	while((m=gzread(fp,buf+size*n,size))>0)
+-	{
+-		if(m<size)	{	buf[size*n+m]=0;	break;	}
+-		n++;		buf=(char*)realloc(buf,size*(n+1));
+-	}
+-	return buf;
++//-----------------------------------------------------------------------------
++char *mgl_read_gz(gzFile fp)
++{
++	long size=1024,n=0,m;
++	char *buf=(char*)malloc(size);
++	while((m=gzread(fp,buf+size*n,size))>0)
++	{
++		if(m<size)	{	buf[size*n+m]=0;	break;	}
++		n++;		buf=(char*)realloc(buf,size*(n+1));
++	}
++	return buf;
+ }
+ //-----------------------------------------------------------------------------
+ bool mglData::Read(const char *fname)
+@@ -321,23 +321,23 @@
+ 	long nb,i;
+ 	gzFile fp = gzopen(fname,"r");
+ 	if(!fp)
+-	{
++	{
+ 		if(!a)	Create(1,1,1);
+ 		return	false;
+ 	}
+-	char *buf = mgl_read_gz(fp);
++	char *buf = mgl_read_gz(fp);
+ 	nb = strlen(buf);	gzclose(fp);
+ 
+ 	bool first=false,com=false;
+ 	register char ch;
+ 	for(i=nb-1;i>=0;i--)	if(buf[i]>' ')	break;
+-	buf[i+1]=0;	nb = i;		// remove tailing spaces
++	buf[i+1]=0;	nb = i;		// remove tailing spaces
+ 	for(i=0;i<nb-1 && !isn(buf[i]);i++)	// determine nx
+ 	{
+ 		if(buf[i]=='#')		while(!isn(buf[i]) && i<nb)	i++;
+ 		ch = buf[i];
+ 		if(ch>' ' && !first)	first=true;
+-		if(first && (ch==' ' || ch=='\t') && buf[i+1]>' ') k++;
++		if(first && (ch==' ' || ch=='\t') && buf[i+1]>' ') k++;
+ 	}
+ 	first = false;
+ 	for(i=0;i<nb-1;i++)					// determine ny
+@@ -362,7 +362,7 @@
+ 		}
+ 	}
+ 	else	for(i=0;i<nb-1;i++)	if(buf[i]=='\f')	l++;
+-	free(buf);
++	free(buf);
+ 	return Read(fname,k,m,l);
+ }
+ //-----------------------------------------------------------------------------
+@@ -382,7 +382,7 @@
+ 	gzFile fp = gzopen(fname,"r");
+ 	if(!fp)	return false;
+ 	Create(mx,my,mz);
+-	char *buf = mgl_read_gz(fp);
++	char *buf = mgl_read_gz(fp);
+ 	long nb = strlen(buf);	gzclose(fp);
+ 
+ 	register long i=0, j=0, k=0;
+@@ -408,8 +408,8 @@
+ 		char *s=buf+j;
+ 		while(buf[j]>' ' && j<nb)	j++;
+ 		buf[j]=0;
+-		a[i] = atof(s);
+-		i++;	if(i>=nx*ny*nz)	break;
++		a[i] = atof(s);
++		i++;	if(i>=nx*ny*nz)	break;
+ 	}
+ 	free(buf);
+ 	return true;
+@@ -421,7 +421,7 @@
+ 	gzFile fp = gzopen(fname,"r");
+ 	if(!fp)	return false;
+ 	nx = ny = nz = 1;	NewId();
+-	char *buf = mgl_read_gz(fp);
++	char *buf = mgl_read_gz(fp);
+ 	long nb = strlen(buf);	gzclose(fp);
+ 
+ 	register long i=0,j=0;
+@@ -692,10 +692,10 @@
+ 	{
+ 		for(k=dim;k<nz;k++)
+ 		{
+-			z = (nz>dim+1) ? (k-dim)/(nz-dim-1.) : 0;
+-			aa = a+nx*ny*k;
+-//#pragma omp parallel for
+-			for(i=0;i<nx*ny;i++)
++			z = (nz>dim+1) ? (k-dim)/(nz-dim-1.) : 0;
++			aa = a+nx*ny*k;
++//#pragma omp parallel for
++			for(i=0;i<nx*ny;i++)
+ 				aa[i] = eqs.Calc(dx*(i%nx),dy*(i/nx),z,aa[i]);
+ 		}
+ 	}
+@@ -703,10 +703,10 @@
+ 	{
+ 		if(ny==1)	dim = 0;
+ 		dy = ny>dim+1 ? 1/(ny-dim-1.) : 0;
+-		for(j=dim;j<ny;j++)
+-		{
+-			y = dy*(j-dim);		aa = a+nx*j;
+-//#pragma omp parallel for
++		for(j=dim;j<ny;j++)
++		{
++			y = dy*(j-dim);		aa = a+nx*j;
++//#pragma omp parallel for
+ 			for(i=0;i<nx;i++)	aa[i] = eqs.Calc(dx*i,y,0,aa[i]);
+ 		}
+ 	}
+@@ -771,10 +771,10 @@
+ 		long dx,dy,dz,i1,j1,k1;
+ 		dx = (i+1)*rx<=nx ? rx : nx-i*rx;
+ 		dy = (j+1)*ry<=ny ? ry : ny-j*ry;
+-		dz = (k+1)*rz<=nz ? rz : nz-k*rz;
++		dz = (k+1)*rz<=nz ? rz : nz-k*rz;
+ 		mreal s = 0;
+ 		for(i1=i*rx;i1<i*rx+dx;i1++)	for(j1=j*ry;j1<j*ry+dz;j1++)	for(k1=k*rz;k1<k*rz+dz;k1++)
+-			s += a[i1+nx*(j1+ny*k1)];
++			s += a[i1+nx*(j1+ny*k1)];
+ 		b[i+kx*(j+ky*k)] = s/dx*dy*dz;
+ 	}
+ 	delete []a;	a=b;
+@@ -912,42 +912,42 @@
+ }
+ //-----------------------------------------------------------------------------
+ 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
++	long 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++)
++	{
++		long 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_HDF5
+@@ -991,14 +991,14 @@
+ {
+ 	hid_t hf,hd,hs;
+ 	hsize_t dims[3];
+-	long rank, res = H5Fis_hdf5(fname);
++	long rank, res = H5Fis_hdf5(fname);
+ 	if(res<=0)	{	ReadHDF4(fname,data);	return;	}
+ 	hf = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT);	if(hf<0)	return;
+ #ifndef H5_USE_16_API
+ 	hd = H5Dopen(hf,data,H5P_DEFAULT);
+ #else
+ 	hd = H5Dopen(hf,data);
+-#endif
++#endif
+ 	if(hd<0)	return;
+ 	hs = H5Dget_space(hd);
+ 	rank = H5Sget_simple_extent_ndims(hs);
+@@ -1115,7 +1115,7 @@
+ 	for(;i<res.gl_pathc;i++)
+ 	{
+ 		if(d.Read(res.gl_pathv[i]))
+-			if(!mgl_add_file(kx,ky,kz,b,d,as_slice))
++			if(!mgl_add_file(kx,ky,kz,b,d,as_slice))
+ 			{	delete []fname;		return false;	}
+ 	}
+ 	Set(b,kx,ky,kz);
diff --git a/debian/patches/series b/debian/patches/series
index a51d7a1..93e491e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ dircategory-and-direntry-mgl-ru-texi.patch
 dircategory-and-direntry-mgl-en-texi.patch
 correct-spelling-error-in-nympy-i.patch
 createpngdirectory.patch 
+mgl-mgl_data_io_cpp.patch
diff --git a/mgl/mgl_data_io.cpp b/mgl/mgl_data_io.cpp
index caf525c..e389422 100644
--- a/mgl/mgl_data_io.cpp
+++ b/mgl/mgl_data_io.cpp
@@ -2,33 +2,33 @@
  * mgl_data_io.cpp is part of Math Graphic Library
  * Copyright (C) 2007 Alexey Balakin <balakin at 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
+#define intf hdf4_intf
+#include <hdf/mfhdf.h>
+#undef intf
 #endif
 
 #ifndef WIN32
@@ -302,17 +302,17 @@ void mglData::Save(const char *fname,int ns) const
 	}
 	fclose(fp);
 }
-//-----------------------------------------------------------------------------
-char *mgl_read_gz(gzFile fp)
-{
-	long size=1024,n=0,m;
-	char *buf=(char*)malloc(size);
-	while((m=gzread(fp,buf+size*n,size))>0)
-	{
-		if(m<size)	{	buf[size*n+m]=0;	break;	}
-		n++;		buf=(char*)realloc(buf,size*(n+1));
-	}
-	return buf;
+//-----------------------------------------------------------------------------
+char *mgl_read_gz(gzFile fp)
+{
+	long size=1024,n=0,m;
+	char *buf=(char*)malloc(size);
+	while((m=gzread(fp,buf+size*n,size))>0)
+	{
+		if(m<size)	{	buf[size*n+m]=0;	break;	}
+		n++;		buf=(char*)realloc(buf,size*(n+1));
+	}
+	return buf;
 }
 //-----------------------------------------------------------------------------
 bool mglData::Read(const char *fname)
@@ -321,23 +321,23 @@ bool mglData::Read(const char *fname)
 	long nb,i;
 	gzFile fp = gzopen(fname,"r");
 	if(!fp)
-	{
+	{
 		if(!a)	Create(1,1,1);
 		return	false;
 	}
-	char *buf = mgl_read_gz(fp);
+	char *buf = mgl_read_gz(fp);
 	nb = strlen(buf);	gzclose(fp);
 
 	bool first=false,com=false;
 	register char ch;
 	for(i=nb-1;i>=0;i--)	if(buf[i]>' ')	break;
-	buf[i+1]=0;	nb = i;		// remove tailing spaces
+	buf[i+1]=0;	nb = i;		// remove tailing spaces
 	for(i=0;i<nb-1 && !isn(buf[i]);i++)	// determine nx
 	{
 		if(buf[i]=='#')		while(!isn(buf[i]) && i<nb)	i++;
 		ch = buf[i];
 		if(ch>' ' && !first)	first=true;
-		if(first && (ch==' ' || ch=='\t') && buf[i+1]>' ') k++;
+		if(first && (ch==' ' || ch=='\t') && buf[i+1]>' ') k++;
 	}
 	first = false;
 	for(i=0;i<nb-1;i++)					// determine ny
@@ -362,7 +362,7 @@ bool mglData::Read(const char *fname)
 		}
 	}
 	else	for(i=0;i<nb-1;i++)	if(buf[i]=='\f')	l++;
-	free(buf);
+	free(buf);
 	return Read(fname,k,m,l);
 }
 //-----------------------------------------------------------------------------
@@ -382,7 +382,7 @@ bool mglData::Read(const char *fname,int mx,int my,int mz)
 	gzFile fp = gzopen(fname,"r");
 	if(!fp)	return false;
 	Create(mx,my,mz);
-	char *buf = mgl_read_gz(fp);
+	char *buf = mgl_read_gz(fp);
 	long nb = strlen(buf);	gzclose(fp);
 
 	register long i=0, j=0, k=0;
@@ -408,8 +408,8 @@ bool mglData::Read(const char *fname,int mx,int my,int mz)
 		char *s=buf+j;
 		while(buf[j]>' ' && j<nb)	j++;
 		buf[j]=0;
-		a[i] = atof(s);
-		i++;	if(i>=nx*ny*nz)	break;
+		a[i] = atof(s);
+		i++;	if(i>=nx*ny*nz)	break;
 	}
 	free(buf);
 	return true;
@@ -421,7 +421,7 @@ bool mglData::ReadMat(const char *fname,int dim)
 	gzFile fp = gzopen(fname,"r");
 	if(!fp)	return false;
 	nx = ny = nz = 1;	NewId();
-	char *buf = mgl_read_gz(fp);
+	char *buf = mgl_read_gz(fp);
 	long nb = strlen(buf);	gzclose(fp);
 
 	register long i=0,j=0;
@@ -692,10 +692,10 @@ void mglData::Modify(const char *eq,int dim)
 	{
 		for(k=dim;k<nz;k++)
 		{
-			z = (nz>dim+1) ? (k-dim)/(nz-dim-1.) : 0;
-			aa = a+nx*ny*k;
-//#pragma omp parallel for
-			for(i=0;i<nx*ny;i++)
+			z = (nz>dim+1) ? (k-dim)/(nz-dim-1.) : 0;
+			aa = a+nx*ny*k;
+//#pragma omp parallel for
+			for(i=0;i<nx*ny;i++)
 				aa[i] = eqs.Calc(dx*(i%nx),dy*(i/nx),z,aa[i]);
 		}
 	}
@@ -703,10 +703,10 @@ void mglData::Modify(const char *eq,int dim)
 	{
 		if(ny==1)	dim = 0;
 		dy = ny>dim+1 ? 1/(ny-dim-1.) : 0;
-		for(j=dim;j<ny;j++)
-		{
-			y = dy*(j-dim);		aa = a+nx*j;
-//#pragma omp parallel for
+		for(j=dim;j<ny;j++)
+		{
+			y = dy*(j-dim);		aa = a+nx*j;
+//#pragma omp parallel for
 			for(i=0;i<nx;i++)	aa[i] = eqs.Calc(dx*i,y,0,aa[i]);
 		}
 	}
@@ -771,10 +771,10 @@ void mglData::Squeeze(int rx,int ry,int rz,bool smooth)
 		long dx,dy,dz,i1,j1,k1;
 		dx = (i+1)*rx<=nx ? rx : nx-i*rx;
 		dy = (j+1)*ry<=ny ? ry : ny-j*ry;
-		dz = (k+1)*rz<=nz ? rz : nz-k*rz;
+		dz = (k+1)*rz<=nz ? rz : nz-k*rz;
 		mreal s = 0;
 		for(i1=i*rx;i1<i*rx+dx;i1++)	for(j1=j*ry;j1<j*ry+dz;j1++)	for(k1=k*rz;k1<k*rz+dz;k1++)
-			s += a[i1+nx*(j1+ny*k1)];
+			s += a[i1+nx*(j1+ny*k1)];
 		b[i+kx*(j+ky*k)] = s/dx*dy*dz;
 	}
 	delete []a;	a=b;
@@ -912,42 +912,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
+	long 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++)
+	{
+		long 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_HDF5
@@ -991,14 +991,14 @@ void mglData::ReadHDF(const char *fname,const char *data)
 {
 	hid_t hf,hd,hs;
 	hsize_t dims[3];
-	long rank, res = H5Fis_hdf5(fname);
+	long rank, res = H5Fis_hdf5(fname);
 	if(res<=0)	{	ReadHDF4(fname,data);	return;	}
 	hf = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT);	if(hf<0)	return;
 #ifndef H5_USE_16_API
 	hd = H5Dopen(hf,data,H5P_DEFAULT);
 #else
 	hd = H5Dopen(hf,data);
-#endif
+#endif
 	if(hd<0)	return;
 	hs = H5Dget_space(hd);
 	rank = H5Sget_simple_extent_ndims(hs);
@@ -1115,7 +1115,7 @@ bool mglData::ReadAll(const char *templ, bool as_slice)
 	for(;i<res.gl_pathc;i++)
 	{
 		if(d.Read(res.gl_pathv[i]))
-			if(!mgl_add_file(kx,ky,kz,b,d,as_slice))
+			if(!mgl_add_file(kx,ky,kz,b,d,as_slice))
 			{	delete []fname;		return false;	}
 	}
 	Set(b,kx,ky,kz);

-- 
Packaging for mathgl



More information about the debian-science-commits mailing list