Skip to content

Commit 91fc10f

Browse files
committed
Fix compile errors in CYR_RECODE code, per report from Oliver Elphick.
1 parent 90739d4 commit 91fc10f

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

src/backend/utils/init/miscinit.c

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.87 2002/04/27 21:24:34 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.88 2002/05/03 20:43:30 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -25,6 +25,8 @@
2525
#include <pwd.h>
2626
#include <stdlib.h>
2727
#include <errno.h>
28+
#include <netinet/in.h>
29+
#include <arpa/inet.h>
2830

2931
#include "catalog/catname.h"
3032
#include "catalog/pg_shadow.h"
@@ -36,17 +38,19 @@
3638
#include "utils/syscache.h"
3739

3840

39-
#ifdef CYR_RECODE
40-
unsigned char RecodeForwTable[128];
41-
unsigned char RecodeBackTable[128];
42-
#endif
43-
4441
ProcessingMode Mode = InitProcessing;
4542

4643
/* Note: we rely on these to initialize as zeroes */
4744
static char directoryLockFile[MAXPGPATH];
4845
static char socketLockFile[MAXPGPATH];
4946

47+
#ifdef CYR_RECODE
48+
static unsigned char RecodeForwTable[128];
49+
static unsigned char RecodeBackTable[128];
50+
51+
static void GetCharSetByHost(char *TableName, int host, const char *DataDir);
52+
#endif
53+
5054

5155
/* ----------------------------------------------------------------
5256
* ignoring system indexes support stuff
@@ -236,14 +240,14 @@ pg_convert2(PG_FUNCTION_ARGS)
236240

237241
#ifdef CYR_RECODE
238242

243+
void
239244
SetCharSet(void)
240245
{
241246
FILE *file;
242247
char *filename;
243248
char *map_file;
244249
char buf[MAX_TOKEN];
245-
int i,
246-
c;
250+
int i;
247251
unsigned char FromChar,
248252
ToChar;
249253
char ChTable[MAX_TOKEN];
@@ -289,8 +293,8 @@ SetCharSet(void)
289293
while (!feof(file) && buf[0])
290294
{
291295
next_token(file, buf, sizeof(buf));
292-
elog(LOG, "SetCharSet: unknown tag %s in file %s"
293-
buf, filename);
296+
elog(LOG, "SetCharSet: unknown tag %s in file %s",
297+
buf, filename);
294298
}
295299
}
296300
}
@@ -415,7 +419,6 @@ GetCharSetByHost(char *TableName, int host, const char *DataDir)
415419
*map_file;
416420
int key,
417421
ChIndex = 0,
418-
c,
419422
i,
420423
bufsize;
421424
struct CharsetItem *ChArray[MAX_CHARSETS];
@@ -445,8 +448,8 @@ GetCharSetByHost(char *TableName, int host, const char *DataDir)
445448
else if (strcasecmp(buf, "RecodeTable") == 0)
446449
key = KEY_TABLE;
447450
else
448-
elog(LOG, "GetCharSetByHost: unknown tag %s in file %s"
449-
buf, CHARSET_FILE);
451+
elog(LOG, "GetCharSetByHost: unknown tag %s in file %s",
452+
buf, CHARSET_FILE);
450453

451454
switch (key)
452455
{
@@ -501,8 +504,8 @@ GetCharSetByHost(char *TableName, int host, const char *DataDir)
501504
while (!feof(file) && buf[0])
502505
{
503506
next_token(file, buf, sizeof(buf));
504-
elog(LOG, "GetCharSetByHost: unknown tag %s in file %s"
505-
buf, CHARSET_FILE);
507+
elog(LOG, "GetCharSetByHost: unknown tag %s in file %s",
508+
buf, CHARSET_FILE);
506509
}
507510
}
508511
}

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