Skip to content

Commit 9c56b40

Browse files
committed
Add fix for 0x7fU constants to pgindent
1 parent eeadc5e commit 9c56b40

File tree

3 files changed

+32
-9
lines changed

3 files changed

+32
-9
lines changed

src/backend/utils/mb/big5.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* 1999/1/15 Tatsuo Ishii
99
*
10-
* $Id: big5.c,v 1.4 1999/05/25 22:42:19 momjian Exp $
10+
* $Id: big5.c,v 1.5 1999/05/26 15:19:54 momjian Exp $
1111
*/
1212

1313
#include "mb/pg_wchar.h"
@@ -218,7 +218,7 @@ static unsigned short BinarySearchRange
218218
{
219219
if (0 == array[mid].peer)
220220
return 0;
221-
if (code >= (unsigned) 0xa140)
221+
if (code >= 0xa140U)
222222
{
223223
/* big5 to cns */
224224
tmp = ((code & 0xff00) - (array[mid].code & 0xff00)) >> 8;
@@ -292,7 +292,7 @@ BIG5toCNS(unsigned short big5, unsigned char *lc)
292292
unsigned short cns = 0;
293293
int i;
294294

295-
if (big5 < (unsigned) 0xc940)
295+
if (big5 < 0xc940U)
296296
{
297297
/* level 1 */
298298

@@ -301,14 +301,14 @@ BIG5toCNS(unsigned short big5, unsigned char *lc)
301301
if (b1c4[i][0] == big5)
302302
{
303303
*lc = LC_CNS11643_4;
304-
return (b1c4[i][1] | (unsigned) 0x8080);
304+
return (b1c4[i][1] | 0x8080U);
305305
}
306306
}
307307

308308
if (0 < (cns = BinarySearchRange(big5Level1ToCnsPlane1, 23, big5)))
309309
*lc = LC_CNS11643_1;
310310
}
311-
else if (big5 == (unsigned) 0xc94a)
311+
else if (big5 == 0xc94aU)
312312
{
313313
/* level 2 */
314314
*lc = LC_CNS11643_1;

src/backend/utils/mb/conv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* conversion between client encoding and server internal encoding
33
* (currently mule internal code (mic) is used)
44
* Tatsuo Ishii
5-
* $Id: conv.c,v 1.10 1999/05/25 22:42:20 momjian Exp $
5+
* $Id: conv.c,v 1.11 1999/05/26 15:19:55 momjian Exp $
66
*/
77
#include <stdio.h>
88
#include <string.h>
@@ -384,7 +384,7 @@ big52mic(unsigned char *big5, unsigned char *p, int len)
384384

385385
while (len > 0 && (c1 = *big5++))
386386
{
387-
if (c1 <= (unsigned) 0x7f)
387+
if (c1 <= 0x7fU)
388388
{ /* ASCII */
389389
len--;
390390
*p++ = c1;

src/tools/pgindent/indent.bsd.patch

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
This increases the number of typedef's understood by BSD indent from 100
3-
to 1000.
3+
to 1000. The second patch allows it to understand 0x7fU constants.
4+
5+
---------------------------------------------------------------------------
46

57
*** ./lexi.c.orig Mon Sep 8 17:55:47 1997
68
--- ./lexi.c Mon Sep 8 17:02:10 1997
@@ -17,7 +19,28 @@ to 1000.
1719
int rwcode;
1820
};
1921

20-
! struct templ specials[1000] =
22+
! struct templ specials[4096] =
2123
{
2224
"switch", 1,
2325
"case", 2,
26+
27+
*** ./lexi.c.orig Wed May 26 10:50:54 1999
28+
--- ./lexi.c Wed May 26 10:51:08 1999
29+
***************
30+
*** 186,192 ****
31+
*e_token++ = *buf_ptr++;
32+
}
33+
}
34+
! if (*buf_ptr == 'L' || *buf_ptr == 'l')
35+
*e_token++ = *buf_ptr++;
36+
}
37+
else
38+
--- 186,193 ----
39+
*e_token++ = *buf_ptr++;
40+
}
41+
}
42+
! if (*buf_ptr == 'L' || *buf_ptr == 'U' ||
43+
! *buf_ptr == 'l' || *buf_ptr == 'u')
44+
*e_token++ = *buf_ptr++;
45+
}
46+
else

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy