David L. Thompson:
 |Randall,
 |
 |Did you get a private e-mail I sent yesterday? I applied the 
 |cachegraph patch to the dpexec directory and to the one dxmod file, 
 |however I now have one set of warnings I want to clarify are okay 
 |before just casting them away.

I retrieved it this morning.  It was in my Yahoo box, but I didn't make it
over there yesterday to check new mail.  Sorry about that.

 |In src/exec/dpexec/graph.c, arg 3 of two calls to
 |_dxf_ExHasIntegerAttribute are now _excache variables instead of
 |integers. Since _excache is just an enum, I can cast them, but what is
 |the chance that the values returned by this function are not one of the
 |enum values?

I was careful not to change the logic.  Since this shouldn't affect the
generated code it's just a typing issue.  

This was just types cleanup I did to cut down on the number of compiler
warnings I was getting while building the graph modules.

The reason I changing it from int to _excache is because it is assigned to
pv.excache later in the function, and this ProgramVariable field has type
_excache.  The SGI compiler didn't complain about passing an <enum *> to an
<int *>, so the _dxf_ExHasIntegerAttribute wasn't flagged, but I gather your
compiler is complaining about this.

To your question though.  I'm of course not as familiar with the internals
as you, but as far as I can tell, for proper behavior this ATTR_CACHE
attribute shouldn't be any value besides the enumerated values.  However,
tracing it through I don't see dpexec restricting it so that it "must" be.
It appears the ATTR_CACHE is only set in function.c::ExExtractAttrs(), but
it is set directly to the integer value parsed from the script statement
(the %d in '[cache:%d]') without clamping to the enumerated values.  

So, changing types to _excache appears to be the better solution, but more
checking on cache value parsing in function.c::ExExtractAttrs() might be
useful.

Thanks for applying the patch.

Randall


-- 
Randall Hopper (mailto:[EMAIL PROTECTED])
EPA Scientific Visualization Center
US EPA MD/24 ERC-1A; RTP, NC 27711

Reply via email to