Ticket #33903: patch-ml4.i.diff

File patch-ml4.i.diff, 877 bytes (added by paumard, 12 years ago)

Bug fix from github

  • ml4.i

    diff -u ml4.i.orig ml4.i
    old new func ml4write(file,data,varname,mode,endian=) 
    124124    ncols=int(dims(3));
    125125  }
    126126 
    127   if      (structof(data)==long)   { type='l'; }
     127  tmp = data; // otherwise data may be swapped in place in endian='L'
     128
     129  // next line: fix from Thibaut Paumard for Debian.
     130  if      (structof(data)==long)   { type='l'; tmp=int(tmp); }
    128131  else if (structof(data)==int)    { type='l'; }
    129132  else if (structof(data)==float)  { type='r'; }
    130133  else if (structof(data)==double) { type='d'; }
    func ml4write(file,data,varname,mode,endian=) 
    132135  else if (structof(data)==char)   { type='b'; }
    133136  else error,"Unsupported type";
    134137
    135   tmp = data; // otherwise data may be swapped in place in endian='L'
    136  
    137138  status = matout(file,varname,&tmp,nrows,ncols,type,mode,endian);
    138139  if (status) error,"write failed";
    139140}