summaryrefslogtreecommitdiff
path: root/addr2line.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-06 19:27:04 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-06 19:27:04 +0000
commitc73c876d54104757435a49dca877b7f8ef81d8f4 (patch)
treeaeb4624e2925f9cc3440cb08c949833571152d00 /addr2line.c
parent59eacb45e5576b6f304e66ba4ed8a89382921c9c (diff)
* addr2line.c: use more generic type:
* u_char -> unsigned char * u_short -> unsigned short * u_int -> unsigned int * u_long -> unsigned long * quad_t -> int64_t * u_quad_t -> uint64_t * addr2line.c (imax): inline is defined by configure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'addr2line.c')
-rw-r--r--addr2line.c39
1 files changed, 13 insertions, 26 deletions
diff --git a/addr2line.c b/addr2line.c
index ec69efd214..f89a9d24fe 100644
--- a/addr2line.c
+++ b/addr2line.c
@@ -646,19 +646,6 @@ rb_dump_backtrace_with_lines(int num_traces, void **trace, char **syms)
free(lines);
}
-#if defined(__sun)
-/* Solaris has different quad_t and does not have u_quad_t */
-# include "ruby/defines.h"
-# define quad_t LONG_LONG
-# define u_quad_t unsigned LONG_LONG
-/* __inline can only be used with GCC or Sun Studio 12 Update 1 or later */
-# if defined(__GNUC__)
-# elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
-# else
-# define __inline inline
-# endif
-#endif /* defined(__sun) */
-
/* From FreeBSD's lib/libstand/printf.c */
/*-
* Copyright (c) 1986, 1988, 1991, 1993
@@ -702,7 +689,7 @@ extern int rb_toupper(int c);
#define toupper(c) rb_toupper(c)
#define hex2ascii(hex) (hex2ascii_data[hex])
char const hex2ascii_data[] = "0123456789abcdefghijklmnopqrstuvwxyz";
-static __inline int imax(int a, int b) { return (a > b ? a : b); }
+static inline int imax(int a, int b) { return (a > b ? a : b); }
static int kvprintf(char const *fmt, void (*func)(int), void *arg, int radix, va_list ap);
static void putce(int c)
@@ -782,7 +769,7 @@ kvprintf(char const *fmt, void (*func)(int), void *arg, int radix, va_list ap)
char nbuf[MAXNBUF];
char *d;
const char *p, *percent, *q;
- u_char *up;
+ unsigned char *up;
int ch, n;
uintmax_t num;
int base, lflag, qflag, tmp, width, ladjust, sharpflag, neg, sign, dot;
@@ -806,7 +793,7 @@ kvprintf(char const *fmt, void (*func)(int), void *arg, int radix, va_list ap)
for (;;) {
padc = ' ';
width = 0;
- while ((ch = (u_char)*fmt++) != '%' || stop) {
+ while ((ch = (unsigned char)*fmt++) != '%' || stop) {
if (ch == '\0')
return (retval);
PCHAR(ch);
@@ -815,7 +802,7 @@ kvprintf(char const *fmt, void (*func)(int), void *arg, int radix, va_list ap)
qflag = 0; lflag = 0; ladjust = 0; sharpflag = 0; neg = 0;
sign = 0; dot = 0; dwidth = 0; upper = 0;
cflag = 0; hflag = 0; jflag = 0; tflag = 0; zflag = 0;
-reswitch: switch (ch = (u_char)*fmt++) {
+reswitch: switch (ch = (unsigned char)*fmt++) {
case '.':
dot = 1;
goto reswitch;
@@ -861,7 +848,7 @@ reswitch: switch (ch = (u_char)*fmt++) {
width = n;
goto reswitch;
case 'b':
- num = (u_int)va_arg(ap, int);
+ num = (unsigned int)va_arg(ap, int);
p = va_arg(ap, char *);
for (q = ksprintn(nbuf, num, *p++, NULL, 0); *q;)
PCHAR(*q--);
@@ -887,7 +874,7 @@ reswitch: switch (ch = (u_char)*fmt++) {
PCHAR(va_arg(ap, int));
break;
case 'D':
- up = va_arg(ap, u_char *);
+ up = va_arg(ap, unsigned char *);
p = va_arg(ap, char *);
if (!width)
width = 16;
@@ -926,7 +913,7 @@ reswitch: switch (ch = (u_char)*fmt++) {
if (jflag)
*(va_arg(ap, intmax_t *)) = retval;
else if (qflag)
- *(va_arg(ap, quad_t *)) = retval;
+ *(va_arg(ap, int64_t *)) = retval;
else if (lflag)
*(va_arg(ap, long *)) = retval;
else if (zflag)
@@ -999,25 +986,25 @@ handle_nosign:
if (jflag)
num = va_arg(ap, uintmax_t);
else if (qflag)
- num = va_arg(ap, u_quad_t);
+ num = va_arg(ap, uint64_t);
else if (tflag)
num = va_arg(ap, ptrdiff_t);
else if (lflag)
- num = va_arg(ap, u_long);
+ num = va_arg(ap, unsigned long);
else if (zflag)
num = va_arg(ap, size_t);
else if (hflag)
- num = (u_short)va_arg(ap, int);
+ num = (unsigned short)va_arg(ap, int);
else if (cflag)
- num = (u_char)va_arg(ap, int);
+ num = (unsigned char)va_arg(ap, int);
else
- num = va_arg(ap, u_int);
+ num = va_arg(ap, unsigned int);
goto number;
handle_sign:
if (jflag)
num = va_arg(ap, intmax_t);
else if (qflag)
- num = va_arg(ap, quad_t);
+ num = va_arg(ap, int64_t);
else if (tflag)
num = va_arg(ap, ptrdiff_t);
else if (lflag)