From: Claudio V. C. <cv...@us...> - 2001-06-16 00:20:32
|
> -----Original Message----- > From: fir...@li... > [mailto:fir...@li...]On Behalf Of Ann W. > Harrison > Sent: Jueves 14 de Junio de 2001 9:42 > > > > > there is actually at least one place where > > > >global data _can't_ be const since the code > > > >modifies it! > > > > > > OK, where is that bit of loveliness? I have this problem in gen.c; where I spoiled one of the functions that *could* have received const data... although I don't think it manages global data. In gen_select(): else if (item->nod_type == nod_substr) { /* CVC: SQL starts at 1 but C starts at zero. */ NOD node = item->nod_arg [e_substr_start]; --(*(SLONG *) (node->nod_desc.dsc_address)); parameter->par_name = parameter->par_alias = "SUBSTRING"; } I could find a better place to adjust the first parameter of substring. > Your other routine is probably the > one after my signature, MET_exact_name, which has absolutely > no business being a public routine in MET but should be something > in UTL or some place and should be called RTRIM. (snarl). Guilty again. :-( I had to create pass_exact_name() in pass1.c because I couldn't make the whole thing to compile when calling the exact_name() functions in either met.c or metd.c because the core engine was built, but some of the utilities kept kicking the compiler, so I had no chance. Now, we have: metd with its own metd.exact_name() met with its own MET_exact_name() pass1 with its own pass_exact_name(), my personal contribution to massive anarchy. Is this can be put in a common file, it would be better. Redundancy is the worst enemy of controlled changes. Another, different type of redundancy inherent to structured programming is the BLR generation that the DSQL layer does: there are several functions that have a long switch for node types. Miss one node type in one function and you get a nice error always camouflaged as SQLDA missing or incorrect version, or incorrect number/type of variables. C. |