]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/unicode.c
Merge remote-tracking branch 'origin/master'
[libucw.git] / ucw / unicode.c
index 8d537f54d566de18358653d235ef2ad2227da923..8615f122b22fb65ba9aa30ca9bf3592791a3155a 100644 (file)
@@ -8,13 +8,13 @@
  *     of the GNU Lesser General Public License.
  */
 
-#include "ucw/lib.h"
-#include "ucw/unicode.h"
+#include <ucw/lib.h>
+#include <ucw/unicode.h>
 
-uns
+size_t
 utf8_strlen(const byte *str)
 {
-  uns len = 0;
+  size_t len = 0;
   while (*str)
     {
       UTF8_SKIP(str);
@@ -23,10 +23,10 @@ utf8_strlen(const byte *str)
   return len;
 }
 
-uns
-utf8_strnlen(const byte *str, uns n)
+size_t
+utf8_strnlen(const byte *str, size_t n)
 {
-  uns len = 0;
+  size_t len = 0;
   const byte *end = str + n;
   while (str < end)
     {
@@ -60,9 +60,9 @@ int main(int argc, char **argv)
 #undef F
   };
 
-  uns func = ~0U;
+  uint func = ~0U;
   if (argc > 1)
-    for (uns i = 0; i < ARRAY_SIZE(names); i++)
+    for (uint i = 0; i < ARRAY_SIZE(names); i++)
       if (!strcasecmp(names[i], argv[1]))
        func = i;
   if (!~func)
@@ -74,7 +74,7 @@ int main(int argc, char **argv)
   if (func < FUNC_UTF8_PUT)
     {
       byte *p = buf, *q = buf, *last;
-      uns u;
+      uint u;
       bzero(buf, sizeof(buf));
       while (scanf("%x", &u) == 1)
        *q++ = u;
@@ -107,7 +107,7 @@ int main(int argc, char **argv)
     }
   else
     {
-      uns u, i=0;
+      uint u, i=0;
       while (scanf("%x", &u) == 1)
        {
          byte *p = buf, *q = buf;