From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE057C2BB85 for ; Thu, 16 Apr 2020 14:18:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D88F4206B9 for ; Thu, 16 Apr 2020 14:18:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2442298AbgDPOSE convert rfc822-to-8bit (ORCPT ); Thu, 16 Apr 2020 10:18:04 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:40590 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408787AbgDPOSA (ORCPT ); Thu, 16 Apr 2020 10:18:00 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 7E8D32A087F From: Gabriel Krisman Bertazi To: Ricardo =?utf-8?Q?Ca=C3=B1uelo?= Cc: linux-fsdevel@vger.kernel.org, kernel@collabora.com Subject: Re: [PATCH] Implement utf8 unit tests as a kunit test suite. Organization: Collabora References: <20200415082826.19325-1-ricardo.canuelo@collabora.com> <851rood23s.fsf@collabora.com> <20200416075146.zo5bcx5eoatbdgvx@rcn-XPS-13-9360> Date: Thu, 16 Apr 2020 10:17:54 -0400 In-Reply-To: <20200416075146.zo5bcx5eoatbdgvx@rcn-XPS-13-9360> ("Ricardo =?utf-8?Q?Ca=C3=B1uelo=22's?= message of "Thu, 16 Apr 2020 09:51:46 +0200") Message-ID: <855zdz5xbh.fsf@collabora.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Ricardo CaƱuelo writes: > I don't think it's a good idea to have the version specifier hardcoded twice in > the same file, one in string form (for utf8_load) and another one in integer > form (for the rest of the functions that take the version as a parameter). I > think it'd be a better option to use a macro to stringify the version number > from the integer constants and avoid the snprintf entirely: > > #define str(s) #s > #define VERSION_STR(maj, min, rev) str(maj) "." str(min) "." str(rev) > > ... > > table = utf8_load(VERSION_STR(latest_maj, latest_min, latest_rev)); > > > This way we can define the version constant only once, in integer form, and > then the string form will be a constant generated at compile time. Are you ok > with this? fine with me. Thanks, -- Gabriel Krisman Bertazi