summaryrefslogtreecommitdiff
path: root/lib/uniwidth
diff options
context:
space:
mode:
Diffstat (limited to 'lib/uniwidth')
-rw-r--r--lib/uniwidth/cjk.h2
-rw-r--r--lib/uniwidth/u16-strwidth.c2
-rw-r--r--lib/uniwidth/u16-width.c6
-rw-r--r--lib/uniwidth/u32-strwidth.c2
-rw-r--r--lib/uniwidth/u32-width.c6
-rw-r--r--lib/uniwidth/u8-strwidth.c2
-rw-r--r--lib/uniwidth/u8-width.c6
-rw-r--r--lib/uniwidth/width.c54
8 files changed, 40 insertions, 40 deletions
diff --git a/lib/uniwidth/cjk.h b/lib/uniwidth/cjk.h
index 6124e1a..5d8ef12 100644
--- a/lib/uniwidth/cjk.h
+++ b/lib/uniwidth/cjk.h
@@ -1,5 +1,5 @@
/* Test for CJK encoding.
- Copyright (C) 2001-2002, 2005-2007 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2005-2007, 2009-2010 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This program is free software: you can redistribute it and/or modify it
diff --git a/lib/uniwidth/u16-strwidth.c b/lib/uniwidth/u16-strwidth.c
index e938bd2..01dc33b 100644
--- a/lib/uniwidth/u16-strwidth.c
+++ b/lib/uniwidth/u16-strwidth.c
@@ -1,5 +1,5 @@
/* Determine display width of UTF-16 string.
- Copyright (C) 2001-2002, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2006, 2009-2010 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This program is free software: you can redistribute it and/or modify it
diff --git a/lib/uniwidth/u16-width.c b/lib/uniwidth/u16-width.c
index b866b3c..49a1204 100644
--- a/lib/uniwidth/u16-width.c
+++ b/lib/uniwidth/u16-width.c
@@ -1,5 +1,5 @@
/* Determine display width of UTF-16 string.
- Copyright (C) 2001-2002, 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2006-2007, 2009-2010 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This program is free software: you can redistribute it and/or modify it
@@ -36,11 +36,11 @@ u16_width (const uint16_t *s, size_t n, const char *encoding)
s += u16_mbtouc_unsafe (&uc, s, s_end - s);
if (uc == 0)
- break; /* end of string reached */
+ break; /* end of string reached */
w = uc_width (uc, encoding);
if (w >= 0) /* ignore control characters in the string */
- width += w;
+ width += w;
}
return width;
diff --git a/lib/uniwidth/u32-strwidth.c b/lib/uniwidth/u32-strwidth.c
index ee4eb4a..c21e6aa 100644
--- a/lib/uniwidth/u32-strwidth.c
+++ b/lib/uniwidth/u32-strwidth.c
@@ -1,5 +1,5 @@
/* Determine display width of UTF-32 string.
- Copyright (C) 2001-2002, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2006, 2009-2010 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This program is free software: you can redistribute it and/or modify it
diff --git a/lib/uniwidth/u32-width.c b/lib/uniwidth/u32-width.c
index f928fa4..32c4133 100644
--- a/lib/uniwidth/u32-width.c
+++ b/lib/uniwidth/u32-width.c
@@ -1,5 +1,5 @@
/* Determine display width of UTF-32 string.
- Copyright (C) 2001-2002, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2006, 2009-2010 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This program is free software: you can redistribute it and/or modify it
@@ -32,11 +32,11 @@ u32_width (const uint32_t *s, size_t n, const char *encoding)
int w;
if (uc == 0)
- break; /* end of string reached */
+ break; /* end of string reached */
w = uc_width (uc, encoding);
if (w >= 0) /* ignore control characters in the string */
- width += w;
+ width += w;
}
return width;
diff --git a/lib/uniwidth/u8-strwidth.c b/lib/uniwidth/u8-strwidth.c
index 961f26b..d3404b3 100644
--- a/lib/uniwidth/u8-strwidth.c
+++ b/lib/uniwidth/u8-strwidth.c
@@ -1,5 +1,5 @@
/* Determine display width of UTF-8 string.
- Copyright (C) 2001-2002, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2006, 2009-2010 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This program is free software: you can redistribute it and/or modify it
diff --git a/lib/uniwidth/u8-width.c b/lib/uniwidth/u8-width.c
index ad0d49d..fd27cab 100644
--- a/lib/uniwidth/u8-width.c
+++ b/lib/uniwidth/u8-width.c
@@ -1,5 +1,5 @@
/* Determine display width of UTF-8 string.
- Copyright (C) 2001-2002, 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2006-2007, 2009-2010 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This program is free software: you can redistribute it and/or modify it
@@ -36,11 +36,11 @@ u8_width (const uint8_t *s, size_t n, const char *encoding)
s += u8_mbtouc_unsafe (&uc, s, s_end - s);
if (uc == 0)
- break; /* end of string reached */
+ break; /* end of string reached */
w = uc_width (uc, encoding);
if (w >= 0) /* ignore control characters in the string */
- width += w;
+ width += w;
}
return width;
diff --git a/lib/uniwidth/width.c b/lib/uniwidth/width.c
index 25ff0c7..c88fdb6 100644
--- a/lib/uniwidth/width.c
+++ b/lib/uniwidth/width.c
@@ -1,5 +1,5 @@
/* Determine display width of Unicode character.
- Copyright (C) 2001-2002, 2006-2009 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2006-2010 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This program is free software: you can redistribute it and/or modify it
@@ -310,26 +310,26 @@ uc_width (ucs4_t uc, const char *encoding)
{
int ind = nonspacing_table_ind[uc >> 9];
if (ind >= 0)
- if ((nonspacing_table_data[64*ind + ((uc >> 3) & 63)] >> (uc & 7)) & 1)
- {
- if (uc > 0 && uc < 0xa0)
- return -1;
- else
- return 0;
- }
+ if ((nonspacing_table_data[64*ind + ((uc >> 3) & 63)] >> (uc & 7)) & 1)
+ {
+ if (uc > 0 && uc < 0xa0)
+ return -1;
+ else
+ return 0;
+ }
}
else if ((uc >> 9) == (0xe0000 >> 9))
{
if (uc >= 0xe0100)
- {
- if (uc <= 0xe01ef)
- return 0;
- }
+ {
+ if (uc <= 0xe01ef)
+ return 0;
+ }
else
- {
- if (uc >= 0xe0020 ? uc <= 0xe007f : uc == 0xe0001)
- return 0;
- }
+ {
+ if (uc >= 0xe0020 ? uc <= 0xe007f : uc == 0xe0001)
+ return 0;
+ }
}
/* Test for double-width character.
* Generated from "grep '^....;[WF]' EastAsianWidth.txt"
@@ -337,17 +337,17 @@ uc_width (ucs4_t uc, const char *encoding)
*/
if (uc >= 0x1100
&& ((uc < 0x1160) /* Hangul Jamo */
- || (uc >= 0x2329 && uc < 0x232b) /* Angle Brackets */
- || (uc >= 0x2e80 && uc < 0xa4d0 /* CJK ... Yi */
- && !(uc == 0x303f) && !(uc >= 0x4dc0 && uc < 0x4e00))
- || (uc >= 0xac00 && uc < 0xd7a4) /* Hangul Syllables */
- || (uc >= 0xf900 && uc < 0xfb00) /* CJK Compatibility Ideographs */
- || (uc >= 0xfe10 && uc < 0xfe20) /* Presentation Forms for Vertical */
- || (uc >= 0xfe30 && uc < 0xfe70) /* CJK Compatibility Forms */
- || (uc >= 0xff00 && uc < 0xff61) /* Fullwidth Forms */
- || (uc >= 0xffe0 && uc < 0xffe7) /* Fullwidth Signs */
- || (uc >= 0x20000 && uc <= 0x2a6d6) /* CJK */
- || (uc >= 0x2f800 && uc <= 0x2fa1d) /* CJK Compatibility Ideographs */
+ || (uc >= 0x2329 && uc < 0x232b) /* Angle Brackets */
+ || (uc >= 0x2e80 && uc < 0xa4d0 /* CJK ... Yi */
+ && !(uc == 0x303f) && !(uc >= 0x4dc0 && uc < 0x4e00))
+ || (uc >= 0xac00 && uc < 0xd7a4) /* Hangul Syllables */
+ || (uc >= 0xf900 && uc < 0xfb00) /* CJK Compatibility Ideographs */
+ || (uc >= 0xfe10 && uc < 0xfe20) /* Presentation Forms for Vertical */
+ || (uc >= 0xfe30 && uc < 0xfe70) /* CJK Compatibility Forms */
+ || (uc >= 0xff00 && uc < 0xff61) /* Fullwidth Forms */
+ || (uc >= 0xffe0 && uc < 0xffe7) /* Fullwidth Signs */
+ || (uc >= 0x20000 && uc <= 0x2a6d6) /* CJK */
+ || (uc >= 0x2f800 && uc <= 0x2fa1d) /* CJK Compatibility Ideographs */
) )
return 2;
/* In ancient CJK encodings, Cyrillic and most other characters are