@@ -4676,7 +4676,7 @@ timestamp_part_common(PG_FUNCTION_ARGS, bool retnumeric)
4676
4676
switch (val )
4677
4677
{
4678
4678
case DTK_MICROSEC :
4679
- intresult = tm -> tm_sec * 1000000.0 + fsec ;
4679
+ intresult = tm -> tm_sec * INT64CONST ( 1000000 ) + fsec ;
4680
4680
break ;
4681
4681
4682
4682
case DTK_MILLISEC :
@@ -4685,7 +4685,7 @@ timestamp_part_common(PG_FUNCTION_ARGS, bool retnumeric)
4685
4685
* tm->tm_sec * 1000 + fsec / 1000
4686
4686
* = (tm->tm_sec * 1'000'000 + fsec) / 1000
4687
4687
*/
4688
- PG_RETURN_NUMERIC (int64_div_fast_to_numeric (tm -> tm_sec * 1000000LL + fsec , 3 ));
4688
+ PG_RETURN_NUMERIC (int64_div_fast_to_numeric (tm -> tm_sec * INT64CONST ( 1000000 ) + fsec , 3 ));
4689
4689
else
4690
4690
PG_RETURN_FLOAT8 (tm -> tm_sec * 1000.0 + fsec / 1000.0 );
4691
4691
break ;
@@ -4696,7 +4696,7 @@ timestamp_part_common(PG_FUNCTION_ARGS, bool retnumeric)
4696
4696
* tm->tm_sec + fsec / 1'000'000
4697
4697
* = (tm->tm_sec * 1'000'000 + fsec) / 1'000'000
4698
4698
*/
4699
- PG_RETURN_NUMERIC (int64_div_fast_to_numeric (tm -> tm_sec * 1000000LL + fsec , 6 ));
4699
+ PG_RETURN_NUMERIC (int64_div_fast_to_numeric (tm -> tm_sec * INT64CONST ( 1000000 ) + fsec , 6 ));
4700
4700
else
4701
4701
PG_RETURN_FLOAT8 (tm -> tm_sec + fsec / 1000000.0 );
4702
4702
break ;
@@ -4772,8 +4772,8 @@ timestamp_part_common(PG_FUNCTION_ARGS, bool retnumeric)
4772
4772
case DTK_JULIAN :
4773
4773
if (retnumeric )
4774
4774
PG_RETURN_NUMERIC (numeric_add_opt_error (int64_to_numeric (date2j (tm -> tm_year , tm -> tm_mon , tm -> tm_mday )),
4775
- numeric_div_opt_error (int64_to_numeric (((((tm -> tm_hour * MINS_PER_HOUR ) + tm -> tm_min ) * SECS_PER_MINUTE ) + tm -> tm_sec ) * 1000000LL + fsec ),
4776
- int64_to_numeric (SECS_PER_DAY * 1000000LL ),
4775
+ numeric_div_opt_error (int64_to_numeric (((((tm -> tm_hour * MINS_PER_HOUR ) + tm -> tm_min ) * SECS_PER_MINUTE ) + tm -> tm_sec ) * INT64CONST ( 1000000 ) + fsec ),
4776
+ int64_to_numeric (SECS_PER_DAY * INT64CONST ( 1000000 ) ),
4777
4777
NULL ),
4778
4778
NULL ));
4779
4779
else
@@ -4962,7 +4962,7 @@ timestamptz_part_common(PG_FUNCTION_ARGS, bool retnumeric)
4962
4962
break ;
4963
4963
4964
4964
case DTK_MICROSEC :
4965
- intresult = tm -> tm_sec * 1000000 + fsec ;
4965
+ intresult = tm -> tm_sec * INT64CONST ( 1000000 ) + fsec ;
4966
4966
break ;
4967
4967
4968
4968
case DTK_MILLISEC :
@@ -4971,7 +4971,7 @@ timestamptz_part_common(PG_FUNCTION_ARGS, bool retnumeric)
4971
4971
* tm->tm_sec * 1000 + fsec / 1000
4972
4972
* = (tm->tm_sec * 1'000'000 + fsec) / 1000
4973
4973
*/
4974
- PG_RETURN_NUMERIC (int64_div_fast_to_numeric (tm -> tm_sec * 1000000LL + fsec , 3 ));
4974
+ PG_RETURN_NUMERIC (int64_div_fast_to_numeric (tm -> tm_sec * INT64CONST ( 1000000 ) + fsec , 3 ));
4975
4975
else
4976
4976
PG_RETURN_FLOAT8 (tm -> tm_sec * 1000.0 + fsec / 1000.0 );
4977
4977
break ;
@@ -4982,7 +4982,7 @@ timestamptz_part_common(PG_FUNCTION_ARGS, bool retnumeric)
4982
4982
* tm->tm_sec + fsec / 1'000'000
4983
4983
* = (tm->tm_sec * 1'000'000 + fsec) / 1'000'000
4984
4984
*/
4985
- PG_RETURN_NUMERIC (int64_div_fast_to_numeric (tm -> tm_sec * 1000000LL + fsec , 6 ));
4985
+ PG_RETURN_NUMERIC (int64_div_fast_to_numeric (tm -> tm_sec * INT64CONST ( 1000000 ) + fsec , 6 ));
4986
4986
else
4987
4987
PG_RETURN_FLOAT8 (tm -> tm_sec + fsec / 1000000.0 );
4988
4988
break ;
@@ -5046,8 +5046,8 @@ timestamptz_part_common(PG_FUNCTION_ARGS, bool retnumeric)
5046
5046
case DTK_JULIAN :
5047
5047
if (retnumeric )
5048
5048
PG_RETURN_NUMERIC (numeric_add_opt_error (int64_to_numeric (date2j (tm -> tm_year , tm -> tm_mon , tm -> tm_mday )),
5049
- numeric_div_opt_error (int64_to_numeric (((((tm -> tm_hour * MINS_PER_HOUR ) + tm -> tm_min ) * SECS_PER_MINUTE ) + tm -> tm_sec ) * 1000000LL + fsec ),
5050
- int64_to_numeric (SECS_PER_DAY * 1000000LL ),
5049
+ numeric_div_opt_error (int64_to_numeric (((((tm -> tm_hour * MINS_PER_HOUR ) + tm -> tm_min ) * SECS_PER_MINUTE ) + tm -> tm_sec ) * INT64CONST ( 1000000 ) + fsec ),
5050
+ int64_to_numeric (SECS_PER_DAY * INT64CONST ( 1000000 ) ),
5051
5051
NULL ),
5052
5052
NULL ));
5053
5053
else
@@ -5191,7 +5191,7 @@ interval_part_common(PG_FUNCTION_ARGS, bool retnumeric)
5191
5191
switch (val )
5192
5192
{
5193
5193
case DTK_MICROSEC :
5194
- intresult = tm -> tm_sec * 1000000 + fsec ;
5194
+ intresult = tm -> tm_sec * INT64CONST ( 1000000 ) + fsec ;
5195
5195
break ;
5196
5196
5197
5197
case DTK_MILLISEC :
@@ -5200,7 +5200,7 @@ interval_part_common(PG_FUNCTION_ARGS, bool retnumeric)
5200
5200
* tm->tm_sec * 1000 + fsec / 1000
5201
5201
* = (tm->tm_sec * 1'000'000 + fsec) / 1000
5202
5202
*/
5203
- PG_RETURN_NUMERIC (int64_div_fast_to_numeric (tm -> tm_sec * 1000000LL + fsec , 3 ));
5203
+ PG_RETURN_NUMERIC (int64_div_fast_to_numeric (tm -> tm_sec * INT64CONST ( 1000000 ) + fsec , 3 ));
5204
5204
else
5205
5205
PG_RETURN_FLOAT8 (tm -> tm_sec * 1000.0 + fsec / 1000.0 );
5206
5206
break ;
@@ -5211,7 +5211,7 @@ interval_part_common(PG_FUNCTION_ARGS, bool retnumeric)
5211
5211
* tm->tm_sec + fsec / 1'000'000
5212
5212
* = (tm->tm_sec * 1'000'000 + fsec) / 1'000'000
5213
5213
*/
5214
- PG_RETURN_NUMERIC (int64_div_fast_to_numeric (tm -> tm_sec * 1000000LL + fsec , 6 ));
5214
+ PG_RETURN_NUMERIC (int64_div_fast_to_numeric (tm -> tm_sec * INT64CONST ( 1000000 ) + fsec , 6 ));
5215
5215
else
5216
5216
PG_RETURN_FLOAT8 (tm -> tm_sec + fsec / 1000000.0 );
5217
5217
break ;
0 commit comments