[PATCH, fortran] Simplify constant substrings

Steven Bosscher stevenb@suse.de
Fri Jul 22 14:18:00 GMT 2005


On Friday 22 July 2005 16:15, Paul Brook wrote:
> > > ! 	  s = gfc_getmem (end - start + 1);
>
> Should be +2 if you're including the null terminator.

The original had:

!         gfc_extract_int (p->ref->u.ss.start, &start);
!         start--;  /* Convert from one-based to zero-based.  */
!         gfc_extract_int (p->ref->u.ss.end, &end);
!         s = gfc_getmem (end - start);

;-)

Gr.
Steven



More information about the Fortran mailing list