From 5f8a647bcabed9fa873dd266735c3e58e9fd3c27 Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Mon, 27 Apr 2015 15:28:53 +0200 Subject: [PATCH] Removed keyword 'register' from files. This keyword is deprecated and will break compilation with CLANG. --- include/xbt/str.h | 14 +- src/simdag/dax_dtd.c | 166 +++++++++---------- src/smpi/colls/reduce-rab.c | 22 +-- src/surf/simgrid_dtd.c | 210 ++++++++++++------------- src/xbt/automaton/automaton_lexer.yy.c | 134 ++++++++-------- src/xbt/dict.c | 12 +- src/xbt/graphxml.c | 160 +++++++++---------- src/xbt/mmalloc/mfree.c | 12 +- src/xbt/mmalloc/mmalloc.c | 8 +- src/xbt/snprintf.c | 8 +- 10 files changed, 373 insertions(+), 373 deletions(-) diff --git a/include/xbt/str.h b/include/xbt/str.h index be647e8a0c..bd4f575272 100644 --- a/include/xbt/str.h +++ b/include/xbt/str.h @@ -68,14 +68,14 @@ static XBT_INLINE unsigned int xbt_str_hash_ext(const char *str, int str_len) #ifdef DJB2_HASH_FUNCTION /* fast implementation of djb2 algorithm */ int c; - register unsigned int hash = 5381; + unsigned int hash = 5381; while (str_len--) { c = *str++; hash = ((hash << 5) + hash) + c; /* hash * 33 + c */ } # elif defined(FNV_HASH_FUNCTION) - register unsigned int hash = 0x811c9dc5; + unsigned int hash = 0x811c9dc5; unsigned char *bp = (unsigned char *) str; /* start of buffer */ unsigned char *be = bp + str_len; /* beyond end of buffer */ @@ -90,7 +90,7 @@ static XBT_INLINE unsigned int xbt_str_hash_ext(const char *str, int str_len) } # else - register unsigned int hash = 0; + unsigned int hash = 0; while (str_len--) { hash += (*str) * (*str); @@ -109,14 +109,14 @@ static XBT_INLINE unsigned int xbt_str_hash(const char *str) #ifdef DJB2_HASH_FUNCTION /* fast implementation of djb2 algorithm */ int c; - register unsigned int hash = 5381; + unsigned int hash = 5381; while ((c = *str++)) { hash = ((hash << 5) + hash) + c; /* hash * 33 + c */ } # elif defined(FNV_HASH_FUNCTION) - register unsigned int hash = 0x811c9dc5; + unsigned int hash = 0x811c9dc5; while (*str) { /* multiply by the 32 bit FNV magic prime mod 2^32 */ @@ -129,7 +129,7 @@ static XBT_INLINE unsigned int xbt_str_hash(const char *str) } # else - register unsigned int hash = 0; + unsigned int hash = 0; while (*str) { hash += (*str) * (*str); @@ -138,7 +138,7 @@ static XBT_INLINE unsigned int xbt_str_hash(const char *str) #endif return hash; } - + /**@}*/ SG_END_DECL() diff --git a/src/simdag/dax_dtd.c b/src/simdag/dax_dtd.c index 24afd327d4..be3fcb8a51 100644 --- a/src/simdag/dax_dtd.c +++ b/src/simdag/dax_dtd.c @@ -52,7 +52,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -69,7 +69,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -195,7 +195,7 @@ extern FILE *dax_in, *dax_out; /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE dax_lex. + * existing scanners that call yyless() from OUTSIDE dax_lex. * One obvious solution it to make yy_act a global. I tried that, and saw * a 5% performance hit in a non-dax_lineno scanner, because yy_act is * normally declared as a register variable-- so it is not worth it. @@ -214,7 +214,7 @@ extern FILE *dax_in, *dax_out; if ( *p == '\n' )\ --dax_lineno;\ }while(0) - + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -271,7 +271,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -1239,13 +1239,13 @@ static yyconst flex_int16_t yy_chk[2224] = /* Table of booleans, true if rule could match eol. */ static yyconst flex_int32_t yy_rule_can_match_eol[141] = { 0, -0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, - 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, +0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, + 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, + 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, }; static yy_state_type yy_last_accepting_state; @@ -1268,13 +1268,13 @@ char *dax_text; * FleXML is Copyright (C) 1999-2005 Kristoffer Rose. All rights reserved. * FleXML is Copyright (C) 2003-2013 Martin Quinson. All rights reserved. * (1.9.6). - * + * * There are two, intertwined parts to this program, part A and part B. * * Part A * ------ - * - * Some parts, here collectively called "Part A", are found in the + * + * Some parts, here collectively called "Part A", are found in the * FleXML package. They are Copyright (C) 1999-2005 Kristoffer Rose * and Copyright (C) 2003-2013 Martin Quinson. All rights reserved. * @@ -1292,20 +1292,20 @@ char *dax_text; * Notice that these are explicit rights granted to you for files * generated by the FleXML system. For your rights in connection with * the FleXML system itself please consult the GNU General Public License. - * + * * Part B * ------ - * - * The other parts, here collectively called "Part B", and which came - * from the DTD used by FleXML to generate this program, can be + * + * The other parts, here collectively called "Part B", and which came + * from the DTD used by FleXML to generate this program, can be * distributed (or not, as the case may be) under the terms of whoever - * wrote them, provided these terms respect and obey the two conditions + * wrote them, provided these terms respect and obey the two conditions * above under the heading "Part A". * * The author of and contributors to FleXML specifically disclaim - * any copyright interest in "Part B", unless "Part B" was written + * any copyright interest in "Part B", unless "Part B" was written * by the author of or contributors to FleXML. - * + * */ /* Version strings. */ @@ -1318,7 +1318,7 @@ const char dax__flexml_version[] = "1.9.6"; #include #include #include - + #if defined(_XBT_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__) # ifndef __STRICT_ANSI__ # include @@ -1327,7 +1327,7 @@ const char dax__flexml_version[] = "1.9.6"; #else # include #endif - + #ifndef FLEXML_INDEXSTACKSIZE #define FLEXML_INDEXSTACKSIZE 1000 #endif @@ -1527,7 +1527,7 @@ static void pushbuffer(int p) { ck_ilimit(); indexstack[inext++] = p; - indexstack[inext++] = bnext; + indexstack[inext++] = bnext; } static int popbuffer(void) @@ -1685,11 +1685,11 @@ static int input (void ); static int yy_start_stack_ptr = 0; static int yy_start_stack_depth = 0; static int *yy_start_stack = NULL; - + static void yy_push_state (int new_state ); - + static void yy_pop_state (void ); - + /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ @@ -1794,10 +1794,10 @@ extern int dax_lex (void); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + if ( !(yy_init) ) { (yy_init) = 1; @@ -1904,7 +1904,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1937,7 +1937,7 @@ yy_find_action: yy_size_t yyl; for ( yyl = 0; yyl < dax_leng; ++yyl ) if ( dax_text[yyl] == '\n' ) - + dax_lineno++; ; } @@ -2002,7 +2002,7 @@ SKIP; case 11: /* rule 11 can match eol */ YY_RULE_SETUP -SET(ROOT_dax__adag); +SET(ROOT_dax__adag); YY_BREAK case 12: /* rule 12 can match eol */ @@ -2961,9 +2961,9 @@ case YY_STATE_EOF(IMPOSSIBLE): */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -3095,14 +3095,14 @@ static int yy_get_next_buffer (void) static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; - + yy_state_type yy_current_state; + char *yy_cp; + yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -3127,10 +3127,10 @@ static int yy_get_next_buffer (void) */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -3157,7 +3157,7 @@ static int yy_get_next_buffer (void) { int c; - + *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) @@ -3219,7 +3219,7 @@ static int yy_get_next_buffer (void) (yy_hold_char) = *++(yy_c_buf_p); if ( c == '\n' ) - + dax_lineno++; ; @@ -3229,12 +3229,12 @@ static int yy_get_next_buffer (void) /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ void dax_restart (FILE * input_file ) { - + if ( ! YY_CURRENT_BUFFER ){ dax_ensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = @@ -3247,11 +3247,11 @@ static int yy_get_next_buffer (void) /** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ void dax__switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - + /* TODO. We should be able to replace this entire function body * with * dax_pop_buffer_state(); @@ -3291,13 +3291,13 @@ static void dax__load_buffer_state (void) /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ YY_BUFFER_STATE dax__create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - + b = (YY_BUFFER_STATE) dax_alloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in dax__create_buffer()" ); @@ -3320,11 +3320,11 @@ static void dax__load_buffer_state (void) /** Destroy the buffer. * @param b a buffer created with dax__create_buffer() - * + * */ void dax__delete_buffer (YY_BUFFER_STATE b ) { - + if ( ! b ) return; @@ -3345,7 +3345,7 @@ static void dax__load_buffer_state (void) { int oerrno = errno; - + dax__flush_buffer(b ); b->yy_input_file = file; @@ -3361,13 +3361,13 @@ static void dax__load_buffer_state (void) } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ void dax__flush_buffer (YY_BUFFER_STATE b ) { @@ -3396,7 +3396,7 @@ static void dax__load_buffer_state (void) * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ void dax_push_buffer_state (YY_BUFFER_STATE new_buffer ) { @@ -3426,7 +3426,7 @@ void dax_push_buffer_state (YY_BUFFER_STATE new_buffer ) /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ void dax_pop_buffer_state (void) { @@ -3450,7 +3450,7 @@ void dax_pop_buffer_state (void) static void dax_ensure_buffer_stack (void) { yy_size_t num_to_alloc; - + if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this @@ -3463,9 +3463,9 @@ static void dax_ensure_buffer_stack (void) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in dax_ensure_buffer_stack()" ); - + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; @@ -3493,13 +3493,13 @@ static void dax_ensure_buffer_stack (void) /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. + * + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE dax__scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) @@ -3528,14 +3528,14 @@ YY_BUFFER_STATE dax__scan_buffer (char * base, yy_size_t size ) /** Setup the input buffer state to scan a string. The next call to dax_lex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan - * + * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * dax__scan_bytes() instead. */ YY_BUFFER_STATE dax__scan_string (yyconst char * yystr ) { - + return dax__scan_bytes(yystr,strlen(yystr) ); } @@ -3543,7 +3543,7 @@ YY_BUFFER_STATE dax__scan_string (yyconst char * yystr ) * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * + * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE dax__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) @@ -3552,7 +3552,7 @@ YY_BUFFER_STATE dax__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_le char *buf; yy_size_t n; yy_size_t i; - + /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) dax_alloc(n ); @@ -3638,16 +3638,16 @@ static void yy_fatal_error (yyconst char* msg ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. - * + * */ int dax_get_lineno (void) { - + return dax_lineno; } /** Get the input stream. - * + * */ FILE *dax_get_in (void) { @@ -3655,7 +3655,7 @@ FILE *dax_get_in (void) } /** Get the output stream. - * + * */ FILE *dax_get_out (void) { @@ -3663,7 +3663,7 @@ FILE *dax_get_out (void) } /** Get the length of the current token. - * + * */ yy_size_t dax_get_leng (void) { @@ -3671,7 +3671,7 @@ yy_size_t dax_get_leng (void) } /** Get the current token. - * + * */ char *dax_get_text (void) @@ -3681,18 +3681,18 @@ char *dax_get_text (void) /** Set the current line number. * @param line_number - * + * */ void dax_set_lineno (int line_number ) { - + dax_lineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. - * + * * @see dax__switch_to_buffer */ void dax_set_in (FILE * in_str ) @@ -3723,7 +3723,7 @@ static int yy_init_globals (void) /* We do not touch dax_lineno unless the option is enabled. */ dax_lineno = 1; - + (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; @@ -3753,7 +3753,7 @@ static int yy_init_globals (void) /* dax_lex_destroy is for both reentrant and non-reentrant scanners. */ int dax_lex_destroy (void) { - + /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ dax__delete_buffer(YY_CURRENT_BUFFER ); @@ -3783,7 +3783,7 @@ int dax_lex_destroy (void) #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - register int i; + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -3792,7 +3792,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; diff --git a/src/smpi/colls/reduce-rab.c b/src/smpi/colls/reduce-rab.c index 921eaf0008..e293606bbe 100644 --- a/src/smpi/colls/reduce-rab.c +++ b/src/smpi/colls/reduce-rab.c @@ -3,11 +3,11 @@ /* Copyright: Rolf Rabenseifner, 1997 * Computing Center University of Stuttgart - * rabenseifner@rus.uni-stuttgart.de + * rabenseifner@rus.uni-stuttgart.de * - * The usage of this software is free, + * The usage of this software is free, * but this header must not be removed. - */ + */ #include "colls_private.h" #include @@ -301,7 +301,7 @@ Benchmark results on CRAY T3E MPI: /opt/ctl/mpt/1.1.0.3 datatype: MPI_DOUBLE Ldb[][] = {{ 896,1728, 576, 736},{ 448,1280, 512, 512}} - env: export MPI_BUFFER_MAX=4099 + env: export MPI_BUFFER_MAX=4099 compiled with: cc -c -O3 -h restrict=f old = binary tree protocol of the vendor @@ -413,8 +413,8 @@ typedef enum {MPIM_SHORT, MPIM_INT, MPIM_LONG, MPIM_UNSIGNED_SHORT, MPIM_UNSIGNED, MPIM_UNSIGNED_LONG, MPIM_FLOAT, MPIM_DOUBLE, MPIM_BYTE} MPIM_Datatype; -typedef enum {MPIM_MAX, MPIM_MIN, MPIM_SUM, MPIM_PROD, - MPIM_LAND, MPIM_BAND, MPIM_LOR, MPIM_BOR, +typedef enum {MPIM_MAX, MPIM_MIN, MPIM_SUM, MPIM_PROD, + MPIM_LAND, MPIM_BAND, MPIM_LOR, MPIM_BOR, MPIM_LXOR, MPIM_BXOR} MPIM_Op; #define MPI_I_DO_OP_C_INTEGER(MPI_I_do_op_TYPE,TYPE) \ static void MPI_I_do_op_TYPE(TYPE* b1,TYPE* b2,TYPE* rslt, int cnt,MPIM_Op op)\ @@ -505,8 +505,8 @@ static int MPI_I_anyReduce(void* Sendbuf, void* Recvbuf, int count, MPI_Datatype MPI_Status status; size_t scrlng; int new_prot; - MPIM_Datatype datatype = MPIM_INT; MPIM_Op op = MPIM_MAX; - + MPIM_Datatype datatype = MPIM_INT; MPIM_Op op = MPIM_MAX; + if (mpi_datatype==MPI_SHORT ) datatype=MPIM_SHORT; else if(mpi_datatype==MPI_INT ) datatype=MPIM_INT; else if(mpi_datatype==MPI_LONG ) datatype=MPIM_LONG; @@ -516,7 +516,7 @@ static int MPI_I_anyReduce(void* Sendbuf, void* Recvbuf, int count, MPI_Datatype else if(mpi_datatype==MPI_FLOAT ) datatype=MPIM_FLOAT; else if(mpi_datatype==MPI_DOUBLE ) datatype=MPIM_DOUBLE; else if(mpi_datatype==MPI_BYTE ) datatype=MPIM_BYTE; - + if (mpi_op==MPI_MAX ) op=MPIM_MAX; else if(mpi_op==MPI_MIN ) op=MPIM_MIN; else if(mpi_op==MPI_SUM ) op=MPIM_SUM; @@ -531,10 +531,10 @@ static int MPI_I_anyReduce(void* Sendbuf, void* Recvbuf, int count, MPI_Datatype new_prot = 0; MPI_Comm_size(comm, &size); if (size > 1) /*otherwise no balancing_protocol*/ - { register int ss; + { int ss; if (size==2) ss=0; else if (size==3) ss=1; - else { register int s = size; while (!(s & 1)) s = s >> 1; + else { int s = size; while (!(s & 1)) s = s >> 1; if (s==1) /* size == power of 2 */ ss = 2; else /* size != power of 2 */ ss = 3; } switch(op) { diff --git a/src/surf/simgrid_dtd.c b/src/surf/simgrid_dtd.c index c110244cf3..6f257ccbbf 100644 --- a/src/surf/simgrid_dtd.c +++ b/src/surf/simgrid_dtd.c @@ -52,7 +52,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -69,7 +69,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -195,7 +195,7 @@ extern FILE *surf_parse_in, *surf_parse_out; /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE surf_parse_lex. + * existing scanners that call yyless() from OUTSIDE surf_parse_lex. * One obvious solution it to make yy_act a global. I tried that, and saw * a 5% performance hit in a non-surf_parse_lineno scanner, because yy_act is * normally declared as a register variable-- so it is not worth it. @@ -214,7 +214,7 @@ extern FILE *surf_parse_in, *surf_parse_out; if ( *p == '\n' )\ --surf_parse_lineno;\ }while(0) - + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -271,7 +271,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -4554,35 +4554,35 @@ static yyconst flex_int16_t yy_chk[12714] = /* Table of booleans, true if rule could match eol. */ static yyconst flex_int32_t yy_rule_can_match_eol[596] = { 0, -0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, - 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, - 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, - 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, - 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, - 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, - 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, - 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, + 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, + 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, + 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, + 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, + 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, + 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, + 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, + 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, + 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, }; static yy_state_type yy_last_accepting_state; @@ -4605,13 +4605,13 @@ char *surf_parse_text; * FleXML is Copyright (C) 1999-2005 Kristoffer Rose. All rights reserved. * FleXML is Copyright (C) 2003-2013 Martin Quinson. All rights reserved. * (1.9.6). - * + * * There are two, intertwined parts to this program, part A and part B. * * Part A * ------ - * - * Some parts, here collectively called "Part A", are found in the + * + * Some parts, here collectively called "Part A", are found in the * FleXML package. They are Copyright (C) 1999-2005 Kristoffer Rose * and Copyright (C) 2003-2013 Martin Quinson. All rights reserved. * @@ -4629,20 +4629,20 @@ char *surf_parse_text; * Notice that these are explicit rights granted to you for files * generated by the FleXML system. For your rights in connection with * the FleXML system itself please consult the GNU General Public License. - * + * * Part B * ------ - * - * The other parts, here collectively called "Part B", and which came - * from the DTD used by FleXML to generate this program, can be + * + * The other parts, here collectively called "Part B", and which came + * from the DTD used by FleXML to generate this program, can be * distributed (or not, as the case may be) under the terms of whoever - * wrote them, provided these terms respect and obey the two conditions + * wrote them, provided these terms respect and obey the two conditions * above under the heading "Part A". * * The author of and contributors to FleXML specifically disclaim - * any copyright interest in "Part B", unless "Part B" was written + * any copyright interest in "Part B", unless "Part B" was written * by the author of or contributors to FleXML. - * + * */ /* Version strings. */ @@ -4655,7 +4655,7 @@ const char surfxml_flexml_version[] = "1.9.6"; #include #include #include - + #if defined(_XBT_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__) # ifndef __STRICT_ANSI__ # include @@ -4664,7 +4664,7 @@ const char surfxml_flexml_version[] = "1.9.6"; #else # include #endif - + #ifndef FLEXML_INDEXSTACKSIZE #define FLEXML_INDEXSTACKSIZE 1000 #endif @@ -5149,7 +5149,7 @@ static void pushbuffer(int p) { ck_ilimit(); indexstack[inext++] = p; - indexstack[inext++] = bnext; + indexstack[inext++] = bnext; } static int popbuffer(void) @@ -5405,11 +5405,11 @@ static int input (void ); static int yy_start_stack_ptr = 0; static int yy_start_stack_depth = 0; static int *yy_start_stack = NULL; - + static void yy_push_state (int new_state ); - + static void yy_pop_state (void ); - + /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ @@ -5514,10 +5514,10 @@ extern int surf_parse_lex (void); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + if ( !(yy_init) ) { (yy_init) = 1; @@ -5727,7 +5727,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -5760,7 +5760,7 @@ yy_find_action: yy_size_t yyl; for ( yyl = 0; yyl < surf_parse_leng; ++yyl ) if ( surf_parse_text[yyl] == '\n' ) - + surf_parse_lineno++; ; } @@ -5825,7 +5825,7 @@ SKIP; case 11: /* rule 11 can match eol */ YY_RULE_SETUP -SET(DOCTYPE); +SET(DOCTYPE); YY_BREAK case 12: /* rule 12 can match eol */ @@ -9890,9 +9890,9 @@ case YY_STATE_EOF(IMPOSSIBLE): */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -10024,14 +10024,14 @@ static int yy_get_next_buffer (void) static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; - + yy_state_type yy_current_state; + char *yy_cp; + yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -10056,10 +10056,10 @@ static int yy_get_next_buffer (void) */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -10086,7 +10086,7 @@ static int yy_get_next_buffer (void) { int c; - + *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) @@ -10148,7 +10148,7 @@ static int yy_get_next_buffer (void) (yy_hold_char) = *++(yy_c_buf_p); if ( c == '\n' ) - + surf_parse_lineno++; ; @@ -10158,12 +10158,12 @@ static int yy_get_next_buffer (void) /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ void surf_parse_restart (FILE * input_file ) { - + if ( ! YY_CURRENT_BUFFER ){ surf_parse_ensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = @@ -10176,11 +10176,11 @@ static int yy_get_next_buffer (void) /** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ void surf_parse__switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - + /* TODO. We should be able to replace this entire function body * with * surf_parse_pop_buffer_state(); @@ -10220,13 +10220,13 @@ static void surf_parse__load_buffer_state (void) /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ YY_BUFFER_STATE surf_parse__create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - + b = (YY_BUFFER_STATE) surf_parse_alloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in surf_parse__create_buffer()" ); @@ -10249,11 +10249,11 @@ static void surf_parse__load_buffer_state (void) /** Destroy the buffer. * @param b a buffer created with surf_parse__create_buffer() - * + * */ void surf_parse__delete_buffer (YY_BUFFER_STATE b ) { - + if ( ! b ) return; @@ -10274,7 +10274,7 @@ static void surf_parse__load_buffer_state (void) { int oerrno = errno; - + surf_parse__flush_buffer(b ); b->yy_input_file = file; @@ -10290,13 +10290,13 @@ static void surf_parse__load_buffer_state (void) } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ void surf_parse__flush_buffer (YY_BUFFER_STATE b ) { @@ -10325,7 +10325,7 @@ static void surf_parse__load_buffer_state (void) * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ void surf_parse_push_buffer_state (YY_BUFFER_STATE new_buffer ) { @@ -10355,7 +10355,7 @@ void surf_parse_push_buffer_state (YY_BUFFER_STATE new_buffer ) /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ void surf_parse_pop_buffer_state (void) { @@ -10379,7 +10379,7 @@ void surf_parse_pop_buffer_state (void) static void surf_parse_ensure_buffer_stack (void) { yy_size_t num_to_alloc; - + if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this @@ -10392,9 +10392,9 @@ static void surf_parse_ensure_buffer_stack (void) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in surf_parse_ensure_buffer_stack()" ); - + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; @@ -10422,13 +10422,13 @@ static void surf_parse_ensure_buffer_stack (void) /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. + * + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE surf_parse__scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) @@ -10457,14 +10457,14 @@ YY_BUFFER_STATE surf_parse__scan_buffer (char * base, yy_size_t size ) /** Setup the input buffer state to scan a string. The next call to surf_parse_lex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan - * + * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * surf_parse__scan_bytes() instead. */ YY_BUFFER_STATE surf_parse__scan_string (yyconst char * yystr ) { - + return surf_parse__scan_bytes(yystr,strlen(yystr) ); } @@ -10472,7 +10472,7 @@ YY_BUFFER_STATE surf_parse__scan_string (yyconst char * yystr ) * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * + * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE surf_parse__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) @@ -10481,7 +10481,7 @@ YY_BUFFER_STATE surf_parse__scan_bytes (yyconst char * yybytes, yy_size_t _yyb char *buf; yy_size_t n; yy_size_t i; - + /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) surf_parse_alloc(n ); @@ -10567,16 +10567,16 @@ static void yy_fatal_error (yyconst char* msg ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. - * + * */ int surf_parse_get_lineno (void) { - + return surf_parse_lineno; } /** Get the input stream. - * + * */ FILE *surf_parse_get_in (void) { @@ -10584,7 +10584,7 @@ FILE *surf_parse_get_in (void) } /** Get the output stream. - * + * */ FILE *surf_parse_get_out (void) { @@ -10592,7 +10592,7 @@ FILE *surf_parse_get_out (void) } /** Get the length of the current token. - * + * */ yy_size_t surf_parse_get_leng (void) { @@ -10600,7 +10600,7 @@ yy_size_t surf_parse_get_leng (void) } /** Get the current token. - * + * */ char *surf_parse_get_text (void) @@ -10610,18 +10610,18 @@ char *surf_parse_get_text (void) /** Set the current line number. * @param line_number - * + * */ void surf_parse_set_lineno (int line_number ) { - + surf_parse_lineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. - * + * * @see surf_parse__switch_to_buffer */ void surf_parse_set_in (FILE * in_str ) @@ -10652,7 +10652,7 @@ static int yy_init_globals (void) /* We do not touch surf_parse_lineno unless the option is enabled. */ surf_parse_lineno = 1; - + (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; @@ -10682,7 +10682,7 @@ static int yy_init_globals (void) /* surf_parse_lex_destroy is for both reentrant and non-reentrant scanners. */ int surf_parse_lex_destroy (void) { - + /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ surf_parse__delete_buffer(YY_CURRENT_BUFFER ); @@ -10712,7 +10712,7 @@ int surf_parse_lex_destroy (void) #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - register int i; + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -10721,7 +10721,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; diff --git a/src/xbt/automaton/automaton_lexer.yy.c b/src/xbt/automaton/automaton_lexer.yy.c index e5f85d817a..d0d4d027ff 100644 --- a/src/xbt/automaton/automaton_lexer.yy.c +++ b/src/xbt/automaton/automaton_lexer.yy.c @@ -53,7 +53,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -70,7 +70,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -196,7 +196,7 @@ extern FILE *xbt_automaton_parser_in, *xbt_automaton_parser_out; #define YY_LESS_LINENO(n) #define YY_LINENO_REWIND_TO(ptr) - + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -253,7 +253,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -531,9 +531,9 @@ char *xbt_automaton_parser_text; #include #include "parserPromela.tab.hacc" - + extern YYSTYPE yylval; - + #line 538 "automaton_lexer.yy.c" #define INITIAL 0 @@ -594,7 +594,7 @@ extern int xbt_automaton_parser_wrap (void ); #endif static void yyunput (int c,char *buf_ptr ); - + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -717,10 +717,10 @@ extern int xbt_automaton_parser_lex (void); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + if ( !(yy_init) ) { (yy_init) = 1; @@ -769,7 +769,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -902,13 +902,13 @@ YY_RULE_SETUP case 19: YY_RULE_SETUP #line 59 "parserPromela.lex" -{ sscanf(xbt_automaton_parser_text,"%lf",&yylval.real); +{ sscanf(xbt_automaton_parser_text,"%lf",&yylval.real); return (LITT_REEL); } YY_BREAK case 20: YY_RULE_SETUP #line 62 "parserPromela.lex" -{ sscanf(xbt_automaton_parser_text,"%d",&yylval.integer); +{ sscanf(xbt_automaton_parser_text,"%d",&yylval.integer); return (LITT_ENT); } YY_BREAK case 21: @@ -916,7 +916,7 @@ case 21: YY_RULE_SETUP #line 65 "parserPromela.lex" { yylval.string=(char *)malloc(strlen(xbt_automaton_parser_text)+1); - sscanf(xbt_automaton_parser_text,"%s",yylval.string); + sscanf(xbt_automaton_parser_text,"%s",yylval.string); return (LITT_CHAINE); } YY_BREAK case 22: @@ -1085,9 +1085,9 @@ case YY_STATE_EOF(INITIAL): */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -1219,14 +1219,14 @@ static int yy_get_next_buffer (void) static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; - + yy_state_type yy_current_state; + char *yy_cp; + yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1251,10 +1251,10 @@ static int yy_get_next_buffer (void) */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1272,10 +1272,10 @@ static int yy_get_next_buffer (void) return yy_is_jam ? 0 : yy_current_state; } - static void yyunput (int c, register char * yy_bp ) + static void yyunput (int c, char * yy_bp ) { - register char *yy_cp; - + char *yy_cp; + yy_cp = (yy_c_buf_p); /* undo effects of setting up xbt_automaton_parser_text */ @@ -1284,10 +1284,10 @@ static int yy_get_next_buffer (void) if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register yy_size_t number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + yy_size_t number_to_move = (yy_n_chars) + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = + char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -1318,7 +1318,7 @@ static int yy_get_next_buffer (void) { int c; - + *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) @@ -1385,12 +1385,12 @@ static int yy_get_next_buffer (void) /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ void xbt_automaton_parser_restart (FILE * input_file ) { - + if ( ! YY_CURRENT_BUFFER ){ xbt_automaton_parser_ensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = @@ -1403,11 +1403,11 @@ static int yy_get_next_buffer (void) /** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ void xbt_automaton_parser__switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - + /* TODO. We should be able to replace this entire function body * with * xbt_automaton_parser_pop_buffer_state(); @@ -1447,13 +1447,13 @@ static void xbt_automaton_parser__load_buffer_state (void) /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ YY_BUFFER_STATE xbt_automaton_parser__create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - + b = (YY_BUFFER_STATE) xbt_automaton_parser_alloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__create_buffer()" ); @@ -1476,11 +1476,11 @@ static void xbt_automaton_parser__load_buffer_state (void) /** Destroy the buffer. * @param b a buffer created with xbt_automaton_parser__create_buffer() - * + * */ void xbt_automaton_parser__delete_buffer (YY_BUFFER_STATE b ) { - + if ( ! b ) return; @@ -1501,7 +1501,7 @@ static void xbt_automaton_parser__load_buffer_state (void) { int oerrno = errno; - + xbt_automaton_parser__flush_buffer(b ); b->yy_input_file = file; @@ -1517,13 +1517,13 @@ static void xbt_automaton_parser__load_buffer_state (void) } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ void xbt_automaton_parser__flush_buffer (YY_BUFFER_STATE b ) { @@ -1552,7 +1552,7 @@ static void xbt_automaton_parser__load_buffer_state (void) * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ void xbt_automaton_parser_push_buffer_state (YY_BUFFER_STATE new_buffer ) { @@ -1582,7 +1582,7 @@ void xbt_automaton_parser_push_buffer_state (YY_BUFFER_STATE new_buffer ) /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ void xbt_automaton_parser_pop_buffer_state (void) { @@ -1606,7 +1606,7 @@ void xbt_automaton_parser_pop_buffer_state (void) static void xbt_automaton_parser_ensure_buffer_stack (void) { yy_size_t num_to_alloc; - + if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this @@ -1619,9 +1619,9 @@ static void xbt_automaton_parser_ensure_buffer_stack (void) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser_ensure_buffer_stack()" ); - + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; @@ -1649,13 +1649,13 @@ static void xbt_automaton_parser_ensure_buffer_stack (void) /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. + * + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE xbt_automaton_parser__scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) @@ -1684,14 +1684,14 @@ YY_BUFFER_STATE xbt_automaton_parser__scan_buffer (char * base, yy_size_t size /** Setup the input buffer state to scan a string. The next call to xbt_automaton_parser_lex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan - * + * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * xbt_automaton_parser__scan_bytes() instead. */ YY_BUFFER_STATE xbt_automaton_parser__scan_string (yyconst char * yystr ) { - + return xbt_automaton_parser__scan_bytes(yystr,strlen(yystr) ); } @@ -1699,7 +1699,7 @@ YY_BUFFER_STATE xbt_automaton_parser__scan_string (yyconst char * yystr ) * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * + * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE xbt_automaton_parser__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) @@ -1708,7 +1708,7 @@ YY_BUFFER_STATE xbt_automaton_parser__scan_bytes (yyconst char * yybytes, yy_si char *buf; yy_size_t n; yy_size_t i; - + /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) xbt_automaton_parser_alloc(n ); @@ -1762,16 +1762,16 @@ static void yy_fatal_error (yyconst char* msg ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. - * + * */ int xbt_automaton_parser_get_lineno (void) { - + return xbt_automaton_parser_lineno; } /** Get the input stream. - * + * */ FILE *xbt_automaton_parser_get_in (void) { @@ -1779,7 +1779,7 @@ FILE *xbt_automaton_parser_get_in (void) } /** Get the output stream. - * + * */ FILE *xbt_automaton_parser_get_out (void) { @@ -1787,7 +1787,7 @@ FILE *xbt_automaton_parser_get_out (void) } /** Get the length of the current token. - * + * */ yy_size_t xbt_automaton_parser_get_leng (void) { @@ -1795,7 +1795,7 @@ yy_size_t xbt_automaton_parser_get_leng (void) } /** Get the current token. - * + * */ char *xbt_automaton_parser_get_text (void) @@ -1805,18 +1805,18 @@ char *xbt_automaton_parser_get_text (void) /** Set the current line number. * @param line_number - * + * */ void xbt_automaton_parser_set_lineno (int line_number ) { - + xbt_automaton_parser_lineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. - * + * * @see xbt_automaton_parser__switch_to_buffer */ void xbt_automaton_parser_set_in (FILE * in_str ) @@ -1870,7 +1870,7 @@ static int yy_init_globals (void) /* xbt_automaton_parser_lex_destroy is for both reentrant and non-reentrant scanners. */ int xbt_automaton_parser_lex_destroy (void) { - + /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ xbt_automaton_parser__delete_buffer(YY_CURRENT_BUFFER ); @@ -1896,7 +1896,7 @@ int xbt_automaton_parser_lex_destroy (void) #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - register int i; + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -1905,7 +1905,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; diff --git a/src/xbt/dict.c b/src/xbt/dict.c index f632631312..9d2ba31844 100644 --- a/src/xbt/dict.c +++ b/src/xbt/dict.c @@ -107,12 +107,12 @@ XBT_INLINE unsigned int xbt_dict_size(xbt_dict_t dict) static void xbt_dict_rehash(xbt_dict_t dict) { const int oldsize = dict->table_size + 1; - register int newsize = oldsize * 2; - register int i; - register xbt_dictelm_t *currcell; - register xbt_dictelm_t *twincell; - register xbt_dictelm_t bucklet; - register xbt_dictelm_t *pprev; + int newsize = oldsize * 2; + int i; + xbt_dictelm_t *currcell; + xbt_dictelm_t *twincell; + xbt_dictelm_t bucklet; + xbt_dictelm_t *pprev; currcell = (xbt_dictelm_t *) xbt_realloc((char *) dict->table, diff --git a/src/xbt/graphxml.c b/src/xbt/graphxml.c index 9391589c9e..0df74b0354 100644 --- a/src/xbt/graphxml.c +++ b/src/xbt/graphxml.c @@ -52,7 +52,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -69,7 +69,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -195,7 +195,7 @@ extern FILE *xbt_graph_parse_in, *xbt_graph_parse_out; /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE xbt_graph_parse_lex. + * existing scanners that call yyless() from OUTSIDE xbt_graph_parse_lex. * One obvious solution it to make yy_act a global. I tried that, and saw * a 5% performance hit in a non-xbt_graph_parse_lineno scanner, because yy_act is * normally declared as a register variable-- so it is not worth it. @@ -214,7 +214,7 @@ extern FILE *xbt_graph_parse_in, *xbt_graph_parse_out; if ( *p == '\n' )\ --xbt_graph_parse_lineno;\ }while(0) - + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -271,7 +271,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -1040,10 +1040,10 @@ static yyconst flex_int16_t yy_chk[1642] = /* Table of booleans, true if rule could match eol. */ static yyconst flex_int32_t yy_rule_can_match_eol[93] = { 0, -0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, - 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, +0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, + 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, }; static yy_state_type yy_last_accepting_state; @@ -1066,13 +1066,13 @@ char *xbt_graph_parse_text; * FleXML is Copyright (C) 1999-2005 Kristoffer Rose. All rights reserved. * FleXML is Copyright (C) 2003-2013 Martin Quinson. All rights reserved. * (1.9.6). - * + * * There are two, intertwined parts to this program, part A and part B. * * Part A * ------ - * - * Some parts, here collectively called "Part A", are found in the + * + * Some parts, here collectively called "Part A", are found in the * FleXML package. They are Copyright (C) 1999-2005 Kristoffer Rose * and Copyright (C) 2003-2013 Martin Quinson. All rights reserved. * @@ -1090,20 +1090,20 @@ char *xbt_graph_parse_text; * Notice that these are explicit rights granted to you for files * generated by the FleXML system. For your rights in connection with * the FleXML system itself please consult the GNU General Public License. - * + * * Part B * ------ - * - * The other parts, here collectively called "Part B", and which came - * from the DTD used by FleXML to generate this program, can be + * + * The other parts, here collectively called "Part B", and which came + * from the DTD used by FleXML to generate this program, can be * distributed (or not, as the case may be) under the terms of whoever - * wrote them, provided these terms respect and obey the two conditions + * wrote them, provided these terms respect and obey the two conditions * above under the heading "Part A". * * The author of and contributors to FleXML specifically disclaim - * any copyright interest in "Part B", unless "Part B" was written + * any copyright interest in "Part B", unless "Part B" was written * by the author of or contributors to FleXML. - * + * */ /* Version strings. */ @@ -1116,7 +1116,7 @@ const char graphxml_flexml_version[] = "1.9.6"; #include #include #include - + #if defined(_XBT_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__) # ifndef __STRICT_ANSI__ # include @@ -1125,7 +1125,7 @@ const char graphxml_flexml_version[] = "1.9.6"; #else # include #endif - + #ifndef FLEXML_INDEXSTACKSIZE #define FLEXML_INDEXSTACKSIZE 1000 #endif @@ -1286,7 +1286,7 @@ static void pushbuffer(int p) { ck_ilimit(); indexstack[inext++] = p; - indexstack[inext++] = bnext; + indexstack[inext++] = bnext; } static int popbuffer(void) @@ -1436,11 +1436,11 @@ static int input (void ); static int yy_start_stack_ptr = 0; static int yy_start_stack_depth = 0; static int *yy_start_stack = NULL; - + static void yy_push_state (int new_state ); - + static void yy_pop_state (void ); - + /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ @@ -1545,10 +1545,10 @@ extern int xbt_graph_parse_lex (void); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + if ( !(yy_init) ) { (yy_init) = 1; @@ -1644,7 +1644,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1677,7 +1677,7 @@ yy_find_action: yy_size_t yyl; for ( yyl = 0; yyl < xbt_graph_parse_leng; ++yyl ) if ( xbt_graph_parse_text[yyl] == '\n' ) - + xbt_graph_parse_lineno++; ; } @@ -1742,7 +1742,7 @@ SKIP; case 11: /* rule 11 can match eol */ YY_RULE_SETUP -SET(DOCTYPE); +SET(DOCTYPE); YY_BREAK case 12: /* rule 12 can match eol */ @@ -2418,9 +2418,9 @@ case YY_STATE_EOF(IMPOSSIBLE): */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -2552,14 +2552,14 @@ static int yy_get_next_buffer (void) static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; - + yy_state_type yy_current_state; + char *yy_cp; + yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -2584,10 +2584,10 @@ static int yy_get_next_buffer (void) */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -2614,7 +2614,7 @@ static int yy_get_next_buffer (void) { int c; - + *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) @@ -2676,7 +2676,7 @@ static int yy_get_next_buffer (void) (yy_hold_char) = *++(yy_c_buf_p); if ( c == '\n' ) - + xbt_graph_parse_lineno++; ; @@ -2686,12 +2686,12 @@ static int yy_get_next_buffer (void) /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ void xbt_graph_parse_restart (FILE * input_file ) { - + if ( ! YY_CURRENT_BUFFER ){ xbt_graph_parse_ensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = @@ -2704,11 +2704,11 @@ static int yy_get_next_buffer (void) /** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ void xbt_graph_parse__switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - + /* TODO. We should be able to replace this entire function body * with * xbt_graph_parse_pop_buffer_state(); @@ -2748,13 +2748,13 @@ static void xbt_graph_parse__load_buffer_state (void) /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ YY_BUFFER_STATE xbt_graph_parse__create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - + b = (YY_BUFFER_STATE) xbt_graph_parse_alloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse__create_buffer()" ); @@ -2777,11 +2777,11 @@ static void xbt_graph_parse__load_buffer_state (void) /** Destroy the buffer. * @param b a buffer created with xbt_graph_parse__create_buffer() - * + * */ void xbt_graph_parse__delete_buffer (YY_BUFFER_STATE b ) { - + if ( ! b ) return; @@ -2802,7 +2802,7 @@ static void xbt_graph_parse__load_buffer_state (void) { int oerrno = errno; - + xbt_graph_parse__flush_buffer(b ); b->yy_input_file = file; @@ -2818,13 +2818,13 @@ static void xbt_graph_parse__load_buffer_state (void) } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ void xbt_graph_parse__flush_buffer (YY_BUFFER_STATE b ) { @@ -2853,7 +2853,7 @@ static void xbt_graph_parse__load_buffer_state (void) * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ void xbt_graph_parse_push_buffer_state (YY_BUFFER_STATE new_buffer ) { @@ -2883,7 +2883,7 @@ void xbt_graph_parse_push_buffer_state (YY_BUFFER_STATE new_buffer ) /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ void xbt_graph_parse_pop_buffer_state (void) { @@ -2907,7 +2907,7 @@ void xbt_graph_parse_pop_buffer_state (void) static void xbt_graph_parse_ensure_buffer_stack (void) { yy_size_t num_to_alloc; - + if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this @@ -2920,9 +2920,9 @@ static void xbt_graph_parse_ensure_buffer_stack (void) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse_ensure_buffer_stack()" ); - + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; @@ -2950,13 +2950,13 @@ static void xbt_graph_parse_ensure_buffer_stack (void) /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. + * + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE xbt_graph_parse__scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) @@ -2985,14 +2985,14 @@ YY_BUFFER_STATE xbt_graph_parse__scan_buffer (char * base, yy_size_t size ) /** Setup the input buffer state to scan a string. The next call to xbt_graph_parse_lex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan - * + * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * xbt_graph_parse__scan_bytes() instead. */ YY_BUFFER_STATE xbt_graph_parse__scan_string (yyconst char * yystr ) { - + return xbt_graph_parse__scan_bytes(yystr,strlen(yystr) ); } @@ -3000,7 +3000,7 @@ YY_BUFFER_STATE xbt_graph_parse__scan_string (yyconst char * yystr ) * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * + * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE xbt_graph_parse__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) @@ -3009,7 +3009,7 @@ YY_BUFFER_STATE xbt_graph_parse__scan_bytes (yyconst char * yybytes, yy_size_t char *buf; yy_size_t n; yy_size_t i; - + /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) xbt_graph_parse_alloc(n ); @@ -3095,16 +3095,16 @@ static void yy_fatal_error (yyconst char* msg ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. - * + * */ int xbt_graph_parse_get_lineno (void) { - + return xbt_graph_parse_lineno; } /** Get the input stream. - * + * */ FILE *xbt_graph_parse_get_in (void) { @@ -3112,7 +3112,7 @@ FILE *xbt_graph_parse_get_in (void) } /** Get the output stream. - * + * */ FILE *xbt_graph_parse_get_out (void) { @@ -3120,7 +3120,7 @@ FILE *xbt_graph_parse_get_out (void) } /** Get the length of the current token. - * + * */ yy_size_t xbt_graph_parse_get_leng (void) { @@ -3128,7 +3128,7 @@ yy_size_t xbt_graph_parse_get_leng (void) } /** Get the current token. - * + * */ char *xbt_graph_parse_get_text (void) @@ -3138,18 +3138,18 @@ char *xbt_graph_parse_get_text (void) /** Set the current line number. * @param line_number - * + * */ void xbt_graph_parse_set_lineno (int line_number ) { - + xbt_graph_parse_lineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. - * + * * @see xbt_graph_parse__switch_to_buffer */ void xbt_graph_parse_set_in (FILE * in_str ) @@ -3180,7 +3180,7 @@ static int yy_init_globals (void) /* We do not touch xbt_graph_parse_lineno unless the option is enabled. */ xbt_graph_parse_lineno = 1; - + (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; @@ -3210,7 +3210,7 @@ static int yy_init_globals (void) /* xbt_graph_parse_lex_destroy is for both reentrant and non-reentrant scanners. */ int xbt_graph_parse_lex_destroy (void) { - + /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ xbt_graph_parse__delete_buffer(YY_CURRENT_BUFFER ); @@ -3240,7 +3240,7 @@ int xbt_graph_parse_lex_destroy (void) #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - register int i; + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -3249,7 +3249,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; diff --git a/src/xbt/mmalloc/mfree.c b/src/xbt/mmalloc/mfree.c index 373c1149f5..a67b995802 100644 --- a/src/xbt/mmalloc/mfree.c +++ b/src/xbt/mmalloc/mfree.c @@ -23,7 +23,7 @@ void mfree(struct mdesc *mdp, void *ptr) { int type; size_t block, frag_nb; - register size_t i; + size_t i; int it; mmalloc_paranoia(mdp); @@ -51,7 +51,7 @@ void mfree(struct mdesc *mdp, void *ptr) UNLOCK(mdp); THROWF(system_error, 0, "Asked to free a fragment in a block that is already free. I'm puzzled.\n"); break; - + case MMALLOC_TYPE_UNFRAGMENTED: /* Get as many statistics as early as we can. */ mdp -> heapstats.chunks_used--; @@ -147,8 +147,8 @@ void mfree(struct mdesc *mdp, void *ptr) mdp -> heapstats.bytes_free -= bytes; } */ - /* Set the next search to begin at this block. - This is probably important to the trick where realloc returns the block to + /* Set the next search to begin at this block. + This is probably important to the trick where realloc returns the block to the system before reasking for the same block with a bigger size. */ mdp->heapindex = block; break; @@ -191,13 +191,13 @@ void mfree(struct mdesc *mdp, void *ptr) mdp->heapinfo[block].type = MMALLOC_TYPE_UNFRAGMENTED; mdp->heapinfo[block].busy_block.size = 1; mdp->heapinfo[block].busy_block.busy_size = 0; - + /* Keep the statistics accurate. */ mdp -> heapstats.chunks_used++; mdp -> heapstats.bytes_used += BLOCKSIZE; mdp -> heapstats.chunks_free -= BLOCKSIZE >> type; mdp -> heapstats.bytes_free -= BLOCKSIZE; - + mfree((void *) mdp, (void *) ADDRESS(block)); } else if (mdp->heapinfo[block].busy_frag.nfree != 0) { /* If some fragments of this block are free, you know what? I'm already happy. */ diff --git a/src/xbt/mmalloc/mmalloc.c b/src/xbt/mmalloc/mmalloc.c index 4c3223877b..b47f13647d 100644 --- a/src/xbt/mmalloc/mmalloc.c +++ b/src/xbt/mmalloc/mmalloc.c @@ -177,8 +177,8 @@ void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size) { void *result; size_t block, blocks, lastblocks, start; - register size_t i; - register size_t log; + size_t i; + size_t log; int it; size_t requested_size = size; // The amount of memory requested by user, for real @@ -266,7 +266,7 @@ void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size) mdp->heapinfo[block].busy_frag.ignore[0] = 0; //xbt_backtrace_no_malloc(mdp->heapinfo[block].busy_frag.bt[0],XBT_BACKTRACE_SIZE); //xbt_libunwind_backtrace(mdp->heapinfo[block].busy_frag.bt[0],XBT_BACKTRACE_SIZE); - + /* update stats */ mdp -> heapstats.chunks_free += (BLOCKSIZE >> log) - 1; mdp -> heapstats.bytes_free += BLOCKSIZE - (1 << log); @@ -359,7 +359,7 @@ void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size) mdp->heapinfo[block].busy_block.busy_size = requested_size; //mdp->heapinfo[block].busy_block.bt_size = xbt_backtrace_no_malloc(mdp->heapinfo[block].busy_block.bt,XBT_BACKTRACE_SIZE); //mdp->heapinfo[block].busy_block.bt_size = xbt_libunwind_backtrace(mdp->heapinfo[block].busy_block.bt,XBT_BACKTRACE_SIZE); - + mdp -> heapstats.chunks_used++; mdp -> heapstats.bytes_used += blocks * BLOCKSIZE; mdp -> heapstats.bytes_free -= blocks * BLOCKSIZE; diff --git a/src/xbt/snprintf.c b/src/xbt/snprintf.c index c1a4983a1f..e4d51cada7 100644 --- a/src/xbt/snprintf.c +++ b/src/xbt/snprintf.c @@ -370,17 +370,17 @@ #endif #define fast_memcpy(d,s,n) \ - { register size_t nn = (size_t)(n); \ + { size_t nn = (size_t)(n); \ if (nn >= breakeven_point) memcpy((d), (s), nn); \ else if (nn > 0) { /* proc call overhead is worth only for large strings*/\ - register char *dd; register const char *ss; \ + char *dd; const char *ss; \ for (ss=(s), dd=(d); nn>0; nn--) *dd++ = *ss++; } } #define fast_memset(d,c,n) \ - { register size_t nn = (size_t)(n); \ + { size_t nn = (size_t)(n); \ if (nn >= breakeven_point) memset((d), (int)(c), nn); \ else if (nn > 0) { /* proc call overhead is worth only for large strings*/\ - register char *dd; register const int cc=(int)(c); \ + char *dd; const int cc=(int)(c); \ for (dd=(d); nn>0; nn--) *dd++ = cc; } } /* prototypes */ -- 2.20.1