Fix Style java code format and warnings

The code had many bad formating and syntax or API usage warnings,
as well as some unused methods or classes which are fixed with this
patch.

Task-number: QTBUG-71590
Change-Id: Ib113a0dc05703afb5190ec880b27daf75274cb1e
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit dc9075554135160bb07aa54708aba69d127160e2)
This commit is contained in:
Assam Boudjelthia 2021-08-02 00:15:07 +03:00
parent 4d0db58c20
commit 5b0c1561ad
3 changed files with 347 additions and 537 deletions

View File

@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@ -45,9 +45,3 @@ Java_org_qtproject_qt_android_ExtractStyle_extractNativeChunkInfo20(JNIEnv *, jo
{
return 0;
}
extern "C" JNIEXPORT jintArray JNICALL
Java_org_qtproject_qt_android_ExtractStyle_extractChunkInfo20(JNIEnv *, jobject, jbyteArray)
{
return 0;
}

View File

@ -1,5 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Copyright (C) 2014 BogDan Vatra <bogdan@kde.org>
** Contact: https://www.qt.io/licensing/
**
@ -126,26 +127,6 @@ Java_org_qtproject_qt_android_ExtractStyle_extractNativeChunkInfo20(JNIEnv *env,
return result;
}
extern "C" JNIEXPORT jintArray JNICALL
Java_org_qtproject_qt_android_ExtractStyle_extractChunkInfo20(JNIEnv *env, jobject obj,
jbyteArray chunkObj)
{
size_t chunkSize = env->GetArrayLength(chunkObj);
void* storage = alloca(chunkSize);
env->GetByteArrayRegion(chunkObj, 0, chunkSize,
reinterpret_cast<jbyte*>(storage));
if (QJniEnvironment::checkAndClearExceptions(env))
return 0;
jintArray res = Java_org_qtproject_qt_android_ExtractStyle_extractNativeChunkInfo20(env, obj,
long(storage));
if (QJniEnvironment::checkAndClearExceptions(env))
res = nullptr;
return res;
}
static inline void fill9patchOffsets(Res_png_9patch20* patch) {
patch->xDivsOffset = sizeof(Res_png_9patch20);
patch->yDivsOffset = patch->xDivsOffset + (patch->numXDivs * sizeof(int32_t));