libpq/conv.c

From: Tomoaki NISHIYAMA <tomoaki(at)biol(dot)s(dot)u-tokyo(dot)ac(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Cc: tomoaki(at)biol(dot)s(dot)u-tokyo(dot)ac(dot)jp
Subject: libpq/conv.c
Date: 1999-06-14 07:50:59
Message-ID: 19990614165059R.tomoaki@moss.nibb.ac.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The conversion tables are declared as "char []" not "unsigned char[]",
while they are passed to "unsigned char*".
Is there any reason to prevent declaring as "unsigned char[]"?

A patch is following my signature.
--------
Tomoaki Nishiyama
e-mail:tomoaki(at)biol(dot)s(dot)u-tokyo(dot)ac(dot)jp
Department of Biological Sciences,
Graduate School of Science, The University of Tokyo

--- conv.orig Thu May 27 16:00:39 1999
+++ conv.c Mon Jun 14 16:34:03 1999
@@ -724,7 +724,7 @@
static void
iso2mic(unsigned char *l, unsigned char *p, int len)
{
- static char iso2koi[] = {
+ static unsigned char iso2koi[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -750,7 +750,7 @@
static void
mic2iso(unsigned char *mic, unsigned char *p, int len)
{
- static char koi2iso[] = {
+ static unsigned char koi2iso[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -776,7 +776,7 @@
static void
win2mic(unsigned char *l, unsigned char *p, int len)
{
- static char win2koi[] = {
+ static unsigned char win2koi[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -802,7 +802,7 @@
static void
mic2win(unsigned char *mic, unsigned char *p, int len)
{
- static char koi2win[] = {
+ static unsigned char koi2win[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -828,7 +828,7 @@
static void
alt2mic(unsigned char *l, unsigned char *p, int len)
{
- static char alt2koi[] = {
+ static unsigned char alt2koi[] = {
0xe1, 0xe2, 0xf7, 0xe7, 0xe4, 0xe5, 0xf6, 0xfa,
0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0,
0xf2, 0xf3, 0xf4, 0xf5, 0xe6, 0xe8, 0xe3, 0xfe,
@@ -854,7 +854,7 @@
static void
mic2alt(unsigned char *mic, unsigned char *p, int len)
{
- static char koi2alt[] = {
+ static unsigned char koi2alt[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

Browse pgsql-hackers by date

  From Date Subject
Next Message Roman Hodek 1999-06-14 08:13:01 Re: Patch for m68k architecture (fwd)
Previous Message Daniel Kalchev 1999-06-14 07:39:52 Re: [HACKERS] another locale problem