aboutsummaryrefslogtreecommitdiff
path: root/src/hyper
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-08-08 17:37:46 +0000
committerdos-reis <gdr@axiomatics.org>2010-08-08 17:37:46 +0000
commit13112984fd32d4684959a923497a9a476981283e (patch)
tree05c9b0a7efa76555aec9b49abf9203f4c1d462bf /src/hyper
parent45103d600768000e5c242fe478ff9468526bb8f6 (diff)
downloadopen-axiom-13112984fd32d4684959a923497a9a476981283e.tar.gz
* hyper/ex2ht.c (strPrefix): Be const-correct.
* hyper/htinp.c (get_graph_output): Likewise. (print_paste): Likewise. (print_graph_paste): Likewise. * hyper/initx.c (get_color): Likewise. * hyper/keyin.c (handle_key): Likewise. * hyper/lex.c (token_table): Likewise. * hyper/macro.c (number): Likewise. * hyper/mem.c (alloc_page): Likewise. * hyper/parse-aux.c (make_special_page): Likewise. (is_number): Likewise. * hyper/parse-types.c (errmess): Likewise. * lib/sockio-c.c (oa_socket_read): Cast to second argument to appropriate type. (oa_socket_read_byte): Likewise.
Diffstat (limited to 'src/hyper')
-rw-r--r--src/hyper/ex2ht.c2
-rw-r--r--src/hyper/htinp.c12
-rw-r--r--src/hyper/hyper.h4
-rw-r--r--src/hyper/initx.c4
-rw-r--r--src/hyper/keyin.c2
-rw-r--r--src/hyper/lex.c4
-rw-r--r--src/hyper/macro.c14
-rw-r--r--src/hyper/mem.c2
-rw-r--r--src/hyper/node.h2
-rw-r--r--src/hyper/parse-aux.c8
-rw-r--r--src/hyper/parse-types.c4
-rw-r--r--src/hyper/parse.h4
-rw-r--r--src/hyper/token.h4
13 files changed, 34 insertions, 32 deletions
diff --git a/src/hyper/ex2ht.c b/src/hyper/ex2ht.c
index 48556777..a109339a 100644
--- a/src/hyper/ex2ht.c
+++ b/src/hyper/ex2ht.c
@@ -164,7 +164,7 @@ emitFooter(FILE *outFile)
static char *
-strPrefix(char* prefix, char *s)
+strPrefix(const char* prefix, char *s)
{
while (*prefix != '\0' && *prefix == *s) {
prefix++;
diff --git a/src/hyper/htinp.c b/src/hyper/htinp.c
index c4a62bd5..b2065b8e 100644
--- a/src/hyper/htinp.c
+++ b/src/hyper/htinp.c
@@ -60,8 +60,8 @@ static char * make_paste_file_name(char * buf , char * filename);
static void make_the_input_file(UnloadedPage * page);
static void make_input_file_from_page(HyperDocPage * page);
static int inListAndNewer(char * inputFile , char * htFile);
-static void print_paste(FILE * pfile , char * realcom , char * command , char * pagename , int com_type);
-static void print_graph_paste(FILE * pfile , char * realcom , char * command , char * pagename , int com_type);
+static void print_paste(FILE*, char* , char*, const char*, int);
+static void print_graph_paste(FILE*, char*, char* , const char*, int);
static void send_command(char * command , int com_type);
#define MaxInputFiles 256
@@ -406,7 +406,7 @@ get_spad_output(FILE *pfile,char *command,int com_type)
* health of the viewport. We do this after the (|close|).
*/
void
-get_graph_output(char *command,char *pagename,int com_type)
+get_graph_output(char* command, const char* pagename, int com_type)
{
int n, i;
char buf[1024];
@@ -453,7 +453,8 @@ send_command(char *command,int com_type)
}
static void
-print_paste(FILE *pfile,char *realcom,char *command,char *pagename,int com_type)
+print_paste(FILE* pfile, char* realcom, char* command,
+ const char* pagename, int com_type)
{
fprintf(pfile, "\\begin{patch}{%sPatch%d}\n", pagename, example_number);
fprintf(pfile, "\\begin{paste}{%sFull%d}{%sEmpty%d}\n",
@@ -480,7 +481,8 @@ print_paste(FILE *pfile,char *realcom,char *command,char *pagename,int com_type)
fflush(pfile);
}
static void
-print_graph_paste(FILE *pfile,char *realcom,char *command,char *pagename,int com_type)
+print_graph_paste(FILE* pfile, char* realcom, char* command,
+ const char* pagename, int com_type)
{
fprintf(pfile, "\\begin{patch}{%sPatch%d}\n", pagename, example_number);
fprintf(pfile, "\\begin{paste}{%sFull%d}{%sEmpty%d}\n",
diff --git a/src/hyper/hyper.h b/src/hyper/hyper.h
index de108ea4..2abecbaf 100644
--- a/src/hyper/hyper.h
+++ b/src/hyper/hyper.h
@@ -74,7 +74,7 @@ extern IfNode * alloc_ifnode(void);
extern InputBox * alloc_inputbox(void);
extern LineStruct * alloc_inputline(int size);
extern TextNode * alloc_node(void);
-extern HyperDocPage * alloc_page(char * name);
+extern HyperDocPage * alloc_page(const char * name);
extern PasteNode * alloc_paste_node(char * name);
extern RadioBoxes * alloc_rbs(void);
extern void free_button_list(ButtonList * bl);
@@ -105,7 +105,7 @@ extern void verify_record(void );
extern char * strCopy(char * s);
extern void print_paste_line(FILE * pfile , char * str);
extern void get_spad_output(FILE * pfile , char * command , int com_type);
-extern void get_graph_output(char * command , char * pagename , int com_type);
+extern void get_graph_output(char*, const char*, int);
extern void add_buffer_to_sym(char * buffer , InputItem * sym);
extern void dialog(XEvent * event , KeySym keysym , char * buffer);
extern void draw_inputsymbol(InputItem * sym);
diff --git a/src/hyper/initx.c b/src/hyper/initx.c
index 45a9ff4d..c4d212dd 100644
--- a/src/hyper/initx.c
+++ b/src/hyper/initx.c
@@ -75,7 +75,7 @@ extern int gethostname(char *, int );
static void get_GCs(HDWindow * window);
static int get_border_properties(void);
-static int get_color(char * , char * , int, Colormap*);
+static int get_color(const char* , const char* , int, Colormap*);
static void ingItColors_and_fonts(void);
static void load_font(XFontStruct * * font_info , char * fontname);
static void mergeDatabases(void);
@@ -897,7 +897,7 @@ change_text(int color, XFontStruct *font)
*/
static int
-get_color(char *name, char *klass, int def, Colormap *map)
+get_color(const char *name, const char *klass, int def, Colormap *map)
{
char fullname[256];
char fullclass[256];
diff --git a/src/hyper/keyin.c b/src/hyper/keyin.c
index 9e0f35e8..b397d956 100644
--- a/src/hyper/keyin.c
+++ b/src/hyper/keyin.c
@@ -127,7 +127,7 @@ handle_key(XEvent *event)
XComposeStatus compstatus;
int charcount;
int display_again = 0;
- char *name;
+ const char *name;
char *filename;
/*char *head = "echo htadd -l ";*/
/*char *blank1 = " ";*/
diff --git a/src/hyper/lex.c b/src/hyper/lex.c
index 3f703f4e..1b828a08 100644
--- a/src/hyper/lex.c
+++ b/src/hyper/lex.c
@@ -114,7 +114,7 @@ char sock_buf[1024]; /* buffer for socket input */
static HashTable tokenHashTable; /* hash table of parser tokens */
-char* token_table[] = {
+const char* token_table[] = {
"", /* Dummy token name */
"word",
"page",
@@ -476,7 +476,7 @@ get_token(void)
last_token = 0;
token.type = unget_toke.type;
strcpy(buffer, unget_toke.id);
- free(unget_toke.id);
+ free((char*) unget_toke.id);
token.id = buffer + 1;
if (token.type == EOF)
return EOF;
diff --git a/src/hyper/macro.c b/src/hyper/macro.c
index cdabf8f8..596506c6 100644
--- a/src/hyper/macro.c
+++ b/src/hyper/macro.c
@@ -86,14 +86,14 @@ scan_HyperDoc(void)
}
int
-number(char *str)
+number(const char *str)
{
- char *t = str;
-
- while (*t)
- if (!isdigit(*t++))
- return 0;
- return 1;
+ const char *t = str;
+
+ while (*t)
+ if (!isdigit(*t++))
+ return 0;
+ return 1;
}
/* Parse a given macro given the pointer to the unlaoded macro ** */
diff --git a/src/hyper/mem.c b/src/hyper/mem.c
index 1617e21d..0aca518b 100644
--- a/src/hyper/mem.c
+++ b/src/hyper/mem.c
@@ -376,7 +376,7 @@ free_cond(CondNode *cond)
/* Allocate a new HyperDoc page */
HyperDocPage *
-alloc_page(char *name)
+alloc_page(const char *name)
{
HyperDocPage *page;
diff --git a/src/hyper/node.h b/src/hyper/node.h
index 43f4dc6b..38204487 100644
--- a/src/hyper/node.h
+++ b/src/hyper/node.h
@@ -255,7 +255,7 @@ typedef struct ButtonList {
typedef struct HyperDocPage {
short type; /* Normal, Quitbutton, Upbutton etc. */
- char *name; /* ID of page */
+ const char *name; /* ID of page */
char *filename; /* The name of the file in which the page
occurs, Null if not */
int scroll_off; /* The offset in the scrolling region */
diff --git a/src/hyper/parse-aux.c b/src/hyper/parse-aux.c
index 27556058..30957cce 100644
--- a/src/hyper/parse-aux.c
+++ b/src/hyper/parse-aux.c
@@ -43,7 +43,7 @@
#include "hyper.h"
static void read_ht_file(HashTable * page_hash , HashTable * macro_hash , HashTable * patch_hash , FILE * db_fp , char * db_file);
-static HyperDocPage * make_special_page(int type , char * name);
+static HyperDocPage * make_special_page(int type , const char * name);
extern int make_input_file;
extern int gverify_dates;
@@ -387,7 +387,7 @@ make_paste_window(PasteNode *paste)
/* create a HyperDoc page structure with the given type and name */
static HyperDocPage *
-make_special_page(int type, char *name)
+make_special_page(int type, const char *name)
{
HyperDocPage *page = alloc_page(name);
@@ -470,9 +470,9 @@ add_dependencies(void)
/* Returns true iff the TextNode contains a single integer */
int
-is_number(char * str)
+is_number(const char * str)
{
- char *s;
+ const char *s;
for (s = str; *s != '\0'; s++) {
if (!(isdigit(*s) || *s == '-'))
diff --git a/src/hyper/parse-types.c b/src/hyper/parse-types.c
index 67bbc252..9f0ddeaf 100644
--- a/src/hyper/parse-types.c
+++ b/src/hyper/parse-types.c
@@ -61,7 +61,7 @@ boolean gInItems = FALSE;
boolean gInOptional = FALSE;
-static char *errmess[] = {
+static const char* errmess[] = {
"place holder",
"parsing condition node",
"unrecognized keyword"
@@ -78,7 +78,7 @@ static char *errmess[] = {
*/
static void
-htperror(char *msg, int erno)
+htperror(const char* msg, int erno)
{
char obuff[256];
diff --git a/src/hyper/parse.h b/src/hyper/parse.h
index eaddd9bf..3c9b90bd 100644
--- a/src/hyper/parse.h
+++ b/src/hyper/parse.h
@@ -79,11 +79,11 @@ extern int window_equal(Window * w1 , Window * w2);
extern char * window_id(Window w);
extern void read_ht_db(HashTable * page_hash , HashTable * macro_hash , HashTable * patch_hash);
extern int get_filename(void);
-extern int is_number(char * str);
+extern int is_number(const char * str);
extern void parser_error(char * str);
extern int get_where(void);
extern void scan_HyperDoc(void);
-extern int number(char * str);
+extern int number(const char * str);
extern ParameterList init_parameter_elem(int number);
extern int push_parameters(ParameterList);
extern int pop_parameters(void);
diff --git a/src/hyper/token.h b/src/hyper/token.h
index e840ec42..c9bdf121 100644
--- a/src/hyper/token.h
+++ b/src/hyper/token.h
@@ -51,7 +51,7 @@
typedef struct Token {
int type; /* token type. One of those listed below */
- char *id; /* string value if type == Identifier */
+ const char *id; /* string value if type == Identifier */
} Token;
/*
@@ -239,7 +239,7 @@ typedef enum openaxiom_token_kind {
} openaxiom_token_kind;
-extern char *token_table[];
+extern const char *token_table[];
/* places from which input may be read */