[FriBidi-commit] fribidi2/charset fribidi-char-sets-cap-rtl.c, 1.10, 1.11 fribidi-char-sets-utf8.c, 1.2, 1.3

Behdad Esfahbod behdad at freedesktop.org
Sat Jul 30 19:06:31 EST 2005


Update of /cvs/fribidi/fribidi2/charset
In directory gabe:/tmp/cvs-serv8824/charset

Modified Files:
	fribidi-char-sets-cap-rtl.c fribidi-char-sets-utf8.c 
Log Message:
Small changes to shut gcc warnings up.


Index: fribidi-char-sets-cap-rtl.c
===================================================================
RCS file: /cvs/fribidi/fribidi2/charset/fribidi-char-sets-cap-rtl.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- fribidi-char-sets-cap-rtl.c	10 Jan 2005 06:43:53 -0000	1.10
+++ fribidi-char-sets-cap-rtl.c	30 Jul 2005 09:06:28 -0000	1.11
@@ -45,14 +45,21 @@
 
 #include <stdio.h>
 
-enum MyFriBidiTypeEnum
+enum
 {
 # define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) TYPE = FRIBIDI_TYPE_##TYPE,
 # include "fribidi-bidi-types-list.h"
 # undef _FRIBIDI_ADD_TYPE
-  _FRIBIDI_NUM_TYPES
+  _FRIBIDI_MAX_TYPES_VALUE
 };
 
+enum
+{
+# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) DUMMY_##TYPE,
+# include "fribidi-bidi-types-list.h"
+# undef _FRIBIDI_ADD_TYPE
+  _FRIBIDI_NUM_TYPES
+};
 
 static FriBidiCharType CapRTLCharTypes[] = {
 /* *INDENT-OFF* */
@@ -67,7 +74,7 @@
 /* *INDENT-ON* */
 };
 
-#define CAPRTL_CHARS (sizeof CapRTLCharTypes / sizeof CapRTLCharTypes[0])
+#define CAPRTL_CHARS (int)(sizeof CapRTLCharTypes / sizeof CapRTLCharTypes[0])
 
 static FriBidiChar *caprtl_to_unicode = NULL;
 
@@ -78,7 +85,7 @@
 {
   int request[_FRIBIDI_NUM_TYPES];
   FriBidiCharType to_type[_FRIBIDI_NUM_TYPES];
-  int num_types = 0, j, count = 0;
+  int num_types = 0, count = 0;
   FriBidiCharType i;
   char mark[CAPRTL_CHARS];
 
@@ -86,17 +93,20 @@
     (FriBidiChar *) fribidi_malloc (CAPRTL_CHARS *
 				    sizeof caprtl_to_unicode[0]);
   for (i = 0; i < CAPRTL_CHARS; i++)
-    if (CapRTLCharTypes[i] == fribidi_get_bidi_type(i))
-    {
-      caprtl_to_unicode[i] = i;
-      mark[i] = 1;
-    }
+    if (CapRTLCharTypes[i] == fribidi_get_bidi_type (i))
+      {
+	caprtl_to_unicode[i] = i;
+	mark[i] = 1;
+      }
     else
       {
+	int j;
+
 	caprtl_to_unicode[i] = FRIBIDI_UNICODE_CHARS;
 	mark[i] = 0;
-        if (fribidi_get_mirror_char (i, NULL))
-	  DBG ("warning: I could not map mirroring character map to itself in CapRTL");
+	if (fribidi_get_mirror_char (i, NULL))
+	  DBG
+	    ("warning: I could not map mirroring character map to itself in CapRTL");
 
 	for (j = 0; j < num_types; j++)
 	  if (to_type[j] == CapRTLCharTypes[i])
@@ -121,25 +131,26 @@
 	if (!request[j])	/* Do not need this type */
 	  continue;
 	for (k = 0; k < CAPRTL_CHARS; k++)
-	  if (caprtl_to_unicode[k] == FRIBIDI_UNICODE_CHARS && to_type[j] == CapRTLCharTypes[k])
-	  {
-	    request[j]--;
-	    count--;
-	    caprtl_to_unicode[k] = i;
-	    break;
-	  }
+	  if (caprtl_to_unicode[k] == FRIBIDI_UNICODE_CHARS
+	      && to_type[j] == CapRTLCharTypes[k])
+	    {
+	      request[j]--;
+	      count--;
+	      caprtl_to_unicode[k] = i;
+	      break;
+	    }
       }
   if (count)
-  {
-    int j;
+    {
+      int j;
 
-    DBG ("warning: could not find a mapping for CapRTL to Unicode:");
-    for (j = 0; j < num_types; j++)
-      if (request[j])
-	DBG2 ("  need this type: %s", fribidi_get_bidi_type_name
-	    (to_type[j]));
-	
-  }
+      DBG ("warning: could not find a mapping for CapRTL to Unicode:");
+      for (j = 0; j < num_types; j++)
+	if (request[j])
+	  DBG2 ("  need this type: %s", fribidi_get_bidi_type_name
+		(to_type[j]));
+
+    }
 }
 
 static char
@@ -155,7 +166,7 @@
 
   for (i = 0; i < CAPRTL_CHARS; i++)
     if (uch == caprtl_to_unicode[i])
-      return (char) i;
+      return (unsigned char) i;
   return '?';
 }
 
@@ -224,12 +235,13 @@
 fribidi_unicode_to_cap_rtl (
   /* input */
   const FriBidiChar *us,
-  int len,
+  FriBidiStrIndex len,
   /* output */
   char *s
 )
 {
-  int i, j;
+  FriBidiStrIndex i;
+  int j;
 
   j = 0;
   for (i = 0; i < len; i++)

Index: fribidi-char-sets-utf8.c
===================================================================
RCS file: /cvs/fribidi/fribidi2/charset/fribidi-char-sets-utf8.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- fribidi-char-sets-utf8.c	3 May 2004 22:05:19 -0000	1.2
+++ fribidi-char-sets-utf8.c	30 Jul 2005 09:06:28 -0000	1.3
@@ -49,11 +49,11 @@
 )
 {
   FriBidiStrIndex length;
-  const unsigned char *s = (unsigned char *) ss;
+  const unsigned char *s = (unsigned const char *) ss;
   const unsigned char *t = s;
 
   length = 0;
-  while (s - t < len)
+  while ((FriBidiStrIndex) (s - t) < len)
     {
       register unsigned char ch = *s;
       if (ch <= 0x7f)		/* one byte */
@@ -86,7 +86,7 @@
   char *ss
 )
 {
-  int i;
+  FriBidiStrIndex i;
   unsigned char *s = (unsigned char *) ss;
   unsigned char *t = s;
 



More information about the fribidi-commit mailing list