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

Commitc90b85e

Browse files
committed
Second try at fixing warnings caused by commit9b43d73.
Commitef3f9e6 suppressed one cause of warnings here, butrecent clang on OS X is still unhappy because we're passing a "long"to abs(). The fact that tm_gmtoff is declared as long is no doubt ahangover from days when int might be only 16 bits; but Postgres hasnever been able to run on such machines, so we can just cast it to intwith no worries. For consistency, also cast to int in the otheruses of tm_gmtoff in this stanza.Note: this code is still broken on machines that don't follow C99integer-division-truncates-towards-zero rules. Given the lack ofcomplaints about it, I don't feel a large desire to complicate thingsenough to cope with the pre-C99 rules.
1 parenta482043 commitc90b85e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/backend/utils/adt/formatting.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2503,11 +2503,11 @@ DCH_to_char(FormatNode *node, bool is_interval, TmToChar *in, char *out, Oid col
25032503
break;
25042504
caseDCH_OF:
25052505
INVALID_FOR_INTERVAL;
2506-
sprintf(s,"%+0*ld",S_FM(n->suffix) ?0 :3,tm->tm_gmtoff /SECS_PER_HOUR);
2506+
sprintf(s,"%+0*d",S_FM(n->suffix) ?0 :3, (int)tm->tm_gmtoff /SECS_PER_HOUR);
25072507
s+=strlen(s);
2508-
if (tm->tm_gmtoff %SECS_PER_HOUR!=0)
2508+
if ((int)tm->tm_gmtoff %SECS_PER_HOUR!=0)
25092509
{
2510-
sprintf(s,":%02d",abs(tm->tm_gmtoff %SECS_PER_HOUR) /SECS_PER_MINUTE);
2510+
sprintf(s,":%02d",abs((int)tm->tm_gmtoff %SECS_PER_HOUR) /SECS_PER_MINUTE);
25112511
s+=strlen(s);
25122512
}
25132513
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp