]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use correct default for target functions that return pointer
authorAndreas Schwab <schwab@linux-m68k.org>
Tue, 7 Jan 2014 20:28:53 +0000 (21:28 +0100)
committerAndreas Schwab <schwab@linux-m68k.org>
Tue, 7 Jan 2014 21:58:31 +0000 (22:58 +0100)
* target.c (return_null): Define.
(update_current_target): Use it instead of return_zero for
functions that return a pointer.

gdb/ChangeLog
gdb/target.c

index b97682781f33f468d55beb6f4c6172652335d93b..e3fe61597a08e5a676be9b6f21b9da386096c2d4 100644 (file)
@@ -1,3 +1,9 @@
+2014-01-07  Andreas Schwab  <schwab@linux-m68k.org>
+
+       * target.c (return_null): Define.
+       (update_current_target): Use it instead of return_zero for
+       functions that return a pointer.
+
 2014-01-07  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>
 
        * source.c (add_path): Fix check for duplicated paths in the previously
index 65c7a7a0b1db08d0a15c8db423a906e3d0110c3f..42a8741e3a1a2aec0c436544bb016725ce312ab6 100644 (file)
@@ -64,6 +64,8 @@ static int return_one (void);
 
 static int return_minus_one (void);
 
+static void *return_null (void);
+
 void target_ignore (void);
 
 static void target_command (char *, int);
@@ -806,10 +808,10 @@ update_current_target (void)
            return_zero);
   de_fault (to_extra_thread_info,
            (char *(*) (struct thread_info *))
-           return_zero);
+           return_null);
   de_fault (to_thread_name,
            (char *(*) (struct thread_info *))
-           return_zero);
+           return_null);
   de_fault (to_stop,
            (void (*) (ptid_t))
            target_ignore);
@@ -819,7 +821,7 @@ update_current_target (void)
            tcomplain);
   de_fault (to_pid_to_exec_file,
            (char *(*) (int))
-           return_zero);
+           return_null);
   de_fault (to_async,
            (void (*) (void (*) (enum inferior_event_type, void*), void*))
            tcomplain);
@@ -918,7 +920,7 @@ update_current_target (void)
            tcomplain);
   de_fault (to_traceframe_info,
            (struct traceframe_info * (*) (void))
-           return_zero);
+           return_null);
   de_fault (to_supports_evaluation_of_breakpoint_conditions,
            (int (*) (void))
            return_zero);
@@ -3634,6 +3636,12 @@ return_minus_one (void)
   return -1;
 }
 
+static void *
+return_null (void)
+{
+  return 0;
+}
+
 /*
  * Find the next target down the stack from the specified target.
  */