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

Commit8433e0b

Browse files
committed
Suppress implicit-conversion warnings seen with newer clang versions.
We were assigning values near 255 through "char *" pointers. On machineswhere char is signed, that's not entirely kosher, and it's reasonablefor compilers to warn about it.A better solution would be to change the pointer type to "unsigned char *",but that would be vastly more invasive. For the moment, let's just applythis simple backpatchable solution.Aleksander AlekseevDiscussion:https://postgr.es/m/20170220141239.GD12278@e733.localdomainDiscussion:https://postgr.es/m/2839.1490714708@sss.pgh.pa.us
1 parentc804c00 commit8433e0b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4878,7 +4878,7 @@ BootStrapXLOG(void)
48784878
record->xl_rmid=RM_XLOG_ID;
48794879
recptr+=SizeOfXLogRecord;
48804880
/* fill the XLogRecordDataHeaderShort struct */
4881-
*(recptr++)=XLR_BLOCK_ID_DATA_SHORT;
4881+
*(recptr++)=(char)XLR_BLOCK_ID_DATA_SHORT;
48824882
*(recptr++)=sizeof(checkPoint);
48834883
memcpy(recptr,&checkPoint,sizeof(checkPoint));
48844884
recptr+=sizeof(checkPoint);

‎src/backend/access/transam/xloginsert.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ XLogRecordAssemble(RmgrId rmid, uint8 info,
703703
/* followed by the record's origin, if any */
704704
if (include_origin&&replorigin_session_origin!=InvalidRepOriginId)
705705
{
706-
*(scratch++)=XLR_BLOCK_ID_ORIGIN;
706+
*(scratch++)=(char)XLR_BLOCK_ID_ORIGIN;
707707
memcpy(scratch,&replorigin_session_origin,sizeof(replorigin_session_origin));
708708
scratch+=sizeof(replorigin_session_origin);
709709
}
@@ -713,13 +713,13 @@ XLogRecordAssemble(RmgrId rmid, uint8 info,
713713
{
714714
if (mainrdata_len>255)
715715
{
716-
*(scratch++)=XLR_BLOCK_ID_DATA_LONG;
716+
*(scratch++)=(char)XLR_BLOCK_ID_DATA_LONG;
717717
memcpy(scratch,&mainrdata_len,sizeof(uint32));
718718
scratch+=sizeof(uint32);
719719
}
720720
else
721721
{
722-
*(scratch++)=XLR_BLOCK_ID_DATA_SHORT;
722+
*(scratch++)=(char)XLR_BLOCK_ID_DATA_SHORT;
723723
*(scratch++)= (uint8)mainrdata_len;
724724
}
725725
rdt_datas_last->next=mainrdata_head;

‎src/bin/pg_resetxlog/pg_resetxlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ WriteEmptyXLOG(void)
11001100
record->xl_rmid=RM_XLOG_ID;
11011101

11021102
recptr+=SizeOfXLogRecord;
1103-
*(recptr++)=XLR_BLOCK_ID_DATA_SHORT;
1103+
*(recptr++)=(char)XLR_BLOCK_ID_DATA_SHORT;
11041104
*(recptr++)=sizeof(CheckPoint);
11051105
memcpy(recptr,&ControlFile.checkPointCopy,
11061106
sizeof(CheckPoint));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp