Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
a1635450
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a1635450
编写于
9月 05, 1997
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Cleanups needed for indent. Remove };
上级
fe97d580
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
253 addition
and
254 deletion
+253
-254
src/backend/catalog/heap.c
src/backend/catalog/heap.c
+3
-3
src/backend/optimizer/plan/planner.c
src/backend/optimizer/plan/planner.c
+1
-2
src/backend/optimizer/util/pathnode.c
src/backend/optimizer/util/pathnode.c
+2
-2
src/backend/parser/analyze.c
src/backend/parser/analyze.c
+2
-2
src/backend/storage/ipc/s_lock.c
src/backend/storage/ipc/s_lock.c
+14
-14
src/backend/utils/adt/date.c
src/backend/utils/adt/date.c
+7
-7
src/backend/utils/adt/datetime.c
src/backend/utils/adt/datetime.c
+9
-9
src/backend/utils/adt/dt.c
src/backend/utils/adt/dt.c
+143
-143
src/backend/utils/adt/geo_ops.c
src/backend/utils/adt/geo_ops.c
+72
-72
未找到文件。
src/backend/catalog/heap.c
浏览文件 @
a1635450
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.2
3 1997/09/04 13:17:59 vadim
Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.2
4 1997/09/05 18:13:45 momjian
Exp $
*
* INTERFACE ROUTINES
* heap_creatr() - Create an uncataloged heap relation
...
...
@@ -262,7 +262,7 @@ heap_creatr(char *name,
sprintf
(
tempname
,
"temp_%d"
,
relid
);
relname
=
tempname
;
isTemp
=
1
;
}
;
}
}
/* ----------------
...
...
@@ -1403,7 +1403,7 @@ InitTempRelList(void)
if
(
tempRels
)
{
free
(
tempRels
->
rels
);
free
(
tempRels
);
}
;
}
tempRels
=
(
TempRelList
*
)
malloc
(
sizeof
(
TempRelList
));
tempRels
->
size
=
TEMP_REL_LIST_SIZE
;
...
...
src/backend/optimizer/plan/planner.c
浏览文件 @
a1635450
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.
2 1996/10/31 10:59:15 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.
3 1997/09/05 18:10:32 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -384,7 +384,6 @@ pg_checkretval(Oid rettype, QueryTreeList *queryTreeList)
tletype = (Oid) ((Param*)thenode)->paramtype;
else if (IsA(thenode,Expr)) {
tletype = Expr
}
} else if (IsA(thenode,LispList)) {
thenode = lfirst(thenode);
if (IsA(thenode,Oper))
...
...
src/backend/optimizer/util/pathnode.c
浏览文件 @
a1635450
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.
2 1997/03/18 18:40:40 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.
3 1997/09/05 18:10:36 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -218,7 +218,7 @@ create_seqscan_path(Rel *rel)
#if 0
if (XfuncMode != XFUNC_OFF) {
pathnode->path_cost +=
xfunc_get_path_cost(pathnode)
)
;
xfunc_get_path_cost(pathnode);
}
#endif
return
(
pathnode
);
...
...
src/backend/parser/analyze.c
浏览文件 @
a1635450
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.3
6 1997/09/01 05:56:34 thomas
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.3
7 1997/09/05 18:10:42 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1353,7 +1353,7 @@ make_targetlist_expr(ParseState *pstate,
} else
if (attrtype != type_id) {
if ((attrtype == INT2OID) && (type_id == INT4OID))
lfirst(expr) = lispInteger (INT2OID);
do CASHOID too
lfirst(expr) = lispInteger (INT2OID);
/* handle CASHOID too*/
else if ((attrtype == FLOAT4OID) && (type_id == FLOAT8OID))
lfirst(expr) = lispInteger (FLOAT4OID);
else
...
...
src/backend/storage/ipc/s_lock.c
浏览文件 @
a1635450
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.2
0 1997/08/24 23:07:28
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.2
1 1997/09/05 18:10:54
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -481,19 +481,19 @@ S_INIT_LOCK(slock_t *lock)
static
int
tas_dummy
()
{
__asm__
(
"
tas:
/* r3 points to the location of p */
lwarx 5,0,3
/* r5 = *p */
cmpwi 5,0
/* r5 == 0 ? */
bne fail
/* if not 0, jump to fail */
addi 5,5,1
/* set 1 to r5 */
stwcx. 5,0,3
/* try update p atomically */
beq success
/* jump if scceed */
fail: li 3,1
/* set 1 to r3 */
blr
success:
li 3,0
/* set 0 to r3 */
blr
__asm__
(
"
\n
\
tas:
\n
\
lwarx 5,0,3
\n
\
cmpwi 5,0
\n
\
bne fail
\n
\
addi 5,5,1
\n
\
stwcx. 5,0,3
\n
\
beq success
\n
\
fail: li 3,1
\n
\
blr
\n
\
success:
\n
\
li 3,0
\n
\
blr
\n
\
"
);
}
...
...
src/backend/utils/adt/date.c
浏览文件 @
a1635450
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.1
3 1997/08/19 21:34:30
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.1
4 1997/09/05 18:11:05
momjian Exp $
*
* NOTES
* This code is actually (almost) unused.
...
...
@@ -144,7 +144,7 @@ printf( "reltimein- %d fields are type %d (DTK_DATE=%d)\n", nf, dtype, DTK_DATE)
default:
return
(
INVALID_RELTIME
);
}
;
}
elog
(
WARN
,
"Bad reltime (internal coding error) '%s'"
,
str
);
return
(
INVALID_RELTIME
);
...
...
@@ -166,7 +166,7 @@ char *reltimeout(int32 time)
}
else
{
reltime2tm
(
time
,
tm
);
EncodeTimeSpan
(
tm
,
0
,
DateStyle
,
buf
);
}
;
}
result
=
PALLOC
(
strlen
(
buf
)
+
1
);
strcpy
(
result
,
buf
);
...
...
@@ -305,7 +305,7 @@ timespan_reltime(TimeSpan *timespan)
}
else
{
year
=
0
;
month
=
timespan
->
month
;
}
;
}
span
=
(((((
double
)
365
*
year
)
+
((
double
)
30
*
month
))
*
86400
)
+
timespan
->
time
);
...
...
@@ -315,7 +315,7 @@ printf( "timespan_reltime- convert m%d s%f to %f [%d %d]\n",
#endif
time
=
(((
span
>
INT_MIN
)
&&
(
span
<
INT_MAX
))
?
span
:
INVALID_RELTIME
);
}
;
}
return
(
time
);
}
/* timespan_reltime() */
...
...
@@ -341,7 +341,7 @@ reltime_timespan(RelativeTime reltime)
result
->
time
=
reltime
;
result
->
month
=
((
12
*
year
)
+
month
);
}
;
}
return
(
result
);
}
/* reltime_timespan() */
...
...
@@ -694,7 +694,7 @@ int isreltime(char *str)
default:
return
0
;
break
;
}
;
}
return
0
;
}
/* isreltime() */
...
...
src/backend/utils/adt/datetime.c
浏览文件 @
a1635450
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.1
2 1997/08/28 05:06:29 vadim
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.1
3 1997/09/05 18:11:10 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -95,7 +95,7 @@ printf( "date_in- input string is %s\n", str);
default:
elog
(
WARN
,
"Unrecognized date external representation %s"
,
str
);
}
;
}
if
(
tm
->
tm_year
<
0
||
tm
->
tm_year
>
32767
)
elog
(
WARN
,
"date_in: year must be limited to values 0 through 32767 in '%s'"
,
str
);
...
...
@@ -186,7 +186,7 @@ date_cmp(DateADT dateVal1, DateADT dateVal2)
return
-
1
;
}
else
if
(
dateVal1
>
dateVal2
)
{
return
1
;
}
;
}
return
0
;
}
/* date_cmp() */
...
...
@@ -281,7 +281,7 @@ datetime_date(DateTime *datetime)
}
else
{
if
(
datetime2tm
(
*
datetime
,
&
tz
,
tm
,
&
fsec
,
&
tzn
)
!=
0
)
elog
(
WARN
,
"Unable to convert datetime to date"
,
NULL
);
}
;
}
result
=
(
date2j
(
tm
->
tm_year
,
tm
->
tm_mon
,
tm
->
tm_mday
)
-
date2j
(
2000
,
1
,
1
));
...
...
@@ -319,7 +319,7 @@ abstime_date(AbsoluteTime abstime)
abstime2tm
(
abstime
,
&
tz
,
tm
,
NULL
);
result
=
date2j
(
tm
->
tm_year
,
tm
->
tm_mon
,
tm
->
tm_mday
)
-
date2j
(
2000
,
1
,
1
);
break
;
}
;
}
return
(
result
);
}
/* abstime_date() */
...
...
@@ -404,7 +404,7 @@ printf( "date2tm- convert %d-%d-%d %d:%d%d to datetime\n",
*
tzp
=
0
;
tm
->
tm_isdst
=
0
;
if
(
tzn
!=
NULL
)
*
tzn
=
NULL
;
}
;
}
return
0
;
}
/* date2tm() */
...
...
@@ -482,8 +482,8 @@ time_out(TimeADT *time)
sprintf
(
buf
,
"%02d:%02d:%02d"
,
hour
,
min
,
sec
);
}
else
{
sprintf
(
buf
,
"%02d:%02d:%05.2f"
,
hour
,
min
,
(
sec
+
fsec
));
}
;
}
;
}
}
#endif
result
=
PALLOC
(
strlen
(
buf
)
+
1
);
...
...
@@ -570,7 +570,7 @@ datetime_datetime(DateADT date, TimeADT *time)
}
else
{
result
=
date_datetime
(
date
);
*
result
+=
*
time
;
}
;
}
return
(
result
);
}
/* datetime_datetime() */
...
...
src/backend/utils/adt/dt.c
浏览文件 @
a1635450
此差异已折叠。
点击以展开。
src/backend/utils/adt/geo_ops.c
浏览文件 @
a1635450
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.1
6 1997/08/21 23:56:41
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.1
7 1997/09/05 18:11:14
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -158,7 +158,7 @@ static int pair_decode(char *str, float8 *x, float8 *y, char **s)
if
(
*
str
!=
RDELIM
)
return
(
FALSE
);
str
++
;
while
(
isspace
(
*
str
))
str
++
;
}
;
}
if
(
s
!=
NULL
)
*
s
=
str
;
return
(
TRUE
);
...
...
@@ -196,8 +196,8 @@ static int path_decode(int opentype, int npts, char *str, int *isopen, char **ss
}
else
if
(
strrchr
(
s
,
LDELIM
)
==
s
)
{
depth
++
;
s
=
cp
;
}
;
}
;
}
}
for
(
i
=
0
;
i
<
npts
;
i
++
)
{
if
(
!
pair_decode
(
s
,
&
(
p
->
x
),
&
(
p
->
y
),
&
s
))
...
...
@@ -205,7 +205,7 @@ static int path_decode(int opentype, int npts, char *str, int *isopen, char **ss
if
(
*
s
==
DELIM
)
s
++
;
p
++
;
}
;
}
while
(
depth
>
0
)
{
if
((
*
s
==
RDELIM
)
...
...
@@ -215,8 +215,8 @@ static int path_decode(int opentype, int npts, char *str, int *isopen, char **ss
while
(
isspace
(
*
s
))
s
++
;
}
else
{
return
(
FALSE
);
}
;
}
;
}
}
*
ss
=
s
;
return
(
TRUE
);
...
...
@@ -239,7 +239,7 @@ static char *path_encode( bool closed, int npts, Point *pt)
break
;
default:
break
;
}
;
}
for
(
i
=
0
;
i
<
npts
;
i
++
)
{
*
cp
++
=
LDELIM
;
...
...
@@ -249,7 +249,7 @@ static char *path_encode( bool closed, int npts, Point *pt)
*
cp
++
=
RDELIM
;
*
cp
++
=
DELIM
;
pt
++
;
}
;
}
cp
--
;
switch
(
closed
)
{
case
TRUE
:
...
...
@@ -260,7 +260,7 @@ static char *path_encode( bool closed, int npts, Point *pt)
break
;
default:
break
;
}
;
}
*
cp
=
'\0'
;
return
(
result
);
...
...
@@ -280,7 +280,7 @@ static int pair_count(char *s, char delim)
while
((
s
=
strchr
(
s
,
delim
))
!=
NULL
)
{
ndelim
++
;
s
++
;
}
;
}
return
((
ndelim
%
2
)
?
((
ndelim
+
1
)
/
2
)
:
-
1
);
}
...
...
@@ -320,12 +320,12 @@ BOX *box_in(char *str)
x
=
box
->
high
.
x
;
box
->
high
.
x
=
box
->
low
.
x
;
box
->
low
.
x
=
x
;
}
;
}
if
(
box
->
high
.
y
<
box
->
low
.
y
)
{
y
=
box
->
high
.
y
;
box
->
high
.
y
=
box
->
low
.
y
;
box
->
low
.
y
=
y
;
}
;
}
return
(
box
);
}
/* box_in() */
...
...
@@ -361,14 +361,14 @@ static BOX *box_fill(BOX *result, double x1, double x2, double y1, double y2)
}
else
{
result
->
high
.
x
=
x2
;
result
->
low
.
x
=
x1
;
}
;
}
if
(
y1
>
y2
)
{
result
->
high
.
y
=
y1
;
result
->
low
.
y
=
y2
;
}
else
{
result
->
high
.
y
=
y2
;
result
->
low
.
y
=
y1
;
}
;
}
return
(
result
);
}
...
...
@@ -739,7 +739,7 @@ printf( "line_construct_pp- line is neither vertical nor horizontal (diffs x=%.*
digits8
,
(
pt2
->
x
-
pt1
->
x
),
digits8
,
(
pt2
->
y
-
pt1
->
y
));
#endif
result
->
m
=
result
->
A
;
}
;
}
return
(
result
);
}
/* line_construct_pp() */
...
...
@@ -760,7 +760,7 @@ static bool line_parallel(LINE *l1, LINE *l2)
#endif
if
(
FPzero
(
l1
->
B
))
{
return
(
FPzero
(
l2
->
B
));
}
;
}
return
(
FPeq
(
l2
->
A
,
l1
->
A
*
(
l2
->
B
/
l1
->
B
)));
}
/* line_parallel() */
...
...
@@ -778,7 +778,7 @@ bool line_perp(LINE *l1, LINE *l2)
return
(
FPzero
(
l2
->
B
)
);
}
else
if
(
FPzero
(
l1
->
B
))
{
return
(
FPzero
(
l2
->
A
)
);
}
;
}
return
(
FPeq
(((
l1
->
A
*
l2
->
B
)
/
(
l1
->
B
*
l2
->
A
)),
-
1
.
0
)
);
}
/* line_perp() */
...
...
@@ -889,7 +889,7 @@ line_interpt(LINE *l1, LINE *l2)
#endif
x
=
(
l1
->
C
-
l2
->
C
)
/
(
l2
->
A
-
l1
->
A
);
y
=
(
l1
->
A
*
x
+
l1
->
C
);
}
;
}
result
=
point_construct
(
x
,
y
);
#ifdef GEODEBUG
...
...
@@ -946,7 +946,7 @@ PATH *path_in(char *str)
if
((
*
s
==
LDELIM
)
&&
(
strrchr
(
s
,
LDELIM
)
==
s
))
{
s
++
;
depth
++
;
}
;
}
size
=
offsetof
(
PATH
,
p
[
0
])
+
(
sizeof
(
path
->
p
[
0
])
*
npts
);
path
=
PALLOC
(
size
);
...
...
@@ -1153,7 +1153,7 @@ double *path_distance(PATH *p1, PATH *p2)
min
=
tmp
;
}
else
{
PFREE
(
tmp
);
}
;
}
}
return
(
min
);
...
...
@@ -1593,12 +1593,12 @@ lseg_interpt(LSEG *l1, LSEG *l2)
||
(
FPeq
(
l1
->
p
[
1
].
x
,
l2
->
p
[
1
].
x
)
&&
FPeq
(
l1
->
p
[
1
].
y
,
l2
->
p
[
1
].
y
)))
{
result
->
x
=
l1
->
p
[
1
].
x
;
result
->
y
=
l1
->
p
[
1
].
y
;
}
;
}
}
else
{
PFREE
(
result
);
result
=
NULL
;
}
;
}
;
}
}
PFREE
(
tmp1
);
PFREE
(
tmp2
);
...
...
@@ -1653,7 +1653,7 @@ double *dist_ps(Point *pt, LSEG *lseg)
(
lseg
->
p
[
1
].
x
-
lseg
->
p
[
0
].
x
);
#endif
m
=
((
lseg
->
p
[
0
].
y
-
lseg
->
p
[
1
].
y
)
/
(
lseg
->
p
[
1
].
x
-
lseg
->
p
[
0
].
x
));
}
;
}
ln
=
line_construct_pm
(
pt
,
m
);
#ifdef GEODEBUG
...
...
@@ -1680,7 +1680,7 @@ printf( "dist_ps- distance is %f to intersection point is (%f,%f)\n",
tmpdist
=
point_distance
(
pt
,
&
lseg
->
p
[
1
]);
if
(
*
tmpdist
<
*
result
)
*
result
=
*
tmpdist
;
PFREE
(
tmpdist
);
}
;
}
if
(
ip
!=
NULL
)
PFREE
(
ip
);
PFREE
(
ln
);
...
...
@@ -1756,8 +1756,8 @@ double *dist_sl(LSEG *lseg, LINE *line)
result
=
d2
;
}
else
{
PFREE
(
d2
);
}
;
}
;
}
}
return
(
result
);
}
...
...
@@ -1818,7 +1818,7 @@ printf( "dist_cpoly- center inside of polygon\n");
*
result
=
0
;
return
(
result
);
}
;
}
/* initialize distance with segment between first and last points */
seg
.
p
[
0
].
x
=
poly
->
p
[
0
].
x
;
...
...
@@ -1842,7 +1842,7 @@ printf( "dist_cpoly- segment %d distance is %f\n", (i+1), *d);
#endif
if
(
*
d
<
*
result
)
*
result
=
*
d
;
PFREE
(
d
);
}
;
}
*
result
-=
circle
->
radius
;
if
(
*
result
<
0
)
*
result
=
0
;
...
...
@@ -1883,8 +1883,8 @@ printf( "interpt_sl- intersection point is on segment\n");
}
else
{
PFREE
(
p
);
p
=
NULL
;
}
;
}
;
}
}
PFREE
(
tmp
);
return
(
p
);
...
...
@@ -2232,12 +2232,12 @@ static void make_bound_box(POLYGON *poly)
if
(
poly
->
p
[
i
].
x
>
x2
)
x2
=
poly
->
p
[
i
].
x
;
if
(
poly
->
p
[
i
].
y
<
y1
)
y1
=
poly
->
p
[
i
].
y
;
if
(
poly
->
p
[
i
].
y
>
y2
)
y2
=
poly
->
p
[
i
].
y
;
}
;
}
box_fill
(
&
(
poly
->
boundbox
),
x1
,
x2
,
y1
,
y2
);
}
else
{
elog
(
WARN
,
"Unable to create bounding box for empty polygon"
,
NULL
);
}
;
}
}
/*------------------------------------------------------------------
...
...
@@ -2354,7 +2354,7 @@ bool poly_same(POLYGON *polya, POLYGON *polyb)
if
((
polya
->
p
[
i
].
x
!=
polyb
->
p
[
i
].
x
)
||
(
polya
->
p
[
i
].
y
!=
polyb
->
p
[
i
].
y
))
return
FALSE
;
}
;
}
return
TRUE
;
#endif
}
/* poly_same() */
...
...
@@ -2395,18 +2395,18 @@ poly_contain(POLYGON *polya, POLYGON *polyb)
printf
(
"poly_contain- point (%f,%f) not in polygon
\n
"
,
polyb
->
p
[
i
].
x
,
polyb
->
p
[
i
].
y
);
#endif
return
(
FALSE
);
}
;
}
;
}
}
for
(
i
=
0
;
i
<
polya
->
npts
;
i
++
)
{
if
(
point_inside
(
&
(
polya
->
p
[
i
]),
polyb
->
npts
,
&
(
polyb
->
p
[
0
]))
==
1
)
{
#if GEODEBUG
printf
(
"poly_contain- point (%f,%f) in polygon
\n
"
,
polya
->
p
[
i
].
x
,
polya
->
p
[
i
].
y
);
#endif
return
(
FALSE
);
}
;
}
;
}
}
return
(
TRUE
);
}
;
}
#if GEODEBUG
printf
(
"poly_contain- bound box ((%f,%f),(%f,%f)) not inside ((%f,%f),(%f,%f))
\n
"
,
polyb
->
boundbox
.
low
.
x
,
polyb
->
boundbox
.
low
.
y
,
polyb
->
boundbox
.
high
.
x
,
polyb
->
boundbox
.
high
.
y
,
...
...
@@ -2691,11 +2691,11 @@ path_add(PATH *p1, PATH *p2)
for
(
i
=
0
;
i
<
p1
->
npts
;
i
++
)
{
result
->
p
[
i
].
x
=
p1
->
p
[
i
].
x
;
result
->
p
[
i
].
y
=
p1
->
p
[
i
].
y
;
}
;
}
for
(
i
=
0
;
i
<
p2
->
npts
;
i
++
)
{
result
->
p
[
i
+
p1
->
npts
].
x
=
p2
->
p
[
i
].
x
;
result
->
p
[
i
+
p1
->
npts
].
y
=
p2
->
p
[
i
].
y
;
}
;
}
return
(
result
);
}
/* path_add() */
...
...
@@ -2717,7 +2717,7 @@ path_add_pt(PATH *path, Point *point)
for
(
i
=
0
;
i
<
path
->
npts
;
i
++
)
{
result
->
p
[
i
].
x
+=
point
->
x
;
result
->
p
[
i
].
y
+=
point
->
y
;
}
;
}
return
(
result
);
}
/* path_add_pt() */
...
...
@@ -2736,7 +2736,7 @@ path_sub_pt(PATH *path, Point *point)
for
(
i
=
0
;
i
<
path
->
npts
;
i
++
)
{
result
->
p
[
i
].
x
-=
point
->
x
;
result
->
p
[
i
].
y
-=
point
->
y
;
}
;
}
return
(
result
);
}
/* path_sub_pt() */
...
...
@@ -2762,7 +2762,7 @@ path_mul_pt(PATH *path, Point *point)
result
->
p
[
i
].
x
=
p
->
x
;
result
->
p
[
i
].
y
=
p
->
y
;
PFREE
(
p
);
}
;
}
return
(
result
);
}
/* path_mul_pt() */
...
...
@@ -2784,7 +2784,7 @@ path_div_pt(PATH *path, Point *point)
result
->
p
[
i
].
x
=
p
->
x
;
result
->
p
[
i
].
y
=
p
->
y
;
PFREE
(
p
);
}
;
}
return
(
result
);
}
/* path_div_pt() */
...
...
@@ -2846,7 +2846,7 @@ POLYGON *path_poly(PATH *path)
for
(
i
=
0
;
i
<
path
->
npts
;
i
++
)
{
poly
->
p
[
i
].
x
=
path
->
p
[
i
].
x
;
poly
->
p
[
i
].
y
=
path
->
p
[
i
].
y
;
}
;
}
make_bound_box
(
poly
);
...
...
@@ -2886,7 +2886,7 @@ PATH
for
(
i
=
0
;
i
<
result
->
npts
;
i
++
)
{
result
->
p
[
i
].
x
=
path
->
p
[
i
+
1
].
x
;
result
->
p
[
i
].
y
=
path
->
p
[
i
+
1
].
y
;
}
;
}
return
(
result
);
}
/* upgradepath() */
...
...
@@ -2932,7 +2932,7 @@ poly_center(POLYGON *poly)
}
else
{
result
=
NULL
;
}
;
}
return
(
result
);
}
/* poly_center() */
...
...
@@ -3006,7 +3006,7 @@ poly_path(POLYGON *poly)
for
(
i
=
0
;
i
<
poly
->
npts
;
i
++
)
{
path
->
p
[
i
].
x
=
poly
->
p
[
i
].
x
;
path
->
p
[
i
].
y
=
poly
->
p
[
i
].
y
;
}
;
}
return
(
path
);
}
/* poly_path() */
...
...
@@ -3039,17 +3039,17 @@ POLYGON
for
(
i
=
0
;
i
<
n2
;
i
++
)
{
result
->
p
[
2
*
i
].
x
=
poly
->
p
[
i
].
x
;
/* even indices */
result
->
p
[
2
*
i
+
1
].
x
=
poly
->
p
[
i
].
y
;
/* odd indices */
}
;
}
if
((
ii
=
((
poly
->
npts
%
2
)
?
1
:
0
)))
{
result
->
p
[
poly
->
npts
-
1
].
x
=
poly
->
p
[
n2
].
x
;
result
->
p
[
0
].
y
=
poly
->
p
[
n2
].
y
;
}
;
}
for
(
i
=
0
;
i
<
n2
;
i
++
)
{
result
->
p
[
2
*
i
+
ii
].
y
=
poly
->
p
[
i
+
n2
+
ii
].
x
;
/* even (+offset) indices */
result
->
p
[
2
*
i
+
ii
+
1
].
y
=
poly
->
p
[
i
+
n2
+
ii
].
y
;
/* odd (+offset) indices */
}
;
}
return
(
result
);
}
/* upgradepoly() */
...
...
@@ -3079,17 +3079,17 @@ POLYGON
for
(
i
=
0
;
i
<
n2
;
i
++
)
{
result
->
p
[
i
].
x
=
poly
->
p
[
2
*
i
].
x
;
/* even indices */
result
->
p
[
i
].
y
=
poly
->
p
[
2
*
i
+
1
].
x
;
/* odd indices */
}
;
}
if
((
ii
=
((
poly
->
npts
%
2
)
?
1
:
0
)))
{
result
->
p
[
n2
].
x
=
poly
->
p
[
poly
->
npts
-
1
].
x
;
result
->
p
[
n2
].
y
=
poly
->
p
[
0
].
y
;
}
;
}
for
(
i
=
0
;
i
<
n2
;
i
++
)
{
result
->
p
[
i
+
n2
+
ii
].
x
=
poly
->
p
[
2
*
i
+
ii
].
y
;
/* even (+offset) indices */
result
->
p
[
i
+
n2
+
ii
].
y
=
poly
->
p
[
2
*
i
+
ii
+
1
].
y
;
/* odd (+offset) indices */
}
;
}
return
(
result
);
}
/* revertpoly() */
...
...
@@ -3131,8 +3131,8 @@ CIRCLE *circle_in(char *str)
while
(
isspace
(
*
cp
))
cp
++
;
if
(
*
cp
==
LDELIM
)
{
s
=
cp
;
}
;
}
;
}
}
if
(
!
pair_decode
(
s
,
&
circle
->
center
.
x
,
&
circle
->
center
.
y
,
&
s
))
elog
(
WARN
,
"Bad circle external representation '%s'"
,
str
);
...
...
@@ -3151,8 +3151,8 @@ CIRCLE *circle_in(char *str)
while
(
isspace
(
*
s
))
s
++
;
}
else
{
elog
(
WARN
,
"Bad circle external representation '%s'"
,
str
);
}
;
}
;
}
}
if
(
*
s
!=
'\0'
)
elog
(
WARN
,
"Bad circle external representation '%s'"
,
str
);
...
...
@@ -3628,7 +3628,7 @@ POLYGON *circle_poly(int npts, CIRCLE *circle)
angle
=
i
*
(
2
*
PI
/
npts
);
poly
->
p
[
i
].
x
=
circle
->
center
.
x
-
(
circle
->
radius
*
cos
(
angle
));
poly
->
p
[
i
].
y
=
circle
->
center
.
y
+
(
circle
->
radius
*
sin
(
angle
));
}
;
}
make_bound_box
(
poly
);
...
...
@@ -3660,13 +3660,13 @@ CIRCLE *poly_circle(POLYGON *poly)
for
(
i
=
0
;
i
<
poly
->
npts
;
i
++
)
{
circle
->
center
.
x
+=
poly
->
p
[
i
].
x
;
circle
->
center
.
y
+=
poly
->
p
[
i
].
y
;
}
;
}
circle
->
center
.
x
/=
poly
->
npts
;
circle
->
center
.
y
/=
poly
->
npts
;
for
(
i
=
0
;
i
<
poly
->
npts
;
i
++
)
{
circle
->
radius
+=
point_dt
(
&
poly
->
p
[
i
],
&
circle
->
center
);
}
;
}
circle
->
radius
/=
poly
->
npts
;
if
(
FPzero
(
circle
->
radius
))
...
...
@@ -3762,8 +3762,8 @@ lseg_crossing( double x, double y, double px, double py)
}
else
{
/* x < 0 */
if
(
FPzero
(
py
))
return
(
FPlt
(
px
,
0
)
?
0
:
HIT_IT
);
return
(
0
);
}
;
}
;
}
}
/* Now we know y != 0; set sgn to sign of y */
sgn
=
(
FPgt
(
y
,
0
)
?
1
:
-
1
);
...
...
@@ -3779,7 +3779,7 @@ lseg_crossing( double x, double y, double px, double py)
z
=
(
x
-
px
)
*
y
-
(
y
-
py
)
*
x
;
if
(
FPzero
(
z
))
return
(
HIT_IT
);
return
(
FPgt
(
(
sgn
*
z
),
0
)
?
0
:
2
*
sgn
);
}
;
}
}
/* lseg_crossing() */
...
...
@@ -3802,8 +3802,8 @@ plist_same(int npts, Point p1[], Point p2[])
printf
(
"plist_same- %d failed forward match with %d
\n
"
,
j
,
ii
);
#endif
break
;
}
;
}
;
}
}
#ifdef GEODEBUG
printf
(
"plist_same- ii = %d/%d after forward match
\n
"
,
ii
,
npts
);
#endif
...
...
@@ -3819,15 +3819,15 @@ printf( "plist_same- ii = %d/%d after forward match\n", ii, npts);
printf
(
"plist_same- %d failed reverse match with %d
\n
"
,
j
,
ii
);
#endif
break
;
}
;
}
;
}
}
#ifdef GEODEBUG
printf
(
"plist_same- ii = %d/%d after reverse match
\n
"
,
ii
,
npts
);
#endif
if
(
ii
==
npts
)
return
(
TRUE
);
}
;
}
;
}
}
return
(
FALSE
);
}
/* plist_same() */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录