diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2009-06-09 21:02:58 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2009-06-09 21:02:58 +0000 |
commit | ff2c5bd7ed9f9da59e349c3f5eb7577b430b3b6a (patch) | |
tree | 8f3df2a8d4f02b5bfeb1f6bfb903cd30e665c717 | |
parent | 6e6848f7471a0f11e90181f2b939855ad26894c9 (diff) | |
download | ATCD-ff2c5bd7ed9f9da59e349c3f5eb7577b430b3b6a.tar.gz |
Tue Jun 9 21:01:30 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 16 | ||||
-rw-r--r-- | TAO/TAO_IDL/contrib/mcpp/directive.cpp | 4 | ||||
-rw-r--r-- | TAO/TAO_IDL/contrib/mcpp/eval.cpp | 4 | ||||
-rw-r--r-- | TAO/TAO_IDL/contrib/mcpp/expand.cpp | 29 | ||||
-rw-r--r-- | TAO/TAO_IDL/contrib/mcpp/internal.H | 2 | ||||
-rw-r--r-- | TAO/TAO_IDL/contrib/mcpp/main.cpp | 14 | ||||
-rw-r--r-- | TAO/TAO_IDL/contrib/mcpp/mbchar.cpp | 4 | ||||
-rw-r--r-- | TAO/TAO_IDL/contrib/mcpp/mcpp.mpc | 4 | ||||
-rw-r--r-- | TAO/TAO_IDL/contrib/mcpp/noconfig.H | 4 | ||||
-rw-r--r-- | TAO/TAO_IDL/contrib/mcpp/support.cpp | 10 | ||||
-rw-r--r-- | TAO/TAO_IDL/contrib/mcpp/system.H | 3 | ||||
-rw-r--r-- | TAO/TAO_IDL/contrib/mcpp/system.cpp | 14 |
12 files changed, 69 insertions, 39 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 9c6017a0312..40c5d341467 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,19 @@ +Tue Jun 9 21:01:30 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * TAO_IDL/contrib/mcpp/directive.cpp: + * TAO_IDL/contrib/mcpp/eval.cpp: + * TAO_IDL/contrib/mcpp/expand.cpp: + * TAO_IDL/contrib/mcpp/internal.H: + * TAO_IDL/contrib/mcpp/main.cpp: + * TAO_IDL/contrib/mcpp/mbchar.cpp: + * TAO_IDL/contrib/mcpp/mcpp.mpc: + * TAO_IDL/contrib/mcpp/noconfig.H: + * TAO_IDL/contrib/mcpp/support.cpp: + * TAO_IDL/contrib/mcpp/system.H: + * TAO_IDL/contrib/mcpp/system.cpp: + + Compile warning fixes. + Tue Jun 9 20:25:50 UTC 2009 Adam Mitz <mitza@ociweb.com> * bin/tao_orb_tests.lst: diff --git a/TAO/TAO_IDL/contrib/mcpp/directive.cpp b/TAO/TAO_IDL/contrib/mcpp/directive.cpp index 3c1ba0e321a..028247e1582 100644 --- a/TAO/TAO_IDL/contrib/mcpp/directive.cpp +++ b/TAO/TAO_IDL/contrib/mcpp/directive.cpp @@ -110,7 +110,7 @@ void directive( void) int token_type; int hash; int c; - char * tp; + const char * tp; in_directive = TRUE; if (keep_comments) { @@ -700,7 +700,7 @@ DEFBUF * do_define( int redefined; /* TRUE if redefined */ int dnargs = 0; /* defp->nargs */ int cmp; /* Result of name comparison */ - size_t def_start, def_end; /* Column of macro definition */ + size_t def_start = 0, def_end = 0; /* Column of macro definition */ repl_base = repl_list; repl_end = & repl_list[ NMACWORK]; diff --git a/TAO/TAO_IDL/contrib/mcpp/eval.cpp b/TAO/TAO_IDL/contrib/mcpp/eval.cpp index 196d4be8cca..1ece434f222 100644 --- a/TAO/TAO_IDL/contrib/mcpp/eval.cpp +++ b/TAO/TAO_IDL/contrib/mcpp/eval.cpp @@ -212,7 +212,7 @@ typedef struct sizes { typedef struct types { int type; /* This is the bits for types */ - char * token_name; /* this is the token word */ + const char * token_name; /* this is the token word */ int excluded; /* but these aren't legal here. */ } TYPES; @@ -1218,7 +1218,7 @@ static expr_t eval_one( if (uc1 == 'u' || uc1 == 'U') { if ((count < 4 && uc1 == 'u') || (count < 8 && uc1 == 'U')) goto undefined; - if ((value >= 0L && value <= 0x9FL + if ((value <= 0x9FL && value != 0x24L && value != 0x40L && value != 0x60L) || (!stdc3 && value >= 0xD800L && value <= 0xDFFFL)) { if (!skip) diff --git a/TAO/TAO_IDL/contrib/mcpp/expand.cpp b/TAO/TAO_IDL/contrib/mcpp/expand.cpp index 71fb66dd8d0..cf8008bb9da 100644 --- a/TAO/TAO_IDL/contrib/mcpp/expand.cpp +++ b/TAO/TAO_IDL/contrib/mcpp/expand.cpp @@ -401,7 +401,7 @@ static int print_macro_inf( * Enabled by '#pragma MCPP debug macro_call' or -K option in STD mode. */ { - MACRO_INF * m_inf; + MACRO_INF * m_inf = 0; int num; int num_args; /* Number of actual args (maybe less than expected) */ int i; @@ -502,7 +502,7 @@ static char * chk_magic_balance( char arg_id[ MAX_NEST_MAGICS][ ARG_E_LEN_V - 2]; char * mac_loc[ MAX_NEST_MAGICS]; char * arg_loc[ MAX_NEST_MAGICS]; - char * mesg = "%s %ld %s-closing-comment(s) in tracing macro"; + const char * mesg = "%s %ld %s-closing-comment(s) in tracing macro"; int mac, arg; int mac_s_n, mac_e_n, arg_s_n, arg_e_n; char * buf_p = buf; /* Save 'buf' for debugging purpose */ @@ -665,7 +665,7 @@ static char * replace( /* Number of actual arguments (maybe less than expected) */ int enable_trace_macro; /* To exclude _Pragma() pseudo macro */ int m_num = 0; /* 'mac_num' of current macro */ - MACRO_INF * m_inf; /* Pointer into mac_inf[] */ + MACRO_INF * m_inf = 0; /* Pointer into mac_inf[] */ if (mcpp_debug & EXPAND) { dump_a_def( "replace entry", defp, FALSE, TRUE, fp_debug); @@ -1253,7 +1253,7 @@ static const char * remove_magics( char ** arg_loc; char * mgc_index; size_t max_magics; - int mac_n, arg_n, ind, n; + unsigned int mac_n, arg_n, ind, n; char * first = 0; char * last = 0; char * token; @@ -1289,7 +1289,8 @@ static const char * remove_magics( /* Read stacked arg_p and write it to arg_p as a dummy buffer */ while ((*ap++ = c = get_ch()) != RT_END && file == infile) { if (c == MAC_INF) { - if (mac_n >= max_magics || arg_n >= max_magics * 2) { + if (mac_n >= max_magics || + arg_n >= max_magics * 2) { max_magics *= 2; mac_id = (char (*)[ MAC_S_LEN]) xrealloc( reinterpret_cast<char *> (mac_id), MAC_S_LEN * max_magics); arg_id = (char (*)[ ARG_S_LEN]) xrealloc( reinterpret_cast<char *> (arg_id), ARG_S_LEN * max_magics * 2); @@ -1373,8 +1374,8 @@ static const char * remove_magics( /* Remove pair of magics surrounding the last (or first) token */ if (mac_n) { /* Remove pair of macro magics surrounding the token */ - int magic, mac_s, mac_e; - int nest_s, nest_e; + unsigned int magic, mac_s, mac_e; + unsigned int nest_s, nest_e; nest_s = 0; for (mac_s = 0; mac_loc[ mac_s] < token; mac_s++) { @@ -1412,8 +1413,8 @@ static const char * remove_magics( } if (arg_n) { /* Remove pair of arg magics surrounding the token */ - int magic, arg_s, arg_e; - int nest_s, nest_e; + unsigned int magic, arg_s, arg_e; + unsigned int nest_s, nest_e; nest_s = 0; for (arg_s = 0; arg_loc[ arg_s] < token; arg_s++) { @@ -1454,9 +1455,9 @@ static const char * remove_magics( mac_n = arg_n = n = 0; while ((*tp++ = c = get_ch()) != RT_END && file == infile) { - char ** loc_tab; - int num, mark, rm, magic; - size_t len; + char ** loc_tab = 0; + int num = 0, mark = 0, rm = 0, magic = 0; + size_t len = 0; if (c != MAC_INF) { scan_token( c, (--tp, &tp), ep); @@ -1834,7 +1835,7 @@ static char * substitute( char * tp = 0; /* Temporary pointer into buffer*/ char * out_p = out; /* Current output pointer */ FILEINFO * file; /* Input sequences stacked on a "file" */ - DEFBUF * inner; /* Inner macro to replace */ + DEFBUF * inner = 0; /* Inner macro to replace */ int c; /* First character of token */ int token_type; char * mac_arg_start = 0; @@ -2416,7 +2417,7 @@ static char * substitute( int nargs = 0; /* Number of collected args */ int var_arg = defp->nargs & VA_ARGS; /* Variable args */ int more_to_come = FALSE; /* Next argument is expected*/ - LOCATION * locs; /* Location of args in source file */ + LOCATION * locs = 0; /* Location of args in source file */ LOCATION * loc; /* Current locs */ MAGIC_SEQ mgc_prefix; /* MAC_INF seqs and spaces preceding an arg */ int c; diff --git a/TAO/TAO_IDL/contrib/mcpp/internal.H b/TAO/TAO_IDL/contrib/mcpp/internal.H index 85763d1e572..52757f08a02 100644 --- a/TAO/TAO_IDL/contrib/mcpp/internal.H +++ b/TAO/TAO_IDL/contrib/mcpp/internal.H @@ -438,7 +438,7 @@ extern DEFBUF * is_macro( char ** cp); /* mbchar.c */ extern size_t (* mb_read)( int c1, char ** in_pp, char ** out_pp); /* Read mbchar sequence */ -extern const char * set_encoding( char * name, char * env, int pragma); +extern const char * set_encoding( const char * name, const char * env, int pragma); /* Multi-byte char encoding */ extern void mb_init( void); /* Initialize mbchar variables */ diff --git a/TAO/TAO_IDL/contrib/mcpp/main.cpp b/TAO/TAO_IDL/contrib/mcpp/main.cpp index 1745346270e..c87eb156de8 100644 --- a/TAO/TAO_IDL/contrib/mcpp/main.cpp +++ b/TAO/TAO_IDL/contrib/mcpp/main.cpp @@ -66,7 +66,8 @@ * are used instead of -a. */ FALSE, /* lang_asm: -a (assembler source) */ - FALSE /* no_source_line: -j (no source line in diag) */ + FALSE, /* no_source_line: -j (no source line in diag) */ + FALSE /* dollar_in_name */ }; int mcpp_mode = STD; /* Mode of preprocessing */ @@ -230,6 +231,11 @@ NBUFF, /* Least maximum of string length */ IDMAX, /* Least maximum of identifier length */ NMACPARS, /* Least maximum of number of macro params */ + EXP_NEST_CPLUS_MIN, + BLK_NEST_CPLUS_MIN, + INCLUDE_NEST_CPLUS_MIN, + NMACRO_CPLUS_MIN, + LINE_CPLUS_LIMIT }; /* @@ -337,9 +343,9 @@ int main char ** argv ) { - char * in_file = 0; - char * out_file = 0; - char * stdin_name = "<stdin>"; + char * in_file = 0; + char * out_file = 0; + char * stdin_name = "<stdin>"; if (setjmp( error_exit) == -1) { errors++; diff --git a/TAO/TAO_IDL/contrib/mcpp/mbchar.cpp b/TAO/TAO_IDL/contrib/mcpp/mbchar.cpp index 7aee95471fe..6aeb1579a01 100644 --- a/TAO/TAO_IDL/contrib/mcpp/mbchar.cpp +++ b/TAO/TAO_IDL/contrib/mcpp/mbchar.cpp @@ -351,8 +351,8 @@ static size_t mb_read_utf8( int c1, char ** in_pp, char ** out_pp); const char * set_encoding( - char * name, /* Name of encoding specified */ - char * env, /* Name of environment variable */ + const char * name, /* Name of encoding specified */ + const char * env, /* Name of environment variable */ int pragma /* 2: #pragma setlocale, 1: #pragma __setlocale, 0: not #pragma */ ) diff --git a/TAO/TAO_IDL/contrib/mcpp/mcpp.mpc b/TAO/TAO_IDL/contrib/mcpp/mcpp.mpc index c78676ad575..25020fbda2a 100644 --- a/TAO/TAO_IDL/contrib/mcpp/mcpp.mpc +++ b/TAO/TAO_IDL/contrib/mcpp/mcpp.mpc @@ -21,8 +21,8 @@ project(tao_mcpp_exe) : aceexe, install, tao_output, crosscompile { project(TAO_IDL_MCPP) : acelib, conv_lib, tao_output, crosscompile { requires += mcpp - macros += MCPP_LIB - dynamicflags += MCPP_LIB_BUILD_DLL MCPP_LIB=1 + macros += MCPP_LIB=1 + dynamicflags += MCPP_LIB_BUILD_DLL Header_Files { *.h diff --git a/TAO/TAO_IDL/contrib/mcpp/noconfig.H b/TAO/TAO_IDL/contrib/mcpp/noconfig.H index 071ef618db3..0eff7d8c254 100644 --- a/TAO/TAO_IDL/contrib/mcpp/noconfig.H +++ b/TAO/TAO_IDL/contrib/mcpp/noconfig.H @@ -6,6 +6,8 @@ * must edit this file here and there. */ +#include "ace/Basic_Types.h" + #define TRUE 1 #define FALSE 0 @@ -14,8 +16,6 @@ * 'Host' means the O.S. and the compiler with which cpp is compiled. */ -#include "ace/config.h" - #ifdef ACE_WIN32 #define SYSTEM SYS_WIN #else diff --git a/TAO/TAO_IDL/contrib/mcpp/support.cpp b/TAO/TAO_IDL/contrib/mcpp/support.cpp index 7ec709482e9..f3b34fa0083 100644 --- a/TAO/TAO_IDL/contrib/mcpp/support.cpp +++ b/TAO/TAO_IDL/contrib/mcpp/support.cpp @@ -1,4 +1,4 @@ -h/*- $Id$ +/*- $Id$ * Copyright (c) 1998, 2002-2008 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> * All rights reserved. * @@ -72,6 +72,7 @@ h/*- $Id$ #if PREPROCESSED #include "mcpp.H" +#error "Unsupportred configuration" #else #include "system.H" #include "internal.H" @@ -180,6 +181,9 @@ int using_mem_buffers( void) } #define BUF_INCR_SIZE (NWORK * 2) +#ifdef MAX +#undef MAX +#endif #define MAX( a, b) (((a) > (b)) ? (a) : (b)) static char * append_to_buffer( @@ -1651,7 +1655,7 @@ static char * parse_line( void) char * limit; /* Buffer end */ char * tp; /* Current pointer into temporary buffer */ char * sp; /* Pointer into input buffer */ - size_t com_size; + size_t com_size = 0; int c; if ((sp = get_line( FALSE)) == 0) /* Next logical line */ @@ -1815,7 +1819,7 @@ static char * read_a_comment( */ { int c; - char * saved_sp; + char * saved_sp = 0; int cat_line = 0; /* Number of catenated lines */ if (keep_spaces) { diff --git a/TAO/TAO_IDL/contrib/mcpp/system.H b/TAO/TAO_IDL/contrib/mcpp/system.H index b65ec375936..188bc47c024 100644 --- a/TAO/TAO_IDL/contrib/mcpp/system.H +++ b/TAO/TAO_IDL/contrib/mcpp/system.H @@ -359,6 +359,9 @@ typedef long expr_t; #define BLK_NEST_CPLUS_MIN 0x100 #define INCLUDE_NEST_CPLUS_MIN 0x100 #define NMACRO_CPLUS_MIN 0x10000 +#define LINE90LIMIT 32767 +#define LINE_CPLUS_LIMIT 32767 + /* LINE99LIMIT means the line number limit of C99 */ #define LINE99LIMIT 0x7FFFFFFF diff --git a/TAO/TAO_IDL/contrib/mcpp/system.cpp b/TAO/TAO_IDL/contrib/mcpp/system.cpp index 583ee0bdaaa..4b08cae98e9 100644 --- a/TAO/TAO_IDL/contrib/mcpp/system.cpp +++ b/TAO/TAO_IDL/contrib/mcpp/system.cpp @@ -1826,6 +1826,9 @@ static void init_cpu_macro ( * GCC-specific-build defines these macro by init_gcc_macro(). */ { + ACE_UNUSED_ARG (gval); + ACE_UNUSED_ARG (sse); + const char * cpu_macro[][ 7] = { #if SYS_FAMILY == SYS_UNIX { "__i386__" @@ -1980,9 +1983,6 @@ static void init_std_defines( void) } } -#define LINE90LIMIT 32767 -#define LINE_CPLUS_LIMIT 32767 - static void set_limit( void) /* * Set the minimum translation limits specified by the Standards. @@ -2027,7 +2027,7 @@ static void set_pragma_op( void) * macro. */ { - char * name = "_Pragma"; + const char * name = "_Pragma"; char tmp[ 16]; ACE_OS::sprintf( tmp, "%c%s ( %c%c )", DEF_MAGIC, name, MAC_PARM, 1); @@ -2474,7 +2474,7 @@ static char * norm_path( } if (fname) ACE_OS::strcat( slbuf1, fname); - if (stat( slbuf1, & st_buf) != 0 /* Non-existent */ + if (ACE_OS::stat( slbuf1, & st_buf) != 0 /* Non-existent */ || (! fname && ! S_ISDIR( st_buf.st_mode)) /* Not a directory though 'fname' is not specified */ || (fname && ! S_ISREG( st_buf.st_mode))) @@ -2879,7 +2879,7 @@ void put_depend( static char * output = 0; /* File names */ static size_t * pos = 0; /* Offset to filenames */ - static int pos_num; /* Index of pos[] */ + static unsigned int pos_num; /* Index of pos[] */ static char * out_p; /* Pointer to output[] */ static size_t mkdep_len; /* Size of output[] */ static size_t pos_max; /* Size of pos[] */ @@ -4668,7 +4668,7 @@ void do_pragma( void) { 0, 0 }, }; struct Debug_arg *argp; - int num; + int num = 0; int c; c = skip_ws(); |