Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b3a47cd

Browse files
committed
Suppress compiler warning about unportable pointer value.
Setting a pointer value to "0xdeadbeef" draws a warning from some compilers, and for good reason. Be less cute and just set it to NULL. In passing make some other cosmetic adjustments nearby. Discussion: https://postgr.es/m/CAJrrPGdW3EkU-CRobvVKYf3fJuBdgWyuGeAbNzAQ4yBh+bfb_Q@mail.gmail.com
1 parent 14722c6 commit b3a47cd

File tree

1 file changed

+6
-4
lines changed
  • src/backend/replication/logical

1 file changed

+6
-4
lines changed

src/backend/replication/logical/proto.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ logicalrep_read_commit(StringInfo in, LogicalRepCommitData *commit_data)
9595
uint8 flags = pq_getmsgbyte(in);
9696

9797
if (flags != 0)
98-
elog(ERROR, "unknown flags %u in commit message", flags);
98+
elog(ERROR, "unrecognized flags %u in commit message", flags);
9999

100100
/* read fields */
101101
commit_data->commit_lsn = pq_getmsgint64(in);
@@ -468,7 +468,6 @@ logicalrep_read_tuple(StringInfo in, LogicalRepTupleData *tuple)
468468
for (i = 0; i < natts; i++)
469469
{
470470
char kind;
471-
int len;
472471

473472
kind = pq_getmsgbyte(in);
474473

@@ -479,10 +478,13 @@ logicalrep_read_tuple(StringInfo in, LogicalRepTupleData *tuple)
479478
tuple->changed[i] = true;
480479
break;
481480
case 'u': /* unchanged column */
482-
tuple->values[i] = (char *) 0xdeadbeef; /* make bad usage more obvious */
481+
/* we don't receive the value of an unchanged column */
482+
tuple->values[i] = NULL;
483483
break;
484484
case 't': /* text formatted value */
485485
{
486+
int len;
487+
486488
tuple->changed[i] = true;
487489

488490
len = pq_getmsgint(in, 4); /* read length */
@@ -494,7 +496,7 @@ logicalrep_read_tuple(StringInfo in, LogicalRepTupleData *tuple)
494496
}
495497
break;
496498
default:
497-
elog(ERROR, "unknown data representation type '%c'", kind);
499+
elog(ERROR, "unrecognized data representation type '%c'", kind);
498500
}
499501
}
500502
}

0 commit comments

Comments
 (0)