From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2555 invoked by alias); 21 Dec 2006 11:48:13 -0000 Received: (qmail 2547 invoked by uid 22791); 21 Dec 2006 11:48:13 -0000 X-Spam-Check-By: sourceware.org Received: from mail.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 21 Dec 2006 11:48:03 +0000 Received: from Relay1.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 8D59D12268; Thu, 21 Dec 2006 12:47:59 +0100 (CET) From: Andreas Schwab To: Joel Brobecker Cc: Markus Deuling , GDB Patches Subject: Re: [RFA] gdbserver/server.c: Replace 2x strlen() by a variable References: <458A3B6C.2040803@de.ibm.com> <20061221110904.GG3640@adacore.com> X-Yow: I'm pretending I'm pulling in a TROUT! Am I doing it correctly?? Date: Thu, 21 Dec 2006 11:48:00 -0000 In-Reply-To: <20061221110904.GG3640@adacore.com> (Joel Brobecker's message of "Thu, 21 Dec 2006 15:09:04 +0400") Message-ID: User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes 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: 2006-12/txt/msg00286.txt.bz2 Joel Brobecker writes: >> ChangeLog: >> >> * server.c (handle_general_set): New variable len instead >> of using strlen two times. > > Actually, since the same string is duplicated a couple of times, > I would also suggest declaring a constant string "QPassSignals:" > and use the constant instead of risking a typo... How about: > > const char str[] = "QPassSignals:"; Or just define it as a macro. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."