@@ -388,9 +388,9 @@ AppendSeconds(char *cp, int sec, fsec_t fsec, int precision, bool fillzeros)
388
388
Assert (precision >= 0 );
389
389
390
390
if (fillzeros )
391
- cp = pg_ltostr_zeropad (cp , Abs (sec ), 2 );
391
+ cp = pg_ultostr_zeropad (cp , Abs (sec ), 2 );
392
392
else
393
- cp = pg_ltostr (cp , Abs (sec ));
393
+ cp = pg_ultostr (cp , Abs (sec ));
394
394
395
395
/* fsec_t is just an int32 */
396
396
if (fsec != 0 )
@@ -430,7 +430,7 @@ AppendSeconds(char *cp, int sec, fsec_t fsec, int precision, bool fillzeros)
430
430
* which will generate a correct answer in the minimum valid width.
431
431
*/
432
432
if (value )
433
- return pg_ltostr (cp , Abs (fsec ));
433
+ return pg_ultostr (cp , Abs (fsec ));
434
434
435
435
return end ;
436
436
}
@@ -3831,20 +3831,20 @@ EncodeTimezone(char *str, int tz, int style)
3831
3831
3832
3832
if (sec != 0 )
3833
3833
{
3834
- str = pg_ltostr_zeropad (str , hour , 2 );
3834
+ str = pg_ultostr_zeropad (str , hour , 2 );
3835
3835
* str ++ = ':' ;
3836
- str = pg_ltostr_zeropad (str , min , 2 );
3836
+ str = pg_ultostr_zeropad (str , min , 2 );
3837
3837
* str ++ = ':' ;
3838
- str = pg_ltostr_zeropad (str , sec , 2 );
3838
+ str = pg_ultostr_zeropad (str , sec , 2 );
3839
3839
}
3840
3840
else if (min != 0 || style == USE_XSD_DATES )
3841
3841
{
3842
- str = pg_ltostr_zeropad (str , hour , 2 );
3842
+ str = pg_ultostr_zeropad (str , hour , 2 );
3843
3843
* str ++ = ':' ;
3844
- str = pg_ltostr_zeropad (str , min , 2 );
3844
+ str = pg_ultostr_zeropad (str , min , 2 );
3845
3845
}
3846
3846
else
3847
- str = pg_ltostr_zeropad (str , hour , 2 );
3847
+ str = pg_ultostr_zeropad (str , hour , 2 );
3848
3848
return str ;
3849
3849
}
3850
3850
@@ -3861,40 +3861,40 @@ EncodeDateOnly(struct pg_tm *tm, int style, char *str)
3861
3861
case USE_ISO_DATES :
3862
3862
case USE_XSD_DATES :
3863
3863
/* compatible with ISO date formats */
3864
- str = pg_ltostr_zeropad (str ,
3864
+ str = pg_ultostr_zeropad (str ,
3865
3865
(tm -> tm_year > 0 ) ? tm -> tm_year : - (tm -> tm_year - 1 ), 4 );
3866
3866
* str ++ = '-' ;
3867
- str = pg_ltostr_zeropad (str , tm -> tm_mon , 2 );
3867
+ str = pg_ultostr_zeropad (str , tm -> tm_mon , 2 );
3868
3868
* str ++ = '-' ;
3869
- str = pg_ltostr_zeropad (str , tm -> tm_mday , 2 );
3869
+ str = pg_ultostr_zeropad (str , tm -> tm_mday , 2 );
3870
3870
break ;
3871
3871
3872
3872
case USE_SQL_DATES :
3873
3873
/* compatible with Oracle/Ingres date formats */
3874
3874
if (DateOrder == DATEORDER_DMY )
3875
3875
{
3876
- str = pg_ltostr_zeropad (str , tm -> tm_mday , 2 );
3876
+ str = pg_ultostr_zeropad (str , tm -> tm_mday , 2 );
3877
3877
* str ++ = '/' ;
3878
- str = pg_ltostr_zeropad (str , tm -> tm_mon , 2 );
3878
+ str = pg_ultostr_zeropad (str , tm -> tm_mon , 2 );
3879
3879
}
3880
3880
else
3881
3881
{
3882
- str = pg_ltostr_zeropad (str , tm -> tm_mon , 2 );
3882
+ str = pg_ultostr_zeropad (str , tm -> tm_mon , 2 );
3883
3883
* str ++ = '/' ;
3884
- str = pg_ltostr_zeropad (str , tm -> tm_mday , 2 );
3884
+ str = pg_ultostr_zeropad (str , tm -> tm_mday , 2 );
3885
3885
}
3886
3886
* str ++ = '/' ;
3887
- str = pg_ltostr_zeropad (str ,
3887
+ str = pg_ultostr_zeropad (str ,
3888
3888
(tm -> tm_year > 0 ) ? tm -> tm_year : - (tm -> tm_year - 1 ), 4 );
3889
3889
break ;
3890
3890
3891
3891
case USE_GERMAN_DATES :
3892
3892
/* German-style date format */
3893
- str = pg_ltostr_zeropad (str , tm -> tm_mday , 2 );
3893
+ str = pg_ultostr_zeropad (str , tm -> tm_mday , 2 );
3894
3894
* str ++ = '.' ;
3895
- str = pg_ltostr_zeropad (str , tm -> tm_mon , 2 );
3895
+ str = pg_ultostr_zeropad (str , tm -> tm_mon , 2 );
3896
3896
* str ++ = '.' ;
3897
- str = pg_ltostr_zeropad (str ,
3897
+ str = pg_ultostr_zeropad (str ,
3898
3898
(tm -> tm_year > 0 ) ? tm -> tm_year : - (tm -> tm_year - 1 ), 4 );
3899
3899
break ;
3900
3900
@@ -3903,18 +3903,18 @@ EncodeDateOnly(struct pg_tm *tm, int style, char *str)
3903
3903
/* traditional date-only style for Postgres */
3904
3904
if (DateOrder == DATEORDER_DMY )
3905
3905
{
3906
- str = pg_ltostr_zeropad (str , tm -> tm_mday , 2 );
3906
+ str = pg_ultostr_zeropad (str , tm -> tm_mday , 2 );
3907
3907
* str ++ = '-' ;
3908
- str = pg_ltostr_zeropad (str , tm -> tm_mon , 2 );
3908
+ str = pg_ultostr_zeropad (str , tm -> tm_mon , 2 );
3909
3909
}
3910
3910
else
3911
3911
{
3912
- str = pg_ltostr_zeropad (str , tm -> tm_mon , 2 );
3912
+ str = pg_ultostr_zeropad (str , tm -> tm_mon , 2 );
3913
3913
* str ++ = '-' ;
3914
- str = pg_ltostr_zeropad (str , tm -> tm_mday , 2 );
3914
+ str = pg_ultostr_zeropad (str , tm -> tm_mday , 2 );
3915
3915
}
3916
3916
* str ++ = '-' ;
3917
- str = pg_ltostr_zeropad (str ,
3917
+ str = pg_ultostr_zeropad (str ,
3918
3918
(tm -> tm_year > 0 ) ? tm -> tm_year : - (tm -> tm_year - 1 ), 4 );
3919
3919
break ;
3920
3920
}
@@ -3939,9 +3939,9 @@ EncodeDateOnly(struct pg_tm *tm, int style, char *str)
3939
3939
void
3940
3940
EncodeTimeOnly (struct pg_tm * tm , fsec_t fsec , bool print_tz , int tz , int style , char * str )
3941
3941
{
3942
- str = pg_ltostr_zeropad (str , tm -> tm_hour , 2 );
3942
+ str = pg_ultostr_zeropad (str , tm -> tm_hour , 2 );
3943
3943
* str ++ = ':' ;
3944
- str = pg_ltostr_zeropad (str , tm -> tm_min , 2 );
3944
+ str = pg_ultostr_zeropad (str , tm -> tm_min , 2 );
3945
3945
* str ++ = ':' ;
3946
3946
str = AppendSeconds (str , tm -> tm_sec , fsec , MAX_TIME_PRECISION , true);
3947
3947
if (print_tz )
@@ -3984,16 +3984,16 @@ EncodeDateTime(struct pg_tm *tm, fsec_t fsec, bool print_tz, int tz, const char
3984
3984
case USE_ISO_DATES :
3985
3985
case USE_XSD_DATES :
3986
3986
/* Compatible with ISO-8601 date formats */
3987
- str = pg_ltostr_zeropad (str ,
3987
+ str = pg_ultostr_zeropad (str ,
3988
3988
(tm -> tm_year > 0 ) ? tm -> tm_year : - (tm -> tm_year - 1 ), 4 );
3989
3989
* str ++ = '-' ;
3990
- str = pg_ltostr_zeropad (str , tm -> tm_mon , 2 );
3990
+ str = pg_ultostr_zeropad (str , tm -> tm_mon , 2 );
3991
3991
* str ++ = '-' ;
3992
- str = pg_ltostr_zeropad (str , tm -> tm_mday , 2 );
3992
+ str = pg_ultostr_zeropad (str , tm -> tm_mday , 2 );
3993
3993
* str ++ = (style == USE_ISO_DATES ) ? ' ' : 'T' ;
3994
- str = pg_ltostr_zeropad (str , tm -> tm_hour , 2 );
3994
+ str = pg_ultostr_zeropad (str , tm -> tm_hour , 2 );
3995
3995
* str ++ = ':' ;
3996
- str = pg_ltostr_zeropad (str , tm -> tm_min , 2 );
3996
+ str = pg_ultostr_zeropad (str , tm -> tm_min , 2 );
3997
3997
* str ++ = ':' ;
3998
3998
str = AppendTimestampSeconds (str , tm , fsec );
3999
3999
if (print_tz )
@@ -4004,23 +4004,23 @@ EncodeDateTime(struct pg_tm *tm, fsec_t fsec, bool print_tz, int tz, const char
4004
4004
/* Compatible with Oracle/Ingres date formats */
4005
4005
if (DateOrder == DATEORDER_DMY )
4006
4006
{
4007
- str = pg_ltostr_zeropad (str , tm -> tm_mday , 2 );
4007
+ str = pg_ultostr_zeropad (str , tm -> tm_mday , 2 );
4008
4008
* str ++ = '/' ;
4009
- str = pg_ltostr_zeropad (str , tm -> tm_mon , 2 );
4009
+ str = pg_ultostr_zeropad (str , tm -> tm_mon , 2 );
4010
4010
}
4011
4011
else
4012
4012
{
4013
- str = pg_ltostr_zeropad (str , tm -> tm_mon , 2 );
4013
+ str = pg_ultostr_zeropad (str , tm -> tm_mon , 2 );
4014
4014
* str ++ = '/' ;
4015
- str = pg_ltostr_zeropad (str , tm -> tm_mday , 2 );
4015
+ str = pg_ultostr_zeropad (str , tm -> tm_mday , 2 );
4016
4016
}
4017
4017
* str ++ = '/' ;
4018
- str = pg_ltostr_zeropad (str ,
4018
+ str = pg_ultostr_zeropad (str ,
4019
4019
(tm -> tm_year > 0 ) ? tm -> tm_year : - (tm -> tm_year - 1 ), 4 );
4020
4020
* str ++ = ' ' ;
4021
- str = pg_ltostr_zeropad (str , tm -> tm_hour , 2 );
4021
+ str = pg_ultostr_zeropad (str , tm -> tm_hour , 2 );
4022
4022
* str ++ = ':' ;
4023
- str = pg_ltostr_zeropad (str , tm -> tm_min , 2 );
4023
+ str = pg_ultostr_zeropad (str , tm -> tm_min , 2 );
4024
4024
* str ++ = ':' ;
4025
4025
str = AppendTimestampSeconds (str , tm , fsec );
4026
4026
@@ -4043,16 +4043,16 @@ EncodeDateTime(struct pg_tm *tm, fsec_t fsec, bool print_tz, int tz, const char
4043
4043
4044
4044
case USE_GERMAN_DATES :
4045
4045
/* German variant on European style */
4046
- str = pg_ltostr_zeropad (str , tm -> tm_mday , 2 );
4046
+ str = pg_ultostr_zeropad (str , tm -> tm_mday , 2 );
4047
4047
* str ++ = '.' ;
4048
- str = pg_ltostr_zeropad (str , tm -> tm_mon , 2 );
4048
+ str = pg_ultostr_zeropad (str , tm -> tm_mon , 2 );
4049
4049
* str ++ = '.' ;
4050
- str = pg_ltostr_zeropad (str ,
4050
+ str = pg_ultostr_zeropad (str ,
4051
4051
(tm -> tm_year > 0 ) ? tm -> tm_year : - (tm -> tm_year - 1 ), 4 );
4052
4052
* str ++ = ' ' ;
4053
- str = pg_ltostr_zeropad (str , tm -> tm_hour , 2 );
4053
+ str = pg_ultostr_zeropad (str , tm -> tm_hour , 2 );
4054
4054
* str ++ = ':' ;
4055
- str = pg_ltostr_zeropad (str , tm -> tm_min , 2 );
4055
+ str = pg_ultostr_zeropad (str , tm -> tm_min , 2 );
4056
4056
* str ++ = ':' ;
4057
4057
str = AppendTimestampSeconds (str , tm , fsec );
4058
4058
@@ -4078,7 +4078,7 @@ EncodeDateTime(struct pg_tm *tm, fsec_t fsec, bool print_tz, int tz, const char
4078
4078
* str ++ = ' ' ;
4079
4079
if (DateOrder == DATEORDER_DMY )
4080
4080
{
4081
- str = pg_ltostr_zeropad (str , tm -> tm_mday , 2 );
4081
+ str = pg_ultostr_zeropad (str , tm -> tm_mday , 2 );
4082
4082
* str ++ = ' ' ;
4083
4083
memcpy (str , months [tm -> tm_mon - 1 ], 3 );
4084
4084
str += 3 ;
@@ -4088,16 +4088,16 @@ EncodeDateTime(struct pg_tm *tm, fsec_t fsec, bool print_tz, int tz, const char
4088
4088
memcpy (str , months [tm -> tm_mon - 1 ], 3 );
4089
4089
str += 3 ;
4090
4090
* str ++ = ' ' ;
4091
- str = pg_ltostr_zeropad (str , tm -> tm_mday , 2 );
4091
+ str = pg_ultostr_zeropad (str , tm -> tm_mday , 2 );
4092
4092
}
4093
4093
* str ++ = ' ' ;
4094
- str = pg_ltostr_zeropad (str , tm -> tm_hour , 2 );
4094
+ str = pg_ultostr_zeropad (str , tm -> tm_hour , 2 );
4095
4095
* str ++ = ':' ;
4096
- str = pg_ltostr_zeropad (str , tm -> tm_min , 2 );
4096
+ str = pg_ultostr_zeropad (str , tm -> tm_min , 2 );
4097
4097
* str ++ = ':' ;
4098
4098
str = AppendTimestampSeconds (str , tm , fsec );
4099
4099
* str ++ = ' ' ;
4100
- str = pg_ltostr_zeropad (str ,
4100
+ str = pg_ultostr_zeropad (str ,
4101
4101
(tm -> tm_year > 0 ) ? tm -> tm_year : - (tm -> tm_year - 1 ), 4 );
4102
4102
4103
4103
if (print_tz )
0 commit comments