gcc/libjava/gnu/gcj/io/natSimpleSHSStream.cc
Bryce McKinlay 1349c68851 re PR libgcj/25187 (dereferencing type-punned pointer warnings while building libgcj)
2006-02-08  Bryce McKinlay  <mckinlay@redhat.com>

        PR libgcj/25187:
        * gnu/gcj/io/natSimpleSHSStream.cc
        (gnu::gcj::io::SimpleSHSStream::shsFinal): Remove bogus cast.
        * interpret.cc (_Jv_InterpMethod::run): Simplify arguments to
        _Jv_InterpFrame().
        * boehm.cc: #undef some autoconf macros before including gc-config.h.
        (_Jv_MarkObject): Don't mark the class, it is reachable via the vtable.
        (_Jv_MarkArray): Likewise.
        * java/lang/ref/natReference.cc (java::lang::ref::Reference::create):
        Simplify _Jv_GCRegisterDisappearingLink() call.
        * java/lang/Class.h (getComponentType): Use element_type.
        (element_type): New field declaration, as a union with "methods".
        * java/lang/natClassLoader.cc (_Jv_NewArrayClass): Use "element_type".
        * java/net/natVMNetworkInterfacePosix.cc
        (java::net::VMNetworkInterface::getInterfaces): Add "int" cast to
        avoid sign comparison warning.
        * include/java-interp.h (_Jv_InterpFrame): Take thread as second
        argument, not parent call frame.
        * include/x86_64-signal.h (MAKE_THROW_FRAME): Use "gregs" directly,
        without a cast.
        (restore_rt): Declare with hidden visibility, not "static".
        * posix.cc (_Jv_platform_initProperties): Make "tmpdir" a string
        constant.
        * jni.cc (_Jv_JNI_DestroyJavaVM): Use a union to avoid strict alias
        warning

From-SVN: r110783
2006-02-09 01:35:33 +00:00

56 lines
1.1 KiB
C++

// natSimpleSHSStream.cc
/* Copyright (C) 2000 Free Software Foundation
This file is part of libgcj.
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
#include <config.h>
#include <string.h>
#include <stdlib.h>
#include <gnu/gcj/io/SimpleSHSStream.h>
#include <gcj/cni.h>
#include <jvm.h>
#define PROTO
#include "shs.h"
jbyteArray
gnu::gcj::io::SimpleSHSStream::shsFinal (jbyteArray shs_info)
{
SHS_INFO *info = (SHS_INFO *)elements(shs_info);
::shsFinal (info);
jbyteArray buffer = JvNewByteArray (SHS_DIGESTSIZE);
memcpy (elements (buffer), &info->digest, SHS_DIGESTSIZE);
return buffer;
}
void
gnu::gcj::io::SimpleSHSStream::shsUpdate (jbyteArray shs_info, jbyteArray buf, jint count)
{
SHS_INFO *info = (SHS_INFO *)elements(shs_info);
uint8_t *buffer = (uint8_t *)elements(buf);
::shsUpdate (info, buffer, count);
}
jbyteArray
gnu::gcj::io::SimpleSHSStream::shsInit ()
{
jbyteArray result = JvNewByteArray (sizeof (SHS_INFO));
SHS_INFO *info = (SHS_INFO *)elements(result);
::shsInit (info);
return result;
}