Bug#831181: patch updated for gcc-6

2016-07-19 Thread Thies Jochimsen

Dear Gianfranco, thank you for the patch, it should do the right thing.

I have implemented these fixes for GCC6 with slight modifications in the 
Odin SVN to avoid problems on other platforms (VxWorks, Visual Studio).


T.



Am 16.07.2016 um 09:55 schrieb Gianfranco Costamagna:

Hi, attached the patch updated for gcc-6 (addition of the incomplete upstream 
one)
and the complete debdiff for a building oding against gcc-6

basically the new issues (excluding the already upstream-patched 
"odinseq/odinpulse.cpp"

were:
in odinseq/seqgradspiral.cpp
bad compare between double and float

-  max_grad_diff=STD_max(double(max_grad_diff),fabs(tds.Gx-last_Gx));
-  max_grad_diff=STD_max(double(max_grad_diff),fabs(tds.Gy-last_Gy));
+  max_grad_diff=STD_max(max_grad_diff,fabs(tds.Gx-last_Gx));
+  max_grad_diff=STD_max(max_grad_diff,fabs(tds.Gy-last_Gy));


- max_grad_magn=STD_max(double(max_grad_magn),fabs(tds.Gx));
-max_grad_magn=STD_max(double(max_grad_magn),fabs(tds.Gy));
+max_grad_magn=STD_max(max_grad_magn,fabs(tds.Gx));
+max_grad_magn=STD_max(max_grad_magn,fabs(tds.Gy));



and in cmdline-utils/swab.cpp

ifstream return check
-  if(in_data == NULL) {
+  if(in_data.fail()) {


-  if(out_data == NULL) {
+  if(out_data.fail()) {


-  if(out_data == NULL) {
+  if(out_data.fail()) {


they seem to be correct to me, but I'm ccing upstream to be sure :)

BTW, in deferred/5.
thanks,

G.




Bug#831181: patch updated for gcc-6

2016-07-16 Thread Gianfranco Costamagna
Hi, attached the patch updated for gcc-6 (addition of the incomplete upstream 
one)
and the complete debdiff for a building oding against gcc-6

basically the new issues (excluding the already upstream-patched 
"odinseq/odinpulse.cpp"

were:
in odinseq/seqgradspiral.cpp
bad compare between double and float

-  max_grad_diff=STD_max(double(max_grad_diff),fabs(tds.Gx-last_Gx));
-  max_grad_diff=STD_max(double(max_grad_diff),fabs(tds.Gy-last_Gy));
+  max_grad_diff=STD_max(max_grad_diff,fabs(tds.Gx-last_Gx));
+  max_grad_diff=STD_max(max_grad_diff,fabs(tds.Gy-last_Gy));


- max_grad_magn=STD_max(double(max_grad_magn),fabs(tds.Gx));
-max_grad_magn=STD_max(double(max_grad_magn),fabs(tds.Gy));
+max_grad_magn=STD_max(max_grad_magn,fabs(tds.Gx));
+max_grad_magn=STD_max(max_grad_magn,fabs(tds.Gy));



and in cmdline-utils/swab.cpp

ifstream return check
-  if(in_data == NULL) {
+  if(in_data.fail()) {


-  if(out_data == NULL) {
+  if(out_data.fail()) {


-  if(out_data == NULL) {
+  if(out_data.fail()) {


they seem to be correct to me, but I'm ccing upstream to be sure :)

BTW, in deferred/5.
thanks,

G.


debdiff-v2
Description: Binary data
Description: Fix some std::max(double,float) call mismatch and some "ifstream not comparable with NULL"

Author: Gianfranco Costamagna 

--- odin-2.0.2.orig/odinseq/seqgradspiral.cpp
+++ odin-2.0.2/odinseq/seqgradspiral.cpp
@@ -27,12 +27,12 @@ float SeqGradSpiral::readout_npts() cons
 const kspace_coord& tds=traj_cache->calculate(s);
 if(i) {
   deltaKtangential=STD_max(double(deltaKtangential),norm(tds.kx-last_kx,tds.ky-last_ky));
-  max_grad_diff=STD_max(double(max_grad_diff),fabs(tds.Gx-last_Gx));
-  max_grad_diff=STD_max(double(max_grad_diff),fabs(tds.Gy-last_Gy));
+  max_grad_diff=STD_max(max_grad_diff,fabs(tds.Gx-last_Gx));
+  max_grad_diff=STD_max(max_grad_diff,fabs(tds.Gy-last_Gy));
 }
 
-max_grad_magn=STD_max(double(max_grad_magn),fabs(tds.Gx));
-max_grad_magn=STD_max(double(max_grad_magn),fabs(tds.Gy));
+max_grad_magn=STD_max(max_grad_magn,fabs(tds.Gx));
+max_grad_magn=STD_max(max_grad_magn,fabs(tds.Gy));
 
 last_kx=tds.kx;
 last_ky=tds.ky;
--- odin-2.0.2.orig/cmdline-utils/swab.cpp
+++ odin-2.0.2/cmdline-utils/swab.cpp
@@ -28,7 +28,7 @@ int main(int argc, char* argv[]) {
   }
 
   std::ifstream in_data(argv[2],std::ios::in|std::ios::binary);
-  if(in_data == NULL) {
+  if(in_data.fail()) {
 std::cerr << "swab: ERROR: can't open file " << argv[2] << std::endl;
 return -1;
   }
@@ -56,14 +56,14 @@ int main(int argc, char* argv[]) {
   for(k=0;k

Bug#831181: patch

2016-07-15 Thread Gianfranco Costamagna
control: tags -1 patch
control: tags -1 pending

Hi maintainer, the patch for this issue has been uploaded on deferred/5, and 
attached
to this email.

G.


debdiff
Description: Binary data