[Prev][Next][Index]

Mei-Hui Su: gettruetype 2




It appears that the snapshot is not up to date for some reason??
Bernd's message to me from 17 Jan 95 indicates the correct code is
there, so I do not understand. Perhaps someone wants to look at this.

/Andrew/

------- Forwarded Message

Received: from bioserv.compbio.caltech.edu (bioserv.compbio.caltech.edu [131.215.4.170]) by antares.mcs.anl.gov (8.6.10/8.6.10)  with SMTP
	id LAA01423 for <mauer@mcs.anl.gov>; Fri, 15 Sep 1995 11:50:24 -0500
Received: from metis.compbio.edu (metis.compbio.caltech.edu) by bioserv
        (5.0/DEI:4.45) id AA08674; Fri, 15 Sep 1995 09:50:20 -0700
Received: by metis.compbio.edu (5.0/SMI-SVR4)
	id AA09834; Fri, 15 Sep 1995 09:50:19 +0800
Date: Fri, 15 Sep 1995 09:50:19 +0800
From: mei@compbio.caltech.edu (Mei-Hui Su)
Message-Id: <9509151650.AA09834@metis.compbio.edu>
To: mauer@mcs.anl.gov
Subject: gettruetype 2



Aha..

  We got the latest snapshot that the sage people told us to
gt but the last line of your getTrueType look different from
the code in libSage++.C we have here. And, you are right, with
your getTrueType, it should work perfectly.. Thanks.

mei


------- End of Forwarded Message

This was the code I sent Mei:

       case T_POINTER:
       {
	    SgType *next;
	    SgType *current;
	    int current_indirection;

	    current = this;
	    
	    current_indirection =
		 isSgPointerType(current)->indirection();

	    if (current_indirection > 0)
		 return this;

	    /* if current_indirection == 0, we have a useless pointer,
	       so just return a truetype of its base */
	    
	    while (current_indirection < 0)
	    {
		 // Get next type
		 next = current->baseType();

		 if ( isSgPointerType (next) )
		 {
		      // add indirection to current
		      current_indirection +=
			   isSgPointerType(next)->indirection();
		 }
		 else if ( isSgArrayType (next) )
		 {
		      /* One level of indirection for each dimension. */
		      current_indirection +=
			   isSgArrayType(next)->dimension();
		 }
		 else
		 {
		      /* Don't know what's going on. Fix me.
		         This includes the case of ptr not having
			 a base type, so next = NULL. */
		      abort();
		 }
		 current = next;
	    }
/* ==========> Apparently this is different? =========> */
            /* Don't use next because we might not execute the above while. */
	    return current->baseType()->getTrueType(mask, follow_typedefs);
       }
            break;