summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Chimento <philip.chimento@gmail.com>2023-03-04 18:17:39 +0000
committerPhilip Chimento <philip.chimento@gmail.com>2023-03-04 18:17:39 +0000
commitc4f8b4814d03e61faeb0b78e98c46bde9e967eaf (patch)
treecf873268536345d1012a9c5e20c77194994803cb
parent38f96bd8d378f8547b1886b1490a5fd985125e2d (diff)
parent86a66ea412a725caa59d9fa41ea333117406768e (diff)
downloadgjs-c4f8b4814d03e61faeb0b78e98c46bde9e967eaf.tar.gz
Merge branch 'signed-char-fix' into 'master'
value: Use a signed char to old g_value_get_schar result Closes #529 See merge request GNOME/gjs!825
-rw-r--r--gi/value.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/gi/value.cpp b/gi/value.cpp
index 2e2f49aa..17db002f 100644
--- a/gi/value.cpp
+++ b/gi/value.cpp
@@ -458,11 +458,11 @@ gjs_value_to_g_value_internal(JSContext *context,
return throw_expect_type(context, value, "string");
}
} else if (gtype == G_TYPE_CHAR) {
- gint32 i;
+ int32_t i;
if (Gjs::js_value_to_c_checked<signed char>(context, value, &i,
&out_of_range) &&
!out_of_range) {
- g_value_set_schar(gvalue, (signed char)i);
+ g_value_set_schar(gvalue, static_cast<signed char>(i));
} else {
return throw_expect_type(context, value, "char", 0, out_of_range);
}
@@ -881,7 +881,7 @@ gjs_value_from_g_value_internal(JSContext *context,
return false;
}
} else if (gtype == G_TYPE_CHAR) {
- char v;
+ signed char v;
v = g_value_get_schar(gvalue);
value_p.setInt32(v);
} else if (gtype == G_TYPE_UCHAR) {