[MINC-users] Minc 1.5.1 64-bit compatibility bug

Alexandre CARMEL-VEILLEUX acveilleux at mrs.mni.mcgill.ca
Tue Jul 22 14:43:31 EDT 2008


On Tue, Jul 22, 2008 at 02:38:17PM -0400, Claude LEPAGE wrote:
> > 
> > 	I forgot the "easy" fix:
> > 
> >        case ARGV_CONSTANT:
> >           *((int *) infoPtr->dst) = *((int*)(&infoPtr->src));
> >           break;
> > 
> > Becomes:
> > 
> >        case ARGV_CONSTANT:
> >           *((long *) infoPtr->dst) = *((long*)(&infoPtr->src));
> > 	  break;
> 
> MI_PET = "PET__" (5bytes + 1byte for \0) 

infoPtr->src contains the pointer to "PET__", not "PET__". This is the case
where a Pointer is being passed as a "constant" argument. On 32-bit platform
all works well because an int can contain a pointer.

Alex

> The above will get you 8 bytes (and the full string), but should clobber 
> the infoPtr->help key follwing src in the struct. 
> 
> Use ARGV_STRING.
> 
> Claude
> _______________________________________________
> MINC-users at bic.mni.mcgill.ca
> http://www2.bic.mni.mcgill.ca/mailman/listinfo/minc-users


More information about the MINC-users mailing list