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

Commit95cbfb5

Browse files
author
Neil Conway
committed
Refactor exec_cast_value() and exec_simple_cast_value(): since they do
not ever write through the `isnull' parameter, it does not need to bean out parameter. Therefore it can be declared a "bool" rather than a"bool *".
1 parent525e83b commit95cbfb5

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

‎src/pl/plpgsql/src/pl_exec.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* procedural language
44
*
55
* IDENTIFICATION
6-
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.150 2005/07/2800:26:30 tgl Exp $
6+
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.151 2005/07/2807:51:13 neilc Exp $
77
*
88
* This software is copyrighted by Jan Wieck - Hamburg.
99
*
@@ -173,10 +173,10 @@ static Datum exec_cast_value(Datum value, Oid valtype,
173173
FmgrInfo*reqinput,
174174
Oidreqtypioparam,
175175
int32reqtypmod,
176-
bool*isnull);
176+
boolisnull);
177177
staticDatumexec_simple_cast_value(Datumvalue,Oidvaltype,
178178
Oidreqtype,int32reqtypmod,
179-
bool*isnull);
179+
boolisnull);
180180
staticvoidexec_init_tuple_store(PLpgSQL_execstate*estate);
181181
staticboolcompatible_tupdesc(TupleDesctd1,TupleDesctd2);
182182
staticvoidexec_set_found(PLpgSQL_execstate*estate,boolstate);
@@ -356,7 +356,7 @@ plpgsql_exec_function(PLpgSQL_function *func, FunctionCallInfo fcinfo)
356356
&(func->fn_retinput),
357357
func->fn_rettypioparam,
358358
-1,
359-
&fcinfo->isnull);
359+
fcinfo->isnull);
360360

361361
/*
362362
* If the function's return type isn't by value, copy the value
@@ -1348,7 +1348,7 @@ exec_stmt_fori(PLpgSQL_execstate *estate, PLpgSQL_stmt_fori *stmt)
13481348
value=exec_cast_value(value,valtype,var->datatype->typoid,
13491349
&(var->datatype->typinput),
13501350
var->datatype->typioparam,
1351-
var->datatype->atttypmod,&isnull);
1351+
var->datatype->atttypmod,isnull);
13521352
if (isnull)
13531353
ereport(ERROR,
13541354
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
@@ -1364,7 +1364,7 @@ exec_stmt_fori(PLpgSQL_execstate *estate, PLpgSQL_stmt_fori *stmt)
13641364
value=exec_cast_value(value,valtype,var->datatype->typoid,
13651365
&(var->datatype->typinput),
13661366
var->datatype->typioparam,
1367-
var->datatype->atttypmod,&isnull);
1367+
var->datatype->atttypmod,isnull);
13681368
if (isnull)
13691369
ereport(ERROR,
13701370
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
@@ -1868,7 +1868,7 @@ exec_stmt_return_next(PLpgSQL_execstate *estate,
18681868
var->datatype->typoid,
18691869
tupdesc->attrs[0]->atttypid,
18701870
tupdesc->attrs[0]->atttypmod,
1871-
&isNull);
1871+
isNull);
18721872

18731873
tuple=heap_form_tuple(tupdesc,&retval,&isNull);
18741874

@@ -1934,7 +1934,7 @@ exec_stmt_return_next(PLpgSQL_execstate *estate,
19341934
rettype,
19351935
tupdesc->attrs[0]->atttypid,
19361936
tupdesc->attrs[0]->atttypmod,
1937-
&isNull);
1937+
isNull);
19381938

19391939
tuple=heap_form_tuple(tupdesc,&retval,&isNull);
19401940

@@ -2995,7 +2995,7 @@ exec_assign_value(PLpgSQL_execstate *estate,
29952995
&(var->datatype->typinput),
29962996
var->datatype->typioparam,
29972997
var->datatype->atttypmod,
2998-
isNull);
2998+
*isNull);
29992999

30003000
if (*isNull&&var->notnull)
30013001
ereport(ERROR,
@@ -3194,7 +3194,7 @@ exec_assign_value(PLpgSQL_execstate *estate,
31943194
valtype,
31953195
atttype,
31963196
atttypmod,
3197-
&attisnull);
3197+
attisnull);
31983198
if (attisnull)
31993199
nulls[fno]='n';
32003200
else
@@ -3340,7 +3340,7 @@ exec_assign_value(PLpgSQL_execstate *estate,
33403340
valtype,
33413341
arrayelemtypeid,
33423342
-1,
3343-
isNull);
3343+
*isNull);
33443344

33453345
/*
33463346
* Build the modified array value.
@@ -3564,7 +3564,7 @@ exec_eval_integer(PLpgSQL_execstate *estate,
35643564
exprdatum=exec_eval_expr(estate,expr,isNull,&exprtypeid);
35653565
exprdatum=exec_simple_cast_value(exprdatum,exprtypeid,
35663566
INT4OID,-1,
3567-
isNull);
3567+
*isNull);
35683568
returnDatumGetInt32(exprdatum);
35693569
}
35703570

@@ -3586,7 +3586,7 @@ exec_eval_boolean(PLpgSQL_execstate *estate,
35863586
exprdatum=exec_eval_expr(estate,expr,isNull,&exprtypeid);
35873587
exprdatum=exec_simple_cast_value(exprdatum,exprtypeid,
35883588
BOOLOID,-1,
3589-
isNull);
3589+
*isNull);
35903590
returnDatumGetBool(exprdatum);
35913591
}
35923592

@@ -4060,9 +4060,9 @@ exec_cast_value(Datum value, Oid valtype,
40604060
FmgrInfo*reqinput,
40614061
Oidreqtypioparam,
40624062
int32reqtypmod,
4063-
bool*isnull)
4063+
boolisnull)
40644064
{
4065-
if (!*isnull)
4065+
if (!isnull)
40664066
{
40674067
/*
40684068
* If the type of the queries return value isn't that of the
@@ -4095,9 +4095,9 @@ exec_cast_value(Datum value, Oid valtype,
40954095
staticDatum
40964096
exec_simple_cast_value(Datumvalue,Oidvaltype,
40974097
Oidreqtype,int32reqtypmod,
4098-
bool*isnull)
4098+
boolisnull)
40994099
{
4100-
if (!*isnull)
4100+
if (!isnull)
41014101
{
41024102
if (valtype!=reqtype||reqtypmod!=-1)
41034103
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp