[gjs] arg: Use default c++ type names to figure out the array size
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] arg: Use default c++ type names to figure out the array size
- Date: Sat, 8 Aug 2020 19:44:08 +0000 (UTC)
commit 32ae03786d7ed90ea5008059b3cce756b4b2c5bc
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date: Thu May 14 00:05:09 2020 +0200
arg: Use default c++ type names to figure out the array size
gi/arg.cpp | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
---
diff --git a/gi/arg.cpp b/gi/arg.cpp
index 230bf898..11655bf5 100644
--- a/gi/arg.cpp
+++ b/gi/arg.cpp
@@ -1364,30 +1364,30 @@ gjs_g_array_new_for_type(JSContext *context,
element_size = sizeof(gboolean);
break;
case GI_TYPE_TAG_UNICHAR:
- element_size = sizeof(gunichar);
+ element_size = sizeof(char32_t);
break;
case GI_TYPE_TAG_UINT8:
case GI_TYPE_TAG_INT8:
- element_size = sizeof(guint8);
- break;
+ element_size = sizeof(uint8_t);
+ break;
case GI_TYPE_TAG_UINT16:
case GI_TYPE_TAG_INT16:
- element_size = sizeof(guint16);
- break;
+ element_size = sizeof(uint16_t);
+ break;
case GI_TYPE_TAG_UINT32:
case GI_TYPE_TAG_INT32:
- element_size = sizeof(guint32);
- break;
+ element_size = sizeof(uint32_t);
+ break;
case GI_TYPE_TAG_UINT64:
case GI_TYPE_TAG_INT64:
- element_size = sizeof(guint64);
- break;
+ element_size = sizeof(uint64_t);
+ break;
case GI_TYPE_TAG_FLOAT:
- element_size = sizeof(gfloat);
- break;
+ element_size = sizeof(float);
+ break;
case GI_TYPE_TAG_DOUBLE:
- element_size = sizeof(gdouble);
- break;
+ element_size = sizeof(double);
+ break;
case GI_TYPE_TAG_GTYPE:
element_size = sizeof(GType);
break;
@@ -1399,8 +1399,8 @@ gjs_g_array_new_for_type(JSContext *context,
case GI_TYPE_TAG_GSLIST:
case GI_TYPE_TAG_GHASH:
case GI_TYPE_TAG_ERROR:
- element_size = sizeof(gpointer);
- break;
+ element_size = sizeof(void*);
+ break;
case GI_TYPE_TAG_VOID:
default:
gjs_throw(context,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]