From aa099ade815644694e37c44cb129d3267c297d06 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 20 Nov 2012 02:40:12 +0000 Subject: Fix int-to-pointer-cast warnings for MIPS. --- ports/sysdeps/mips/jmpbuf-unwind.h | 8 +++++--- ports/sysdeps/unix/sysv/linux/mips/____longjmp_chk.c | 4 ++-- ports/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h | 14 +++++++------- 3 files changed, 14 insertions(+), 12 deletions(-) (limited to 'ports/sysdeps') diff --git a/ports/sysdeps/mips/jmpbuf-unwind.h b/ports/sysdeps/mips/jmpbuf-unwind.h index 31c9c8de7d..ba174d6079 100644 --- a/ports/sysdeps/mips/jmpbuf-unwind.h +++ b/ports/sysdeps/mips/jmpbuf-unwind.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc. +/* Copyright (C) 2003-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -25,8 +25,10 @@ #define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ ((void *) (address) < (void *) demangle ((jmpbuf)[0].__sp)) -#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \ - _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj) +#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \ + _JMPBUF_UNWINDS_ADJ (_jmpbuf, \ + (void *) (_Unwind_Ptr) _Unwind_GetCFA (_context), \ + _adj) static inline uintptr_t __attribute__ ((unused)) _jmpbuf_sp (__jmp_buf regs) diff --git a/ports/sysdeps/unix/sysv/linux/mips/____longjmp_chk.c b/ports/sysdeps/unix/sysv/linux/mips/____longjmp_chk.c index d8da27024b..943b404140 100644 --- a/ports/sysdeps/unix/sysv/linux/mips/____longjmp_chk.c +++ b/ports/sysdeps/unix/sysv/linux/mips/____longjmp_chk.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Free Software Foundation, Inc. +/* Copyright (C) 2009-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -29,7 +29,7 @@ int ret = __sigaltstack (NULL, &ss); \ if (ret == 0 \ && (!(ss.ss_flags & SS_ONSTACK) \ - || ((unsigned sp_type) ((sp_type) ss.ss_sp \ + || ((unsigned sp_type) ((sp_type) (long) ss.ss_sp \ + (sp_type) ss.ss_size \ - sp_saved) \ < ss.ss_size))) \ diff --git a/ports/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h b/ports/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h index 9edde21683..7793e21478 100644 --- a/ports/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h +++ b/ports/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2000-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger , 2000. @@ -23,9 +23,9 @@ #define SIGCONTEXT unsigned long _code, struct sigcontext * #define SIGCONTEXT_EXTRA_ARGS _code, -#define GET_PC(ctx) ((void *) ctx->sc_pc) -#define GET_FRAME(ctx) ((void *) ctx->sc_regs[30]) -#define GET_STACK(ctx) ((void *) ctx->sc_regs[29]) +#define GET_PC(ctx) ((void *) (unsigned long) ctx->sc_pc) +#define GET_FRAME(ctx) ((void *) (unsigned long) ctx->sc_regs[30]) +#define GET_STACK(ctx) ((void *) (unsigned long) ctx->sc_regs[29]) #define CALL_SIGHANDLER(handler, signo, ctx) \ (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx)) @@ -33,9 +33,9 @@ #define SIGCONTEXT unsigned long _code, ucontext_t * #define SIGCONTEXT_EXTRA_ARGS _code, -#define GET_PC(ctx) ((void *) ctx->uc_mcontext.pc) -#define GET_FRAME(ctx) ((void *) ctx->uc_mcontext.gregs[30]) -#define GET_STACK(ctx) ((void *) ctx->uc_mcontext.gregs[29]) +#define GET_PC(ctx) ((void *) (unsigned long) ctx->uc_mcontext.pc) +#define GET_FRAME(ctx) ((void *) (unsigned long) ctx->uc_mcontext.gregs[30]) +#define GET_STACK(ctx) ((void *) (unsigned long) ctx->uc_mcontext.gregs[29]) #define CALL_SIGHANDLER(handler, signo, ctx) \ (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx)) -- cgit 1.4.1