diff options
author | behdad <behdad> | 2002-01-15 17:13:09 +0000 |
---|---|---|
committer | behdad <behdad> | 2002-01-15 17:13:09 +0000 |
commit | bafd506f214609f7a92879312cdc9c21a4bdaac5 (patch) | |
tree | 867350280a2113d374e9da34664083a1dead5105 | |
parent | fe30fb1ce01167a377abe9da24468f4d95c62bf2 (diff) |
Global cleanups
-rw-r--r-- | Makefile.am | 8 | ||||
-rw-r--r-- | fribidi.c | 5 | ||||
-rw-r--r-- | fribidi_benchmark.c | 2 | ||||
-rw-r--r-- | fribidi_char_sets_cap_rtl.c | 4 | ||||
-rw-r--r-- | fribidi_create_char_types.c | 3 | ||||
-rw-r--r-- | fribidi_create_mirroring.c | 12 | ||||
-rw-r--r-- | fribidi_mem.c | 25 | ||||
-rw-r--r-- | packtab.c | 2 |
8 files changed, 28 insertions, 33 deletions
diff --git a/Makefile.am b/Makefile.am index 8426e81..a55c54d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -113,7 +113,7 @@ fribidi_tab_mirroring.i: $(fribidi_create_mirroring_SOURCES) \ if test -d unidata; then UNIDATA=unidata; \ else UNIDATA="$(srcdir)/unidata"; fi && \ ./fribidi_create_mirroring "$$UNIDATA" || \ - ($(RM) -f "$@"; false) + ($(RM) "$@"; false) $(srcdir)/fribidi_mirroring.c: fribidi_tab_mirroring.i @@ -132,8 +132,8 @@ fribidi_tab_char_type_%.i: $(fribidi_create_char_types_SOURCES) \ else UNIDATA="$(srcdir)/unidata"; fi && \ ./fribidi_create_char_types "`echo "$@" \ | $(SED) 's/[^0-9]*//g'`" "$$UNIDATA" || \ - ($(RM) -f "$@"; false) - $(RM) -f fribidi_tab_char_type_stamp + ($(RM) "$@"; false) + $(RM) fribidi_tab_char_type_stamp $(MAKE) fribidi_tab_char_type_stamp fribidi_tab_char_type_stamp: @@ -153,7 +153,7 @@ tests/test_%.reference: tests/test_%.input $(libfribidi_la_SOURCES) testcase="$@" && \ charset="`echo "$@" | $(SED) 's/_[^_]*$$//;s/.*_//'`" && \ ./fribidi --test --charset "$$charset" "$<" > "$@" || \ - ($(RM) -f "$@"; false) + ($(RM) "$@"; false) test.reference: for testcase in "$(srcdir)"/tests/test_*.input; do \ @@ -195,15 +195,14 @@ run_length_encode_types (FriBidiCharType *char_type, FriBidiStrIndex type_len) link = new_type_link (); link->type = char_type[i]; link->pos = i; - FRIBIDI_ADD_TYPE_LINK(last,link) - } + FRIBIDI_ADD_TYPE_LINK (last, link)} /* Add the ending link */ link = new_type_link (); link->type = FRIBIDI_TYPE_EOT; link->level = FRIBIDI_LEVEL_END; link->pos = type_len; - FRIBIDI_ADD_TYPE_LINK(last,link); + FRIBIDI_ADD_TYPE_LINK (last, link); return list; } diff --git a/fribidi_benchmark.c b/fribidi_benchmark.c index ad7ed1d..5e91112 100644 --- a/fribidi_benchmark.c +++ b/fribidi_benchmark.c @@ -103,7 +103,7 @@ benchmark (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]; - uint8 embedding_list[MAX_STR_LEN]; + FriBidiLevel embedding_list[MAX_STR_LEN]; FriBidiCharType base; double time0, time1; diff --git a/fribidi_char_sets_cap_rtl.c b/fribidi_char_sets_cap_rtl.c index 3ba6bcf..82632b8 100644 --- a/fribidi_char_sets_cap_rtl.c +++ b/fribidi_char_sets_cap_rtl.c @@ -258,11 +258,13 @@ fribidi_char_set_enter_cap_rtl (void) { if (!caprtl_to_unicode) { - int request[FRIBIDI_TYPES_COUNT + 1] = { }; + int request[FRIBIDI_TYPES_COUNT + 1]; int i, count; caprtl_to_unicode = (FriBidiChar *) malloc (CAPRTL_CHARS * sizeof caprtl_to_unicode[0]); + for (i = 0; i < FRIBIDI_TYPES_COUNT; i++) + request[i] = 0; for (i = 0; i < CAPRTL_CHARS; i++) if (fribidi_get_mirror_char (i, NULL)) caprtl_to_unicode[i] = i; diff --git a/fribidi_create_char_types.c b/fribidi_create_char_types.c index 34a35f0..794fe6d 100644 --- a/fribidi_create_char_types.c +++ b/fribidi_create_char_types.c @@ -110,7 +110,6 @@ get_type (char *s) #define default_type "LTR" static int table[FRIBIDI_UNICODE_CHARS]; -static char *unicode_data_version; static void init_table () @@ -143,7 +142,7 @@ static void read_unicode_data () { char s[500], tp[10]; - int i; + unsigned int i; FILE *f; printf ("Reading `UnicodeData.txt'\n"); diff --git a/fribidi_create_mirroring.c b/fribidi_create_mirroring.c index 0faef56..cd75f7c 100644 --- a/fribidi_create_mirroring.c +++ b/fribidi_create_mirroring.c @@ -24,13 +24,6 @@ #include <string.h> static void -err (char *msg) -{ - fprintf (stderr, "fribidi_create_mirroring: error: %s\n", msg); - exit (1); -} - -static void err2 (char *fmt, char *p) { fprintf (stderr, "fribidi_create_mirroring: error: "); @@ -49,7 +42,7 @@ static void read_bidi_mirroring () { char s[500]; - int i, j; + unsigned int i, j; FILE *f; for (i = 0; i < 0x110000; i++) @@ -109,7 +102,8 @@ write_mirror (char *file) " equivalent.\n" "\n" " There are lots of characters that are designed as being mirrored\n" - " but do not have any mirrored glyph, e.g. the sign for there exist.\n" + " but do not have any mirrored glyph, e.g. the sign for there exist.\n"); + fprintf (f, " Are these used in Arabic? That is are all the mathematical signs\n" " that are assigned to be mirrorable actually mirrored in Arabic?\n" " If that is the case, we'll change the below code to include also\n" diff --git a/fribidi_mem.c b/fribidi_mem.c index 73bcadd..3034a31 100644 --- a/fribidi_mem.c +++ b/fribidi_mem.c @@ -23,6 +23,17 @@ #include <ctype.h> #include "fribidi_mem.h" +struct _FriBidiMemChunk +{ + char *name; + int atom_size; + int area_size; + int type; + + int empty_size; + void *chunk; +}; + FriBidiList * fribidi_list_append (FriBidiList *list, void *data) { @@ -42,17 +53,6 @@ fribidi_list_append (FriBidiList *list, void *data) return list; } -struct _FriBidiMemChunk -{ - char *name; - int atom_size; - int area_size; - int type; - - int empty_size; - void *chunk; -}; - FriBidiMemChunk * fribidi_mem_chunk_new (char *name, int atom_size, unsigned long area_size, int type) @@ -90,7 +90,8 @@ fribidi_mem_chunk_alloc (FriBidiMemChunk *mem_chunk) mem_chunk->empty_size = mem_chunk->area_size; } m = mem_chunk->chunk; - mem_chunk->chunk += mem_chunk->atom_size; + mem_chunk->chunk = (void *) + ((char *) mem_chunk->chunk + mem_chunk->atom_size); mem_chunk->empty_size -= mem_chunk->atom_size; } else @@ -82,7 +82,7 @@ found () best_cluster[i] = clusters[i]; } } -}; +} static void bt (int node_size) |