Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

pgindent run before PG 9.1 beta 1.

  • Loading branch information...
commit bf50caf105a901c4f83ac1df3cdaf910c26694a4 1 parent 9a8b731
@bmomjian bmomjian authored
Showing with 4,664 additions and 4,211 deletions.
  1. +7 −6 contrib/adminpack/adminpack.c
  2. +3 −3 contrib/auth_delay/auth_delay.c
  3. +1 −1  contrib/btree_gist/btree_cash.c
  4. +7 −7 contrib/btree_gist/btree_date.c
  5. +4 −4 contrib/btree_gist/btree_float4.c
  6. +5 −5 contrib/btree_gist/btree_float8.c
  7. +4 −4 contrib/btree_gist/btree_int2.c
  8. +7 −7 contrib/btree_gist/btree_int4.c
  9. +7 −7 contrib/btree_gist/btree_int8.c
  10. +3 −3 contrib/btree_gist/btree_interval.c
  11. +5 −5 contrib/btree_gist/btree_oid.c
  12. +3 −3 contrib/btree_gist/btree_time.c
  13. +16 −17 contrib/btree_gist/btree_ts.c
  14. +4 −4 contrib/btree_gist/btree_utils_num.c
  15. +3 −3 contrib/btree_gist/btree_utils_num.h
  16. +1 −1  contrib/btree_gist/btree_utils_var.c
  17. +1 −1  contrib/dummy_seclabel/dummy_seclabel.c
  18. +45 −46 contrib/file_fdw/file_fdw.c
  19. +49 −42 contrib/fuzzystrmatch/levenshtein.c
  20. +2 −2 contrib/hstore/hstore_gin.c
  21. +2 −2 contrib/hstore/hstore_op.c
  22. +3 −3 contrib/intarray/_int_bool.c
  23. +4 −3 contrib/intarray/_int_gin.c
  24. +2 −2 contrib/intarray/_int_tool.c
  25. +0 −1  contrib/isn/ISBN.h
  26. +2 −2 contrib/pg_archivecleanup/pg_archivecleanup.c
  27. +1 −1  contrib/pg_stat_statements/pg_stat_statements.c
  28. +41 −34 contrib/pg_test_fsync/pg_test_fsync.c
  29. +4 −3 contrib/pg_trgm/trgm.h
  30. +12 −8 contrib/pg_trgm/trgm_gin.c
  31. +24 −22 contrib/pg_trgm/trgm_gist.c
  32. +6 −5 contrib/pg_trgm/trgm_op.c
  33. +5 −2 contrib/pg_upgrade/check.c
  34. +1 −2  contrib/pg_upgrade/controldata.c
  35. +1 −1  contrib/pg_upgrade/exec.c
  36. +1 −0  contrib/pg_upgrade/file.c
  37. +8 −8 contrib/pg_upgrade/function.c
  38. +30 −24 contrib/pg_upgrade/info.c
  39. +11 −10 contrib/pg_upgrade/pg_upgrade.c
  40. +20 −18 contrib/pg_upgrade/pg_upgrade.h
  41. +10 −10 contrib/pg_upgrade/relfilenode.c
  42. +7 −7 contrib/pg_upgrade/server.c
  43. +2 −2 contrib/pg_upgrade/tablespace.c
  44. +1 −1  contrib/pg_upgrade/util.c
  45. +1 −1  contrib/pg_upgrade/version_old_8_3.c
  46. +4 −4 contrib/pg_upgrade_support/pg_upgrade_support.c
  47. +18 −18 contrib/pgbench/pgbench.c
  48. +1 −1  contrib/seg/seg.c
  49. +18 −19 contrib/sepgsql/dml.c
  50. +71 −71 contrib/sepgsql/hooks.c
  51. +61 −60 contrib/sepgsql/label.c
  52. +14 −14 contrib/sepgsql/proc.c
  53. +28 −27 contrib/sepgsql/relation.c
  54. +9 −9 contrib/sepgsql/schema.c
  55. +524 −216 contrib/sepgsql/selinux.c
  56. +21 −20 contrib/sepgsql/sepgsql.h
  57. +1 −1  contrib/spi/moddatetime.c
  58. +6 −6 contrib/xml2/xpath.c
  59. +1 −2  contrib/xml2/xslt_proc.c
  60. +1 −1  src/backend/access/common/heaptuple.c
  61. +1 −1  src/backend/access/common/indextuple.c
  62. +9 −4 src/backend/access/gin/ginarrayproc.c
  63. +5 −5 src/backend/access/gin/ginbulk.c
  64. +6 −4 src/backend/access/gin/gindatapage.c
  65. +9 −7 src/backend/access/gin/ginentrypage.c
  66. +9 −9 src/backend/access/gin/ginfast.c
  67. +70 −73 src/backend/access/gin/ginget.c
  68. +6 −6 src/backend/access/gin/gininsert.c
  69. +12 −11 src/backend/access/gin/ginscan.c
  70. +19 −19 src/backend/access/gin/ginutil.c
  71. +1 −1  src/backend/access/gin/ginvacuum.c
  72. +4 −4 src/backend/access/gin/ginxlog.c
  73. +78 −74 src/backend/access/gist/gist.c
  74. +11 −11 src/backend/access/gist/gistget.c
  75. +3 −3 src/backend/access/gist/gistproc.c
  76. +6 −5 src/backend/access/gist/gistscan.c
  77. +2 −1  src/backend/access/gist/gistutil.c
  78. +10 −7 src/backend/access/gist/gistxlog.c
  79. +1 −0  src/backend/access/hash/hash.c
  80. +18 −18 src/backend/access/heap/heapam.c
  81. +1 −1  src/backend/access/heap/hio.c
  82. +2 −2 src/backend/access/heap/rewriteheap.c
  83. +1 −1  src/backend/access/index/indexam.c
  84. +10 −10 src/backend/access/nbtree/nbtinsert.c
  85. +3 −3 src/backend/access/nbtree/nbtpage.c
  86. +2 −1  src/backend/access/nbtree/nbtree.c
  87. +3 −3 src/backend/access/nbtree/nbtsearch.c
  88. +1 −1  src/backend/access/nbtree/nbtsort.c
  89. +4 −4 src/backend/access/nbtree/nbtutils.c
  90. +7 −7 src/backend/access/transam/twophase.c
  91. +3 −3 src/backend/access/transam/varsup.c
  92. +31 −30 src/backend/access/transam/xact.c
  93. +106 −102 src/backend/access/transam/xlog.c
  94. +8 −8 src/backend/catalog/aclchk.c
  95. +12 −11 src/backend/catalog/catalog.c
  96. +11 −11 src/backend/catalog/dependency.c
  97. +30 −30 src/backend/catalog/heap.c
  98. +32 −32 src/backend/catalog/index.c
  99. +12 −12 src/backend/catalog/namespace.c
  100. +27 −25 src/backend/catalog/objectaddress.c
  101. +9 −7 src/backend/catalog/pg_collation.c
  102. +3 −3 src/backend/catalog/pg_constraint.c
  103. +4 −4 src/backend/catalog/pg_depend.c
  104. +44 −44 src/backend/catalog/pg_enum.c
  105. +3 −3 src/backend/catalog/pg_proc.c
  106. +2 −2 src/backend/catalog/pg_type.c
  107. +2 −2 src/backend/catalog/storage.c
  108. +1 −1  src/backend/catalog/toasting.c
  109. +21 −19 src/backend/commands/alter.c
  110. +5 −5 src/backend/commands/analyze.c
  111. +11 −11 src/backend/commands/cluster.c
  112. +9 −9 src/backend/commands/collationcmds.c
  113. +11 −9 src/backend/commands/comment.c
  114. +3 −2 src/backend/commands/conversioncmds.c
  115. +54 −54 src/backend/commands/copy.c
  116. +6 −6 src/backend/commands/dbcommands.c
  117. +13 −13 src/backend/commands/explain.c
  118. +159 −159 src/backend/commands/extension.c
  119. +4 −4 src/backend/commands/foreigncmds.c
  120. +2 −2 src/backend/commands/functioncmds.c
  121. +7 −7 src/backend/commands/indexcmds.c
  122. +16 −16 src/backend/commands/opclasscmds.c
  123. +3 −2 src/backend/commands/operatorcmds.c
  124. +4 −4 src/backend/commands/portalcmds.c
  125. +1 −1  src/backend/commands/prepare.c
  126. +22 −21 src/backend/commands/seclabel.c
  127. +2 −2 src/backend/commands/sequence.c
  128. +152 −143 src/backend/commands/tablecmds.c
  129. +7 −7 src/backend/commands/tablespace.c
  130. +18 −18 src/backend/commands/trigger.c
  131. +12 −8 src/backend/commands/tsearchcmds.c
  132. +4 −4 src/backend/commands/typecmds.c
  133. +10 −9 src/backend/commands/user.c
  134. +5 −5 src/backend/commands/vacuum.c
  135. +4 −3 src/backend/commands/vacuumlazy.c
  136. +12 −12 src/backend/commands/variable.c
  137. +7 −6 src/backend/commands/view.c
  138. +30 −29 src/backend/executor/execMain.c
  139. +3 −3 src/backend/executor/execQual.c
  140. +3 −3 src/backend/executor/execUtils.c
  141. +23 −23 src/backend/executor/functions.c
  142. +4 −4 src/backend/executor/nodeAgg.c
  143. +2 −2 src/backend/executor/nodeBitmapIndexscan.c
  144. +1 −1  src/backend/executor/nodeForeignscan.c
  145. +7 −9 src/backend/executor/nodeHash.c
  146. +29 −24 src/backend/executor/nodeHashjoin.c
  147. +10 −10 src/backend/executor/nodeIndexscan.c
  148. +7 −7 src/backend/executor/nodeLimit.c
  149. +1 −1  src/backend/executor/nodeLockRows.c
  150. +18 −18 src/backend/executor/nodeMergeAppend.c
  151. +1 −1  src/backend/executor/nodeMergejoin.c
  152. +20 −20 src/backend/executor/nodeModifyTable.c
  153. +5 −6 src/backend/executor/nodeNestloop.c
  154. +1 −1  src/backend/executor/nodeRecursiveunion.c
  155. +1 −1  src/backend/executor/nodeSetOp.c
  156. +1 −1  src/backend/executor/nodeWindowAgg.c
  157. +5 −5 src/backend/executor/spi.c
  158. +30 −33 src/backend/libpq/auth.c
  159. +12 −12 src/backend/libpq/hba.c
  160. +29 −28 src/backend/libpq/pqcomm.c
  161. +4 −5 src/backend/main/main.c
  162. +3 −3 src/backend/nodes/copyfuncs.c
  163. +22 −21 src/backend/nodes/nodeFuncs.c
  164. +1 −1  src/backend/nodes/params.c
  165. +19 −19 src/backend/optimizer/path/allpaths.c
  166. +14 −14 src/backend/optimizer/path/costsize.c
  167. +7 −7 src/backend/optimizer/path/equivclass.c
  168. +21 −21 src/backend/optimizer/path/indxpath.c
  169. +4 −4 src/backend/optimizer/path/joinpath.c
  170. +5 −5 src/backend/optimizer/path/joinrels.c
  171. +7 −7 src/backend/optimizer/path/pathkeys.c
  172. +8 −7 src/backend/optimizer/plan/analyzejoins.c
  173. +29 −27 src/backend/optimizer/plan/createplan.c
  174. +7 −6 src/backend/optimizer/plan/initsplan.c
  175. +20 −20 src/backend/optimizer/plan/planagg.c
  176. +7 −7 src/backend/optimizer/plan/planmain.c
  177. +9 −9 src/backend/optimizer/plan/planner.c
  178. +11 −11 src/backend/optimizer/prep/prepjointree.c
  179. +20 −19 src/backend/optimizer/prep/prepqual.c
  180. +2 −2 src/backend/optimizer/prep/preptlist.c
  181. +1 −1  src/backend/optimizer/prep/prepunion.c
  182. +32 −32 src/backend/optimizer/util/clauses.c
  183. +3 −3 src/backend/optimizer/util/pathnode.c
  184. +2 −2 src/backend/optimizer/util/placeholder.c
  185. +1 −1  src/backend/optimizer/util/predtest.c
  186. +1 −1  src/backend/optimizer/util/var.c
  187. +14 −14 src/backend/parser/analyze.c
  188. +5 −5 src/backend/parser/parse_agg.c
  189. +4 −4 src/backend/parser/parse_clause.c
  190. +4 −4 src/backend/parser/parse_coerce.c
  191. +48 −45 src/backend/parser/parse_collate.c
  192. +4 −4 src/backend/parser/parse_cte.c
  193. +9 −7 src/backend/parser/parse_expr.c
  194. +4 −4 src/backend/parser/parse_func.c
  195. +4 −4 src/backend/parser/parse_node.c
  196. +3 −3 src/backend/parser/parse_oper.c
  197. +2 −2 src/backend/parser/parse_param.c
  198. +5 −5 src/backend/parser/parse_relation.c
  199. +3 −3 src/backend/parser/parse_target.c
  200. +36 −35 src/backend/parser/parse_utilcmd.c
  201. +1 −1  src/backend/port/dynloader/freebsd.c
  202. +1 −1  src/backend/port/dynloader/netbsd.c
  203. +1 −1  src/backend/port/dynloader/openbsd.c
  204. +4 −4 src/backend/port/pipe.c
  205. +4 −4 src/backend/port/sysv_shmem.c
  206. +40 −40 src/backend/port/unix_latch.c
  207. +30 −30 src/backend/port/win32/crashdump.c
  208. +1 −1  src/backend/port/win32/timer.c
  209. +14 −14 src/backend/port/win32_latch.c
  210. +17 −17 src/backend/postmaster/autovacuum.c
  211. +13 −12 src/backend/postmaster/bgwriter.c
  212. +7 −6 src/backend/postmaster/pgstat.c
  213. +37 −38 src/backend/postmaster/postmaster.c
  214. +4 −4 src/backend/postmaster/syslogger.c
  215. +1 −1  src/backend/regex/regcomp.c
  216. +20 −17 src/backend/replication/basebackup.c
  217. +69 −67 src/backend/replication/syncrep.c
  218. +23 −24 src/backend/replication/walreceiver.c
  219. +2 −2 src/backend/replication/walreceiverfuncs.c
  220. +65 −65 src/backend/replication/walsender.c
  221. +3 −3 src/backend/rewrite/rewriteDefine.c
  222. +18 −18 src/backend/rewrite/rewriteHandler.c
  223. +1 −1  src/backend/rewrite/rewriteSupport.c
  224. +8 −8 src/backend/storage/buffer/bufmgr.c
  225. +1 −1  src/backend/storage/buffer/freelist.c
  226. +4 −4 src/backend/storage/buffer/localbuf.c
  227. +11 −9 src/backend/storage/file/fd.c
  228. +32 −28 src/backend/storage/file/reinit.c
  229. +5 −5 src/backend/storage/ipc/pmsignal.c
  230. +20 −22 src/backend/storage/ipc/procarray.c
  231. +8 −8 src/backend/storage/ipc/standby.c
  232. +2 −2 src/backend/storage/large_object/inv_api.c
  233. +2 −1  src/backend/storage/lmgr/lock.c
  234. +59 −60 src/backend/storage/lmgr/predicate.c
  235. +5 −5 src/backend/storage/smgr/md.c
  236. +3 −3 src/backend/storage/smgr/smgr.c
  237. +11 −12 src/backend/tcop/postgres.c
  238. +3 −3 src/backend/tcop/pquery.c
  239. +4 −3 src/backend/tcop/utility.c
  240. +1 −1  src/backend/tsearch/spell.c
  241. +6 −5 src/backend/tsearch/ts_locale.c
  242. +4 −4 src/backend/tsearch/ts_selfuncs.c
  243. +361 −348 src/backend/tsearch/wparser_def.c
  244. +2 −2 src/backend/utils/adt/acl.c
  245. +3 −2 src/backend/utils/adt/arrayfuncs.c
  246. +12 −12 src/backend/utils/adt/cash.c
  247. +1 −1  src/backend/utils/adt/date.c
  248. +1 −1  src/backend/utils/adt/datetime.c
  249. +1 −1  src/backend/utils/adt/dbsize.c
  250. +2 −2 src/backend/utils/adt/enum.c
  251. +12 −12 src/backend/utils/adt/formatting.c
  252. +7 −6 src/backend/utils/adt/genfile.c
  253. +12 −12 src/backend/utils/adt/like.c
  254. +3 −3 src/backend/utils/adt/nabstime.c
  255. +30 −30 src/backend/utils/adt/network.c
  256. +27 −26 src/backend/utils/adt/numeric.c
  257. +8 −8 src/backend/utils/adt/numutils.c
  258. +20 −21 src/backend/utils/adt/pg_locale.c
  259. +9 −9 src/backend/utils/adt/pgstatfuncs.c
  260. +10 −10 src/backend/utils/adt/ri_triggers.c
  261. +23 −23 src/backend/utils/adt/ruleutils.c
  262. +78 −79 src/backend/utils/adt/selfuncs.c
  263. +6 −4 src/backend/utils/adt/tsginidx.c
  264. +1 −0  src/backend/utils/adt/tsvector_op.c
  265. +1 −0  src/backend/utils/adt/varbit.c
  266. +55 −53 src/backend/utils/adt/varlena.c
  267. +11 −9 src/backend/utils/adt/xml.c
  268. +2 −1  src/backend/utils/cache/inval.c
  269. +5 −5 src/backend/utils/cache/lsyscache.c
  270. +2 −2 src/backend/utils/cache/plancache.c
  271. +4 −4 src/backend/utils/cache/relcache.c
  272. +1 −1  src/backend/utils/cache/syscache.c
  273. +1 −1  src/backend/utils/cache/ts_cache.c
  274. +34 −33 src/backend/utils/cache/typcache.c
  275. +6 −5 src/backend/utils/error/elog.c
  276. +6 −6 src/backend/utils/fmgr/fmgr.c
  277. +3 −3 src/backend/utils/fmgr/funcapi.c
  278. +6 −6 src/backend/utils/init/miscinit.c
  279. +5 −5 src/backend/utils/init/postinit.c
  280. +6 −6 src/backend/utils/mb/mbutils.c
  281. +44 −43 src/backend/utils/misc/guc.c
  282. +8 −6 src/backend/utils/misc/rbtree.c
  283. +1 −1  src/backend/utils/misc/tzparser.c
  284. +2 −2 src/backend/utils/mmgr/aset.c
  285. +7 −7 src/backend/utils/mmgr/portalmem.c
  286. +1 −1  src/backend/utils/resowner/resowner.c
  287. +9 −9 src/backend/utils/sort/tuplesort.c
  288. +3 −3 src/backend/utils/time/snapmgr.c
  289. +33 −34 src/bin/initdb/initdb.c
  290. +6 −5 src/bin/pg_basebackup/pg_basebackup.c
  291. +23 −24 src/bin/pg_ctl/pg_ctl.c
  292. +70 −64 src/bin/pg_dump/compress_io.c
  293. +11 −11 src/bin/pg_dump/compress_io.h
  294. +1 −1  src/bin/pg_dump/dumputils.c
  295. +1 −1  src/bin/pg_dump/dumputils.h
  296. +15 −15 src/bin/pg_dump/pg_backup_archiver.c
  297. +4 −5 src/bin/pg_dump/pg_backup_archiver.h
  298. +3 −2 src/bin/pg_dump/pg_backup_custom.c
  299. +39 −34 src/bin/pg_dump/pg_backup_directory.c
  300. +1 −1  src/bin/pg_dump/pg_backup_tar.c
Sorry, we could not display the entire diff because too many files (446) changed.
View
13 contrib/adminpack/adminpack.c
@@ -78,18 +78,19 @@ convert_and_check_filename(text *arg, bool logAllowed)
/* Disallow '/a/b/data/..' */
if (path_contains_parent_reference(filename))
ereport(ERROR,
- (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
- (errmsg("reference to parent directory (\"..\") not allowed"))));
+ (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
+ (errmsg("reference to parent directory (\"..\") not allowed"))));
+
/*
- * Allow absolute paths if within DataDir or Log_directory, even
- * though Log_directory might be outside DataDir.
+ * Allow absolute paths if within DataDir or Log_directory, even
+ * though Log_directory might be outside DataDir.
*/
if (!path_is_prefix_of_path(DataDir, filename) &&
(!logAllowed || !is_absolute_path(Log_directory) ||
!path_is_prefix_of_path(Log_directory, filename)))
ereport(ERROR,
- (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
- (errmsg("absolute path not allowed"))));
+ (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
+ (errmsg("absolute path not allowed"))));
}
else if (!path_is_relative_and_below_cwd(filename))
ereport(ERROR,
View
6 contrib/auth_delay/auth_delay.c
@@ -18,13 +18,13 @@
PG_MODULE_MAGIC;
-void _PG_init(void);
+void _PG_init(void);
/* GUC Variables */
static int auth_delay_milliseconds;
/* Original Hook */
-static ClientAuthentication_hook_type original_client_auth_hook = NULL;
+static ClientAuthentication_hook_type original_client_auth_hook = NULL;
/*
* Check authentication
@@ -55,7 +55,7 @@ _PG_init(void)
{
/* Define custom GUC variables */
DefineCustomIntVariable("auth_delay.milliseconds",
- "Milliseconds to delay before reporting authentication failure",
+ "Milliseconds to delay before reporting authentication failure",
NULL,
&auth_delay_milliseconds,
0,
View
2  contrib/btree_gist/btree_cash.c
@@ -169,7 +169,7 @@ gbt_cash_distance(PG_FUNCTION_ARGS)
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
);
}
View
14 contrib/btree_gist/btree_date.c
@@ -90,9 +90,9 @@ static float8
gdb_date_dist(const void *a, const void *b)
{
/* we assume the difference can't overflow */
- Datum diff = DirectFunctionCall2(date_mi,
+ Datum diff = DirectFunctionCall2(date_mi,
DateADTGetDatum(*((const DateADT *) a)),
- DateADTGetDatum(*((const DateADT *) b)));
+ DateADTGetDatum(*((const DateADT *) b)));
return (float8) Abs(DatumGetInt32(diff));
}
@@ -113,14 +113,14 @@ static const gbtree_ninfo tinfo =
PG_FUNCTION_INFO_V1(date_dist);
-Datum date_dist(PG_FUNCTION_ARGS);
+Datum date_dist(PG_FUNCTION_ARGS);
Datum
date_dist(PG_FUNCTION_ARGS)
{
/* we assume the difference can't overflow */
- Datum diff = DirectFunctionCall2(date_mi,
- PG_GETARG_DATUM(0),
- PG_GETARG_DATUM(1));
+ Datum diff = DirectFunctionCall2(date_mi,
+ PG_GETARG_DATUM(0),
+ PG_GETARG_DATUM(1));
PG_RETURN_INT32(Abs(DatumGetInt32(diff)));
}
@@ -181,7 +181,7 @@ gbt_date_distance(PG_FUNCTION_ARGS)
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
);
}
View
8 contrib/btree_gist/btree_float4.c
@@ -94,18 +94,18 @@ static const gbtree_ninfo tinfo =
PG_FUNCTION_INFO_V1(float4_dist);
-Datum float4_dist(PG_FUNCTION_ARGS);
+Datum float4_dist(PG_FUNCTION_ARGS);
Datum
float4_dist(PG_FUNCTION_ARGS)
{
- float4 a = PG_GETARG_FLOAT4(0);
+ float4 a = PG_GETARG_FLOAT4(0);
float4 b = PG_GETARG_FLOAT4(1);
float4 r;
r = a - b;
CHECKFLOATVAL(r, isinf(a) || isinf(b), true);
- PG_RETURN_FLOAT4( Abs(r) );
+ PG_RETURN_FLOAT4(Abs(r));
}
@@ -162,7 +162,7 @@ gbt_float4_distance(PG_FUNCTION_ARGS)
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
);
}
View
10 contrib/btree_gist/btree_float8.c
@@ -76,8 +76,8 @@ gbt_float8key_cmp(const void *a, const void *b)
static float8
gbt_float8_dist(const void *a, const void *b)
{
- float8 arg1 = *(const float8 *)a;
- float8 arg2 = *(const float8 *)b;
+ float8 arg1 = *(const float8 *) a;
+ float8 arg2 = *(const float8 *) b;
float8 r;
r = arg1 - arg2;
@@ -102,7 +102,7 @@ static const gbtree_ninfo tinfo =
PG_FUNCTION_INFO_V1(float8_dist);
-Datum float8_dist(PG_FUNCTION_ARGS);
+Datum float8_dist(PG_FUNCTION_ARGS);
Datum
float8_dist(PG_FUNCTION_ARGS)
{
@@ -113,7 +113,7 @@ float8_dist(PG_FUNCTION_ARGS)
r = a - b;
CHECKFLOATVAL(r, isinf(a) || isinf(b), true);
- PG_RETURN_FLOAT8( Abs(r) );
+ PG_RETURN_FLOAT8(Abs(r));
}
/**************************************************
@@ -169,7 +169,7 @@ gbt_float8_distance(PG_FUNCTION_ARGS)
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
);
}
View
8 contrib/btree_gist/btree_int2.c
@@ -94,12 +94,12 @@ static const gbtree_ninfo tinfo =
PG_FUNCTION_INFO_V1(int2_dist);
-Datum int2_dist(PG_FUNCTION_ARGS);
+Datum int2_dist(PG_FUNCTION_ARGS);
Datum
int2_dist(PG_FUNCTION_ARGS)
{
- int2 a = PG_GETARG_INT16(0);
- int2 b = PG_GETARG_INT16(1);
+ int2 a = PG_GETARG_INT16(0);
+ int2 b = PG_GETARG_INT16(1);
int2 r;
int2 ra;
@@ -169,7 +169,7 @@ gbt_int2_distance(PG_FUNCTION_ARGS)
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
);
}
View
14 contrib/btree_gist/btree_int4.c
@@ -95,14 +95,14 @@ static const gbtree_ninfo tinfo =
PG_FUNCTION_INFO_V1(int4_dist);
-Datum int4_dist(PG_FUNCTION_ARGS);
+Datum int4_dist(PG_FUNCTION_ARGS);
Datum
int4_dist(PG_FUNCTION_ARGS)
{
- int4 a = PG_GETARG_INT32(0);
- int4 b = PG_GETARG_INT32(1);
- int4 r;
- int4 ra;
+ int4 a = PG_GETARG_INT32(0);
+ int4 b = PG_GETARG_INT32(1);
+ int4 r;
+ int4 ra;
r = a - b;
ra = Abs(r);
@@ -111,7 +111,7 @@ int4_dist(PG_FUNCTION_ARGS)
if (ra < 0 || (!SAMESIGN(a, b) && !SAMESIGN(r, a)))
ereport(ERROR,
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
- errmsg("integer out of range")));
+ errmsg("integer out of range")));
PG_RETURN_INT32(ra);
}
@@ -170,7 +170,7 @@ gbt_int4_distance(PG_FUNCTION_ARGS)
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
);
}
View
14 contrib/btree_gist/btree_int8.c
@@ -95,14 +95,14 @@ static const gbtree_ninfo tinfo =
PG_FUNCTION_INFO_V1(int8_dist);
-Datum int8_dist(PG_FUNCTION_ARGS);
+Datum int8_dist(PG_FUNCTION_ARGS);
Datum
int8_dist(PG_FUNCTION_ARGS)
{
- int64 a = PG_GETARG_INT64(0);
- int64 b = PG_GETARG_INT64(1);
- int64 r;
- int64 ra;
+ int64 a = PG_GETARG_INT64(0);
+ int64 b = PG_GETARG_INT64(1);
+ int64 r;
+ int64 ra;
r = a - b;
ra = Abs(r);
@@ -111,7 +111,7 @@ int8_dist(PG_FUNCTION_ARGS)
if (ra < 0 || (!SAMESIGN(a, b) && !SAMESIGN(r, a)))
ereport(ERROR,
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
- errmsg("bigint out of range")));
+ errmsg("bigint out of range")));
PG_RETURN_INT64(ra);
}
@@ -170,7 +170,7 @@ gbt_int8_distance(PG_FUNCTION_ARGS)
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
);
}
View
6 contrib/btree_gist/btree_interval.c
@@ -88,7 +88,7 @@ intr2num(const Interval *i)
static float8
gbt_intv_dist(const void *a, const void *b)
{
- return (float8)Abs(intr2num((Interval*)a) - intr2num((Interval*)b));
+ return (float8) Abs(intr2num((Interval *) a) - intr2num((Interval *) b));
}
/*
@@ -127,7 +127,7 @@ abs_interval(Interval *a)
}
PG_FUNCTION_INFO_V1(interval_dist);
-Datum interval_dist(PG_FUNCTION_ARGS);
+Datum interval_dist(PG_FUNCTION_ARGS);
Datum
interval_dist(PG_FUNCTION_ARGS)
{
@@ -240,7 +240,7 @@ gbt_intv_distance(PG_FUNCTION_ARGS)
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) query, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) query, GIST_LEAF(entry), &tinfo)
);
}
View
10 contrib/btree_gist/btree_oid.c
@@ -101,13 +101,13 @@ static const gbtree_ninfo tinfo =
PG_FUNCTION_INFO_V1(oid_dist);
-Datum oid_dist(PG_FUNCTION_ARGS);
+Datum oid_dist(PG_FUNCTION_ARGS);
Datum
oid_dist(PG_FUNCTION_ARGS)
{
- Oid a = PG_GETARG_OID(0);
- Oid b = PG_GETARG_OID(1);
- Oid res;
+ Oid a = PG_GETARG_OID(0);
+ Oid b = PG_GETARG_OID(1);
+ Oid res;
if (a < b)
res = b - a;
@@ -170,7 +170,7 @@ gbt_oid_distance(PG_FUNCTION_ARGS)
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
);
}
View
6 contrib/btree_gist/btree_time.c
@@ -119,7 +119,7 @@ gbt_time_dist(const void *a, const void *b)
{
const TimeADT *aa = (const TimeADT *) a;
const TimeADT *bb = (const TimeADT *) b;
- Interval *i;
+ Interval *i;
i = DatumGetIntervalP(DirectFunctionCall2(time_mi_time,
TimeADTGetDatumFast(*aa),
@@ -143,7 +143,7 @@ static const gbtree_ninfo tinfo =
PG_FUNCTION_INFO_V1(time_dist);
-Datum time_dist(PG_FUNCTION_ARGS);
+Datum time_dist(PG_FUNCTION_ARGS);
Datum
time_dist(PG_FUNCTION_ARGS)
{
@@ -239,7 +239,7 @@ gbt_time_distance(PG_FUNCTION_ARGS)
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
);
}
View
33 contrib/btree_gist/btree_ts.c
@@ -120,7 +120,7 @@ gbt_ts_dist(const void *a, const void *b)
{
const Timestamp *aa = (const Timestamp *) a;
const Timestamp *bb = (const Timestamp *) b;
- Interval *i;
+ Interval *i;
if (TIMESTAMP_NOT_FINITE(*aa) || TIMESTAMP_NOT_FINITE(*bb))
return get_float8_infinity();
@@ -147,17 +147,17 @@ static const gbtree_ninfo tinfo =
PG_FUNCTION_INFO_V1(ts_dist);
-Datum ts_dist(PG_FUNCTION_ARGS);
+Datum ts_dist(PG_FUNCTION_ARGS);
Datum
ts_dist(PG_FUNCTION_ARGS)
{
Timestamp a = PG_GETARG_TIMESTAMP(0);
Timestamp b = PG_GETARG_TIMESTAMP(1);
- Interval *r;
+ Interval *r;
if (TIMESTAMP_NOT_FINITE(a) || TIMESTAMP_NOT_FINITE(b))
{
- Interval *p = palloc(sizeof(Interval));
+ Interval *p = palloc(sizeof(Interval));
p->day = INT_MAX;
p->month = INT_MAX;
@@ -169,25 +169,24 @@ ts_dist(PG_FUNCTION_ARGS)
PG_RETURN_INTERVAL_P(p);
}
else
-
- r = DatumGetIntervalP(DirectFunctionCall2(timestamp_mi,
- PG_GETARG_DATUM(0),
- PG_GETARG_DATUM(1)));
- PG_RETURN_INTERVAL_P( abs_interval(r) );
+ r = DatumGetIntervalP(DirectFunctionCall2(timestamp_mi,
+ PG_GETARG_DATUM(0),
+ PG_GETARG_DATUM(1)));
+ PG_RETURN_INTERVAL_P(abs_interval(r));
}
PG_FUNCTION_INFO_V1(tstz_dist);
-Datum tstz_dist(PG_FUNCTION_ARGS);
+Datum tstz_dist(PG_FUNCTION_ARGS);
Datum
tstz_dist(PG_FUNCTION_ARGS)
{
- TimestampTz a = PG_GETARG_TIMESTAMPTZ(0);
- TimestampTz b = PG_GETARG_TIMESTAMPTZ(1);
- Interval *r;
+ TimestampTz a = PG_GETARG_TIMESTAMPTZ(0);
+ TimestampTz b = PG_GETARG_TIMESTAMPTZ(1);
+ Interval *r;
if (TIMESTAMP_NOT_FINITE(a) || TIMESTAMP_NOT_FINITE(b))
{
- Interval *p = palloc(sizeof(Interval));
+ Interval *p = palloc(sizeof(Interval));
p->day = INT_MAX;
p->month = INT_MAX;
@@ -202,7 +201,7 @@ tstz_dist(PG_FUNCTION_ARGS)
r = DatumGetIntervalP(DirectFunctionCall2(timestamp_mi,
PG_GETARG_DATUM(0),
PG_GETARG_DATUM(1)));
- PG_RETURN_INTERVAL_P( abs_interval(r) );
+ PG_RETURN_INTERVAL_P(abs_interval(r));
}
@@ -309,7 +308,7 @@ gbt_ts_distance(PG_FUNCTION_ARGS)
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
);
}
@@ -354,7 +353,7 @@ gbt_tstz_distance(PG_FUNCTION_ARGS)
qqq = tstz_to_ts_gmt(query);
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) &qqq, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) &qqq, GIST_LEAF(entry), &tinfo)
);
}
View
8 contrib/btree_gist/btree_utils_num.c
@@ -223,8 +223,8 @@ gbt_num_consistent(const GBT_NUMKEY_R *key,
retval = (*tinfo->f_le) (query, key->upper);
break;
case BtreeGistNotEqualStrategyNumber:
- retval = (! ((*tinfo->f_eq) (query, key->lower) &&
- (*tinfo->f_eq) (query, key->upper))) ? true : false;
+ retval = (!((*tinfo->f_eq) (query, key->lower) &&
+ (*tinfo->f_eq) (query, key->upper))) ? true : false;
break;
default:
retval = false;
@@ -249,9 +249,9 @@ gbt_num_distance(const GBT_NUMKEY_R *key,
if (tinfo->f_dist == NULL)
elog(ERROR, "KNN search is not supported for btree_gist type %d",
(int) tinfo->t);
- if ( tinfo->f_le(query, key->lower) )
+ if (tinfo->f_le(query, key->lower))
retval = tinfo->f_dist(query, key->lower);
- else if ( tinfo->f_ge(query, key->upper) )
+ else if (tinfo->f_ge(query, key->upper))
retval = tinfo->f_dist(query, key->upper);
else
retval = 0.0;
View
6 contrib/btree_gist/btree_utils_num.h
@@ -46,7 +46,7 @@ typedef struct
bool (*f_le) (const void *, const void *); /* less or equal */
bool (*f_lt) (const void *, const void *); /* less than */
int (*f_cmp) (const void *, const void *); /* key compare function */
- float8 (*f_dist) (const void *, const void *); /* key distance function */
+ float8 (*f_dist) (const void *, const void *); /* key distance function */
} gbtree_ninfo;
@@ -94,7 +94,7 @@ typedef struct
#define GET_FLOAT_DISTANCE(t, arg1, arg2) Abs( ((float8) *((const t *) (arg1))) - ((float8) *((const t *) (arg2))) )
-#define SAMESIGN(a,b) (((a) < 0) == ((b) < 0))
+#define SAMESIGN(a,b) (((a) < 0) == ((b) < 0))
/*
* check to see if a float4/8 val has underflowed or overflowed
@@ -121,7 +121,7 @@ extern bool gbt_num_consistent(const GBT_NUMKEY_R *key, const void *query,
const gbtree_ninfo *tinfo);
extern float8 gbt_num_distance(const GBT_NUMKEY_R *key, const void *query,
- bool is_leaf, const gbtree_ninfo *tinfo);
+ bool is_leaf, const gbtree_ninfo *tinfo);
extern GIST_SPLITVEC *gbt_num_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v,
const gbtree_ninfo *tinfo);
View
2  contrib/btree_gist/btree_utils_var.c
@@ -598,7 +598,7 @@ gbt_var_consistent(
|| gbt_var_node_pf_match(key, query, tinfo);
break;
case BtreeGistNotEqualStrategyNumber:
- retval = ! ((*tinfo->f_eq) (query, key->lower) && (*tinfo->f_eq) (query, key->upper));
+ retval = !((*tinfo->f_eq) (query, key->lower) && (*tinfo->f_eq) (query, key->upper));
break;
default:
retval = FALSE;
View
2  contrib/dummy_seclabel/dummy_seclabel.c
@@ -18,7 +18,7 @@
PG_MODULE_MAGIC;
/* Entrypoint of the module */
-void _PG_init(void);
+void _PG_init(void);
static void
dummy_object_relabel(const ObjectAddress *object, const char *seclabel)
View
91 contrib/file_fdw/file_fdw.c
@@ -45,17 +45,17 @@ struct FileFdwOption
*/
static struct FileFdwOption valid_options[] = {
/* File options */
- { "filename", ForeignTableRelationId },
+ {"filename", ForeignTableRelationId},
/* Format options */
/* oids option is not supported */
- { "format", ForeignTableRelationId },
- { "header", ForeignTableRelationId },
- { "delimiter", ForeignTableRelationId },
- { "quote", ForeignTableRelationId },
- { "escape", ForeignTableRelationId },
- { "null", ForeignTableRelationId },
- { "encoding", ForeignTableRelationId },
+ {"format", ForeignTableRelationId},
+ {"header", ForeignTableRelationId},
+ {"delimiter", ForeignTableRelationId},
+ {"quote", ForeignTableRelationId},
+ {"escape", ForeignTableRelationId},
+ {"null", ForeignTableRelationId},
+ {"encoding", ForeignTableRelationId},
/*
* force_quote is not supported by file_fdw because it's for COPY TO.
@@ -68,7 +68,7 @@ static struct FileFdwOption valid_options[] = {
*/
/* Sentinel */
- { NULL, InvalidOid }
+ {NULL, InvalidOid}
};
/*
@@ -76,9 +76,9 @@ static struct FileFdwOption valid_options[] = {
*/
typedef struct FileFdwExecutionState
{
- char *filename; /* file to read */
- List *options; /* merged COPY options, excluding filename */
- CopyState cstate; /* state of reading file */
+ char *filename; /* file to read */
+ List *options; /* merged COPY options, excluding filename */
+ CopyState cstate; /* state of reading file */
} FileFdwExecutionState;
/*
@@ -94,8 +94,8 @@ PG_FUNCTION_INFO_V1(file_fdw_validator);
* FDW callback routines
*/
static FdwPlan *filePlanForeignScan(Oid foreigntableid,
- PlannerInfo *root,
- RelOptInfo *baserel);
+ PlannerInfo *root,
+ RelOptInfo *baserel);
static void fileExplainForeignScan(ForeignScanState *node, ExplainState *es);
static void fileBeginForeignScan(ForeignScanState *node, int eflags);
static TupleTableSlot *fileIterateForeignScan(ForeignScanState *node);
@@ -109,8 +109,8 @@ static bool is_valid_option(const char *option, Oid context);
static void fileGetOptions(Oid foreigntableid,
char **filename, List **other_options);
static void estimate_costs(PlannerInfo *root, RelOptInfo *baserel,
- const char *filename,
- Cost *startup_cost, Cost *total_cost);
+ const char *filename,
+ Cost *startup_cost, Cost *total_cost);
/*
@@ -149,16 +149,16 @@ file_fdw_validator(PG_FUNCTION_ARGS)
/*
* Only superusers are allowed to set options of a file_fdw foreign table.
- * This is because the filename is one of those options, and we don't
- * want non-superusers to be able to determine which file gets read.
+ * This is because the filename is one of those options, and we don't want
+ * non-superusers to be able to determine which file gets read.
*
* Putting this sort of permissions check in a validator is a bit of a
* crock, but there doesn't seem to be any other place that can enforce
* the check more cleanly.
*
- * Note that the valid_options[] array disallows setting filename at
- * any options level other than foreign table --- otherwise there'd
- * still be a security hole.
+ * Note that the valid_options[] array disallows setting filename at any
+ * options level other than foreign table --- otherwise there'd still be a
+ * security hole.
*/
if (catalog == ForeignTableRelationId && !superuser())
ereport(ERROR,
@@ -171,7 +171,7 @@ file_fdw_validator(PG_FUNCTION_ARGS)
*/
foreach(cell, options_list)
{
- DefElem *def = (DefElem *) lfirst(cell);
+ DefElem *def = (DefElem *) lfirst(cell);
if (!is_valid_option(def->defname, catalog))
{
@@ -276,7 +276,7 @@ fileGetOptions(Oid foreigntableid,
prev = NULL;
foreach(lc, options)
{
- DefElem *def = (DefElem *) lfirst(lc);
+ DefElem *def = (DefElem *) lfirst(lc);
if (strcmp(def->defname, "filename") == 0)
{
@@ -302,7 +302,7 @@ filePlanForeignScan(Oid foreigntableid,
PlannerInfo *root,
RelOptInfo *baserel)
{
- FdwPlan *fdwplan;
+ FdwPlan *fdwplan;
char *filename;
List *options;
@@ -313,7 +313,7 @@ filePlanForeignScan(Oid foreigntableid,
fdwplan = makeNode(FdwPlan);
estimate_costs(root, baserel, filename,
&fdwplan->startup_cost, &fdwplan->total_cost);
- fdwplan->fdw_private = NIL; /* not used */
+ fdwplan->fdw_private = NIL; /* not used */
return fdwplan;
}
@@ -337,7 +337,7 @@ fileExplainForeignScan(ForeignScanState *node, ExplainState *es)
/* Suppress file size if we're not showing cost details */
if (es->costs)
{
- struct stat stat_buf;
+ struct stat stat_buf;
if (stat(filename, &stat_buf) == 0)
ExplainPropertyLong("Foreign File Size", (long) stat_buf.st_size,
@@ -368,8 +368,8 @@ fileBeginForeignScan(ForeignScanState *node, int eflags)
&filename, &options);
/*
- * Create CopyState from FDW options. We always acquire all columns,
- * so as to match the expected ScanTupleSlot signature.
+ * Create CopyState from FDW options. We always acquire all columns, so
+ * as to match the expected ScanTupleSlot signature.
*/
cstate = BeginCopyFrom(node->ss.ss_currentRelation,
filename,
@@ -398,7 +398,7 @@ fileIterateForeignScan(ForeignScanState *node)
{
FileFdwExecutionState *festate = (FileFdwExecutionState *) node->fdw_state;
TupleTableSlot *slot = node->ss.ss_ScanTupleSlot;
- bool found;
+ bool found;
ErrorContextCallback errcontext;
/* Set up callback to identify error line number. */
@@ -410,8 +410,8 @@ fileIterateForeignScan(ForeignScanState *node)
/*
* The protocol for loading a virtual tuple into a slot is first
* ExecClearTuple, then fill the values/isnull arrays, then
- * ExecStoreVirtualTuple. If we don't find another row in the file,
- * we just skip the last step, leaving the slot empty as required.
+ * ExecStoreVirtualTuple. If we don't find another row in the file, we
+ * just skip the last step, leaving the slot empty as required.
*
* We can pass ExprContext = NULL because we read all columns from the
* file, so no need to evaluate default expressions.
@@ -471,17 +471,17 @@ estimate_costs(PlannerInfo *root, RelOptInfo *baserel,
const char *filename,
Cost *startup_cost, Cost *total_cost)
{
- struct stat stat_buf;
- BlockNumber pages;
- int tuple_width;
- double ntuples;
- double nrows;
- Cost run_cost = 0;
- Cost cpu_per_tuple;
+ struct stat stat_buf;
+ BlockNumber pages;
+ int tuple_width;
+ double ntuples;
+ double nrows;
+ Cost run_cost = 0;
+ Cost cpu_per_tuple;
/*
- * Get size of the file. It might not be there at plan time, though,
- * in which case we have to use a default estimate.
+ * Get size of the file. It might not be there at plan time, though, in
+ * which case we have to use a default estimate.
*/
if (stat(filename, &stat_buf) < 0)
stat_buf.st_size = 10 * BLCKSZ;
@@ -489,7 +489,7 @@ estimate_costs(PlannerInfo *root, RelOptInfo *baserel,
/*
* Convert size to pages for use in I/O cost estimate below.
*/
- pages = (stat_buf.st_size + (BLCKSZ-1)) / BLCKSZ;
+ pages = (stat_buf.st_size + (BLCKSZ - 1)) / BLCKSZ;
if (pages < 1)
pages = 1;
@@ -505,10 +505,9 @@ estimate_costs(PlannerInfo *root, RelOptInfo *baserel,
ntuples = clamp_row_est((double) stat_buf.st_size / (double) tuple_width);
/*
- * Now estimate the number of rows returned by the scan after applying
- * the baserestrictinfo quals. This is pretty bogus too, since the
- * planner will have no stats about the relation, but it's better than
- * nothing.
+ * Now estimate the number of rows returned by the scan after applying the
+ * baserestrictinfo quals. This is pretty bogus too, since the planner
+ * will have no stats about the relation, but it's better than nothing.
*/
nrows = ntuples *
clauselist_selectivity(root,
@@ -523,7 +522,7 @@ estimate_costs(PlannerInfo *root, RelOptInfo *baserel,
baserel->rows = nrows;
/*
- * Now estimate costs. We estimate costs almost the same way as
+ * Now estimate costs. We estimate costs almost the same way as
* cost_seqscan(), thus assuming that I/O costs are equivalent to a
* regular table file of the same size. However, we take per-tuple CPU
* costs as 10x of a seqscan, to account for the cost of parsing records.
View
91 contrib/fuzzystrmatch/levenshtein.c
@@ -23,7 +23,7 @@
*/
#ifdef LEVENSHTEIN_LESS_EQUAL
static int levenshtein_less_equal_internal(text *s, text *t,
- int ins_c, int del_c, int sub_c, int max_d);
+ int ins_c, int del_c, int sub_c, int max_d);
#else
static int levenshtein_internal(text *s, text *t,
int ins_c, int del_c, int sub_c);
@@ -50,7 +50,7 @@ static int levenshtein_internal(text *s, text *t,
* array.
*
* If max_d >= 0, we only need to provide an accurate answer when that answer
- * is less than or equal to the bound. From any cell in the matrix, there is
+ * is less than or equal to the bound. From any cell in the matrix, there is
* theoretical "minimum residual distance" from that cell to the last column
* of the final row. This minimum residual distance is zero when the
* untransformed portions of the strings are of equal length (because we might
@@ -87,11 +87,13 @@ levenshtein_internal(text *s, text *t,
/*
* For levenshtein_less_equal_internal, we have real variables called
- * start_column and stop_column; otherwise it's just short-hand for 0
- * and m.
+ * start_column and stop_column; otherwise it's just short-hand for 0 and
+ * m.
*/
#ifdef LEVENSHTEIN_LESS_EQUAL
- int start_column, stop_column;
+ int start_column,
+ stop_column;
+
#undef START_COLUMN
#undef STOP_COLUMN
#define START_COLUMN start_column
@@ -139,16 +141,16 @@ levenshtein_internal(text *s, text *t,
stop_column = m + 1;
/*
- * If max_d >= 0, determine whether the bound is impossibly tight. If so,
+ * If max_d >= 0, determine whether the bound is impossibly tight. If so,
* return max_d + 1 immediately. Otherwise, determine whether it's tight
* enough to limit the computation we must perform. If so, figure out
* initial stop column.
*/
if (max_d >= 0)
{
- int min_theo_d; /* Theoretical minimum distance. */
- int max_theo_d; /* Theoretical maximum distance. */
- int net_inserts = n - m;
+ int min_theo_d; /* Theoretical minimum distance. */
+ int max_theo_d; /* Theoretical maximum distance. */
+ int net_inserts = n - m;
min_theo_d = net_inserts < 0 ?
-net_inserts * del_c : net_inserts * ins_c;
@@ -162,20 +164,20 @@ levenshtein_internal(text *s, text *t,
else if (ins_c + del_c > 0)
{
/*
- * Figure out how much of the first row of the notional matrix
- * we need to fill in. If the string is growing, the theoretical
+ * Figure out how much of the first row of the notional matrix we
+ * need to fill in. If the string is growing, the theoretical
* minimum distance already incorporates the cost of deleting the
- * number of characters necessary to make the two strings equal
- * in length. Each additional deletion forces another insertion,
- * so the best-case total cost increases by ins_c + del_c.
- * If the string is shrinking, the minimum theoretical cost
- * assumes no excess deletions; that is, we're starting no futher
- * right than column n - m. If we do start further right, the
- * best-case total cost increases by ins_c + del_c for each move
- * right.
+ * number of characters necessary to make the two strings equal in
+ * length. Each additional deletion forces another insertion, so
+ * the best-case total cost increases by ins_c + del_c. If the
+ * string is shrinking, the minimum theoretical cost assumes no
+ * excess deletions; that is, we're starting no futher right than
+ * column n - m. If we do start further right, the best-case
+ * total cost increases by ins_c + del_c for each move right.
*/
- int slack_d = max_d - min_theo_d;
- int best_column = net_inserts < 0 ? -net_inserts : 0;
+ int slack_d = max_d - min_theo_d;
+ int best_column = net_inserts < 0 ? -net_inserts : 0;
+
stop_column = best_column + (slack_d / (ins_c + del_c)) + 1;
if (stop_column > m)
stop_column = m + 1;
@@ -185,15 +187,15 @@ levenshtein_internal(text *s, text *t,
/*
* In order to avoid calling pg_mblen() repeatedly on each character in s,
- * we cache all the lengths before starting the main loop -- but if all the
- * characters in both strings are single byte, then we skip this and use
- * a fast-path in the main loop. If only one string contains multi-byte
- * characters, we still build the array, so that the fast-path needn't
- * deal with the case where the array hasn't been initialized.
+ * we cache all the lengths before starting the main loop -- but if all
+ * the characters in both strings are single byte, then we skip this and
+ * use a fast-path in the main loop. If only one string contains
+ * multi-byte characters, we still build the array, so that the fast-path
+ * needn't deal with the case where the array hasn't been initialized.
*/
if (m != s_bytes || n != t_bytes)
{
- int i;
+ int i;
const char *cp = s_data;
s_char_len = (int *) palloc((m + 1) * sizeof(int));
@@ -214,8 +216,8 @@ levenshtein_internal(text *s, text *t,
curr = prev + m;
/*
- * To transform the first i characters of s into the first 0 characters
- * of t, we must perform i deletions.
+ * To transform the first i characters of s into the first 0 characters of
+ * t, we must perform i deletions.
*/
for (i = START_COLUMN; i < STOP_COLUMN; i++)
prev[i] = i * del_c;
@@ -228,6 +230,7 @@ levenshtein_internal(text *s, text *t,
int y_char_len = n != t_bytes + 1 ? pg_mblen(y) : 1;
#ifdef LEVENSHTEIN_LESS_EQUAL
+
/*
* In the best case, values percolate down the diagonal unchanged, so
* we must increment stop_column unless it's already on the right end
@@ -241,10 +244,10 @@ levenshtein_internal(text *s, text *t,
}
/*
- * The main loop fills in curr, but curr[0] needs a special case:
- * to transform the first 0 characters of s into the first j
- * characters of t, we must perform j insertions. However, if
- * start_column > 0, this special case does not apply.
+ * The main loop fills in curr, but curr[0] needs a special case: to
+ * transform the first 0 characters of s into the first j characters
+ * of t, we must perform j insertions. However, if start_column > 0,
+ * this special case does not apply.
*/
if (start_column == 0)
{
@@ -285,7 +288,7 @@ levenshtein_internal(text *s, text *t,
*/
ins = prev[i] + ins_c;
del = curr[i - 1] + del_c;
- if (x[x_char_len-1] == y[y_char_len-1]
+ if (x[x_char_len - 1] == y[y_char_len - 1]
&& x_char_len == y_char_len &&
(x_char_len == 1 || rest_of_char_same(x, y, x_char_len)))
sub = prev[i - 1];
@@ -331,6 +334,7 @@ levenshtein_internal(text *s, text *t,
y += y_char_len;
#ifdef LEVENSHTEIN_LESS_EQUAL
+
/*
* This chunk of code represents a significant performance hit if used
* in the case where there is no max_d bound. This is probably not
@@ -348,15 +352,16 @@ levenshtein_internal(text *s, text *t,
* string, so we want to find the value for zp where where (n - 1)
* - j = (m - 1) - zp.
*/
- int zp = j - (n - m);
+ int zp = j - (n - m);
/* Check whether the stop column can slide left. */
while (stop_column > 0)
{
- int ii = stop_column - 1;
- int net_inserts = ii - zp;
+ int ii = stop_column - 1;
+ int net_inserts = ii - zp;
+
if (prev[ii] + (net_inserts > 0 ? net_inserts * ins_c :
- -net_inserts * del_c) <= max_d)
+ -net_inserts * del_c) <= max_d)
break;
stop_column--;
}
@@ -364,14 +369,16 @@ levenshtein_internal(text *s, text *t,
/* Check whether the start column can slide right. */
while (start_column < stop_column)
{
- int net_inserts = start_column - zp;
+ int net_inserts = start_column - zp;
+
if (prev[start_column] +
(net_inserts > 0 ? net_inserts * ins_c :
- -net_inserts * del_c) <= max_d)
+ -net_inserts * del_c) <= max_d)
break;
+
/*
- * We'll never again update these values, so we must make
- * sure there's nothing here that could confuse any future
+ * We'll never again update these values, so we must make sure
+ * there's nothing here that could confuse any future
* iteration of the outer loop.
*/
prev[start_column] = max_d + 1;
View
4 contrib/hstore/hstore_gin.c
@@ -13,7 +13,7 @@
/*
* When using a GIN index for hstore, we choose to index both keys and values.
* The storage format is "text" values, with K, V, or N prepended to the string
- * to indicate key, value, or null values. (As of 9.1 it might be better to
+ * to indicate key, value, or null values. (As of 9.1 it might be better to
* store null values as nulls, but we'll keep it this way for on-disk
* compatibility.)
*/
@@ -168,7 +168,7 @@ gin_consistent_hstore(PG_FUNCTION_ARGS)
{
/*
* Index doesn't have information about correspondence of keys and
- * values, so we need recheck. However, if not all the keys are
+ * values, so we need recheck. However, if not all the keys are
* present, we can fail at once.
*/
*recheck = true;
View
4 contrib/hstore/hstore_op.c
@@ -437,7 +437,7 @@ hstore_delete_hstore(PG_FUNCTION_ARGS)
if (snullval != HS_VALISNULL(es2, j)
|| (!snullval
&& (svallen != HS_VALLEN(es2, j)
- || memcmp(HS_VAL(es, ps, i), HS_VAL(es2, ps2, j), svallen) != 0)))
+ || memcmp(HS_VAL(es, ps, i), HS_VAL(es2, ps2, j), svallen) != 0)))
{
HS_COPYITEM(ed, bufd, pd,
HS_KEY(es, ps, i), HS_KEYLEN(es, i),
@@ -1000,7 +1000,7 @@ hstore_contains(PG_FUNCTION_ARGS)
if (nullval != HS_VALISNULL(ve, idx)
|| (!nullval
&& (vallen != HS_VALLEN(ve, idx)
- || memcmp(HS_VAL(te, tstr, i), HS_VAL(ve, vstr, idx), vallen))))
+ || memcmp(HS_VAL(te, tstr, i), HS_VAL(ve, vstr, idx), vallen))))
res = false;
}
else
View
6 contrib/intarray/_int_bool.c
@@ -98,7 +98,7 @@ gettoken(WORKSTATE *state, int4 *val)
}
else
{
- long lval;
+ long lval;
nnn[innn] = '\0';
errno = 0;
@@ -355,8 +355,8 @@ gin_bool_consistent(QUERYTYPE *query, bool *check)
return FALSE;
/*
- * Set up data for checkcondition_gin. This must agree with the
- * query extraction code in ginint4_queryextract.
+ * Set up data for checkcondition_gin. This must agree with the query
+ * extraction code in ginint4_queryextract.
*/
gcv.first = items;
gcv.mapped_check = (bool *) palloc(sizeof(bool) * query->size);
View
7 contrib/intarray/_int_gin.c
@@ -34,8 +34,8 @@ ginint4_queryextract(PG_FUNCTION_ARGS)
/*
* If the query doesn't have any required primitive values (for
- * instance, it's something like '! 42'), we have to do a full
- * index scan.
+ * instance, it's something like '! 42'), we have to do a full index
+ * scan.
*/
if (query_has_required_values(query))
*searchMode = GIN_SEARCH_MODE_DEFAULT;
@@ -95,7 +95,7 @@ ginint4_queryextract(PG_FUNCTION_ARGS)
case RTOldContainsStrategyNumber:
if (*nentries > 0)
*searchMode = GIN_SEARCH_MODE_DEFAULT;
- else /* everything contains the empty set */
+ else /* everything contains the empty set */
*searchMode = GIN_SEARCH_MODE_ALL;
break;
default:
@@ -116,6 +116,7 @@ ginint4_consistent(PG_FUNCTION_ARGS)
bool *check = (bool *) PG_GETARG_POINTER(0);
StrategyNumber strategy = PG_GETARG_UINT16(1);
int32 nkeys = PG_GETARG_INT32(3);
+
/* Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4); */
bool *recheck = (bool *) PG_GETARG_POINTER(5);
bool res = FALSE;
View
4 contrib/intarray/_int_tool.c
@@ -183,7 +183,7 @@ rt__int_size(ArrayType *a, float *size)
*size = (float) ARRNELEMS(a);
}
-/* Sort the given data (len >= 2). Return true if any duplicates found */
+/* Sort the given data (len >= 2). Return true if any duplicates found */
bool
isort(int4 *a, int len)
{
@@ -195,7 +195,7 @@ isort(int4 *a, int len)
bool r = FALSE;
/*
- * We use a simple insertion sort. While this is O(N^2) in the worst
+ * We use a simple insertion sort. While this is O(N^2) in the worst
* case, it's quite fast if the input is already sorted or nearly so.
* Also, for not-too-large inputs it's faster than more complex methods
* anyhow.
View
1  contrib/isn/ISBN.h
@@ -988,4 +988,3 @@ const char *ISBN_range_new[][2] = {
{"10-976000", "10-999999"},
{NULL, NULL},
};
-
View
4 contrib/pg_archivecleanup/pg_archivecleanup.c
@@ -25,9 +25,9 @@
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
-#else /* WIN32 */
+#else /* WIN32 */
extern int getopt(int argc, char *const argv[], const char *optstring);
-#endif /* ! WIN32 */
+#endif /* ! WIN32 */
extern char *optarg;
extern int optind;
View
2  contrib/pg_stat_statements/pg_stat_statements.c
@@ -137,7 +137,7 @@ typedef enum
PGSS_TRACK_NONE, /* track no statements */
PGSS_TRACK_TOP, /* only top level statements */
PGSS_TRACK_ALL /* all statements, including nested ones */
-} PGSSTrackLevel;
+} PGSSTrackLevel;
static const struct config_enum_entry track_options[] =
{
View
75 contrib/pg_test_fsync/pg_test_fsync.c
@@ -28,24 +28,28 @@
static const char *progname;
-static int ops_per_test = 2000;
-static char full_buf[XLOG_SEG_SIZE], *buf, *filename = FSYNC_FILENAME;
-static struct timeval start_t, stop_t;
-
-
-static void handle_args(int argc, char *argv[]);
-static void prepare_buf(void);
-static void test_open(void);
-static void test_non_sync(void);
-static void test_sync(int writes_per_op);
-static void test_open_syncs(void);
-static void test_open_sync(const char *msg, int writes_size);
-static void test_file_descriptor_sync(void);
+static int ops_per_test = 2000;
+static char full_buf[XLOG_SEG_SIZE],
+ *buf,
+ *filename = FSYNC_FILENAME;
+static struct timeval start_t,
+ stop_t;
+
+
+static void handle_args(int argc, char *argv[]);
+static void prepare_buf(void);
+static void test_open(void);
+static void test_non_sync(void);
+static void test_sync(int writes_per_op);
+static void test_open_syncs(void);
+static void test_open_sync(const char *msg, int writes_size);
+static void test_file_descriptor_sync(void);
+
#ifdef HAVE_FSYNC_WRITETHROUGH
static int pg_fsync_writethrough(int fd);
#endif
-static void print_elapse(struct timeval start_t, struct timeval stop_t);
-static void die(const char *str);
+static void print_elapse(struct timeval start_t, struct timeval stop_t);
+static void die(const char *str);
int
@@ -103,7 +107,7 @@ handle_args(int argc, char *argv[])
}
while ((option = getopt_long(argc, argv, "f:o:",
- long_options, &optindex)) != -1)
+ long_options, &optindex)) != -1)
{
switch (option)
{
@@ -176,7 +180,9 @@ test_open(void)
static void
test_sync(int writes_per_op)
{
- int tmpfile, ops, writes;
+ int tmpfile,
+ ops,
+ writes;
bool fs_warning = false;
if (writes_per_op == 1)
@@ -353,7 +359,9 @@ test_open_syncs(void)
static void
test_open_sync(const char *msg, int writes_size)
{
- int tmpfile, ops, writes;
+ int tmpfile,
+ ops,
+ writes;
printf(LABEL_FORMAT, msg);
fflush(stdout);
@@ -377,7 +385,6 @@ test_open_sync(const char *msg, int writes_size)
close(tmpfile);
print_elapse(start_t, stop_t);
}
-
#else
printf(NA_FORMAT, "n/a\n");
#endif
@@ -386,22 +393,22 @@ test_open_sync(const char *msg, int writes_size)
static void
test_file_descriptor_sync(void)
{
- int tmpfile, ops;
+ int tmpfile,
+ ops;
/*
- * Test whether fsync can sync data written on a different
- * descriptor for the same file. This checks the efficiency
- * of multi-process fsyncs against the same file.
- * Possibly this should be done with writethrough on platforms
- * which support it.
+ * Test whether fsync can sync data written on a different descriptor for
+ * the same file. This checks the efficiency of multi-process fsyncs
+ * against the same file. Possibly this should be done with writethrough
+ * on platforms which support it.
*/
printf("\nTest if fsync on non-write file descriptor is honored:\n");
printf("(If the times are similar, fsync() can sync data written\n");
printf("on a different descriptor.)\n");
/*
- * first write, fsync and close, which is the
- * normal behavior without multiple descriptors
+ * first write, fsync and close, which is the normal behavior without
+ * multiple descriptors
*/
printf(LABEL_FORMAT, "write, fsync, close");
fflush(stdout);
@@ -416,9 +423,10 @@ test_file_descriptor_sync(void)
if (fsync(tmpfile) != 0)
die("fsync failed");
close(tmpfile);
+
/*
- * open and close the file again to be consistent
- * with the following test
+ * open and close the file again to be consistent with the following
+ * test
*/
if ((tmpfile = open(filename, O_RDWR, 0)) == -1)
die("could not open output file");
@@ -428,9 +436,8 @@ test_file_descriptor_sync(void)
print_elapse(start_t, stop_t);
/*
- * Now open, write, close, open again and fsync
- * This simulates processes fsyncing each other's
- * writes.
+ * Now open, write, close, open again and fsync This simulates processes
+ * fsyncing each other's writes.
*/
printf(LABEL_FORMAT, "write, close, fsync");
fflush(stdout);
@@ -458,7 +465,8 @@ test_file_descriptor_sync(void)
static void
test_non_sync(void)
{
- int tmpfile, ops;
+ int tmpfile,
+ ops;
/*
* Test a simple write without fsync
@@ -494,7 +502,6 @@ pg_fsync_writethrough(int fd)
return -1;
#endif
}
-
#endif
/*
View
7 contrib/pg_trgm/trgm.h
@@ -51,8 +51,9 @@ uint32 trgm2int(trgm *ptr);
#endif
#define ISPRINTABLETRGM(t) ( ISPRINTABLECHAR( ((char*)(t)) ) && ISPRINTABLECHAR( ((char*)(t))+1 ) && ISPRINTABLECHAR( ((char*)(t))+2 ) )
-#define ISESCAPECHAR(x) (*(x) == '\\') /* Wildcard escape character */
-#define ISWILDCARDCHAR(x) (*(x) == '_' || *(x) == '%') /* Wildcard meta-character */
+#define ISESCAPECHAR(x) (*(x) == '\\') /* Wildcard escape character */
+#define ISWILDCARDCHAR(x) (*(x) == '_' || *(x) == '%') /* Wildcard
+ * meta-character */
typedef struct
{
@@ -105,4 +106,4 @@ TRGM *generate_wildcard_trgm(const char *str, int slen);
float4 cnt_sml(TRGM *trg1, TRGM *trg2);
bool trgm_contained_by(TRGM *trg1, TRGM *trg2);
-#endif /* __TRGM_H__ */
+#endif /* __TRGM_H__ */
View
20 contrib/pg_trgm/trgm_gin.c
@@ -67,7 +67,7 @@ gin_extract_value_trgm(PG_FUNCTION_ARGS)
ptr = GETARR(trg);
for (i = 0; i < trglen; i++)
{
- int32 item = trgm2int(ptr);
+ int32 item = trgm2int(ptr);
entries[i] = Int32GetDatum(item);
ptr++;
@@ -83,10 +83,11 @@ gin_extract_query_trgm(PG_FUNCTION_ARGS)
text *val = (text *) PG_GETARG_TEXT_P(0);
int32 *nentries = (int32 *) PG_GETARG_POINTER(1);
StrategyNumber strategy = PG_GETARG_UINT16(2);
- /* bool **pmatch = (bool **) PG_GETARG_POINTER(3); */
- /* Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4); */
- /* bool **nullFlags = (bool **) PG_GETARG_POINTER(5); */
- int32 *searchMode = (int32 *) PG_GETARG_POINTER(6);
+
+ /* bool **pmatch = (bool **) PG_GETARG_POINTER(3); */
+ /* Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4); */
+ /* bool **nullFlags = (bool **) PG_GETARG_POINTER(5); */
+ int32 *searchMode = (int32 *) PG_GETARG_POINTER(6);
Datum *entries = NULL;
TRGM *trg;
int32 trglen;
@@ -104,6 +105,7 @@ gin_extract_query_trgm(PG_FUNCTION_ARGS)
#endif
/* FALL THRU */
case LikeStrategyNumber:
+
/*
* For wildcard search we extract all the trigrams that every
* potentially-matching string must include.
@@ -112,7 +114,7 @@ gin_extract_query_trgm(PG_FUNCTION_ARGS)
break;
default:
elog(ERROR, "unrecognized strategy number: %d", strategy);
- trg = NULL; /* keep compiler quiet */
+ trg = NULL; /* keep compiler quiet */
break;
}
@@ -125,7 +127,7 @@ gin_extract_query_trgm(PG_FUNCTION_ARGS)
ptr = GETARR(trg);
for (i = 0; i < trglen; i++)
{
- int32 item = trgm2int(ptr);
+ int32 item = trgm2int(ptr);
entries[i] = Int32GetDatum(item);
ptr++;
@@ -146,9 +148,11 @@ gin_trgm_consistent(PG_FUNCTION_ARGS)
{
bool *check = (bool *) PG_GETARG_POINTER(0);
StrategyNumber strategy = PG_GETARG_UINT16(1);
+
/* text *query = PG_GETARG_TEXT_P(2); */
int32 nkeys = PG_GETARG_INT32(3);
- /* Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4); */
+
+ /* Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4); */
bool *recheck = (bool *) PG_GETARG_POINTER(5);
bool res;
int32 i,
View
46 contrib/pg_trgm/trgm_gist.c
@@ -190,17 +190,18 @@ gtrgm_consistent(PG_FUNCTION_ARGS)
GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
text *query = PG_GETARG_TEXT_P(1);
StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
/* Oid subtype = PG_GETARG_OID(3); */
bool *recheck = (bool *) PG_GETARG_POINTER(4);
TRGM *key = (TRGM *) DatumGetPointer(entry->key);
TRGM *qtrg;
bool res;
char *cache = (char *) fcinfo->flinfo->fn_extra,
- *cacheContents = cache + MAXALIGN(sizeof(StrategyNumber));
+ *cacheContents = cache + MAXALIGN(sizeof(StrategyNumber));
/*
* Store both the strategy number and extracted trigrams in cache, because
- * trigram extraction is relatively CPU-expensive. We must include
+ * trigram extraction is relatively CPU-expensive. We must include
* strategy number because trigram extraction depends on strategy.
*/
if (cache == NULL || strategy != *((StrategyNumber *) cache) ||
@@ -222,7 +223,7 @@ gtrgm_consistent(PG_FUNCTION_ARGS)
break;
default:
elog(ERROR, "unrecognized strategy number: %d", strategy);
- qtrg = NULL; /* keep compiler quiet */
+ qtrg = NULL; /* keep compiler quiet */
break;
}
@@ -251,20 +252,20 @@ gtrgm_consistent(PG_FUNCTION_ARGS)
*recheck = false;
if (GIST_LEAF(entry))
- { /* all leafs contains orig trgm */
- float4 tmpsml = cnt_sml(key, qtrg);
+ { /* all leafs contains orig trgm */
+ float4 tmpsml = cnt_sml(key, qtrg);
/* strange bug at freebsd 5.2.1 and gcc 3.3.3 */
res = (*(int *) &tmpsml == *(int *) &trgm_limit || tmpsml > trgm_limit) ? true : false;
}
else if (ISALLTRUE(key))
- { /* non-leaf contains signature */
+ { /* non-leaf contains signature */
res = true;
}
else
- { /* non-leaf contains signature */
- int4 count = cnt_sml_sign_common(qtrg, GETSIGN(key));
- int4 len = ARRNELEM(qtrg);
+ { /* non-leaf contains signature */
+ int4 count = cnt_sml_sign_common(qtrg, GETSIGN(key));
+ int4 len = ARRNELEM(qtrg);
if (len == 0)
res = false;
@@ -286,20 +287,20 @@ gtrgm_consistent(PG_FUNCTION_ARGS)
* nodes.
*/
if (GIST_LEAF(entry))
- { /* all leafs contains orig trgm */
+ { /* all leafs contains orig trgm */
res = trgm_contained_by(qtrg, key);
}
else if (ISALLTRUE(key))
- { /* non-leaf contains signature */
+ { /* non-leaf contains signature */
res = true;
}
else
- { /* non-leaf contains signature */
- int32 k,
- tmp = 0,
- len = ARRNELEM(qtrg);
- trgm *ptr = GETARR(qtrg);
- BITVECP sign = GETSIGN(key);
+ { /* non-leaf contains signature */
+ int32 k,
+ tmp = 0,
+ len = ARRNELEM(qtrg);
+ trgm *ptr = GETARR(qtrg);
+ BITVECP sign = GETSIGN(key);
res = true;
for (k = 0; k < len; k++)
@@ -328,6 +329,7 @@ gtrgm_distance(PG_FUNCTION_ARGS)
GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
text *query = PG_GETARG_TEXT_P(1);
StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
/* Oid subtype = PG_GETARG_OID(3); */
TRGM *key = (TRGM *) DatumGetPointer(entry->key);
TRGM *qtrg;
@@ -355,17 +357,17 @@ gtrgm_distance(PG_FUNCTION_ARGS)
{
case DistanceStrategyNumber:
if (GIST_LEAF(entry))
- { /* all leafs contains orig trgm */
+ { /* all leafs contains orig trgm */
res = 1.0 - cnt_sml(key, qtrg);
}
else if (ISALLTRUE(key))
- { /* all leafs contains orig trgm */
+ { /* all leafs contains orig trgm */
res = 0.0;
}
else
- { /* non-leaf contains signature */
- int4 count = cnt_sml_sign_common(qtrg, GETSIGN(key));
- int4 len = ARRNELEM(qtrg);
+ { /* non-leaf contains signature */
+ int4 count = cnt_sml_sign_common(qtrg, GETSIGN(key));
+ int4 len = ARRNELEM(qtrg);
res = (len == 0) ? -1.0 : 1.0 - ((float8) count) / ((float8) len);
}
View
11 contrib/pg_trgm/trgm_op.c
@@ -273,9 +273,9 @@ get_wildcard_part(const char *str, int lenstr,
const char *beginword = str;
const char *endword;
char *s = buf;
- bool in_wildcard_meta = false;
- bool in_escape = false;
- int clen;
+ bool in_wildcard_meta = false;
+ bool in_escape = false;
+ int clen;
/*
* Find the first word character remembering whether last character was
@@ -410,14 +410,14 @@ generate_wildcard_trgm(const char *str, int slen)
{
TRGM *trg;
char *buf,
- *buf2;
+ *buf2;
trgm *tptr;
int len,
charlen,
bytelen;
const char *eword;
- trg = (TRGM *) palloc(TRGMHDRSIZE + sizeof(trgm) * (slen / 2 + 1) * 3);
+ trg = (TRGM *) palloc(TRGMHDRSIZE + sizeof(trgm) * (slen / 2 + 1) *3);
trg->flag = ARRKEY;
SET_VARSIZE(trg, TRGMHDRSIZE);
@@ -638,6 +638,7 @@ similarity_dist(PG_FUNCTION_ARGS)
float4 res = DatumGetFloat4(DirectFunctionCall2(similarity,
PG_GETARG_DATUM(0),
PG_GETARG_DATUM(1)));
+
PG_RETURN_FLOAT4(1.0 - res);
}
View
7 contrib/pg_upgrade/check.c
@@ -212,7 +212,10 @@ check_cluster_versions(void)
old_cluster.major_version = get_major_server_version(&old_cluster);
new_cluster.major_version = get_major_server_version(&new_cluster);
- /* We allow upgrades from/to the same major version for alpha/beta upgrades */
+ /*
+ * We allow upgrades from/to the same major version for alpha/beta
+ * upgrades
+ */
if (GET_MAJOR_VERSION(old_cluster.major_version) < 803)
pg_log(PG_FATAL, "This utility can only upgrade from PostgreSQL version 8.3 and later.\n");
@@ -516,7 +519,7 @@ check_for_isn_and_int8_passing_mismatch(ClusterInfo *cluster)
}
if (script)
- fclose(script);
+ fclose(script);
if (found)
{
View
3  contrib/pg_upgrade/controldata.c
@@ -505,8 +505,7 @@ check_control_data(ControlData *oldctrl,
"\nOld and new pg_controldata date/time storage types do not match.\n");
/*
- * This is a common 8.3 -> 8.4 upgrade problem, so we are more
- * verbose
+ * This is a common 8.3 -> 8.4 upgrade problem, so we are more verbose