[GRASS-dev] Re: [GRASS GIS] #22: Grass r.out.mat 64bit Matlab reading problem

GRASS GIS trac at osgeo.org
Wed Jan 23 00:09:00 EST 2008


#22: Grass r.out.mat 64bit Matlab reading problem
----------------------+-----------------------------------------------------
  Reporter:  alexice  |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect   |      Status:  new                      
  Priority:  minor    |   Milestone:  6.3.0                    
 Component:  default  |     Version:  6.2.3                    
Resolution:           |    Keywords:                           
----------------------+-----------------------------------------------------
Comment (by 1gray):

 Replying to [comment:1 hamish]:

 ...

 > raster/r.out.mat/main.c:
 > The mrows, ncols, format_block, and realflag variables are type "long"
 and written with fwrite(...,sizeof(long),...);. They should be written as
 4 bytes on all platforms. The name_len variable too.

         The file should `#include <stdint.h>' and use int32_t instead of
 `long' where the bit width is important.

 > I think it's an easy fix but I have only passing exposure to 64bit
 programming. I don't have a 64bit machine to test on, but I do have matlab
 2007a.

         At the very least, the s/long/int32_t/ change (where appropriate)
 shouldn't break the 32-bit build.  Could you check it?  (I have access to
 a 64-bit host, but not to Matlab.)

 > r.in.mat uses fread() + "long" integers for those things too, so would
 need to be fixed as well.

 ...

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/22#comment:2>
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/


More information about the grass-dev mailing list