From: Florian Krohm Date: Sat, 24 Nov 2012 21:07:14 +0000 (+0000) Subject: Make some function parameters pointer to const. X-Git-Tag: svn/VALGRIND_3_9_0^2~208 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56bd34923eedfa17c62148a496401a67cb0a1816;p=thirdparty%2Fvalgrind.git Make some function parameters pointer to const. Companion patch to valgrind r13138. git-svn-id: svn://svn.valgrind.org/vex/trunk@2566 --- diff --git a/VEX/priv/guest_amd64_helpers.c b/VEX/priv/guest_amd64_helpers.c index 8cc11ad51e..53546bd3de 100644 --- a/VEX/priv/guest_amd64_helpers.c +++ b/VEX/priv/guest_amd64_helpers.c @@ -811,7 +811,7 @@ ULong amd64g_calculate_condition ( ULong/*AMD64Condcode*/ cond, /* VISIBLE TO LIBVEX CLIENT */ -ULong LibVEX_GuestAMD64_get_rflags ( /*IN*/VexGuestAMD64State* vex_state ) +ULong LibVEX_GuestAMD64_get_rflags ( /*IN*/const VexGuestAMD64State* vex_state ) { ULong rflags = amd64g_calculate_rflags_all_WRK( vex_state->guest_CC_OP, diff --git a/VEX/priv/guest_arm_helpers.c b/VEX/priv/guest_arm_helpers.c index 2c452e35e0..e0d87bd4fd 100644 --- a/VEX/priv/guest_arm_helpers.c +++ b/VEX/priv/guest_arm_helpers.c @@ -910,7 +910,7 @@ void LibVEX_GuestARM_put_flags ( UInt flags_native, #endif /* VISIBLE TO LIBVEX CLIENT */ -UInt LibVEX_GuestARM_get_cpsr ( /*IN*/VexGuestARMState* vex_state ) +UInt LibVEX_GuestARM_get_cpsr ( /*IN*/const VexGuestARMState* vex_state ) { UInt cpsr = 0; // NZCV diff --git a/VEX/priv/guest_ppc_helpers.c b/VEX/priv/guest_ppc_helpers.c index 906f9b4546..f320149f4f 100644 --- a/VEX/priv/guest_ppc_helpers.c +++ b/VEX/priv/guest_ppc_helpers.c @@ -210,7 +210,7 @@ IRExpr* guest_ppc64_spechelper ( const HChar* function_name, /*----------------------------------------------*/ /* VISIBLE TO LIBVEX CLIENT */ -UInt LibVEX_GuestPPC32_get_CR ( /*IN*/VexGuestPPC32State* vex_state ) +UInt LibVEX_GuestPPC32_get_CR ( /*IN*/const VexGuestPPC32State* vex_state ) { # define FIELD(_n) \ ( ( (UInt) \ @@ -231,7 +231,7 @@ UInt LibVEX_GuestPPC32_get_CR ( /*IN*/VexGuestPPC32State* vex_state ) /* VISIBLE TO LIBVEX CLIENT */ /* Note: %CR is 32 bits even for ppc64 */ -UInt LibVEX_GuestPPC64_get_CR ( /*IN*/VexGuestPPC64State* vex_state ) +UInt LibVEX_GuestPPC64_get_CR ( /*IN*/const VexGuestPPC64State* vex_state ) { # define FIELD(_n) \ ( ( (UInt) \ @@ -304,7 +304,7 @@ void LibVEX_GuestPPC64_put_CR ( UInt cr_native, /* VISIBLE TO LIBVEX CLIENT */ -UInt LibVEX_GuestPPC32_get_XER ( /*IN*/VexGuestPPC32State* vex_state ) +UInt LibVEX_GuestPPC32_get_XER ( /*IN*/const VexGuestPPC32State* vex_state ) { UInt w = 0; w |= ( ((UInt)vex_state->guest_XER_BC) & 0xFF ); @@ -317,7 +317,7 @@ UInt LibVEX_GuestPPC32_get_XER ( /*IN*/VexGuestPPC32State* vex_state ) /* VISIBLE TO LIBVEX CLIENT */ /* Note: %XER is 32 bits even for ppc64 */ -UInt LibVEX_GuestPPC64_get_XER ( /*IN*/VexGuestPPC64State* vex_state ) +UInt LibVEX_GuestPPC64_get_XER ( /*IN*/const VexGuestPPC64State* vex_state ) { UInt w = 0; w |= ( ((UInt)vex_state->guest_XER_BC) & 0xFF ); diff --git a/VEX/priv/guest_x86_helpers.c b/VEX/priv/guest_x86_helpers.c index 35938c99cf..9c26794fc8 100644 --- a/VEX/priv/guest_x86_helpers.c +++ b/VEX/priv/guest_x86_helpers.c @@ -713,7 +713,7 @@ UInt x86g_calculate_condition ( UInt/*X86Condcode*/ cond, /* VISIBLE TO LIBVEX CLIENT */ -UInt LibVEX_GuestX86_get_eflags ( /*IN*/VexGuestX86State* vex_state ) +UInt LibVEX_GuestX86_get_eflags ( /*IN*/const VexGuestX86State* vex_state ) { UInt eflags = x86g_calculate_eflags_all_WRK( vex_state->guest_CC_OP, diff --git a/VEX/pub/libvex_guest_amd64.h b/VEX/pub/libvex_guest_amd64.h index b8fef94dc1..d9e5cbb986 100644 --- a/VEX/pub/libvex_guest_amd64.h +++ b/VEX/pub/libvex_guest_amd64.h @@ -186,7 +186,7 @@ void LibVEX_GuestAMD64_initialise ( /*OUT*/VexGuestAMD64State* vex_state ); /* Extract from the supplied VexGuestAMD64State structure the corresponding native %rflags value. */ extern -ULong LibVEX_GuestAMD64_get_rflags ( /*IN*/VexGuestAMD64State* vex_state ); +ULong LibVEX_GuestAMD64_get_rflags ( /*IN*/const VexGuestAMD64State* vex_state ); /* Set the carry flag in the given state to 'new_carry_flag', which should be zero or one. */ @@ -208,7 +208,7 @@ void LibVEX_GuestX86_put_x87 ( /*IN*/UChar* x87_state, /* Extract from the supplied VexGuestX86State structure, an x87 FPU image. */ extern -void LibVEX_GuestX86_get_x87 ( /*IN*/VexGuestX86State* vex_state, +void LibVEX_GuestX86_get_x87 ( /*IN*/const VexGuestX86State* vex_state, /*OUT*/UChar* x87_state ); diff --git a/VEX/pub/libvex_guest_arm.h b/VEX/pub/libvex_guest_arm.h index e837666f49..bb242f48a5 100644 --- a/VEX/pub/libvex_guest_arm.h +++ b/VEX/pub/libvex_guest_arm.h @@ -217,7 +217,7 @@ void LibVEX_GuestARM_initialise ( /*OUT*/VexGuestARMState* vex_state ); /* Calculate the ARM flag state from the saved data. */ extern -UInt LibVEX_GuestARM_get_cpsr ( /*IN*/VexGuestARMState* vex_state ); +UInt LibVEX_GuestARM_get_cpsr ( /*IN*/const VexGuestARMState* vex_state ); #endif /* ndef __LIBVEX_PUB_GUEST_ARM_H */ diff --git a/VEX/pub/libvex_guest_ppc32.h b/VEX/pub/libvex_guest_ppc32.h index c69101722a..d90b7d3bde 100644 --- a/VEX/pub/libvex_guest_ppc32.h +++ b/VEX/pub/libvex_guest_ppc32.h @@ -265,7 +265,7 @@ void LibVEX_GuestPPC32_put_CR ( UInt cr_native, /* Extract from the supplied VexGuestPPC32State structure the corresponding native %CR value. */ extern -UInt LibVEX_GuestPPC32_get_CR ( /*IN*/VexGuestPPC32State* vex_state ); +UInt LibVEX_GuestPPC32_get_CR ( /*IN*/const VexGuestPPC32State* vex_state ); /* Write the given native %XER value to the supplied VexGuestPPC32State @@ -277,7 +277,7 @@ void LibVEX_GuestPPC32_put_XER ( UInt xer_native, /* Extract from the supplied VexGuestPPC32State structure the corresponding native %XER value. */ extern -UInt LibVEX_GuestPPC32_get_XER ( /*IN*/VexGuestPPC32State* vex_state ); +UInt LibVEX_GuestPPC32_get_XER ( /*IN*/const VexGuestPPC32State* vex_state ); #endif /* ndef __LIBVEX_PUB_GUEST_PPC32_H */ diff --git a/VEX/pub/libvex_guest_ppc64.h b/VEX/pub/libvex_guest_ppc64.h index b05b5b15e2..1c9502c240 100644 --- a/VEX/pub/libvex_guest_ppc64.h +++ b/VEX/pub/libvex_guest_ppc64.h @@ -309,7 +309,7 @@ void LibVEX_GuestPPC64_put_CR ( UInt cr_native, corresponding native %CR value. Note, %CR is 32-bits even for ppc64. */ extern -UInt LibVEX_GuestPPC64_get_CR ( /*IN*/VexGuestPPC64State* vex_state ); +UInt LibVEX_GuestPPC64_get_CR ( /*IN*/const VexGuestPPC64State* vex_state ); /* Write the given native %XER value to the supplied @@ -323,7 +323,7 @@ void LibVEX_GuestPPC64_put_XER ( UInt xer_native, corresponding native %XER value. Note, %CR is 32-bits even for ppc64. */ extern -UInt LibVEX_GuestPPC64_get_XER ( /*IN*/VexGuestPPC64State* vex_state ); +UInt LibVEX_GuestPPC64_get_XER ( /*IN*/const VexGuestPPC64State* vex_state ); #endif /* ndef __LIBVEX_PUB_GUEST_PPC64_H */ diff --git a/VEX/pub/libvex_guest_x86.h b/VEX/pub/libvex_guest_x86.h index d46d67b098..d8d2554b93 100644 --- a/VEX/pub/libvex_guest_x86.h +++ b/VEX/pub/libvex_guest_x86.h @@ -277,7 +277,7 @@ void LibVEX_GuestX86_initialise ( /*OUT*/VexGuestX86State* vex_state ); /* Extract from the supplied VexGuestX86State structure the corresponding native %eflags value. */ extern -UInt LibVEX_GuestX86_get_eflags ( /*IN*/VexGuestX86State* vex_state ); +UInt LibVEX_GuestX86_get_eflags ( /*IN*/const VexGuestX86State* vex_state ); /* Set the carry flag in the given state to 'new_carry_flag', which should be zero or one. */