[cpl-plugin-xsh] 02/02: Correct usage of printf. Fixes #750748

Ole Streicher olebole-guest at moszumanska.debian.org
Mon Jun 9 10:56:35 UTC 2014


This is an automated email from the git hooks/post-receive script.

olebole-guest pushed a commit to branch debian
in repository cpl-plugin-xsh.

commit 167f2fb19f8efd75afa6bb26c5fe207d962f7add
Author: Ole Streicher <debian at liska.ath.cx>
Date:   Mon Jun 9 12:34:47 2014 +0200

    Correct usage of printf. Fixes #750748
---
 debian/changelog                         |   7 ++
 debian/patches/adapt-sprintf-usage.patch | 125 +++++++++++++++++++++++++++++++
 debian/patches/series                    |   1 +
 3 files changed, 133 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index a9d9015..4a2eadf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+cpl-plugin-xshoo (2.4.6+dfsg-1) unstable; urgency=low
+
+  * New upstream version. Closes: #748196
+  * Correct usage of sprintf. Closes: #750748
+
+ -- Ole Streicher <debian at liska.ath.cx>  Mon, 09 Jun 2014 12:30:43 +0200
+
 cpl-plugin-xshoo (2.4.0+dfsg-1) unstable; urgency=low
 
   * New upstream version
diff --git a/debian/patches/adapt-sprintf-usage.patch b/debian/patches/adapt-sprintf-usage.patch
new file mode 100644
index 0000000..bb4d7b9
--- /dev/null
+++ b/debian/patches/adapt-sprintf-usage.patch
@@ -0,0 +1,125 @@
+Author: Dejan Latinovic <Dejan.Latinovic at imgtec.com>
+Description: Correct usage of sprintf
+Url: https://bugs.debian.org/750748
+--- a/xsh/tests/test-xsh_correl_gaussians.c
++++ b/xsh/tests/test-xsh_correl_gaussians.c
+@@ -316,7 +316,7 @@
+   //double   mean_i, double   mean_t ;
+   //double   rms_i, rms_t ;
+   //double   sum, sqsum ;
+-  double   norm ;
++  double   norm=0;
+   int      maxpos ;
+   int      nsteps ;
+   int      i ;
+--- a/xsh/xsh_data_order.c
++++ b/xsh/xsh_data_order.c
+@@ -240,23 +240,23 @@
+       char colname[32] ;
+       float coef ;
+ 
+-      sprintf( colname, "%s%d", XSH_ORDER_TABLE_COLNAME_CENTER, k ) ;
++      sprintf( colname, "%s%lld", XSH_ORDER_TABLE_COLNAME_CENTER, k ) ;
+       check(xsh_get_table_value(table, colname, CPL_TYPE_FLOAT, i, &coef));
+       check(cpl_polynomial_set_coeff(result->list[i].cenpoly,
+ 				     &k,coef));
+ 
+-      sprintf( colname, "%s%d", XSH_ORDER_TABLE_COLNAME_EDGLO, k ) ;
++      sprintf( colname, "%s%lld", XSH_ORDER_TABLE_COLNAME_EDGLO, k ) ;
+       check(xsh_get_table_value(table, colname, CPL_TYPE_FLOAT, i, &coef));
+       check(cpl_polynomial_set_coeff(result->list[i].edglopoly,
+ 				     &k,coef));
+ 
+-      sprintf( colname, "%s%d", XSH_ORDER_TABLE_COLNAME_EDGUP, k ) ;
++      sprintf( colname, "%s%lld", XSH_ORDER_TABLE_COLNAME_EDGUP, k ) ;
+       check(xsh_get_table_value(table, colname, CPL_TYPE_FLOAT, i, &coef));
+       check(cpl_polynomial_set_coeff(result->list[i].edguppoly,
+ 				     &k,coef));
+ 
+       /* Compatibility with old order table (had only SLIT) */
+-      sprintf( colname, "%s%d", XSH_ORDER_TABLE_COLNAME_SLICUP, k ) ;
++      sprintf( colname, "%s%lld", XSH_ORDER_TABLE_COLNAME_SLICUP, k ) ;
+       if ( cpl_table_has_column( table, colname ) == 1 ) {
+ 	check(xsh_get_table_value(table, colname, CPL_TYPE_FLOAT, i, &coef));
+ 	check(cpl_polynomial_set_coeff(result->list[i].slicuppoly,
+@@ -265,7 +265,7 @@
+       else check(cpl_polynomial_set_coeff(result->list[i].slicuppoly,
+ 					  &k, 0.));
+ 
+-      sprintf( colname, "%s%d", XSH_ORDER_TABLE_COLNAME_SLICLO, k ) ;
++      sprintf( colname, "%s%lld", XSH_ORDER_TABLE_COLNAME_SLICLO, k ) ;
+       if ( cpl_table_has_column( table, colname ) == 1 ) {
+ 	check(xsh_get_table_value(table, colname, CPL_TYPE_FLOAT, i, &coef));
+ 	check(cpl_polynomial_set_coeff(result->list[i].sliclopoly,
+@@ -836,21 +836,21 @@
+   /* Create as many column as needed, according to the polynomial degree */
+   for( k = 0 ; k<= pol_degree ; k++ ) {
+ 
+-    sprintf( colname, "%s%d", XSH_ORDER_TABLE_COLNAME_CENTER, k ) ;
++    sprintf( colname, "%s%lld", XSH_ORDER_TABLE_COLNAME_CENTER, k ) ;
+     check(
+ 	  cpl_table_new_column(table, colname, CPL_TYPE_FLOAT));
+-    sprintf( colname, "%s%d", XSH_ORDER_TABLE_COLNAME_EDGUP, k ) ;
++    sprintf( colname, "%s%lld", XSH_ORDER_TABLE_COLNAME_EDGUP, k ) ;
+     check(
+ 	  cpl_table_new_column(table, colname, CPL_TYPE_FLOAT));
+-    sprintf( colname, "%s%d", XSH_ORDER_TABLE_COLNAME_EDGLO, k ) ;
++    sprintf( colname, "%s%lld", XSH_ORDER_TABLE_COLNAME_EDGLO, k ) ;
+     check(
+ 	  cpl_table_new_column(table, colname, CPL_TYPE_FLOAT));
+ 
+-    sprintf( colname, "%s%d", XSH_ORDER_TABLE_COLNAME_SLICUP, k ) ;
++    sprintf( colname, "%s%lld", XSH_ORDER_TABLE_COLNAME_SLICUP, k ) ;
+     check(
+ 	  cpl_table_new_column(table, colname, CPL_TYPE_FLOAT));
+ 
+-    sprintf( colname, "%s%d", XSH_ORDER_TABLE_COLNAME_SLICLO, k ) ;
++    sprintf( colname, "%s%lld", XSH_ORDER_TABLE_COLNAME_SLICLO, k ) ;
+     check(
+ 	  cpl_table_new_column(table, colname, CPL_TYPE_FLOAT));
+   }
+@@ -881,7 +881,7 @@
+ 
+       /* Get and Write coef from center polynomial */
+       check(coef = cpl_polynomial_get_coeff(order_list->list[i].cenpoly,&k));
+-      sprintf( colname, "%s%d", XSH_ORDER_TABLE_COLNAME_CENTER, k ) ;
++      sprintf( colname, "%s%lld", XSH_ORDER_TABLE_COLNAME_CENTER, k ) ;
+       check(cpl_table_set(table, colname,i,coef));
+ 
+       /* Get and Write coef from upper polynomial */
+@@ -889,7 +889,7 @@
+         check(coef = cpl_polynomial_get_coeff(order_list->list[i].edguppoly,&k));
+       }
+       else coef = 0.0 ;
+-      sprintf( colname, "%s%d", XSH_ORDER_TABLE_COLNAME_EDGUP, k ) ;
++      sprintf( colname, "%s%lld", XSH_ORDER_TABLE_COLNAME_EDGUP, k ) ;
+       check(cpl_table_set(table, colname,i,coef));
+ 
+       /* Get and Write coef from lower polynomial */
+@@ -897,7 +897,7 @@
+         check(coef = cpl_polynomial_get_coeff(order_list->list[i].edglopoly,&k));
+       }
+       else coef = 0.0;
+-      sprintf( colname, "%s%d", XSH_ORDER_TABLE_COLNAME_EDGLO, k ) ;
++      sprintf( colname, "%s%lld", XSH_ORDER_TABLE_COLNAME_EDGLO, k ) ;
+       check(cpl_table_set(table, colname,i,coef));
+ 
+     /* Get and Write coef from slic lower polynomial */
+@@ -905,7 +905,7 @@
+ 	check(coef = cpl_polynomial_get_coeff(order_list->list[i].sliclopoly,&k));
+       }
+       else coef = 0.0 ;
+-      sprintf( colname, "%s%d", XSH_ORDER_TABLE_COLNAME_SLICLO, k ) ;
++      sprintf( colname, "%s%lld", XSH_ORDER_TABLE_COLNAME_SLICLO, k ) ;
+       check(cpl_table_set(table, colname, i, coef));
+ 
+     /* Get and Write coef from slic upper polynomial */
+@@ -913,7 +913,7 @@
+ 	check(coef = cpl_polynomial_get_coeff(order_list->list[i].slicuppoly,&k));
+       }
+       else coef = 0.0 ;
+-      sprintf( colname, "%s%d", XSH_ORDER_TABLE_COLNAME_SLICUP, k ) ;
++      sprintf( colname, "%s%lld", XSH_ORDER_TABLE_COLNAME_SLICUP, k ) ;
+       check(cpl_table_set(table, colname, i, coef));
+ 
+     }
diff --git a/debian/patches/series b/debian/patches/series
index 8ef9dde..80f7a3b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ set_plugindir.patch
 use-std-paths-for-cpl.patch
 lapack.patch
 force-serial-tests.patch
+adapt-sprintf-usage.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/cpl-plugin-xsh.git



More information about the debian-science-commits mailing list