PATCH: Define wildcardp as a macro with strpbrk

Alan Modra amodra@bigpond.net.au
Wed Aug 25 23:41:00 GMT 2004


I dislike any comparison against TRUE, so much so that I'll reject any
binutils patch using this sort of test, for the reasons you give up
thread.  Comparisons with FALSE aren't quite as bad, but are still bad
style IMO.

Hmm, I see some "!= TRUE" tests have crept in.

bfd/
	* elf32-m32r.c (m32r_elf_relocate_section): Don't compare with
	TRUE or FALSE.
ld/
	* ldlang.c (lang_init): Don't compare with TRUE.

Index: bfd/elf32-m32r.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m32r.c,v
retrieving revision 1.49
diff -u -p -r1.49 elf32-m32r.c
--- bfd/elf32-m32r.c	24 Aug 2004 08:21:25 -0000	1.49
+++ bfd/elf32-m32r.c	25 Aug 2004 23:25:05 -0000
@@ -2627,7 +2627,7 @@ m32r_elf_relocate_section (output_bfd, i
       howto = m32r_elf_howto_table + r_type;
       r_symndx = ELF32_R_SYM (rel->r_info);
 
-      if (info->relocatable && (use_rel == TRUE))
+      if (info->relocatable && use_rel)
 	{
 	  /* This is a relocatable link.  We don't have to change
 	     anything, unless the reloc is against a section symbol,
@@ -2703,7 +2703,7 @@ m32r_elf_relocate_section (output_bfd, i
 	      sec = local_sections[r_symndx];
 	      sym_name = "<local symbol>";
 
-              if (use_rel == FALSE)
+              if (!use_rel)
                 {
 	          relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
 	          addend = rel->r_addend;
@@ -2730,7 +2730,7 @@ m32r_elf_relocate_section (output_bfd, i
 	  else
 	    {
 	      /* External symbol.  */
-              if (info->relocatable && (use_rel == FALSE))
+              if (info->relocatable && !use_rel)
                 continue;
 
 	      h = sym_hashes[r_symndx - symtab_hdr->sh_info];
Index: ld/ldlang.c
===================================================================
RCS file: /cvs/src/src/ld/ldlang.c,v
retrieving revision 1.161
diff -u -p -r1.161 ldlang.c
--- ld/ldlang.c	25 Aug 2004 06:11:43 -0000	1.161
+++ ld/ldlang.c	25 Aug 2004 23:25:44 -0000
@@ -506,8 +506,8 @@ lang_init (void)
      simpler to re-use working machinery than using a linked list in terms
      of code-complexity here in ld, besides the initialization which just
      looks like other code here.  */
-  if (bfd_hash_table_init_n (&lang_definedness_table,
-			     lang_definedness_newfunc, 3) != TRUE)
+  if (!bfd_hash_table_init_n (&lang_definedness_table,
+			      lang_definedness_newfunc, 3))
     einfo (_("%P%F: out of memory during initialization"));
 
   /* Callers of exp_fold_tree need to increment this.  */

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list