[PATCH] Since "return NULL" and "return 0" were mixed in a function, unified to "return NULL".

TaiseiIto taisei1212@outlook.jp
Sat Sep 10 14:24:30 GMT 2022


The function "gdbarch_find_by_info" in "binutils-gdb/gdb/arch-utils.c" returns 0 on line 1363, but returns NULL on line 1376.
I unified to "return NULL" because it is better representation than the other to indicate an invalid address.
---
 gdb/arch-utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 9bd4f0ddae6..0a0107c76dc 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -1360,7 +1360,7 @@ gdbarch_find_by_info (struct gdbarch_info info)
       if (gdbarch_debug)
 	gdb_printf (gdb_stdlog, "gdbarch_find_by_info: "
 		    "No matching architecture\n");
-      return 0;
+      return NULL;
     }
 
   /* Ask the tdep code for an architecture that matches "info".  */
-- 
2.34.1



More information about the Gdb-patches mailing list