Skip to content

Commit 7bfeb1c

Browse files
committed
remove SIGN_EXTEND_CHAR macro
* marshal.c (r_long): cast to `signed char`, which is used already, instead of SIGN_EXTEND_CHAR. * parse.y: SIGN_EXTEND_CHAR is no longer used. [Fix rubyGH-1302] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 6c8efc0 commit 7bfeb1c

File tree

3 files changed

+8
-21
lines changed

3 files changed

+8
-21
lines changed

ChangeLog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
Wed Mar 23 11:44:53 2016 cremno <cremno@mail.ru>
2+
3+
* marshal.c (r_long): cast to `signed char`, which is used
4+
already, instead of SIGN_EXTEND_CHAR.
5+
6+
* parse.y: SIGN_EXTEND_CHAR is no longer used. [Fix GH-1302]
7+
18
Wed Mar 23 11:38:47 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
29

310
* cygwin/GNUmakefile.in (MSYS2_ARG_CONV_EXCL_PARAM):

marshal.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,19 +1174,11 @@ long_toobig(int size)
11741174
STRINGIZE(SIZEOF_LONG)", given %d)", size);
11751175
}
11761176

1177-
#undef SIGN_EXTEND_CHAR
1178-
#if __STDC__
1179-
# define SIGN_EXTEND_CHAR(c) ((signed char)(c))
1180-
#else /* not __STDC__ */
1181-
/* As in Harbison and Steele. */
1182-
# define SIGN_EXTEND_CHAR(c) ((((unsigned char)(c)) ^ 128) - 128)
1183-
#endif
1184-
11851177
static long
11861178
r_long(struct load_arg *arg)
11871179
{
11881180
register long x;
1189-
int c = SIGN_EXTEND_CHAR(r_byte(arg));
1181+
int c = (signed char)r_byte(arg);
11901182
long i;
11911183

11921184
if (c == 0) return 0;

parse.y

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5327,18 +5327,6 @@ ripper_dispatch_delayed_token(struct parser_params *parser, int t)
53275327
#include "ruby/regex.h"
53285328
#include "ruby/util.h"
53295329

5330-
/* We remove any previous definition of `SIGN_EXTEND_CHAR',
5331-
since ours (we hope) works properly with all combinations of
5332-
machines, compilers, `char' and `unsigned char' argument types.
5333-
(Per Bothner suggested the basic approach.) */
5334-
#undef SIGN_EXTEND_CHAR
5335-
#if __STDC__
5336-
# define SIGN_EXTEND_CHAR(c) ((signed char)(c))
5337-
#else /* not __STDC__ */
5338-
/* As in Harbison and Steele. */
5339-
# define SIGN_EXTEND_CHAR(c) ((((unsigned char)(c)) ^ 128) - 128)
5340-
#endif
5341-
53425330
#define parser_encoding_name() (current_enc->name)
53435331
#define parser_mbclen() mbclen((lex_p-1),lex_pend,current_enc)
53445332
#define parser_precise_mbclen() rb_enc_precise_mbclen((lex_p-1),lex_pend,current_enc)

0 commit comments

Comments
 (0)