diff options
-rw-r--r-- | src/ChangeLog | 7 | ||||
-rw-r--r-- | src/clef/Makefile.in | 6 | ||||
-rw-r--r-- | src/clef/edible.c | 8 | ||||
-rw-r--r-- | src/driver/utils.c | 23 | ||||
-rw-r--r-- | src/hyper/htadd.c | 1 | ||||
-rw-r--r-- | src/include/openpty.H1 | 8 | ||||
-rw-r--r-- | src/sman/Makefile.in | 2 | ||||
-rw-r--r-- | src/sman/sman.c | 38 | ||||
-rw-r--r-- | src/sman/sman.h | 2 |
9 files changed, 55 insertions, 40 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index eb9edaff..e2526f6d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,12 @@ 2010-07-29 Gabriel Dos Reis <gdr@cs.tamu.edu> + * clef/Makefile.in: Build and link programs by a C++ compiler. + * clef/edible.c: Make it acceptable to a C++ compiler. + * driver/utils.c: Likewise. + * sman/sman.c: Likewise. + +2010-07-29 Gabriel Dos Reis <gdr@cs.tamu.edu> + * lib/XSpadFill.c: Tidy. * lib/pixmap.c: Likewise. * lib/spadcolors.c: Likewise. diff --git a/src/clef/Makefile.in b/src/clef/Makefile.in index 764df763..a442fd10 100644 --- a/src/clef/Makefile.in +++ b/src/clef/Makefile.in @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2008, Gabriel Dos Reis. +# Copyright (C) 2007-2010, Gabriel Dos Reis. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -58,7 +58,7 @@ stamp: $(axiom_target_bindir)/clef$(EXEEXT) $(STAMP) stamp $(axiom_target_bindir)/clef$(EXEEXT): $(clef_objects) $(clef_DEPENDENCIES) - $(LINK) -o $@ $(clef_objects) $(clef_LDADD) ${LDF} + $(CXXLINK) -o $@ $(clef_objects) $(clef_LDADD) ${LDF} .SUFFIXES: .SUFFIXES: .c .lo .h @@ -68,7 +68,7 @@ $(axiom_target_bindir)/clef$(EXEEXT): $(clef_objects) $(clef_DEPENDENCIES) $(axiom_configdir)/openaxiom-c-macros.h %.lo: %.c $(axiom_c_macros_h) - $(COMPILE) -o $@ ${CCF} $(axiom_includes) $< + $(CXXCOMPILE) -o $@ ${CCF} $(axiom_includes) $< mostlyclean-local: @rm -f $(clef_objects) diff --git a/src/clef/edible.c b/src/clef/edible.c index baacf5fa..100f5a43 100644 --- a/src/clef/edible.c +++ b/src/clef/edible.c @@ -1,7 +1,7 @@ /* Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd. All rights reserved. - Copyright (C) 2007-2009, Gabriel Dos Reis. + Copyright (C) 2007-2010, Gabriel Dos Reis. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -135,7 +135,7 @@ main(int argc, char *argv[]) - putenv("LC_ALL=C"); + putenv((char*) "LC_ALL=C"); setlocale(LC_ALL, ""); /* try to get a pseudoterminal to play with */ if (ptyopen(&contNum, &serverNum, serverPath) == -1) { @@ -280,11 +280,11 @@ main(int argc, char *argv[]) } #endif - code = select(FD_SETSIZE,(void *) &rfds, NULL, NULL, NULL); + code = select(FD_SETSIZE, &rfds, NULL, NULL, NULL); for(; code < 0 ;) { if(errno == EINTR) { check_flip(); - code = select(FD_SETSIZE,(void *) &rfds, NULL, NULL, NULL); + code = select(FD_SETSIZE, &rfds, NULL, NULL, NULL); } else { perror("clef select failure"); diff --git a/src/driver/utils.c b/src/driver/utils.c index d60d4dd6..0936705f 100644 --- a/src/driver/utils.c +++ b/src/driver/utils.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2008-2009, Gabriel Dos Reis. + Copyright (C) 2008-2010, Gabriel Dos Reis. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -135,19 +135,20 @@ openaxiom_build_rts_options(openaxiom_command* command, command->rt_argc = 3; command->rt_argv = (char **) malloc(command->rt_argc * sizeof (char*)); - command->rt_argv[0] = "-batch"; - command->rt_argv[1] = "-eval"; - command->rt_argv[2] = "(" OPENAXIOM_LISP_CORE_ENTRY_POINT ")"; + command->rt_argv[0] = (char*) "-batch"; + command->rt_argv[1] = (char*) "-eval"; + command->rt_argv[2] = + (char*) ("(" OPENAXIOM_LISP_CORE_ENTRY_POINT ")"); break; case openaxiom_sbcl_runtime: command->rt_argc = 4; command->rt_argv = (char **) malloc(command->rt_argc * sizeof (char*)); - command->rt_argv[0] = "--noinform"; - command->rt_argv[1] = "--end-runtime-options"; - command->rt_argv[2] = "--noprint"; - command->rt_argv[3] = "--end-toplevel-options"; + command->rt_argv[0] = (char*) "--noinform"; + command->rt_argv[1] = (char*) "--end-runtime-options"; + command->rt_argv[2] = (char*) "--noprint"; + command->rt_argv[3] = (char*) "--end-toplevel-options"; break; default: @@ -288,7 +289,7 @@ openaxiom_preprocess_arguments(openaxiom_command* command, command->core.argv = (char**) malloc((other + 2) * sizeof(char*)); command->core.argv[0] = argv[0]; - command->core.argv[1] = "--script"; + command->core.argv[1] = (char*) "--script"; for (i = 0; i < other; ++i) command->core.argv[2 + i] = argv[1 + i]; driver = openaxiom_script_driver; @@ -390,7 +391,7 @@ openaxiom_execute_core(const openaxiom_command* command, /* GCL has this oddity that it wants to believe that argv[0] has something to tell about what GCL's own runtime is. Silly. */ if (OPENAXIOM_BASE_RTS == openaxiom_gcl_runtime) - args[0] = ""; + args[0] = (char*) ""; /* And CLISP wants to believe that argv[0] is where it hides stuff from the saved image. */ else if (OPENAXIOM_BASE_RTS == openaxiom_clisp_runtime) @@ -407,7 +408,7 @@ openaxiom_execute_core(const openaxiom_command* command, differentiate this from the base runtime system arguments. We do this by inserting a doubledash to indicate beginning of arguments. */ - args[command->rt_argc + 1] = "--"; + args[command->rt_argc + 1] = (char*) "--"; /* Then, copy over the arguments received from the command line. */ for (i = 1; i < command->core.argc; ++i) args[command->rt_argc + i + 1] = command->core.argv[i]; diff --git a/src/hyper/htadd.c b/src/hyper/htadd.c index 2363c140..b4dc6121 100644 --- a/src/hyper/htadd.c +++ b/src/hyper/htadd.c @@ -36,7 +36,6 @@ /* HyperDoc database file manager */ -#define _HTADD_C #include "openaxiom-c-macros.h" #include <errno.h> diff --git a/src/include/openpty.H1 b/src/include/openpty.H1 index 95f9192b..e0658fc5 100644 --- a/src/include/openpty.H1 +++ b/src/include/openpty.H1 @@ -1 +1,9 @@ +#ifdef __cplusplus +extern "C" { +#endif + extern int ptyopen(int*, int*, char*); + +#ifdef __cplusplus +} +#endif diff --git a/src/sman/Makefile.in b/src/sman/Makefile.in index 2d01a620..261f40ac 100644 --- a/src/sman/Makefile.in +++ b/src/sman/Makefile.in @@ -81,7 +81,7 @@ stamp: $(OUTLIB)/session$(EXEEXT) \ .PRECIOUS: %.lo %.obj %.lo: %.c - $(COMPILE) ${CCF} -o $@ $(axiom_includes) -I$(srcdir) \ + $(CXXCOMPILE) ${CCF} -o $@ $(axiom_includes) -I$(srcdir) \ -I$(top_srcdir)/src/driver $< ${OUTLIB}/session$(EXEEXT): $(session_objects) $(session_DEPENDENCIES) diff --git a/src/sman/sman.c b/src/sman/sman.c index 948a748a..3a7093d0 100644 --- a/src/sman/sman.c +++ b/src/sman/sman.c @@ -1,7 +1,7 @@ /* Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. All rights reserved. - Copyright (C) 2007-2009, Gabriel Dos Reis. + Copyright (C) 2007-2010, Gabriel Dos Reis. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -65,12 +65,12 @@ static void death_handler(int); static void sman_catch_signals(void); static void fix_env(int); static void init_term_io(void); -static char* strPrefix(char* , char*); -static void check_spad_proc(char* , char*); +static const char* strPrefix(const char* , const char*); +static void check_spad_proc(const char* , const char*); static void clean_up_old_sockets(void); static SpadProcess* fork_you(int); -static void exec_command_env(char*); -static SpadProcess* spawn_of_hell(char* , int); +static void exec_command_env(const char*); +static SpadProcess* spawn_of_hell(const char* , int); static void start_the_spadclient(void); static void start_the_local_spadclient(void); static void start_the_session_manager(void); @@ -104,12 +104,12 @@ int server_num; /* OpenAxiom server number */ /* definitions of programs which sman can start */ /************************************************/ -char *GraphicsProgram = "$AXIOM/lib/viewman"; -char *HypertexProgram = "$AXIOM/lib/hypertex -s"; -char *ClefProgram = +const char *GraphicsProgram = "$AXIOM/lib/viewman"; +const char *HypertexProgram = "$AXIOM/lib/hypertex -s"; +const char *ClefProgram = "$AXIOM/bin/clef -f $AXIOM/lib/command.list -e "; -char *SessionManagerProgram = "$AXIOM/lib/session"; -char *SpadClientProgram = "$AXIOM/lib/spadclient"; +const char *SessionManagerProgram = "$AXIOM/lib/session"; +const char *SpadClientProgram = "$AXIOM/lib/spadclient"; char *PasteFile = NULL; char *MakeRecordFile = NULL; char *VerifyRecordFile = NULL; @@ -319,8 +319,8 @@ init_term_io(void) _EOL = oldbuf.c_cc[VEOL]; } -static char * -strPrefix(char *prefix,char * s) +static const char* +strPrefix(const char* prefix, const char* s) { while (*prefix != '\0' && *prefix == *s) { prefix++; @@ -331,9 +331,9 @@ strPrefix(char *prefix,char * s) } static void -check_spad_proc(char *file, char *prefix) +check_spad_proc(const char *file, const char *prefix) { - char *num; + const char *num; int pid; if ((num = strPrefix(prefix, file))) { pid = atoi(num); @@ -392,7 +392,7 @@ fork_you(int death_action) } static void -exec_command_env(char *command) +exec_command_env(const char *command) { char new_command[512]; sprintf(new_command, "exec %s", command); @@ -400,7 +400,7 @@ exec_command_env(char *command) } static SpadProcess * -spawn_of_hell(char *command, int death_action) +spawn_of_hell(const char *command, int death_action) { SpadProcess *proc = fork_you(death_action); if (proc != NULL) { @@ -529,8 +529,8 @@ fork_Axiom(openaxiom_command* cmd) /* Tell the Core that it is being invoked in server mode. */ oa_allocate_process_argv(&cmd->core, 2); cmd->core.argv[0] = - openaxiom_make_path_for(cmd->root_dir, openaxiom_core_driver); - cmd->core.argv[1] = "--role=server"; + (char*) openaxiom_make_path_for(cmd->root_dir, openaxiom_core_driver); + cmd->core.argv[1] = (char*) "--role=server"; openaxiom_execute_core(cmd, openaxiom_core_driver); } } @@ -762,7 +762,7 @@ main(int argc, char *argv[]) command.root_dir = openaxiom_get_systemdir(argc, argv); process_options(&command, argc, argv); - putenv("LC_ALL=C"); + putenv((char*) "LC_ALL=C"); setlocale(LC_ALL, ""); bsdSignal(SIGINT, SIG_IGN,RestartSystemCalls); init_term_io(); diff --git a/src/sman/sman.h b/src/sman/sman.h index 262b62d9..4303e080 100644 --- a/src/sman/sman.h +++ b/src/sman/sman.h @@ -48,7 +48,7 @@ typedef struct spad_proc { int proc_id; /* process id of child */ int death_action; /* one of the above constants */ - char *command; /* sh command line to restart the process */ + const char* command; /* sh command line to restart the process */ struct spad_proc *next; } SpadProcess; |