I'm almost tempted to commit as obvious. I noticed that the callers of these functions from code generated by mkoffload declare the 2nd arg as an int, because they have no visibility of the enum. I thought it wise to make the definitions match.

ok for trunk?

nathan
2015-07-15  Nathan Sidwell  <nat...@codesourcery.com>

	* target.c (GOMP_offload_register): Use int for device type arg.
	(GOMP_offload_unregister): Likewise.

Index: target.c
===================================================================
--- target.c	(revision 225843)
+++ target.c	(working copy)
@@ -727,10 +727,11 @@ gomp_offload_image_to_device (struct gom
 
 /* This function should be called from every offload image while loading.
    It gets the descriptor of the host func and var tables HOST_TABLE, TYPE of
-   the target, and TARGET_DATA needed by target plugin.  */
+   the target, and TARGET_DATA needed by target plugin.  TYPE is an
+   int because the caller is not exposed to the enum definition.   */
 
 void
-GOMP_offload_register (void *host_table, enum offload_target_type target_type,
+GOMP_offload_register (void *host_table, int target_type,
 		       void *target_data)
 {
   int i;
@@ -764,7 +765,7 @@ GOMP_offload_register (void *host_table,
    the target, and TARGET_DATA needed by target plugin.  */
 
 void
-GOMP_offload_unregister (void *host_table, enum offload_target_type target_type,
+GOMP_offload_unregister (void *host_table, int target_type,
 			 void *target_data)
 {
   void **host_func_table = ((void ***) host_table)[0];

Reply via email to