Skip to content

Commit d589566

Browse files
committed
Fixed compiler warinings
1 parent 6f14084 commit d589566

File tree

3 files changed

+32
-12
lines changed

3 files changed

+32
-12
lines changed

src/backend/storage/buffer/bufmgr.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3586,11 +3586,17 @@ static void
35863586
TerminateBufferIO(volatile BufferDesc *buf, bool clear_dirty,
35873587
int set_flag_bits)
35883588
{
3589+
#ifdef USE_ASSERT_CHECKING
35893590
uint32 state;
3591+
#endif
35903592

35913593
Assert(buf == InProgressBuf);
35923594

3593-
state = LockBufHdr(buf);
3595+
#ifdef USE_ASSERT_CHECKING
3596+
state =
3597+
#endif
3598+
LockBufHdr(buf);
3599+
35943600

35953601
Assert(state & BM_IO_IN_PROGRESS);
35963602

src/backend/utils/adt/formatting.c

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,7 +1511,10 @@ str_tolower(const char *buff, size_t nbytes, Oid collid)
15111511
UChar sourcebuf[STACKBUFLEN], destbuf[STACKBUFLEN];
15121512
UChar *source, *dest;
15131513
int buflen;
1514-
size_t result_size, usize;
1514+
size_t result_size;
1515+
#ifdef USE_ASSERT_CHECKING
1516+
size_t usize;
1517+
#endif
15151518
UErrorCode status = U_ZERO_ERROR;
15161519

15171520
if (conv == NULL)
@@ -1558,8 +1561,10 @@ str_tolower(const char *buff, size_t nbytes, Oid collid)
15581561
// and convert modified utf-16 string back to text
15591562
result_size = UCNV_GET_MAX_BYTES_FOR_STRING(buflen, ucnv_getMaxCharSize(conv));
15601563
result = palloc(result_size);
1561-
1562-
usize = ucnv_fromUChars(conv, result, result_size,
1564+
#ifdef USE_ASSERT_CHECKING
1565+
usize =
1566+
#endif
1567+
ucnv_fromUChars(conv, result, result_size,
15631568
dest, buflen, &status);
15641569

15651570
if (U_FAILURE(status))
@@ -1708,7 +1713,10 @@ str_toupper(const char *buff, size_t nbytes, Oid collid)
17081713
UChar sourcebuf[STACKBUFLEN], destbuf[STACKBUFLEN];
17091714
UChar *source, *dest;
17101715
int buflen;
1711-
size_t result_size, usize;
1716+
size_t result_size;
1717+
#ifdef USE_ASSERT_CHECKING
1718+
size_t usize;
1719+
#endif
17121720
UErrorCode status = U_ZERO_ERROR;
17131721

17141722
if (conv == NULL)
@@ -1755,8 +1763,10 @@ str_toupper(const char *buff, size_t nbytes, Oid collid)
17551763
// and convert modified utf-16 string back to text
17561764
result_size = UCNV_GET_MAX_BYTES_FOR_STRING(buflen, ucnv_getMaxCharSize(conv));
17571765
result = palloc(result_size);
1758-
1759-
usize = ucnv_fromUChars(conv, result, result_size,
1766+
#ifdef USE_ASSERT_CHECKING
1767+
usize =
1768+
#endif
1769+
ucnv_fromUChars(conv, result, result_size,
17601770
dest, buflen, &status);
17611771

17621772
if (U_FAILURE(status))
@@ -1906,7 +1916,10 @@ str_initcap(const char *buff, size_t nbytes, Oid collid)
19061916
UChar sourcebuf[STACKBUFLEN], destbuf[STACKBUFLEN];
19071917
UChar *source, *dest;
19081918
int buflen;
1909-
size_t result_size, usize;
1919+
size_t result_size;
1920+
#ifdef USE_ASSERT_CHECKING
1921+
size_t usize;
1922+
#endif
19101923
UErrorCode status = U_ZERO_ERROR;
19111924

19121925
if (conv == NULL)
@@ -1953,8 +1966,10 @@ str_initcap(const char *buff, size_t nbytes, Oid collid)
19531966
// and convert modified utf-16 string back to text
19541967
result_size = UCNV_GET_MAX_BYTES_FOR_STRING(buflen, ucnv_getMaxCharSize(conv));
19551968
result = palloc(result_size);
1956-
1957-
usize = ucnv_fromUChars(conv, result, result_size,
1969+
#ifdef USE_ASSERT_CHECKING
1970+
usize =
1971+
#endif
1972+
ucnv_fromUChars(conv, result, result_size,
19581973
dest, buflen, &status);
19591974

19601975
if (U_FAILURE(status))

src/backend/utils/hash/dynahash.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,8 +1204,7 @@ get_hash_entry(HTAB *hashp, int partition_idx)
12041204
{
12051205
HASHHDR *hctl = hashp->hctl;
12061206
HASHBUCKET newElement;
1207-
int i,
1208-
borrow_from_idx;
1207+
int borrow_from_idx;
12091208

12101209
for (;;)
12111210
{

0 commit comments

Comments
 (0)