Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteebad1a

Browse files
committed
ECPG preprocessor for PostgreSQL 7.4.1, 7.4.2 doubles const,
volatile, static, and register keywords before variables,declared as VARCHAR.Sergey N. Yatskevich
1 parentbbf0eba commiteebad1a

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

‎src/interfaces/ecpg/preproc/preproc.y

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.285 2004/05/30 23:40:40 neilc Exp $*/
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.286 2004/06/11 17:32:39 momjian Exp $*/
22

33
/* Copyright comment*/
44
%{
@@ -19,7 +19,6 @@ char*input_filename = NULL;
1919
staticintQueryIsRule =0, FoundInto =0;
2020
staticintinitializer =0;
2121
staticstructthis_type actual_type[STRUCT_DEPTH];
22-
staticchar *actual_storage[STRUCT_DEPTH];
2322
staticchar *actual_startline[STRUCT_DEPTH];
2423

2524
/* temporarily store struct members while creating the data structure*/
@@ -4473,6 +4472,8 @@ single_var_declaration: storage_declaration
44734472
actual_type[struct_level].type_dimension =$2.type_dimension;
44744473
actual_type[struct_level].type_index =$2.type_index;
44754474
actual_type[struct_level].type_sizeof =$2.type_sizeof;
4475+
4476+
actual_startline[struct_level] = hashline_number();
44764477
}
44774478
variable_list';'
44784479
{
@@ -4484,7 +4485,6 @@ single_var_declaration: storage_declaration
44844485
actual_type[struct_level].type_dimension =$1.type_dimension;
44854486
actual_type[struct_level].type_index =$1.type_index;
44864487
actual_type[struct_level].type_sizeof =$1.type_sizeof;
4487-
actual_storage[struct_level] = EMPTY;
44884488

44894489
actual_startline[struct_level] = hashline_number();
44904490
}
@@ -4610,6 +4610,8 @@ var_declaration: storage_declaration
46104610
actual_type[struct_level].type_dimension =$2.type_dimension;
46114611
actual_type[struct_level].type_index =$2.type_index;
46124612
actual_type[struct_level].type_sizeof =$2.type_sizeof;
4613+
4614+
actual_startline[struct_level] = hashline_number();
46134615
}
46144616
variable_list';'
46154617
{
@@ -4621,7 +4623,6 @@ var_declaration: storage_declaration
46214623
actual_type[struct_level].type_dimension =$1.type_dimension;
46224624
actual_type[struct_level].type_index =$1.type_index;
46234625
actual_type[struct_level].type_sizeof =$1.type_sizeof;
4624-
actual_storage[struct_level] = EMPTY;
46254626

46264627
actual_startline[struct_level] = hashline_number();
46274628
}
@@ -4637,18 +4638,15 @@ var_declaration: storage_declaration
46374638

46384639
storage_declaration:storage_clausestorage_modifier
46394640
{
4640-
actual_storage[struct_level] = cat2_str(mm_strdup($1), mm_strdup($2));
4641-
actual_startline[struct_level] = hashline_number();
4641+
$$ = cat2_str ($1,$2);
46424642
}
46434643
|storage_clause
46444644
{
4645-
actual_storage[struct_level] = mm_strdup($1);
4646-
actual_startline[struct_level] = hashline_number();
4645+
$$ =$1;
46474646
}
46484647
|storage_modifier
46494648
{
4650-
actual_storage[struct_level] = mm_strdup($1);
4651-
actual_startline[struct_level] = hashline_number();
4649+
$$ =$1;
46524650
}
46534651
;
46544652

@@ -4871,7 +4869,7 @@ struct_union_type_with_symbol: s_struct_union_symbol
48714869

48724870
ECPGfree_struct_member(struct_member_list[struct_level]);
48734871
struct_member_list[struct_level] =NULL;
4874-
free(actual_storage[struct_level--]);
4872+
struct_level--;
48754873
if (strncmp($1.su,"struct",sizeof("struct")-1) ==0)
48764874
su_type.type_enum = ECPGt_struct;
48774875
else
@@ -4921,7 +4919,7 @@ struct_union_type: struct_union_type_with_symbol{ $$ = $1; }
49214919
{
49224920
ECPGfree_struct_member(struct_member_list[struct_level]);
49234921
struct_member_list[struct_level] =NULL;
4924-
free(actual_storage[struct_level--]);
4922+
struct_level--;
49254923
$$ = cat_str(4,$1, make_str("{"),$4, make_str("}"));
49264924
}
49274925
;
@@ -5047,9 +5045,9 @@ variable: opt_pointer ECPGColLabel opt_array_bounds opt_initializer
50475045
mmerror(PARSE_ERROR, ET_ERROR,"pointer to varchar are not implemented");
50485046

50495047
if (strcmp(dimension,"0") ==0)
5050-
$$ = cat_str(7, mm_strdup(actual_storage[struct_level]), make2_str(make_str(" struct varchar_"), mm_strdup($2)), make_str(" { int len; char arr["), mm_strdup(length), make_str("]; } *"), mm_strdup($2),$4);
5048+
$$ = cat_str(6, make2_str(make_str(" struct varchar_"), mm_strdup($2)), make_str(" { int len; char arr["), mm_strdup(length), make_str("]; } *"), mm_strdup($2),$4);
50515049
else
5052-
$$ = cat_str(8, mm_strdup(actual_storage[struct_level]), make2_str(make_str(" struct varchar_"), mm_strdup($2)), make_str(" { int len; char arr["), mm_strdup(length), make_str("]; }"), mm_strdup($2), mm_strdup(dim),$4);
5050+
$$ = cat_str(7, make2_str(make_str(" struct varchar_"), mm_strdup($2)), make_str(" { int len; char arr["), mm_strdup(length), make_str("]; }"), mm_strdup($2), mm_strdup(dim),$4);
50535051
break;
50545052

50555053
case ECPGt_char:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp