summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog38
-rw-r--r--src/devices/grohtml/html-text.cpp2
-rw-r--r--src/devices/grohtml/html-text.h2
-rw-r--r--src/devices/grohtml/post-html.cpp8
-rw-r--r--src/devices/grolbp/charset.h2
-rw-r--r--src/devices/grolbp/lbp.h4
-rw-r--r--src/devices/grotty/tty.cpp2
-rw-r--r--src/preproc/html/pre-html.cpp10
-rw-r--r--src/preproc/html/pushback.cpp4
-rw-r--r--src/preproc/html/pushback.h2
-rw-r--r--src/preproc/soelim/soelim.cpp12
-rw-r--r--src/roff/troff/glyphuni.cpp4
-rw-r--r--src/roff/troff/input.cpp2
-rw-r--r--src/roff/troff/uniglyph.cpp4
-rw-r--r--src/roff/troff/uniuni.cpp4
15 files changed, 69 insertions, 31 deletions
diff --git a/ChangeLog b/ChangeLog
index 317f77aa..1d3f74aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,43 @@
2003-04-16 Werner LEMBERG <wl@gnu.org>
+ * src/devices/grohtml/post-html.cpp (text_glob::text_glob):
+ Add `const' to second argument.
+ (html_printer::add_table_end): Add `const' to argument.
+ * src/devices/grohtml/html-text.cpp (html_text::issue_tag): Add
+ `const' to arguments.
+ * src/devices/grohtml/html-text.h: Updated.
+
+ * src/devices/grolbp/charset.h (symset): Use `unsigned char'.
+ * src/devices/grolbp/lbp.h (lbpputc): Use `unsigned char' for
+ argument.
+
+ * src/devices/grotty/tty.cpp (tty_printer::make_rgb_string): Use
+ cast for integer constant.
+
+ * src/preproc/html/pre-html.cpp (image_device): Use `const'.
+ (writeNbytes): Add `const' to first argument.
+ (writeString): Add `const' to argument.
+ (char_buffer::can_see): Add `const' to third argument.
+ * src/preproc/html/pushback.cpp (pushBackBuffer::isString): Add
+ `const' to argument.
+ * src/preproc/html/pushback.h: Updated.
+
+ * src/preproc/soelim/soelim.cpp (include_list): Add `const'.
+ (include_path_append): Add `const' to argument.
+ (do_file): Updated.
+
+ * src/roff/troff/uniglyph.cpp (unicode_to_glyph_list): Use `const'
+ for `value'.
+ (unicode_to_glyph_init::unicode_to_glyph_init): Updated.
+ * src/roff/troff/uniuni.cpp (unicode_decompose_list): Use `const'
+ for `value'.
+ (unicode_decompose_init::unicode_decompose_init): Updated.
+ * src/roff/troff/glyphuni.cpp (glyph_to_unicode_list): Use `const'
+ for `value'.
+ (glyph_to_unicode_init::glyph_to_unicode_init): Updated.
+ * src/roff/troff/input.cc (process_startup_file): Add `const' to
+ argument.
+
* tmac/hyphenex.sh: Make script more portable by using a here
document.
diff --git a/src/devices/grohtml/html-text.cpp b/src/devices/grohtml/html-text.cpp
index ec805331..21a79eb3 100644
--- a/src/devices/grohtml/html-text.cpp
+++ b/src/devices/grohtml/html-text.cpp
@@ -170,7 +170,7 @@ void html_text::end_tag (tag_definition *t)
* issue_tag - writes out an html tag with argument.
*/
-void html_text::issue_tag (char *tagname, char *arg)
+void html_text::issue_tag (const char *tagname, const char *arg)
{
if ((arg == 0) || (strlen(arg) == 0)) {
out->put_string(tagname);
diff --git a/src/devices/grohtml/html-text.h b/src/devices/grohtml/html-text.h
index ba23671e..aa4dd800 100644
--- a/src/devices/grohtml/html-text.h
+++ b/src/devices/grohtml/html-text.h
@@ -116,7 +116,7 @@ private:
char *shutdown (HTML_TAG t);
void check_emit_text (tag_definition *t);
int remove_break (void);
- void issue_tag (char *tagname, char *arg);
+ void issue_tag (const char *tagname, const char *arg);
void issue_color_begin (color *c);
void remove_def (tag_definition *t);
html_indent *remove_indent (HTML_TAG tag);
diff --git a/src/devices/grohtml/post-html.cpp b/src/devices/grohtml/post-html.cpp
index f403f324..bc942b27 100644
--- a/src/devices/grohtml/post-html.cpp
+++ b/src/devices/grohtml/post-html.cpp
@@ -410,7 +410,7 @@ public:
html_table *tab; // table description
private:
- text_glob (style *s, char *str, int length,
+ text_glob (style *s, const char *str, int length,
int min_vertical , int min_horizontal,
int max_vertical , int max_horizontal,
bool is_troff_command,
@@ -418,7 +418,7 @@ private:
bool is_a_line , int thickness);
};
-text_glob::text_glob (style *s, char *str, int length,
+text_glob::text_glob (style *s, const char *str, int length,
int min_vertical, int min_horizontal,
int max_vertical, int max_horizontal,
bool is_troff_command,
@@ -1562,7 +1562,7 @@ class html_printer : public printer {
void remove_tabs (void);
void remove_courier_tabs (void);
void update_min_max (colType type_of_col, int *minimum, int *maximum, text_glob *g);
- void add_table_end (char *);
+ void add_table_end (const char *);
// ADD HERE
public:
@@ -2693,7 +2693,7 @@ void html_printer::update_min_max (colType type_of_col, int *minimum, int *maxim
* debugging string.
*/
-void html_printer::add_table_end (char *
+void html_printer::add_table_end (const char *
#if defined(DEBUG_TABLES)
debug_string
#endif
diff --git a/src/devices/grolbp/charset.h b/src/devices/grolbp/charset.h
index adc76f42..a0cd057b 100644
--- a/src/devices/grolbp/charset.h
+++ b/src/devices/grolbp/charset.h
@@ -1,6 +1,6 @@
// Definition of the WP54 character set
-char symset[] = {
+unsigned char symset[] = {
0x57,0x50,0x35,0x34,0x00,0x41,0x76,0x61,0x6e,0x74,0x47,0x61,
0x72,0x64,0x65,0x2d,0x42,0x6f,0x6f,0x6b,0x00,0x41,0x76,
0x61,0x6e,0x74,0x47,0x61,0x72,0x64,0x65,0x2d,0x44,0x65,
diff --git a/src/devices/grolbp/lbp.h b/src/devices/grolbp/lbp.h
index 3b8a9410..e669ff2a 100644
--- a/src/devices/grolbp/lbp.h
+++ b/src/devices/grolbp/lbp.h
@@ -1,5 +1,5 @@
// -*- C -*-
-/* Copyright (C) 1994, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 2000, 2001, 2003 Free Software Foundation, Inc.
Written by Francisco Andrés Verdú <pandres@dragonet.es>
groff is free software; you can redistribute it and/or modify it under
@@ -52,7 +52,7 @@ lbpputs(const char *data)
};
static inline void
-lbpputc(char c)
+lbpputc(unsigned char c)
{
fputc(c,lbpoutput);
};
diff --git a/src/devices/grotty/tty.cpp b/src/devices/grotty/tty.cpp
index c44f627c..812ebf82 100644
--- a/src/devices/grotty/tty.cpp
+++ b/src/devices/grotty/tty.cpp
@@ -220,7 +220,7 @@ char *tty_printer::make_rgb_string(unsigned int r,
s[3] = char(g & 0xff);
s[4] = char(b >> 8);
s[5] = char(b & 0xff);
- s[6] = 0x80;
+ s[6] = char(0x80);
s[7] = 0;
// avoid null-bytes in string
for (int i = 0; i < 6; i++)
diff --git a/src/preproc/html/pre-html.cpp b/src/preproc/html/pre-html.cpp
index 38cb6075..8869136a 100644
--- a/src/preproc/html/pre-html.cpp
+++ b/src/preproc/html/pre-html.cpp
@@ -97,7 +97,7 @@ static char *psFileName = NULL; // name of postscript file
static char *psPageName = NULL; // name of file containing postscript current page
static char *regionFileName = NULL; // name of file containing all image regions
static char *imagePageName = NULL; // name of bitmap image containing current page
-static char *image_device = "pnmraw";
+static const char *image_device = "pnmraw";
static int image_res = DEFAULT_IMAGE_RES;
static int vertical_offset = 0;
static char *image_template = NULL; // image template filename
@@ -318,7 +318,7 @@ public:
void write_file_html(void);
void write_file_troff(void);
void write_upto_newline (char_block **t, int *i, int is_html);
- int can_see(char_block **t, int *i, char *string);
+ int can_see(char_block **t, int *i, const char *string);
int skip_spaces(char_block **t, int *i);
void skip_until_newline(char_block **t, int *i);
private:
@@ -383,7 +383,7 @@ int char_buffer::read_file (FILE *fp)
* writeNbytes - writes n bytes to stdout.
*/
-static void writeNbytes (char *s, int l)
+static void writeNbytes (const char *s, int l)
{
int n=0;
int r;
@@ -402,7 +402,7 @@ static void writeNbytes (char *s, int l)
* writeString - writes a string to stdout.
*/
-static void writeString (char *s)
+static void writeString (const char *s)
{
writeNbytes(s, strlen(s));
}
@@ -584,7 +584,7 @@ void char_buffer::write_upto_newline (char_block **t, int *i, int is_html)
* can_see - returns TRUE if we can see string in t->buffer[i] onwards
*/
-int char_buffer::can_see (char_block **t, int *i, char *string)
+int char_buffer::can_see (char_block **t, int *i, const char *string)
{
int j = 0;
int l = strlen(string);
diff --git a/src/preproc/html/pushback.cpp b/src/preproc/html/pushback.cpp
index d18c5e2e..07a15e36 100644
--- a/src/preproc/html/pushback.cpp
+++ b/src/preproc/html/pushback.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
Written by Gaius Mulley (gaius@glam.ac.uk).
This file is part of groff.
@@ -191,7 +191,7 @@ void pushBackBuffer::skipUntilToken (void)
* left alone.
*/
-int pushBackBuffer::isString (char *s)
+int pushBackBuffer::isString (const char *s)
{
int length=strlen(s);
int i=0;
diff --git a/src/preproc/html/pushback.h b/src/preproc/html/pushback.h
index 55b4b920..608bac53 100644
--- a/src/preproc/html/pushback.h
+++ b/src/preproc/html/pushback.h
@@ -48,7 +48,7 @@ class pushBackBuffer
float readNumber (void);
int readInt (void);
char *readString (void);
- int isString (char *string);
+ int isString (const char *string);
};
diff --git a/src/preproc/soelim/soelim.cpp b/src/preproc/soelim/soelim.cpp
index 006b04ae..a32d62e2 100644
--- a/src/preproc/soelim/soelim.cpp
+++ b/src/preproc/soelim/soelim.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989-1992, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1989-1992, 2000, 2001, 2003 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -30,7 +30,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "nonposix.h"
static size_t include_list_length;
-static char **include_list;
+static const char **include_list;
int compatible_flag = 0;
@@ -41,14 +41,14 @@ int do_file(const char *filename);
static void
-include_path_append(char *path)
+include_path_append(const char *path)
{
++include_list_length;
size_t nbytes = include_list_length * sizeof(char *);
if (include_list)
- include_list = (char **)realloc((void *)include_list, nbytes);
+ include_list = (const char **)realloc((void *)include_list, nbytes);
else
- include_list = (char **)malloc(nbytes);
+ include_list = (const char **)malloc(nbytes);
if (include_list == NULL)
{
fprintf(stderr, "%s: out of memory\n", program_name);
@@ -180,7 +180,7 @@ int do_file(const char *filename)
size_t j;
for (j = 0; j < include_list_length; ++j)
{
- char *path = include_list[j];
+ const char *path = include_list[j];
if (0 == strcmp(path, "."))
whole_filename = filename;
else
diff --git a/src/roff/troff/glyphuni.cpp b/src/roff/troff/glyphuni.cpp
index 8ce0a52c..7e242ce2 100644
--- a/src/roff/troff/glyphuni.cpp
+++ b/src/roff/troff/glyphuni.cpp
@@ -36,7 +36,7 @@ PTABLE(glyph_to_unicode) glyph_to_unicode_table;
struct {
const char *key;
- char *value;
+ const char *value;
} glyph_to_unicode_list[] = {
{ "!", "0021" },
{ "\"", "0022" },
@@ -491,7 +491,7 @@ glyph_to_unicode_init::glyph_to_unicode_init() {
i < sizeof(glyph_to_unicode_list)/sizeof(glyph_to_unicode_list[0]);
i++) {
glyph_to_unicode *gtu = new glyph_to_unicode[1];
- gtu->value = glyph_to_unicode_list[i].value;
+ gtu->value = (char *)glyph_to_unicode_list[i].value;
glyph_to_unicode_table.define(glyph_to_unicode_list[i].key, gtu);
}
}
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 877bd39e..55178a2c 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -6757,7 +6757,7 @@ static void process_macro_file(const char *mac)
process_input_stack();
}
-static void process_startup_file(char *filename)
+static void process_startup_file(const char *filename)
{
char *path;
search_path *orig_mac_path = mac_path;
diff --git a/src/roff/troff/uniglyph.cpp b/src/roff/troff/uniglyph.cpp
index 7122d03f..3428605c 100644
--- a/src/roff/troff/uniglyph.cpp
+++ b/src/roff/troff/uniglyph.cpp
@@ -36,7 +36,7 @@ PTABLE(unicode_to_glyph) unicode_to_glyph_table;
struct {
const char *key;
- char *value;
+ const char *value;
} unicode_to_glyph_list[] = {
{ "0021", "!" },
//{ "0022", "\"" },
@@ -491,7 +491,7 @@ unicode_to_glyph_init::unicode_to_glyph_init() {
i < sizeof(unicode_to_glyph_list)/sizeof(unicode_to_glyph_list[0]);
i++) {
unicode_to_glyph *utg = new unicode_to_glyph[1];
- utg->value = unicode_to_glyph_list[i].value;
+ utg->value = (char *)unicode_to_glyph_list[i].value;
unicode_to_glyph_table.define(unicode_to_glyph_list[i].key, utg);
}
}
diff --git a/src/roff/troff/uniuni.cpp b/src/roff/troff/uniuni.cpp
index d3a63146..3f4baa42 100644
--- a/src/roff/troff/uniuni.cpp
+++ b/src/roff/troff/uniuni.cpp
@@ -41,7 +41,7 @@ PTABLE(unicode_decompose) unicode_decompose_table;
struct {
const char *key;
- char *value;
+ const char *value;
} unicode_decompose_list[] = {
{ "00C0", "20041_0300" },
{ "00C1", "20041_0301" },
@@ -1982,7 +1982,7 @@ unicode_decompose_init::unicode_decompose_init() {
i < sizeof(unicode_decompose_list)/sizeof(unicode_decompose_list[0]);
i++) {
unicode_decompose *dec = new unicode_decompose[1];
- dec->value = unicode_decompose_list[i].value;
+ dec->value = (char *)unicode_decompose_list[i].value;
unicode_decompose_table.define(unicode_decompose_list[i].key, dec);
}
}