This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] IS_ABSOLUTE_PATH to handle both DOS and POSIX path styles


> From: Aleksandar Ristovski <ARistovski@qnx.com>
> Cc: Daniel Jacobowitz <drow@false.org>, Joel Brobecker 	 <brobecker@adacore.com>, Ryan Mansfield <RMansfield@qnx.com>
> Date: Fri, 4 Jan 2008 14:02:30 -0500
> 
> +#define IS_DIR_SEPARATOR_X(c)	  ((c) == '/')
> +#define IS_ABSOLUTE_PATH_X(c)	  (IS_DIR_SEPARATOR_X((f)[0]))

I think _X is not appropriate here.  How about _POSIX?

> +
> +/* Universal macros, to be used on paths that could be either
> +   POSIX or DOS.  */

What would be the use of these _ANY predicates?  We always run on a
platform that is either DOS or Posix, but never both, right?

A minor nit: your ChangeLog entry

2008-01-04  Aleksandar Ristovski  <aristovski@qnx.com>

        * filenames.h (IS_DIR_SEPARATOR_DOS): New macro.
        (IS_ABSOLUTE_PATH_DOS): New macro.
        (IS_DIR_SEPARATOR_X): New macro.
        (IS_ABSOLUTE_PATH_X): New macro.
        (IS_DIR_SEPARATOR_ANY): New macro.
        (IS_ABSOLUTE_PATH_ANY): New macro.

has two problems:

 . It uses leading spaces instead of a single TAB (maybe due to your
   mailer's munging of whitespace).

 . You could rewrite it as a much more compact single entry:

2008-01-04  Aleksandar Ristovski  <aristovski@qnx.com>

	* filenames.h (IS_DIR_SEPARATOR_DOS, IS_ABSOLUTE_PATH_DOS)
	(IS_DIR_SEPARATOR_X, IS_ABSOLUTE_PATH_X, IS_DIR_SEPARATOR_ANY)
	(IS_ABSOLUTE_PATH_ANY): New macros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]