[FriBidi-commit] fribidi2/bin fribidi-benchmark.c, 1.4,
1.5 fribidi-bidi-types.c, 1.1, 1.2 fribidi-caprtl2utf8.c, 1.1,
1.2 fribidi-main.c, 1.11, 1.12
Behdad Esfahbod
behdad at freedesktop.org
Sat Jul 30 19:06:31 EST 2005
Update of /cvs/fribidi/fribidi2/bin
In directory gabe:/tmp/cvs-serv8824/bin
Modified Files:
fribidi-benchmark.c fribidi-bidi-types.c fribidi-caprtl2utf8.c
fribidi-main.c
Log Message:
Small changes to shut gcc warnings up.
Index: fribidi-benchmark.c
===================================================================
RCS file: /cvs/fribidi/fribidi2/bin/fribidi-benchmark.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- fribidi-benchmark.c 9 Jun 2004 08:56:53 -0000 1.4
+++ fribidi-benchmark.c 30 Jul 2005 09:06:27 -0000 1.5
@@ -64,6 +64,7 @@
#define appname "fribidi_benchmark"
#define MAX_STR_LEN 1000
+#define NUM_ITER 2000
static void
die2 (
@@ -92,8 +93,6 @@
"a _L_L_L_L_L_L_L_L_L_L_L_L_L_L_L_L_L_L_L_L_L_L_L_L_L_L_L_L_L_L_Rbug" \
"here_L is_o_o_o _R ab one_o _r 123,987_LT_oHE_R t_o oNE:" \
-int niter;
-
static void
help (
void
@@ -106,7 +105,7 @@
" -h, --help Display this information and exit\n"
" -V, --version Display version information and exit\n"
" -n, --niter N Number of iterations. Default is %d.\n"
- "\nReport bugs online at\n<" FRIBIDI_BUGREPORT ">.\n", niter);
+ "\nReport bugs online at\n<" FRIBIDI_BUGREPORT ">.\n", NUM_ITER);
exit (0);
}
@@ -131,7 +130,7 @@
static void
benchmark (
- char *S_,
+ const char *S_,
int niter
)
{
@@ -139,7 +138,7 @@
FriBidiChar us[MAX_STR_LEN], out_us[MAX_STR_LEN];
FriBidiStrIndex positionLtoV[MAX_STR_LEN], positionVtoL[MAX_STR_LEN];
FriBidiLevel embedding_list[MAX_STR_LEN];
- FriBidiCharType base;
+ FriBidiParType base;
double time0, time1;
{
@@ -226,7 +225,7 @@
char *argv[]
)
{
- niter = 2000;
+ int niter = NUM_ITER;
/* Parse the command line */
argv[0] = appname;
Index: fribidi-bidi-types.c
===================================================================
RCS file: /cvs/fribidi/fribidi2/bin/fribidi-bidi-types.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- fribidi-bidi-types.c 7 Jun 2005 08:20:05 -0000 1.1
+++ fribidi-bidi-types.c 30 Jul 2005 09:06:27 -0000 1.2
@@ -2,13 +2,16 @@
#include <fribidi.h>
int
-main()
+main (
+ void
+)
{
FriBidiChar c;
for (c = 0; c < FRIBIDI_UNICODE_CHARS; c++)
- printf ("0x%04lx %s\n", (long) c, fribidi_get_bidi_type_name(fribidi_get_bidi_type(c)));
+ printf ("0x%04lx %s\n", (long) c,
+ fribidi_get_bidi_type_name (fribidi_get_bidi_type (c)));
return 0;
}
Index: fribidi-caprtl2utf8.c
===================================================================
RCS file: /cvs/fribidi/fribidi2/bin/fribidi-caprtl2utf8.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- fribidi-caprtl2utf8.c 7 Jun 2005 08:39:14 -0000 1.1
+++ fribidi-caprtl2utf8.c 30 Jul 2005 09:06:27 -0000 1.2
@@ -5,23 +5,26 @@
char buf[BUFSIZ];
FriBidiChar ubuf[BUFSIZ];
-int main()
+int
+main (
+ void
+)
{
- FriBidiCharSet caprtl = fribidi_parse_charset("CapRTL");
- FriBidiCharSet utf8 = fribidi_parse_charset("UTF-8");
+ FriBidiCharSet caprtl = fribidi_parse_charset ("CapRTL");
+ FriBidiCharSet utf8 = fribidi_parse_charset ("UTF-8");
- while (fgets(buf, sizeof buf, stdin))
+ while (fgets (buf, sizeof buf, stdin))
{
char eol[5];
- FriBidiStrIndex len = strlen(buf);
- while (len && (buf[len-1] == '\n' || buf[len-1] == '\r'))
+ FriBidiStrIndex len = strlen (buf);
+ while (len && (buf[len - 1] == '\n' || buf[len - 1] == '\r'))
len--;
strncpy (eol, buf + len, sizeof eol);
buf[len] = 0;
len = fribidi_charset_to_unicode (caprtl, buf, len, ubuf);
- fprintf(stderr, "%d\n", len);
+ fprintf (stderr, "%d\n", len);
len = fribidi_unicode_to_charset (utf8, ubuf, len, buf);
buf[len] = 0;
Index: fribidi-main.c
===================================================================
RCS file: /cvs/fribidi/fribidi2/bin/fribidi-main.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- fribidi-main.c 23 Jun 2004 22:26:06 -0000 1.11
+++ fribidi-main.c 30 Jul 2005 09:06:27 -0000 1.12
@@ -91,9 +91,9 @@
fribidi_boolean show_input, show_visual, show_basedir;
fribidi_boolean show_ltov, show_vtol, show_levels;
int text_width;
-char *char_set;
-char *bol_text, *eol_text;
-FriBidiCharType input_base_direction;
+const char *char_set;
+const char *bol_text, *eol_text;
+FriBidiParType input_base_direction;
#if FRIBIDI_MAIN_USE_ICONV_H
iconv_t to_ucs4, from_ucs4;
#else /* !FRIBIDI_MAIN_USE_ICONV_H */
@@ -185,7 +185,7 @@
exit (0);
}
-char *
+static char *
my_fribidi_strdup (
char *s
)
@@ -227,7 +227,7 @@
char_set = "UTF-8";
bol_text = NULL;
eol_text = NULL;
- input_base_direction = FRIBIDI_TYPE_ON;
+ input_base_direction = FRIBIDI_PAR_ON;
if ((s = (char *) getenv ("COLUMNS")))
{
@@ -374,23 +374,23 @@
file_found = false;
while (optind < argc || !file_found)
{
- char *S_;
+ const char *filename;
- S_ = optind < argc ? argv[optind++] : "-";
+ filename = optind < argc ? argv[optind++] : "-";
file_found = true;
/* Open the infile for reading */
- if (S_[0] == '-' && !S_[1])
+ if (filename[0] == '-' && !filename[1])
{
IN = stdin;
}
else
{
- IN = fopen (S_, "r");
+ IN = fopen (filename, "r");
if (!IN)
{
fprintf (stderr, "%s: %s: no such file or directory\n",
- appname, S_);
+ appname, filename);
exit_val = 1;
continue;
}
@@ -406,10 +406,10 @@
while (fgets (S_, sizeof (S_) - 1, IN))
{
- char *new_line, *nl_found;
+ const char *new_line, *nl_found;
FriBidiChar logical[MAX_STR_LEN];
char outstring[MAX_STR_LEN];
- FriBidiCharType base;
+ FriBidiParType base;
FriBidiStrIndex len;
nl_found = "";
More information about the fribidi-commit
mailing list