diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2010-01-25 12:30:04 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2010-01-25 12:30:04 +0000 |
commit | 65c37b17f39210ff32ba3ec1415d5f5a3f8e86ff (patch) | |
tree | a23710d061b8695f9eec30cbf5591e6016432089 /Build/source/texk/web2c/luatexdir/utils | |
parent | a6ff9d2b253991c7c8eb94f2977abb10ad466480 (diff) |
texk/web2c/luatexdir: compiler warnings
git-svn-id: svn://tug.org/texlive/trunk@16817 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/utils')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/utils/avl.c | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/utils/avlstuff.c | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/utils/avlstuff.h | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/utils/synctex.c | 8 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/utils/utils.c | 49 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/utils/utils.h | 32 |
6 files changed, 52 insertions, 47 deletions
diff --git a/Build/source/texk/web2c/luatexdir/utils/avl.c b/Build/source/texk/web2c/luatexdir/utils/avl.c index 79c746cd10d..0241ebd3e6b 100644 --- a/Build/source/texk/web2c/luatexdir/utils/avl.c +++ b/Build/source/texk/web2c/luatexdir/utils/avl.c @@ -216,6 +216,8 @@ void *avl_delete(struct avl_table *tree, const void *item) struct avl_node *p; /* Traverses tree to find node to delete. */ int cmp; /* Result of comparison between |item| and |p|. */ + void *res; + assert(tree != NULL && item != NULL); k = 0; @@ -231,7 +233,7 @@ void *avl_delete(struct avl_table *tree, const void *item) if (p == NULL) return NULL; } - item = p->avl_data; + res = p->avl_data; if (p->avl_link[1] == NULL) pa[k - 1]->avl_link[da[k - 1]] = p->avl_link[0]; @@ -347,7 +349,7 @@ void *avl_delete(struct avl_table *tree, const void *item) tree->avl_count--; tree->avl_generation++; - return (void *) item; + return res; } /* Refreshes the stack of parent pointers in |trav| diff --git a/Build/source/texk/web2c/luatexdir/utils/avlstuff.c b/Build/source/texk/web2c/luatexdir/utils/avlstuff.c index 5c01142fd59..c2f2537cbd6 100644 --- a/Build/source/texk/web2c/luatexdir/utils/avlstuff.c +++ b/Build/source/texk/web2c/luatexdir/utils/avlstuff.c @@ -166,7 +166,7 @@ static void destroy_oentry(void *pa, void *pb) xfree(p); } -void PdfObjTree_free() +void PdfObjTree_free(void) { int i; diff --git a/Build/source/texk/web2c/luatexdir/utils/avlstuff.h b/Build/source/texk/web2c/luatexdir/utils/avlstuff.h index d920aace82b..a7b565c5152 100644 --- a/Build/source/texk/web2c/luatexdir/utils/avlstuff.h +++ b/Build/source/texk/web2c/luatexdir/utils/avlstuff.h @@ -31,6 +31,6 @@ int comp_int_entry(const void *, const void *, void *); int comp_string_entry(const void *, const void *, void *); integer avl_find_obj(integer, integer, integer); void avl_put_obj(integer, integer); -void PdfObjTree_free(); +void PdfObjTree_free(void); #endif /* AVLSTUFF_H */ diff --git a/Build/source/texk/web2c/luatexdir/utils/synctex.c b/Build/source/texk/web2c/luatexdir/utils/synctex.c index b8bd5779e17..de51a4c8ec5 100644 --- a/Build/source/texk/web2c/luatexdir/utils/synctex.c +++ b/Build/source/texk/web2c/luatexdir/utils/synctex.c @@ -222,6 +222,8 @@ Tue Jul 1 15:23:00 UTC 2008 #define __SyncTeX__ 1 +# include "synctex.h" + # if defined(__SyncTeX__) # include <stdio.h> @@ -300,7 +302,7 @@ void synctex_init_command(void) /* Free all memory used and close the file, * It is sent locally when there is a problem with synctex output. */ -void synctex_abort(void) +static void synctex_abort(void) { SYNCTEX_RETURN_IF_DISABLED; #if SYNCTEX_DEBUG @@ -967,7 +969,7 @@ void synctex_kern(halfword p, halfword this_box) void synctex_char_recorder(halfword p); /* this message is sent whenever a char node ships out */ -void synctexchar(halfword p, halfword this_box) +void synctex_char(halfword p, halfword this_box) { (void)this_box; SYNCTEX_RETURN_IF_DISABLED; @@ -996,7 +998,7 @@ void synctex_node_recorder(halfword p); /* this message should be sent to record information for a node of an unknown type */ -void synctexnode(halfword p, halfword this_box) +void synctex_node(halfword p, halfword this_box) { (void)this_box; SYNCTEX_RETURN_IF_DISABLED; diff --git a/Build/source/texk/web2c/luatexdir/utils/utils.c b/Build/source/texk/web2c/luatexdir/utils/utils.c index 8166e4dca27..b8e715a4a64 100644 --- a/Build/source/texk/web2c/luatexdir/utils/utils.c +++ b/Build/source/texk/web2c/luatexdir/utils/utils.c @@ -36,6 +36,7 @@ #include <float.h> /* for DBL_EPSILON */ #include "zlib.h" #include "ptexlib.h" +#include "utils.h" #include "png.h" #ifdef POPPLER_VERSION @@ -137,7 +138,7 @@ void make_subset_tag(fd_entry * fd) for (glyph = (char *) avl_t_first(&t, fd->gl_tree); glyph != NULL; glyph = (char *) avl_t_next(&t)) { md5_append(&pms, (md5_byte_t *) glyph, strlen(glyph)); - md5_append(&pms, (md5_byte_t *) " ", 1); + md5_append(&pms, (const md5_byte_t *) " ", 1); } } md5_append(&pms, (md5_byte_t *) fd->fontname, strlen(fd->fontname)); @@ -198,7 +199,7 @@ str_number maketexlstring(const char *s, size_t l) } /* print a C string through TeX */ -void print_string(char *j) +void print_string(const char *j) { while (*j) { print_char(*j); @@ -207,7 +208,7 @@ void print_string(char *j) } /* append a C string to a TeX string */ -void append_string(char *s) +void append_string(const char *s) { if (s == NULL || *s == 0) return; @@ -298,7 +299,7 @@ void pdftex_warn(const char *fmt, ...) print_ln(); } -void tex_error(char *msg, char **hlp) +void tex_error(const char *msg, const char **hlp) { str_number aa = 0, bb = 0, cc = 0, dd = 0, ee = 0; int k = 0; @@ -548,7 +549,7 @@ scaled ext_xn_over_d(scaled x, scaled n, scaled d) return (scaled) r; } -void libpdffinish() +void libpdffinish(void) { xfree(fb_array); xfree(char_array); @@ -994,7 +995,7 @@ static void makepdftime(time_t t, char *time_str) } } -void init_start_time() +void init_start_time(void) { if (start_time == 0) { start_time = time((time_t *) NULL); @@ -1002,19 +1003,19 @@ void init_start_time() } } -void print_creation_date() +void print_creation_date(void) { init_start_time(); pdf_printf("/CreationDate (%s)\n", start_time_str); } -void print_mod_date() +void print_mod_date(void) { init_start_time(); pdf_printf("/ModDate (%s)\n", start_time_str); } -void getcreationdate() +void getcreationdate(void) { /* put creation date on top of string pool and update pool_ptr */ size_t len = strlen(start_time_str); @@ -1188,7 +1189,7 @@ static int colstacks_used = 0; procedure calls. */ #define init_colorstacks() if (colstacks_size == 0) colstacks_first_init(); -void colstacks_first_init() +static void colstacks_first_init(void) { colstacks_size = STACK_INCREMENT; colstacks = xtalloc(colstacks_size, colstack_type); @@ -1206,7 +1207,7 @@ void colstacks_first_init() colstacks[0].page_start = true; } -int colorstackused() +int colorstackused(void) { init_colorstacks(); return colstacks_used; @@ -1367,7 +1368,7 @@ integer colorstackpop(int colstack_no) return colstack->literal_mode; } -static void colorstackpagestart() +static void colorstackpagestart(void) { int i, j; colstack_type *colstack; @@ -1422,7 +1423,7 @@ static matrix_entry *matrix_stack = 0; static int matrix_stack_size = 0; static int matrix_stack_used = 0; -boolean matrixused() +boolean matrixused(void) { return matrix_stack_used > 0; } @@ -1436,7 +1437,7 @@ static pos_entry *pos_stack = 0; /* the stack */ static int pos_stack_size = 0; /* initially empty */ static int pos_stack_used = 0; /* used entries */ -void matrix_stack_room() +static void matrix_stack_room(void) { matrix_entry *new_stack; @@ -1591,22 +1592,22 @@ static scaled ret_lly; static scaled ret_urx; static scaled ret_ury; -scaled getllx() +scaled getllx(void) { return ret_llx; } -scaled getlly() +scaled getlly(void) { return ret_lly; } -scaled geturx() +scaled geturx(void) { return ret_urx; } -scaled getury() +scaled getury(void) { return ret_ury; } @@ -1620,7 +1621,7 @@ static int last_ury; #define DO_MIN(a, b) ((a < b) ? a : b) #define DO_MAX(a, b) ((a > b) ? a : b) -void do_matrixtransform(scaled x, scaled y, scaled * retx, scaled * rety) +static void do_matrixtransform(scaled x, scaled y, scaled * retx, scaled * rety) { matrix_entry *m = &matrix_stack[matrix_stack_used - 1]; double x_old = x; @@ -1755,14 +1756,14 @@ scaled divide_scaled_n(double sd, double md, double n) /* C print interface */ -void tprint(char *s) +void tprint(const char *s) { - unsigned char *ss = (unsigned char*) s; + const unsigned char *ss = (const unsigned char*) s; while (*ss) print_char(*ss++); } -void tprint_nl(char *s) +void tprint_nl(const char *s) { print_nlp(); tprint(s); @@ -1772,7 +1773,7 @@ void tprint_nl(char *s) #define int_par(a) zeqtb[static_int_base+(a)].cint /* an integer parameter */ #define escape_char int_par(escape_char_code) -void tprint_esc(char *s) +void tprint_esc(const char *s) { /* prints escape character, then |s| */ int c = -1; /* the escape character code */ if (zeqtb != NULL) { @@ -1783,7 +1784,7 @@ void tprint_esc(char *s) tprint(s); } -void tconfusion(char *s) +void tconfusion(const char *s) { confusion(maketexstring(s)); } diff --git a/Build/source/texk/web2c/luatexdir/utils/utils.h b/Build/source/texk/web2c/luatexdir/utils/utils.h index 0e55feb50aa..138913849b2 100644 --- a/Build/source/texk/web2c/luatexdir/utils/utils.h +++ b/Build/source/texk/web2c/luatexdir/utils/utils.h @@ -35,8 +35,8 @@ __attribute__ ((format(printf, 1, 2))) void pdf_printf(const char *, ...); str_number maketexstring(const char *); str_number maketexlstring(const char *, size_t); -void print_string(char *j); -void append_string(char *s); +void print_string(const char *j); +void append_string(const char *s); __attribute__ ((format(printf, 1, 2))) void tex_printf(const char *, ...); void remove_pdffile(void); @@ -44,7 +44,7 @@ __attribute__ ((noreturn, format(printf, 1, 2))) void pdftex_fail(const char *, ...); __attribute__ ((format(printf, 1, 2))) void pdftex_warn(const char *, ...); -void tex_error(char *msg, char **hlp); +void tex_error(const char *msg, const char **hlp); void garbage_warning(void); char *makecstring(integer); char *makeclstring(integer, size_t *); @@ -64,9 +64,9 @@ void escapename(poolpointer in); void escapehex(poolpointer in); void unescapehex(poolpointer in); void print_ID(str_number); -void init_start_time(); -void print_creation_date(); -void print_mod_date(); +void init_start_time(void); +void print_creation_date(void); +void print_mod_date(void); void getcreationdate(void); char *makecfilename(str_number s); char *stripzeros(char *); @@ -82,7 +82,7 @@ extern size_t last_ptr_index; /* color stack and matrix transformation support */ int newcolorstack(integer s, integer literal_mode, boolean pagestart); -int colorstackused(); +int colorstackused(void); integer colorstackset(int colstack_no, integer s); integer colorstackpush(int colstack_no, integer s); integer colorstackpop(int colstack_no); @@ -93,17 +93,17 @@ void checkpdfrestore(scaledpos pos); void pdfshipoutbegin(boolean shipping_page); void pdfshipoutend(boolean shipping_page); void pdfsetmatrix(poolpointer in, scaledpos pos); -scaled getllx(); -scaled getlly(); -scaled geturx(); -scaled getury(); -void tconfusion(char *s); -void tprint(char *s); -void tprint_nl(char *s); -void tprint_esc(char *s); +scaled getllx(void); +scaled getlly(void); +scaled geturx(void); +scaled getury(void); +void tconfusion(const char *s); +void tprint(const char *s); +void tprint_nl(const char *s); +void tprint_esc(const char *s); void matrixtransformpoint(scaled x, scaled y); void matrixtransformrect(scaled llx, scaled lly, scaled urx, scaled ury); -boolean matrixused(); +boolean matrixused(void); void matrixrecalculate(scaled urx); #endif /* UTILS_H */ |