File tree Expand file tree Collapse file tree 3 files changed +22
-17
lines changed Expand file tree Collapse file tree 3 files changed +22
-17
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ extension_version = 0
13
13
14
14
EXTENSION = uint
15
15
MODULE_big = uint
16
- OBJS = uint.o hash.o hex.o magic.o operators.o aggregates.o
16
+ OBJS = uint.o hash.o hex.o magic.o misc.o operators.o aggregates.o
17
17
DATA_built = uint--$(extension_version ) .sql
18
18
19
19
REGRESS = init hash hex operators misc drop
Original file line number Diff line number Diff line change
1
+ #include <postgres.h>
2
+ #include <fmgr.h>
3
+
4
+ #include "uint.h"
5
+
6
+
7
+ PG_FUNCTION_INFO_V1 (int1um );
8
+ Datum
9
+ int1um (PG_FUNCTION_ARGS )
10
+ {
11
+ int8 arg = PG_GETARG_INT8 (0 );
12
+ int8 result ;
13
+
14
+ result = - arg ;
15
+ /* overflow check */
16
+ if (arg != 0 && SAMESIGN (result , arg ))
17
+ ereport (ERROR ,
18
+ (errcode (ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE ),
19
+ errmsg ("integer out of range" )));
20
+ PG_RETURN_INT8 (result );
21
+ }
Original file line number Diff line number Diff line change @@ -203,19 +203,3 @@ uint8out(PG_FUNCTION_ARGS)
203
203
sprintf (result , "%" PRIu64 , (uint64_t ) arg1 );
204
204
PG_RETURN_CSTRING (result );
205
205
}
206
-
207
- PG_FUNCTION_INFO_V1 (int1um );
208
- Datum
209
- int1um (PG_FUNCTION_ARGS )
210
- {
211
- int8 arg = PG_GETARG_INT8 (0 );
212
- int8 result ;
213
-
214
- result = - arg ;
215
- /* overflow check */
216
- if (arg != 0 && SAMESIGN (result , arg ))
217
- ereport (ERROR ,
218
- (errcode (ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE ),
219
- errmsg ("integer out of range" )));
220
- PG_RETURN_INT8 (result );
221
- }
You can’t perform that action at this time.
0 commit comments