Skip to content

Commit

Permalink
[icalls] Replace gboolean and mono_bool by MonoBoolean. (mono/mono#10948
Browse files Browse the repository at this point in the history
)

Though one of these is an enum, use gint32.

The enums MonoResolveTokenError and MonoProtocolType are also used in icalls, but that is left alone.

Commit migrated from mono/mono@31c90d2
  • Loading branch information
jaykrell authored and akoeplinger committed Oct 5, 2018
1 parent b939198 commit d072c5f
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/mono/mono/metadata/appdomain-icalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ ves_icall_System_AppDomain_LoadAssembly (MonoAppDomainHandle ad,
MonoBoolean refonly,
MonoError *error);
ICALL_EXPORT
gboolean
MonoBoolean
ves_icall_System_AppDomain_InternalIsFinalizingForUnload (gint32 domain_id, MonoError *error);

ICALL_EXPORT
Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono/metadata/appdomain.c
Original file line number Diff line number Diff line change
Expand Up @@ -2560,7 +2560,7 @@ ves_icall_System_AppDomain_InternalUnload (gint32 domain_id, MonoError *error)
mono_error_set_exception_instance (error, exc);
}

gboolean
MonoBoolean
ves_icall_System_AppDomain_InternalIsFinalizingForUnload (gint32 domain_id, MonoError *error)
{
MonoDomain *domain = mono_domain_get_by_id (domain_id);
Expand Down
4 changes: 2 additions & 2 deletions src/mono/mono/metadata/file-mmap-posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ mono_mmap_close (void *mmap_handle, MonoError *error)
}

void
mono_mmap_configure_inheritability (void *mmap_handle, gboolean inheritability, MonoError *error)
mono_mmap_configure_inheritability (void *mmap_handle, gint32 inheritability, MonoError *error)
{
MmapHandle *h = (MmapHandle *)mmap_handle;
int fd, flags;
Expand Down Expand Up @@ -532,7 +532,7 @@ mono_mmap_map (void *handle, gint64 offset, gint64 *size, int access, void **mma
return COULD_NOT_MAP_MEMORY;
}

gboolean
MonoBoolean
mono_mmap_unmap (void *mmap_handle, MonoError *error)
{
int res = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/mono/mono/metadata/file-mmap-windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ mono_mmap_close (void *mmap_handle, MonoError *error)
}

void
mono_mmap_configure_inheritability (void *mmap_handle, gboolean inheritability, MonoError *error)
mono_mmap_configure_inheritability (void *mmap_handle, gint32 inheritability, MonoError *error)
{
g_assert (mmap_handle);
if (!SetHandleInformation (mmap_handle, HANDLE_FLAG_INHERIT, inheritability ? HANDLE_FLAG_INHERIT : 0)) {
Expand Down Expand Up @@ -406,7 +406,7 @@ mono_mmap_map (void *handle, gint64 offset, gint64 *size, int access, void **mma
return 0;
}

gboolean
MonoBoolean
mono_mmap_unmap (void *mmap_handle, MonoError *error)
{
g_assert (mmap_handle);
Expand Down
5 changes: 3 additions & 2 deletions src/mono/mono/metadata/file-mmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ ICALL_EXPORT
void
mono_mmap_close (void *mmap_handle, MonoError *error);

// inheritability is an enum with the values 0 and 1.
ICALL_EXPORT
void
mono_mmap_configure_inheritability (void *mmap_handle, gboolean inheritability, MonoError *error);
mono_mmap_configure_inheritability (void *mmap_handle, gint32 inheritability, MonoError *error);

ICALL_EXPORT
void
Expand All @@ -44,7 +45,7 @@ int
mono_mmap_map (void *handle, gint64 offset, gint64 *size, int access, void **mmap_handle, void **base_address, MonoError *error);

ICALL_EXPORT
gboolean
MonoBoolean
mono_mmap_unmap (void *base_address, MonoError *error);

#endif /* _MONO_METADATA_FILE_MMAP_H_ */
4 changes: 2 additions & 2 deletions src/mono/mono/metadata/icall.c
Original file line number Diff line number Diff line change
Expand Up @@ -5096,7 +5096,7 @@ get_manifest_resource_info_internal (MonoReflectionAssemblyHandle assembly_h, Mo
HANDLE_FUNCTION_RETURN_VAL (result);
}

ICALL_EXPORT gboolean
ICALL_EXPORT MonoBoolean
ves_icall_System_Reflection_Assembly_GetManifestResourceInfoInternal (MonoReflectionAssemblyHandle assembly_h, MonoStringHandle name, MonoManifestResourceInfoHandle info_h, MonoError *error)
{
error_init (error);
Expand Down Expand Up @@ -8036,7 +8036,7 @@ ves_icall_MonoCustomAttrs_IsDefinedInternal (MonoObjectHandle obj, MonoReflectio
}

ICALL_EXPORT MonoArrayHandle
ves_icall_MonoCustomAttrs_GetCustomAttributesInternal (MonoObjectHandle obj, MonoReflectionTypeHandle attr_type, mono_bool pseudoattrs, MonoError *error)
ves_icall_MonoCustomAttrs_GetCustomAttributesInternal (MonoObjectHandle obj, MonoReflectionTypeHandle attr_type, MonoBoolean pseudoattrs, MonoError *error)
{
MonoClass *attr_class;
if (MONO_HANDLE_IS_NULL (attr_type))
Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono/metadata/object-internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -2034,7 +2034,7 @@ ves_icall_MonoMethod_MakeGenericMethod_impl (MonoReflectionMethodHandle rmethod,

ICALL_EXPORT
gint32
ves_icall_ModuleBuilder_getToken (MonoReflectionModuleBuilderHandle mb, MonoObjectHandle obj, gboolean create_open_instance, MonoError *error);
ves_icall_ModuleBuilder_getToken (MonoReflectionModuleBuilderHandle mb, MonoObjectHandle obj, MonoBoolean create_open_instance, MonoError *error);

ICALL_EXPORT
gint32
Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono/metadata/sre.c
Original file line number Diff line number Diff line change
Expand Up @@ -4515,7 +4515,7 @@ mono_sre_generic_param_table_entry_free (GenericParamTableEntry *entry)
}

gint32
ves_icall_ModuleBuilder_getToken (MonoReflectionModuleBuilderHandle mb, MonoObjectHandle obj, gboolean create_open_instance, MonoError *error)
ves_icall_ModuleBuilder_getToken (MonoReflectionModuleBuilderHandle mb, MonoObjectHandle obj, MonoBoolean create_open_instance, MonoError *error)
{
error_init (error);
if (MONO_HANDLE_IS_NULL (obj)) {
Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono/metadata/w32socket-unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -1543,7 +1543,7 @@ mono_w32socket_convert_error (gint error)
}
}

gboolean
MonoBoolean
ves_icall_System_Net_Sockets_Socket_SupportPortReuse (MonoProtocolType proto, MonoError *error)
{
error_init (error);
Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono/metadata/w32socket-win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ mono_w32socket_convert_error (gint error)
return (error > 0 && error < WSABASEERR) ? error + WSABASEERR : error;
}

gboolean
MonoBoolean
ves_icall_System_Net_Sockets_Socket_SupportPortReuse (MonoProtocolType proto, MonoError *error)
{
error_init (error);
Expand Down
22 changes: 11 additions & 11 deletions src/mono/mono/metadata/w32socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ ves_icall_System_Net_Sockets_Socket_Available_internal (gsize sock, gint32 *werr
}

void
ves_icall_System_Net_Sockets_Socket_Blocking_internal (gsize sock, gboolean block, gint32 *werror, MonoError *error)
ves_icall_System_Net_Sockets_Socket_Blocking_internal (gsize sock, MonoBoolean block, gint32 *werror, MonoError *error)
{
int ret;

Expand All @@ -823,7 +823,7 @@ ves_icall_System_Net_Sockets_Socket_Blocking_internal (gsize sock, gboolean bloc
}

gpointer
ves_icall_System_Net_Sockets_Socket_Accept_internal (gsize sock, gint32 *werror, gboolean blocking, MonoError *error)
ves_icall_System_Net_Sockets_Socket_Accept_internal (gsize sock, gint32 *werror, MonoBoolean blocking, MonoError *error)
{
SOCKET newsock;

Expand Down Expand Up @@ -1308,7 +1308,7 @@ ves_icall_System_Net_Sockets_Socket_Poll_internal (gsize sock, gint mode,
}

void
ves_icall_System_Net_Sockets_Socket_Connect_internal (gsize sock, MonoObjectHandle sockaddr, gint32 *werror, gboolean blocking, MonoError *error)
ves_icall_System_Net_Sockets_Socket_Connect_internal (gsize sock, MonoObjectHandle sockaddr, gint32 *werror, MonoBoolean blocking, MonoError *error)
{
struct sockaddr *sa;
socklen_t sa_size;
Expand Down Expand Up @@ -1359,7 +1359,7 @@ ves_icall_System_Net_Sockets_Socket_Duplicate_internal (gpointer handle, gint32
}

gint32
ves_icall_System_Net_Sockets_Socket_Receive_internal (gsize sock, gchar *buffer, gint32 count, gint32 flags, gint32 *werror, gboolean blocking, MonoError *error)
ves_icall_System_Net_Sockets_Socket_Receive_internal (gsize sock, gchar *buffer, gint32 count, gint32 flags, gint32 *werror, MonoBoolean blocking, MonoError *error)
{
int ret;
int recvflags = 0;
Expand All @@ -1383,7 +1383,7 @@ ves_icall_System_Net_Sockets_Socket_Receive_internal (gsize sock, gchar *buffer,
}

gint32
ves_icall_System_Net_Sockets_Socket_Receive_array_internal (gsize sock, WSABUF *buffers, gint32 count, gint32 flags, gint32 *werror, gboolean blocking, MonoError *error)
ves_icall_System_Net_Sockets_Socket_Receive_array_internal (gsize sock, WSABUF *buffers, gint32 count, gint32 flags, gint32 *werror, MonoBoolean blocking, MonoError *error)
{
int ret;
guint32 recv;
Expand All @@ -1408,7 +1408,7 @@ ves_icall_System_Net_Sockets_Socket_Receive_array_internal (gsize sock, WSABUF *
}

gint32
ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal (gsize sock, gchar *buffer, gint32 count, gint32 flags, MonoObjectHandle sockaddr, gint32 *werror, gboolean blocking, MonoError *error)
ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal (gsize sock, gchar *buffer, gint32 count, gint32 flags, MonoObjectHandle sockaddr, gint32 *werror, MonoBoolean blocking, MonoError *error)
{
int ret;
int recvflags = 0;
Expand Down Expand Up @@ -1457,7 +1457,7 @@ ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal (gsize sock, gchar *buf
}

gint32
ves_icall_System_Net_Sockets_Socket_Send_internal (gsize sock, gchar *buffer, gint32 count, gint32 flags, gint32 *werror, gboolean blocking, MonoError *error)
ves_icall_System_Net_Sockets_Socket_Send_internal (gsize sock, gchar *buffer, gint32 count, gint32 flags, gint32 *werror, MonoBoolean blocking, MonoError *error)
{
int ret;
int sendflags = 0;
Expand All @@ -1483,7 +1483,7 @@ ves_icall_System_Net_Sockets_Socket_Send_internal (gsize sock, gchar *buffer, gi
}

gint32
ves_icall_System_Net_Sockets_Socket_Send_array_internal (gsize sock, WSABUF *buffers, gint32 count, gint32 flags, gint32 *werror, gboolean blocking, MonoError *error)
ves_icall_System_Net_Sockets_Socket_Send_array_internal (gsize sock, WSABUF *buffers, gint32 count, gint32 flags, gint32 *werror, MonoBoolean blocking, MonoError *error)
{
int ret;
guint32 sent;
Expand All @@ -1508,7 +1508,7 @@ ves_icall_System_Net_Sockets_Socket_Send_array_internal (gsize sock, WSABUF *buf
}

gint32
ves_icall_System_Net_Sockets_Socket_SendTo_internal (gsize sock, gchar *buffer, gint32 count, gint32 flags, MonoObjectHandle sockaddr, gint32 *werror, gboolean blocking, MonoError *error)
ves_icall_System_Net_Sockets_Socket_SendTo_internal (gsize sock, gchar *buffer, gint32 count, gint32 flags, MonoObjectHandle sockaddr, gint32 *werror, MonoBoolean blocking, MonoError *error)
{
int ret;
int sendflags = 0;
Expand Down Expand Up @@ -2556,8 +2556,8 @@ ves_icall_System_Net_Dns_GetHostName_internal (MonoStringHandleOut h_name, MonoE
}

#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT)
gboolean
ves_icall_System_Net_Sockets_Socket_SendFile_internal (gsize sock, MonoStringHandle filename, MonoArrayHandle pre_buffer, MonoArrayHandle post_buffer, gint flags, gint32 *werror, gboolean blocking, MonoError *error)
MonoBoolean
ves_icall_System_Net_Sockets_Socket_SendFile_internal (gsize sock, MonoStringHandle filename, MonoArrayHandle pre_buffer, MonoArrayHandle post_buffer, gint flags, gint32 *werror, MonoBoolean blocking, MonoError *error)
{
HANDLE file;
gboolean ret;
Expand Down
24 changes: 12 additions & 12 deletions src/mono/mono/metadata/w32socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@ ves_icall_System_Net_Sockets_Socket_Available_internal (gsize sock, gint32 *werr

ICALL_EXPORT
void
ves_icall_System_Net_Sockets_Socket_Blocking_internal (gsize sock, gboolean block, gint32 *werror, MonoError *error);
ves_icall_System_Net_Sockets_Socket_Blocking_internal (gsize sock, MonoBoolean block, gint32 *werror, MonoError *error);

ICALL_EXPORT
gpointer
ves_icall_System_Net_Sockets_Socket_Accept_internal (gsize sock, gint32 *werror, gboolean blocking, MonoError *error);
ves_icall_System_Net_Sockets_Socket_Accept_internal (gsize sock, gint32 *werror, MonoBoolean blocking, MonoError *error);

ICALL_EXPORT
void
Expand All @@ -216,33 +216,33 @@ ves_icall_System_Net_Sockets_Socket_Bind_internal (gsize sock, MonoObjectHandle

ICALL_EXPORT
void
ves_icall_System_Net_Sockets_Socket_Connect_internal (gsize sock, MonoObjectHandle sockaddr, gint32 *werror, gboolean blocking, MonoError *error);
ves_icall_System_Net_Sockets_Socket_Connect_internal (gsize sock, MonoObjectHandle sockaddr, gint32 *werror, MonoBoolean blocking, MonoError *error);

ICALL_EXPORT
gint32
ves_icall_System_Net_Sockets_Socket_Receive_internal (gsize sock, gchar *buffer, gint32 count,
gint32 flags, gint32 *werror, gboolean blocking, MonoError *error);
gint32 flags, gint32 *werror, MonoBoolean blocking, MonoError *error);
ICALL_EXPORT
gint32
ves_icall_System_Net_Sockets_Socket_Receive_array_internal (gsize sock, WSABUF *buffers, gint32 count, gint32 flags,
gint32 *werror, gboolean blocking, MonoError *error);
gint32 *werror, MonoBoolean blocking, MonoError *error);
ICALL_EXPORT
gint32
ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal (gsize sock, gchar *buffer, gint32 count,
gint32 flags, MonoObjectHandle sockaddr, gint32 *werror, gboolean blocking, MonoError *error);
gint32 flags, MonoObjectHandle sockaddr, gint32 *werror, MonoBoolean blocking, MonoError *error);
ICALL_EXPORT
gint32
ves_icall_System_Net_Sockets_Socket_Send_internal (gsize sock, gchar *buffer, gint32 count,
gint32 flags, gint32 *werror, gboolean blocking, MonoError *error);
gint32 flags, gint32 *werror, MonoBoolean blocking, MonoError *error);
ICALL_EXPORT
gint32
ves_icall_System_Net_Sockets_Socket_Send_array_internal (gsize sock, WSABUF *buffers, gint32 count, gint32 flags,
gint32 *werror, gboolean blocking, MonoError *error);
gint32 *werror, MonoBoolean blocking, MonoError *error);
ICALL_EXPORT
gint32
ves_icall_System_Net_Sockets_Socket_SendTo_internal (gsize sock, gchar *buffer, gint32 count,
gint32 flags, MonoObjectHandle sockaddr, gint32 *werror,
gboolean blocking, MonoError *error);
MonoBoolean blocking, MonoError *error);
ICALL_EXPORT
void
ves_icall_System_Net_Sockets_Socket_Select_internal (MonoArrayHandle sockets, gint32 timeout, gint32 *werror, MonoError *error);
Expand Down Expand Up @@ -298,16 +298,16 @@ MonoBoolean
ves_icall_System_Net_Sockets_Socket_Duplicate_internal (gpointer handle, gint32 targetProcessId, gpointer *duplicate_handle, gint32 *werror, MonoError *error);

ICALL_EXPORT
gboolean
MonoBoolean
ves_icall_System_Net_Sockets_Socket_SendFile_internal (gsize sock, MonoStringHandle filename,
MonoArrayHandle pre_buffer, MonoArrayHandle post_buffer,
gint flags, gint32 *werror, gboolean blocking, MonoError *error);
gint flags, gint32 *werror, MonoBoolean blocking, MonoError *error);

ICALL_EXPORT void
ves_icall_cancel_blocking_socket_operation (MonoThreadObjectHandle thread, MonoError *error);

ICALL_EXPORT
gboolean
MonoBoolean
ves_icall_System_Net_Sockets_Socket_SupportPortReuse (MonoProtocolType proto, MonoError *error);

void
Expand Down

0 comments on commit d072c5f

Please sign in to comment.