From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18449 invoked by alias); 22 Oct 2010 15:39:39 -0000 Received: (qmail 18437 invoked by uid 22791); 22 Oct 2010 15:39:37 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 22 Oct 2010 15:39:32 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9MFdUpp031254 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 22 Oct 2010 11:39:30 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id o9MFdUB4012783; Fri, 22 Oct 2010 11:39:30 -0400 Received: from parfait.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o9MFdSPm022254; Fri, 22 Oct 2010 11:39:29 -0400 From: Tom Tromey To: sami wagiaalla Cc: gdb-patches@sourceware.org Subject: Re: [patch 1/2] Overload resolution among children of a common ancestor References: <4C7BD80C.1050906@redhat.com> <4CBDFF43.7000403@redhat.com> Date: Fri, 22 Oct 2010 15:39:00 -0000 In-Reply-To: <4CBDFF43.7000403@redhat.com> (sami wagiaalla's message of "Tue, 19 Oct 2010 16:27:47 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-10/txt/msg00349.txt.bz2 >>>>> "Sami" == sami wagiaalla writes: Sami> This patch introduces a rank struct to be used instead of the int that Sami> is normally used to represent the rank of a conversion. Thanks. I have a few nits to pick but nothing serious. Sami> +/* Return the sum of the rank of A with the rank of B. */ Sami> +struct rank Blank line between comment and start of function. Sami> +/* Compare rank A and B and return: Sami> + 0 if a = b Sami> + 1 if a is better than b Sami> + -1 if b is better than a. */ Sami> +int Sami> +compare_ranks (struct rank a, struct rank b) Likewise. Sami> - LENGTH_MATCH (bv) = (nargs != nparms) ? LENGTH_MISMATCH_BADNESS : 0; Sami> + LENGTH_MATCH (bv) = (nargs != nparms) ? LENGTH_MISMATCH_BADNESS : EXACT_MATCH_BADNESS; I think this needs a line break. Sami> /* Badness if parameter list length doesn't match arg list length */ Sami> -#define LENGTH_MISMATCH_BADNESS 100 Sami> +static const struct rank LENGTH_MISMATCH_BADNESS = {100}; Instead of defining a static instance in the header, define a single instance with a different (not upper-case) name in a .c file, put an extern declaration in the header, and then make the #define refer to it. Tom