Update comments to operator_check

Hello,
I happen to read the code and find the comments to operator_check are
incorrect.  This patch is to fix the comments per my understanding.
The comments and field operator_check was added by this patch

  https://sourceware.org/ml/gdb-patches/2010-04/msg00556.html

but the inconsistency between code and comments wasn't pointed out during
the review.

gdb:

2014-07-30  Yao Qi  <yao@codesourcery.com>

	* parser-defs.h (struct exp_descriptor) <operator_check>: Update
	comments.
	* parse.c (exp_iterate): Update comments.
This commit is contained in:
Yao Qi 2014-07-25 19:35:23 +08:00
parent 976411d6b6
commit a1c7835a2f
3 changed files with 20 additions and 14 deletions

View file

@ -1,3 +1,9 @@
2014-07-30 Yao Qi <yao@codesourcery.com>
* parser-defs.h (struct exp_descriptor) <operator_check>: Update
comments.
* parse.c (exp_iterate): Update comments.
2014-07-30 Gary Benson <gbenson@redhat.com> 2014-07-30 Gary Benson <gbenson@redhat.com>
* common/common-defs.h: New file. * common/common-defs.h: New file.

View file

@ -1835,12 +1835,12 @@ operator_check_standard (struct expression *exp, int pos,
return 0; return 0;
} }
/* Call OBJFILE_FUNC for any TYPE and OBJFILE found being referenced by EXP. /* Call OBJFILE_FUNC for any objfile found being referenced by EXP.
The functions are never called with NULL OBJFILE. Functions get passed an OBJFILE_FUNC is never called with NULL OBJFILE. OBJFILE_FUNC get
arbitrary caller supplied DATA pointer. If any of the functions returns passed an arbitrary caller supplied DATA pointer. If OBJFILE_FUNC
non-zero value then (any other) non-zero value is immediately returned to returns non-zero value then (any other) non-zero value is immediately
the caller. Otherwise zero is returned after iterating through whole EXP. returned to the caller. Otherwise zero is returned after iterating
*/ through whole EXP. */
static int static int
exp_iterate (struct expression *exp, exp_iterate (struct expression *exp,

View file

@ -341,14 +341,14 @@ struct exp_descriptor
the number of subexpressions it takes. */ the number of subexpressions it takes. */
void (*operator_length) (const struct expression*, int, int*, int *); void (*operator_length) (const struct expression*, int, int*, int *);
/* Call TYPE_FUNC and OBJFILE_FUNC for any TYPE and OBJFILE found being /* Call OBJFILE_FUNC for any objfile found being referenced by the
referenced by the single operator of EXP at position POS. Operator single operator of EXP at position POS. Operator parameters are
parameters are located at positive (POS + number) offsets in EXP. located at positive (POS + number) offsets in EXP. OBJFILE_FUNC
The functions should never be called with NULL TYPE or NULL OBJFILE. should never be called with NULL OBJFILE. OBJFILE_FUNC should
Functions should get passed an arbitrary caller supplied DATA pointer. get passed an arbitrary caller supplied DATA pointer. If it
If any of the functions returns non-zero value then (any other) non-zero returns non-zero value then (any other) non-zero value should be
value should be immediately returned to the caller. Otherwise zero immediately returned to the caller. Otherwise zero should be
should be returned. */ returned. */
int (*operator_check) (struct expression *exp, int pos, int (*operator_check) (struct expression *exp, int pos,
int (*objfile_func) (struct objfile *objfile, int (*objfile_func) (struct objfile *objfile,
void *data), void *data),