OSDN Git Service

- trim any trailing whitespace
[uclinux-h8/uClibc.git] / extra / locale / gen_wc8bit.c
index 8a6d47a..c6db412 100644 (file)
@@ -1,3 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
 #define _GNU_SOURCE
 #include <stdio.h>
 #include <stdlib.h>
@@ -13,7 +18,7 @@
 #ifndef _WCTYPE_H
 #define _WCTYPE_H
 #endif
-#include "../../libc/sysdeps/linux/common/bits/uClibc_ctype.h"
+#include UCLIBC_CTYPE_HEADER
 
 
 /*  #define CTYPE_PACKED */
@@ -177,14 +182,14 @@ int main(int argc, char **argv)
                        char *s0;
                        char *s1;
                        int n;
-                       
+
                        s0 = strrchr(*argv, '/');
                        if (!s0) {
                                s0 = *argv;
                        } else {
                                ++s0;
                        }
-                       s1 = strchr(s0, '.');
+                       s1 = strrchr(s0, '.');
                        if (!s1) {
                                n = strlen(s0);
                        } else {
@@ -374,7 +379,7 @@ int main(int argc, char **argv)
                                if ((c != 0) || 1) {
                                        u = towupper(c);
                                        l = towlower(c);
-                                       
+
                                        if (u >= 0x80) u = csd[numsets].w2c[u];
                                        if (l >= 0x80) l = csd[numsets].w2c[l];
 
@@ -459,7 +464,7 @@ int main(int argc, char **argv)
 #if 1
                                wrow[i & (C2WC_ROW_LEN-1)] = csd[numsets].c2w[i];
                                if ((i & (C2WC_ROW_LEN-1)) == (C2WC_ROW_LEN-1)) {
-                                       p = (char *) c2wc_tbl;
+                                       p = (unsigned char *) c2wc_tbl;
                                        for (j=0 ; j < n_c2wc_rows ; j++) {
                                                if (!memcmp(p, (char *) wrow, 2*C2WC_ROW_LEN)) {
                                                        break;
@@ -610,7 +615,7 @@ int main(int argc, char **argv)
 
        fprintf(out, "\nstatic const unsigned short __LOCALE_DATA_Cc2wc_data[%d] = {\n",
                        n_c2wc_rows * C2WC_ROW_LEN);
-       p = (char *) c2wc_tbl;
+       p = (unsigned char *) c2wc_tbl;
        for (j=0 ; j < n_c2wc_rows ; j++) {
                fprintf(out, "\t");
                for (i=0 ; i < C2WC_ROW_LEN ; i++) {