[2398] 2009-07-06 Pavel Roskin <[email protected]>

Pavel Roskin <[email protected]> Mon, 06 Jul 2009 20:13:06 +0000
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 2398
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2398
Author:   proski
Date:     2009-07-06 20:13:06 +0000 (Mon, 06 Jul 2009)
Log Message:
-----------
2009-07-06  Pavel Roskin  <[email protected]>

	* commands/search.c (search_fs): Replace QUID macro with quid_fn
	function pointer.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/commands/search.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-07-06 20:07:58 UTC (rev 2397)
+++ trunk/grub2/ChangeLog	2009-07-06 20:13:06 UTC (rev 2398)
@@ -1,3 +1,8 @@
+2009-07-06  Pavel Roskin  <[email protected]>
+
+	* commands/search.c (search_fs): Replace QUID macro with quid_fn
+	function pointer.
+
 2009-07-06  Daniel Mierswa  <[email protected]>
 
 	* commands/search.c (search_fs): Use grub_strcasecmp() for UUID

Modified: trunk/grub2/commands/search.c
===================================================================
--- trunk/grub2/commands/search.c	2009-07-06 20:07:58 UTC (rev 2397)
+++ trunk/grub2/commands/search.c	2009-07-06 20:13:06 UTC (rev 2398)
@@ -68,17 +68,17 @@
 	{
 	  grub_fs_t fs;
 	  int (*compare_fn) (const char *, const char *);
+	  grub_err_t (*quid_fn) (grub_device_t, char **);
 
 	  fs = grub_fs_probe (dev);
 	  compare_fn = is_uuid ? grub_strcasecmp : grub_strcmp;
+	  quid_fn = is_uuid ? fs->uuid : fs->label;
 
-#define QUID(x)	(is_uuid ? (x)->uuid : (x)->label)
-
-	  if (fs && QUID(fs))
+	  if (fs && quid_fn)
 	    {
 	      char *quid;
 
-	      (QUID(fs)) (dev, &quid);
+	      quid_fn (dev, &quid);
 	      if (grub_errno == GRUB_ERR_NONE && quid)
 		{
 		  if (compare_fn (quid, key) == 0)