Permalink
Browse files

Small changes to shut gcc warnings up.

  • Loading branch information...
behdad
behdad committed Jul 30, 2005
1 parent 6f84aff commit e8bca571a125502fe0735cf45d6af1d3a85a49c7
View
@@ -16,4 +16,5 @@ install-sh
libtool
ltmain.sh
missing
mkinstalldirs
stamp-h1
View
@@ -1,10 +1,10 @@
## -*- Automake -*-
## Process this file with automake to produce Makefile.in
##############################################################################
## $Id: Makefile.am,v 1.8 2004-08-27 21:55:59 behdad Exp $
## $Id: Makefile.am,v 1.9 2005-07-30 09:06:27 behdad Exp $
## $Author: behdad $
## $Date: 2004-08-27 21:55:59 $
## $Revision: 1.8 $
## $Date: 2005-07-30 09:06:27 $
## $Revision: 1.9 $
## $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/Makefile.am,v $
##############################################################################
@@ -33,6 +33,7 @@ MAINTAINERCLEANFILES = \
$(srcdir)/install-sh \
$(srcdir)/ltmain.sh \
$(srcdir)/missing \
$(srcdir)/mkinstalldirs \
`find "$(srcdir)" -type f -name Makefile.in -print` \
`find "$(srcdir)" -type f -name "*~" -print` \
`$(srcdir)/bootstrap --write-configure`
View
4 USERS
@@ -6,4 +6,6 @@ mlterm: http://mlterm.sourceforge.net/
MPlayer: http://www.mplayerhq.hu/
BiCon: http://www.arabeyes.org/project.php?proj=BiCon
Geresh: http://www.typo.co.il/~mooffie/geresh/
Motor: http://konst.org.ua/en/motor
Motor: http://konst.org.ua/en/motor/
CenterICQ: http://konst.org.ua/centericq/
bidiv: http://www.iglu.org.il/faq/cache/153.html
View
@@ -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,15 +130,15 @@ utime (
static void
benchmark (
char *S_,
const char *S_,
int niter
)
{
int len, i;
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;
View
@@ -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;
}
View
@@ -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;
View
@@ -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 = "";
@@ -1,10 +1,10 @@
/* FriBidi
* fribidi-char-sets-cap-rtl.c - CapRTL character set conversion routines
*
* $Id: fribidi-char-sets-cap-rtl.c,v 1.10 2005-01-10 06:43:53 behdad Exp $
* $Id: fribidi-char-sets-cap-rtl.c,v 1.11 2005-07-30 09:06:28 behdad Exp $
* $Author: behdad $
* $Date: 2005-01-10 06:43:53 $
* $Revision: 1.10 $
* $Date: 2005-07-30 09:06:28 $
* $Revision: 1.11 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/charset/fribidi-char-sets-cap-rtl.c,v $
*
* Authors:
@@ -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 @@ static FriBidiCharType CapRTLCharTypes[] = {
/* *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,25 +85,28 @@ init_cap_rtl (
{
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];
caprtl_to_unicode =
(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 @@ init_cap_rtl (
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 @@ fribidi_unicode_to_cap_rtl_c (
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 @@ FriBidiStrIndex
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++)
Oops, something went wrong.

0 comments on commit e8bca57

Please sign in to comment.