From patchwork Wed Jul 15 19:04:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 495982 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E2AA2140284 for ; Thu, 16 Jul 2015 05:04:42 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=Ur+o/rAE; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=RAKOEaEhrn/lDm+Q67Krudj5fFU/FtgNGTKXIs9Ee+N LnZb+/PZIUFKD95as/ZEyVmLbnZqA0shMz+I3krAW3Muz4Wi84Vm5E+0wjVjBqIg m30ZQVULfKB0ZpLWlL9vpJEJgthfs55rgVxfF4KzLnSpvy/seVogPLA3oX8ou+wM = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=tm2B09kOzohtOq9KtlzAdXsccVQ=; b=Ur+o/rAEvhkU4RluF gZhDIsNrvYwlkke9YqOA0JjzIldkReU7tqtXwg4Tegr/zV7Ph9TUpbR4FbxLzxzm NEUXn5NvGrpTko0kpcEMF61Fi9tY5clVABvdRRCCseIt0rDd3JolkaQTW3dP9NUn xw4wZH7IDUm7kUeUSBYgrVVTps= Received: (qmail 24337 invoked by alias); 15 Jul 2015 19:04:35 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 24327 invoked by uid 89); 15 Jul 2015 19:04:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qk0-f169.google.com Received: from mail-qk0-f169.google.com (HELO mail-qk0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 15 Jul 2015 19:04:34 +0000 Received: by qkdl129 with SMTP id l129so35148199qkd.0 for ; Wed, 15 Jul 2015 12:04:31 -0700 (PDT) X-Received: by 10.140.238.146 with SMTP id j140mr4336049qhc.3.1436987071705; Wed, 15 Jul 2015 12:04:31 -0700 (PDT) Received: from ?IPv6:2601:181:c000:c497:a2a8:cdff:fe3e:b48? ([2601:181:c000:c497:a2a8:cdff:fe3e:b48]) by smtp.googlemail.com with ESMTPSA id w126sm2731219qkw.32.2015.07.15.12.04.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Jul 2015 12:04:30 -0700 (PDT) Message-ID: <55A6AEBE.5090406@acm.org> Date: Wed, 15 Jul 2015 15:04:30 -0400 From: Nathan Sidwell User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Jakub Jelinek CC: GCC Patches Subject: fixup gomp register/unregister prototypes 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 * 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];