summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorbehdad <behdad>2005-07-30 09:06:27 +0000
committerbehdad <behdad>2005-07-30 09:06:27 +0000
commite8bca571a125502fe0735cf45d6af1d3a85a49c7 (patch)
tree05ee6f46cecbb78a212ef351444a4669928939b6 /bin
parent6f84aff9f7901178ef9e7e2e463a04e639b5a606 (diff)
downloadfribidi-e8bca571a125502fe0735cf45d6af1d3a85a49c7.tar.gz
Small changes to shut gcc warnings up.
Diffstat (limited to 'bin')
-rw-r--r--bin/fribidi-benchmark.c17
-rw-r--r--bin/fribidi-bidi-types.c7
-rw-r--r--bin/fribidi-caprtl2utf8.c17
-rw-r--r--bin/fribidi-main.c30
4 files changed, 38 insertions, 33 deletions
diff --git a/bin/fribidi-benchmark.c b/bin/fribidi-benchmark.c
index 3de8795..9ca5750 100644
--- a/bin/fribidi-benchmark.c
+++ b/bin/fribidi-benchmark.c
@@ -1,10 +1,10 @@
/* FriBidi
* fribidi-benchmark.c - command line benchmark tool for libfribidi
*
- * $Id: fribidi-benchmark.c,v 1.4 2004-06-09 08:56:53 behdad Exp $
+ * $Id: fribidi-benchmark.c,v 1.5 2005-07-30 09:06:27 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-09 08:56:53 $
- * $Revision: 1.4 $
+ * $Date: 2005-07-30 09:06:27 $
+ * $Revision: 1.5 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/bin/fribidi-benchmark.c,v $
*
* Authors:
@@ -64,6 +64,7 @@
#define appname "fribidi_benchmark"
#define MAX_STR_LEN 1000
+#define NUM_ITER 2000
static void
die2 (
@@ -92,8 +93,6 @@ die2 (
"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 @@ help (
" -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 @@ utime (
static void
benchmark (
- char *S_,
+ const char *S_,
int niter
)
{
@@ -139,7 +138,7 @@ benchmark (
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 @@ main (
char *argv[]
)
{
- niter = 2000;
+ int niter = NUM_ITER;
/* Parse the command line */
argv[0] = appname;
diff --git a/bin/fribidi-bidi-types.c b/bin/fribidi-bidi-types.c
index ecc8dfc..efdf44b 100644
--- a/bin/fribidi-bidi-types.c
+++ b/bin/fribidi-bidi-types.c
@@ -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;
}
diff --git a/bin/fribidi-caprtl2utf8.c b/bin/fribidi-caprtl2utf8.c
index cc7c8ac..492b44e 100644
--- a/bin/fribidi-caprtl2utf8.c
+++ b/bin/fribidi-caprtl2utf8.c
@@ -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;
diff --git a/bin/fribidi-main.c b/bin/fribidi-main.c
index 3744fe7..aa8451b 100644
--- a/bin/fribidi-main.c
+++ b/bin/fribidi-main.c
@@ -1,10 +1,10 @@
/* FriBidi
* fribidi-main.c - command line program for libfribidi
*
- * $Id: fribidi-main.c,v 1.11 2004-06-23 22:26:06 behdad Exp $
+ * $Id: fribidi-main.c,v 1.12 2005-07-30 09:06:27 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-23 22:26:06 $
- * $Revision: 1.11 $
+ * $Date: 2005-07-30 09:06:27 $
+ * $Revision: 1.12 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/bin/fribidi-main.c,v $
*
* Authors:
@@ -91,9 +91,9 @@ fribidi_boolean do_break, do_pad, do_mirror, do_reorder_nsm, do_clean;
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 @@ version (
exit (0);
}
-char *
+static char *
my_fribidi_strdup (
char *s
)
@@ -227,7 +227,7 @@ main (
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 @@ main (
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 @@ main (
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 = "";