1- /* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/type.c,v 1.89 2010/04/0108:41:01 meskes Exp $ */
1+ /* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/type.c,v 1.90 2010/04/0110:30:53 meskes Exp $ */
22
33#include "postgres_fe.h"
44
@@ -236,12 +236,11 @@ static void ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, c
236236struct ECPGtype * type ,struct ECPGtype * ind_type ,const char * prefix ,const char * ind_prefix );
237237
238238void
239- ECPGdump_a_type (FILE * o ,const char * name ,struct ECPGtype * type ,
240- const char * ind_name ,struct ECPGtype * ind_type ,
239+ ECPGdump_a_type (FILE * o ,const char * name ,struct ECPGtype * type ,const int brace_level ,
240+ const char * ind_name ,struct ECPGtype * ind_type ,const int ind_brace_level ,
241241const char * prefix ,const char * ind_prefix ,
242242char * arr_str_siz ,const char * struct_sizeof ,
243- const char * ind_struct_sizeof ,
244- const int brace_level ,const int ind_brace_level )
243+ const char * ind_struct_sizeof )
245244{
246245struct variable * var ;
247246
@@ -251,28 +250,29 @@ ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype * type,
251250{
252251char * str ;
253252
254- str = strdup (name );
253+ str = mm_strdup (name );
255254var = find_variable (str );
256255free (str );
257256
258257if ((var -> type -> type != type -> type )||
259258(var -> type -> type_name && !type -> type_name )||
260259(!var -> type -> type_name && type -> type_name )||
261260(var -> type -> type_name && type -> type_name && strcmp (var -> type -> type_name ,type -> type_name )))
262- mmerror (PARSE_ERROR ,ET_WARNING ,"variable (%s) is hidden by a local variable of a different type" ,name );
261+ mmerror (PARSE_ERROR ,ET_FATAL ,"variable (%s) is hidden by a local variable of a different type" ,name );
263262else if (var -> brace_level != brace_level )
264263mmerror (PARSE_ERROR ,ET_WARNING ,"variable (%s) is hidden by a local variable" ,name );
265264
266265if (ind_name && ind_type && ind_type -> type != ECPGt_NO_INDICATOR && ind_brace_level >=0 )
267266{
268- str = strdup (ind_name );
267+ str = mm_strdup (ind_name );
269268var = find_variable (str );
270269free (str );
270+
271271if ((var -> type -> type != ind_type -> type )||
272272(var -> type -> type_name && !ind_type -> type_name )||
273273(!var -> type -> type_name && ind_type -> type_name )||
274274(var -> type -> type_name && ind_type -> type_name && strcmp (var -> type -> type_name ,ind_type -> type_name )))
275- mmerror (PARSE_ERROR ,ET_WARNING ,"indicator variable (%s) is hidden by a local variable of a different type" ,ind_name );
275+ mmerror (PARSE_ERROR ,ET_FATAL ,"indicator variable (%s) is hidden by a local variable of a different type" ,ind_name );
276276else if (var -> brace_level != ind_brace_level )
277277mmerror (PARSE_ERROR ,ET_WARNING ,"indicator variable (%s) is hidden by a local variable" ,ind_name );
278278}
@@ -535,12 +535,12 @@ ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz,
535535
536536for (p = type -> u .members ;p ;p = p -> next )
537537{
538- ECPGdump_a_type (o ,p -> name ,p -> type ,
538+ ECPGdump_a_type (o ,p -> name ,p -> type ,-1 ,
539539(ind_p != NULL ) ?ind_p -> name :NULL ,
540540(ind_p != NULL ) ?ind_p -> type :NULL ,
541+ -1 ,
541542prefix ,ind_prefix ,arrsiz ,type -> struct_sizeof ,
542- (ind_p != NULL ) ?ind_type -> struct_sizeof :NULL ,
543- -1 ,-1 );
543+ (ind_p != NULL ) ?ind_type -> struct_sizeof :NULL );
544544if (ind_p != NULL && ind_p != & struct_no_indicator )
545545ind_p = ind_p -> next ;
546546}