Re: Improve readability by using designated initializers when possible

Поиск
Список
Период
Сортировка
От jian he
Тема Re: Improve readability by using designated initializers when possible
Дата
Msg-id CACJufxG0umLVho4dznzyHU12WkEf=e9LXF79jUPZ8oMbnuWDXA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Improve readability by using designated initializers when possible  (Jelte Fennema-Nio <postgres@jeltef.nl>)
Ответы Re: Improve readability by using designated initializers when possible  (Japin Li <japinli@hotmail.com>)
Список pgsql-hackers
Hi. minor issues.

@@ -2063,12 +2009,12 @@ find_expr_references_walker(Node *node,
  CoerceViaIO *iocoerce = (CoerceViaIO *) node;

  /* since there is no exposed function, need to depend on type */
- add_object_address(OCLASS_TYPE, iocoerce->resulttype, 0,
+ add_object_address(TypeRelationId iocoerce->resulttype, 0,
    context->addrs);

@@ -2090,21 +2036,21 @@ find_expr_references_walker(Node *node,
  ConvertRowtypeExpr *cvt = (ConvertRowtypeExpr *) node;

  /* since there is no function dependency, need to depend on type */
- add_object_address(OCLASS_TYPE, cvt->resulttype, 0,
+ add_object_address(TypeRelationId cvt->resulttype, 0,
    context->addrs);

obvious typo errors.

diff --git a/src/common/relpath.c b/src/common/relpath.c
index b16fe19dea6..d9214f915c9 100644
--- a/src/common/relpath.c
+++ b/src/common/relpath.c
@@ -31,10 +31,10 @@
  * pg_relation_size().
  */
 const char *const forkNames[] = {
- "main", /* MAIN_FORKNUM */
- "fsm", /* FSM_FORKNUM */
- "vm", /* VISIBILITYMAP_FORKNUM */
- "init" /* INIT_FORKNUM */
+ [MAIN_FORKNUM] = "main",
+ [FSM_FORKNUM] = "fsm",
+ [VISIBILITYMAP_FORKNUM] = "vm",
+ [INIT_FORKNUM] = "init",
 };

`+ [INIT_FORKNUM] = "init", ` no need for an extra  comma?

+ [PG_SJIS] = {0, 0, pg_sjis_mblen, pg_sjis_dsplen,
pg_sjis_verifychar, pg_sjis_verifystr, 2},
+ [PG_BIG5] = {0, 0, pg_big5_mblen, pg_big5_dsplen,
pg_big5_verifychar, pg_big5_verifystr, 2},
+ [PG_GBK] = {0, 0, pg_gbk_mblen, pg_gbk_dsplen, pg_gbk_verifychar,
pg_gbk_verifystr, 2},
+ [PG_UHC] = {0, 0, pg_uhc_mblen, pg_uhc_dsplen, pg_uhc_verifychar,
pg_uhc_verifystr, 2},
+ [PG_GB18030] = {0, 0, pg_gb18030_mblen, pg_gb18030_dsplen,
pg_gb18030_verifychar, pg_gb18030_verifystr, 4},
+ [PG_JOHAB] = {0, 0, pg_johab_mblen, pg_johab_dsplen,
pg_johab_verifychar, pg_johab_verifystr, 3},
+ [PG_SHIFT_JIS_2004] = {0, 0, pg_sjis_mblen, pg_sjis_dsplen,
pg_sjis_verifychar, pg_sjis_verifystr, 2},
 };
similarly, last entry, no need an extra comma?
also other places last array entry no need extra comma.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Matthias van de Meent
Дата:
Сообщение: Re: Sequence Access Methods, round two
Следующее
От: Japin Li
Дата:
Сообщение: Re: Improve readability by using designated initializers when possible