* [RFA] Remove unneeded casts from jvmti.cc
@ 2007-02-13 2:25 Keith Seitz
2007-02-13 2:42 ` Tom Tromey
0 siblings, 1 reply; 3+ messages in thread
From: Keith Seitz @ 2007-02-13 2:25 UTC (permalink / raw)
To: Java Patch List
[-- Attachment #1: Type: text/plain, Size: 486 bytes --]
Hi,
A recent check-in has reintroduced some unnecessary casts that were
eliminated a couple of weeks ago. This patch simply removes these
superfluous casts. [And it fixes a little formatting typo in the func decl.]
Ok?
Keith
ChangeLog
2007-02-09 Keith Seitz <keiths@redhat.com>
* jvmti.cc (_Jv_JVMTI_GetStackTrace): Remove cast
from jthread to Thread *; it is no longer needed.
(_Jv_JVMTI_GetFrameCount): Likewise.
Fix small formatting typo.
[-- Attachment #2: unneeded-jvmit-casts.patch --]
[-- Type: text/x-patch, Size: 1700 bytes --]
Index: jvmti.cc
===================================================================
--- jvmti.cc (revision 121766)
+++ jvmti.cc (working copy)
@@ -256,7 +256,7 @@
static jvmtiError JNICALL
_Jv_JVMTI_GetFrameCount (MAYBE_UNUSED jvmtiEnv *env, jthread thread,
- jint* frame_count)
+ jint *frame_count)
{
REQUIRE_PHASE (env, JVMTI_PHASE_LIVE);
@@ -265,12 +265,10 @@
using namespace java::lang;
THREAD_DEFAULT_TO_CURRENT (thread);
-
- Thread *thr = reinterpret_cast<Thread *> (thread);
- THREAD_CHECK_VALID (thr);
- THREAD_CHECK_IS_ALIVE (thr);
+ THREAD_CHECK_VALID (thread);
+ THREAD_CHECK_IS_ALIVE (thread);
- _Jv_Frame *frame = reinterpret_cast<_Jv_Frame *> (thr->frame);
+ _Jv_Frame *frame = reinterpret_cast<_Jv_Frame *> (thread->frame);
(*frame_count) = frame->depth ();
return JVMTI_ERROR_NONE;
}
@@ -826,10 +824,8 @@
using namespace java::lang;
THREAD_DEFAULT_TO_CURRENT (thread);
-
- Thread *thr = reinterpret_cast<Thread *> (thread);
- THREAD_CHECK_VALID (thr);
- THREAD_CHECK_IS_ALIVE (thr);
+ THREAD_CHECK_VALID (thread);
+ THREAD_CHECK_IS_ALIVE (thread);
jvmtiError jerr = env->GetFrameCount (thread, frame_count);
if (jerr != JVMTI_ERROR_NONE)
@@ -843,7 +839,7 @@
ILLEGAL_ARGUMENT (start_depth >= (*frame_count));
ILLEGAL_ARGUMENT (start_depth < (-(*frame_count)));
- _Jv_Frame *frame = reinterpret_cast<_Jv_Frame *> (thr->frame);
+ _Jv_Frame *frame = reinterpret_cast<_Jv_Frame *> (thread->frame);
// If start_depth is negative use this to determine at what depth to start
// the trace by adding it to the length of the call stack. This allows the
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA] Remove unneeded casts from jvmti.cc
2007-02-13 2:25 [RFA] Remove unneeded casts from jvmti.cc Keith Seitz
@ 2007-02-13 2:42 ` Tom Tromey
2007-02-13 2:45 ` Keith Seitz
0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2007-02-13 2:42 UTC (permalink / raw)
To: Keith Seitz; +Cc: Java Patch List
>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:
Keith> A recent check-in has reintroduced some unnecessary casts that were
Keith> eliminated a couple of weeks ago. This patch simply removes these
Keith> superfluous casts. [And it fixes a little formatting typo in the func
Keith> decl.]
Keith> Ok?
Yes, thanks.
Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA] Remove unneeded casts from jvmti.cc
2007-02-13 2:42 ` Tom Tromey
@ 2007-02-13 2:45 ` Keith Seitz
0 siblings, 0 replies; 3+ messages in thread
From: Keith Seitz @ 2007-02-13 2:45 UTC (permalink / raw)
To: Java Patch List
Tom Tromey wrote:
> Keith> Ok?
>
> Yes, thanks.
Committed.
Keith
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-02-13 2:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-13 2:25 [RFA] Remove unneeded casts from jvmti.cc Keith Seitz
2007-02-13 2:42 ` Tom Tromey
2007-02-13 2:45 ` Keith Seitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).