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

Commit99eb0c1

Browse files
committed
change infinity macros (Bound)
1 parent06ce38b commit99eb0c1

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

‎src/relation_info.h

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,18 @@
2323
/* Range bound */
2424
typedefstruct
2525
{
26-
Datumvalue;/* Actual value if not infinite */
27-
uint8is_infinite;/* bitmask where the least significant bit
28-
is indicates if the bound is infinite and
29-
the second one indicates if bound
30-
is negative */
26+
Datumvalue;/* actual value if not infinite */
27+
int8is_infinite;/* -inf | +inf | finite */
3128
}Bound;
3229

3330

34-
#defineBOUND_INFINITY_MASK0x01
35-
#defineBOUND_NEGATIVE_MASK0x02
31+
#defineFINITE( 0 )
32+
#definePLUS_INFINITY( +1 )
33+
#defineMINUS_INFINITY( -1 )
3634

37-
#defineFINITE0
38-
#definePLUS_INFINITY(BOUND_INFINITY_MASK)
39-
#defineMINUS_INFINITY(BOUND_INFINITY_MASK | BOUND_NEGATIVE_MASK)
40-
41-
#defineIsInfinite(i)((i)->is_infinite & BOUND_INFINITY_MASK)
42-
#defineIsPlusInfinity(i)(IsInfinite(i) && !((i)->is_infinite & BOUND_NEGATIVE_MASK))
43-
#defineIsMinusInfinity(i)(IsInfinite(i) && ((i)->is_infinite & BOUND_NEGATIVE_MASK))
35+
#defineIsInfinite(i)( (i)->is_infinite != FINITE )
36+
#defineIsPlusInfinity(i)( (i)->is_infinite == PLUS_INFINITY )
37+
#defineIsMinusInfinity(i)( (i)->is_infinite == MINUS_INFINITY )
4438

4539

4640
inlinestaticBound
@@ -65,7 +59,7 @@ MakeBound(Datum value)
6559
}
6660

6761
inlinestaticBound
68-
MakeBoundInf(uint8infinity_type)
62+
MakeBoundInf(int8infinity_type)
6963
{
7064
Boundbound= { (Datum)0,infinity_type };
7165

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp