aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-07-21 12:51:56 +0200
committerMattias Andrée <maandree@kth.se>2022-07-21 12:51:56 +0200
commitf96123d8cff0c6183cdc889a3a4df343be5f1ab1 (patch)
tree532e9e0e9b44af35e6bc987f06c37cb0aad02651
parentImprove makefile (diff)
downloadjlibgamma-f96123d8cff0c6183cdc889a3a4df343be5f1ab1.tar.gz
jlibgamma-f96123d8cff0c6183cdc889a3a4df343be5f1ab1.tar.bz2
jlibgamma-f96123d8cff0c6183cdc889a3a4df343be5f1ab1.tar.xz
Fix warnings1.0.2
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--libgamma_AdjustmentMethod.c4
-rw-r--r--libgamma_CRTC.c6
-rw-r--r--libgamma_GammaRamps.c36
-rw-r--r--libgamma_LibgammaException.c2
-rw-r--r--libgamma_Partition.c2
5 files changed, 25 insertions, 25 deletions
diff --git a/libgamma_AdjustmentMethod.c b/libgamma_AdjustmentMethod.c
index b5f9fe1..968aaaf 100644
--- a/libgamma_AdjustmentMethod.c
+++ b/libgamma_AdjustmentMethod.c
@@ -34,11 +34,11 @@ Java_libgamma_AdjustmentMethod_libgamma_1list_1methods(JNIEnv *env, jclass class
if (n > LIBGAMMA_METHOD_COUNT)
abort(); /* Prevented by the #if above and package maintenance */
- rc = (*env)->NewIntArray(env, n);
+ rc = (*env)->NewIntArray(env, (jsize)n);
/* Remember, jint is 32 bits, int is 16+ bits. */
for (i = 0; i < n; i++)
- (*env)->SetIntArrayRegion(env, rc, i, 1, methods + i);
+ (*env)->SetIntArrayRegion(env, rc, (jsize)i, 1, methods + i);
return rc;
(void) class;
diff --git a/libgamma_CRTC.c b/libgamma_CRTC.c
index 284beee..fe7197d 100644
--- a/libgamma_CRTC.c
+++ b/libgamma_CRTC.c
@@ -57,7 +57,7 @@ Java_libgamma_CRTC_libgamma_1crtc_1create(JNIEnv *env, jclass class, jlong parti
int r;
if (!state)
return fail(env, 0);
- r = libgamma_crtc_initialise(state, super, crtc);
+ r = libgamma_crtc_initialise(state, super, (size_t)crtc);
if (r)
return fail(env, r);
return ok(env, state);
@@ -123,8 +123,8 @@ Java_libgamma_CRTC_libgamma_1get_1crtc_1information(JNIEnv *env, jclass class, j
libgamma_get_crtc_information(&info, this, fields);
if (info.edid) {
- edid = (*env)->NewByteArray(env, info.edid_length);
- (*env)->SetByteArrayRegion(env, edid, 0, info.edid_length, (const jbyte*)(info.edid));
+ edid = (*env)->NewByteArray(env, (jsize)info.edid_length);
+ (*env)->SetByteArrayRegion(env, edid, 0, (jsize)info.edid_length, (const jbyte*)(info.edid));
free(info.edid);
}
diff --git a/libgamma_GammaRamps.c b/libgamma_GammaRamps.c
index eb233b7..ebb2e98 100644
--- a/libgamma_GammaRamps.c
+++ b/libgamma_GammaRamps.c
@@ -73,9 +73,9 @@ Java_libgamma_GammaRamps_libgamma_1gamma_1ramps8_1create(JNIEnv *env, jclass cla
int r;
if (!ramps)
return fail(env, 0);
- ramps->red_size = red_size;
- ramps->green_size = green_size;
- ramps->blue_size = blue_size;
+ ramps->red_size = (size_t)red_size;
+ ramps->green_size = (size_t)green_size;
+ ramps->blue_size = (size_t)blue_size;
r = libgamma_gamma_ramps8_initialise(ramps);
if (r)
return fail(env, r);
@@ -103,9 +103,9 @@ Java_libgamma_GammaRamps_libgamma_1gamma_1ramps16_1create(JNIEnv *env, jclass cl
int r;
if (!ramps)
return fail(env, 0);
- ramps->red_size = red_size;
- ramps->green_size = green_size;
- ramps->blue_size = blue_size;
+ ramps->red_size = (size_t)red_size;
+ ramps->green_size = (size_t)green_size;
+ ramps->blue_size = (size_t)blue_size;
r = libgamma_gamma_ramps16_initialise(ramps);
if (r)
return fail(env, r);
@@ -133,9 +133,9 @@ Java_libgamma_GammaRamps_libgamma_1gamma_1ramps32_1create(JNIEnv *env, jclass cl
int r;
if (!ramps)
return fail(env, 0);
- ramps->red_size = red_size;
- ramps->green_size = green_size;
- ramps->blue_size = blue_size;
+ ramps->red_size = (size_t)red_size;
+ ramps->green_size = (size_t)green_size;
+ ramps->blue_size = (size_t)blue_size;
r = libgamma_gamma_ramps32_initialise(ramps);
if (r)
return fail(env, r);
@@ -163,9 +163,9 @@ Java_libgamma_GammaRamps_libgamma_1gamma_1ramps64_1create(JNIEnv *env, jclass cl
int r;
if (!ramps)
return fail(env, 0);
- ramps->red_size = red_size;
- ramps->green_size = green_size;
- ramps->blue_size = blue_size;
+ ramps->red_size = (size_t)red_size;
+ ramps->green_size = (size_t)green_size;
+ ramps->blue_size = (size_t)blue_size;
r = libgamma_gamma_ramps64_initialise(ramps);
if (r)
return fail(env, r);
@@ -193,9 +193,9 @@ Java_libgamma_GammaRamps_libgamma_1gamma_1rampsf_1create(JNIEnv *env, jclass cla
int r;
if (!ramps)
return fail(env, 0);
- ramps->red_size = red_size;
- ramps->green_size = green_size;
- ramps->blue_size = blue_size;
+ ramps->red_size = (size_t)red_size;
+ ramps->green_size = (size_t)green_size;
+ ramps->blue_size = (size_t)blue_size;
r = libgamma_gamma_rampsf_initialise(ramps);
if (r)
return fail(env, r);
@@ -223,9 +223,9 @@ Java_libgamma_GammaRamps_libgamma_1gamma_1rampsd_1create(JNIEnv *env, jclass cla
int r;
if (!ramps)
return fail(env, 0);
- ramps->red_size = red_size;
- ramps->green_size = green_size;
- ramps->blue_size = blue_size;
+ ramps->red_size = (size_t)red_size;
+ ramps->green_size = (size_t)green_size;
+ ramps->blue_size = (size_t)blue_size;
r = libgamma_gamma_rampsd_initialise(ramps);
if (r)
return fail(env, r);
diff --git a/libgamma_LibgammaException.c b/libgamma_LibgammaException.c
index 52d19d7..f686dd8 100644
--- a/libgamma_LibgammaException.c
+++ b/libgamma_LibgammaException.c
@@ -65,7 +65,7 @@ Java_libgamma_LibgammaException_value_1of_1error(JNIEnv *env, jclass class, jstr
jint
Java_libgamma_LibgammaException_libgamma_1group_1gid(JNIEnv *env, jclass class)
{
- return libgamma_group_gid;
+ return (jint)libgamma_group_gid;
(void) env;
(void) class;
}
diff --git a/libgamma_Partition.c b/libgamma_Partition.c
index baea208..9b77ff1 100644
--- a/libgamma_Partition.c
+++ b/libgamma_Partition.c
@@ -62,7 +62,7 @@ Java_libgamma_Partition_libgamma_1partition_1create(JNIEnv *env, jclass class, j
int r;
if (state == NULL)
return fail(env, 0);
- r = libgamma_partition_initialise(state, super, partition);
+ r = libgamma_partition_initialise(state, super, (size_t)partition);
if (r)
return fail(env, r);
return ok(env, state, state->crtcs_available);