diff options
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/linespec.c | 11 |
2 files changed, 11 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 389fa48..c5ea139 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2007-08-10 Michael Snyder <msnyder@access-company.com> + * linespec.c (decode_dollar): Dead code, ptr can't be non-null. + (decode_objc): Use "NULL" instead of 0. + (find_method): Ditto. + (decode_all_digits): Ditto. + (decode_dollar): Ditto. + * mi/mi-main.c (mi_cmd_data_evaluate_expression): Resource leak. * mi/mi-cmd-var.c (mi_cmd_var_list_children): Memory leak. diff --git a/gdb/linespec.c b/gdb/linespec.c index a00cffe..c704d9c 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -1105,7 +1105,7 @@ decode_objc (char **argptr, int funfirstline, struct symtab *file_symtab, if (i1 > 0) { sym_arr = (struct symbol **) alloca ((i1 + 1) * sizeof (struct symbol *)); - sym_arr[i1] = 0; + sym_arr[i1] = NULL; copy = find_imps (file_symtab, block, *argptr, sym_arr, &i1, &i2); *argptr = copy; @@ -1145,7 +1145,7 @@ decode_objc (char **argptr, int funfirstline, struct symtab *file_symtab, else { /* The only match was a non-debuggable symbol. */ - values.sals[0].symtab = 0; + values.sals[0].symtab = NULL; values.sals[0].line = 0; values.sals[0].end = 0; values.sals[0].pc = SYMBOL_VALUE_ADDRESS (sym_arr[0]); @@ -1411,7 +1411,7 @@ find_method (int funfirstline, char ***canonical, char *saved_arg, char *copy, struct type *t, struct symbol *sym_class) { struct symtabs_and_lines values; - struct symbol *sym = 0; + struct symbol *sym = NULL; int i1; /* Counter for the symbol array. */ struct symbol **sym_arr = alloca (total_number_of_methods (t) * sizeof (struct symbol *)); @@ -1573,7 +1573,7 @@ decode_all_digits (char **argptr, struct symtab *default_symtab, sign = none; /* We might need a canonical line spec if no file was specified. */ - int need_canonical = (file_symtab == 0) ? 1 : 0; + int need_canonical = (file_symtab == NULL) ? 1 : 0; init_sal (&val); @@ -1675,7 +1675,7 @@ decode_dollar (char *copy, int funfirstline, struct symtab *default_symtab, /* Look up entire name as a symbol first. */ sym = lookup_symbol (copy, 0, VAR_DOMAIN, 0, &sym_symtab); - file_symtab = (struct symtab *) 0; + file_symtab = (struct symtab *) NULL; need_canonical = 1; /* Symbol was found --> jump to normal symbol processing. */ if (sym) @@ -1689,7 +1689,6 @@ decode_dollar (char *copy, int funfirstline, struct symtab *default_symtab, return minsym_found (funfirstline, msymbol); /* Not a user variable or function -- must be convenience variable. */ - need_canonical = (file_symtab == 0) ? 1 : 0; valx = value_of_internalvar (lookup_internalvar (copy + 1)); if (TYPE_CODE (value_type (valx)) != TYPE_CODE_INT) error (_("Convenience variables used in line specs must have integer values.")); |