From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 4FFD3385DC1B; Wed, 1 Apr 2020 20:13:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4FFD3385DC1B Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Fix value_literal_complex comment X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 3638a098a21ce706ef2b17185f3b165e4f9a5c54 X-Git-Newrev: 6b4a335bf7b7996e904e895b3fdc35443c40cfca Message-Id: <20200401201312.4FFD3385DC1B@sourceware.org> Date: Wed, 1 Apr 2020 20:13:12 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2020 20:13:12 -0000 https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6b4a335bf7b7996e904e895b3fdc35443c40cfca commit 6b4a335bf7b7996e904e895b3fdc35443c40cfca Author: Tom Tromey Date: Wed Apr 1 14:09:52 2020 -0600 Fix value_literal_complex comment Christian pointed out that the value_literal_complex was still a bit weird; this patch rewrites it and moves it to value.h. gdb/ChangeLog 2020-04-01 Tom Tromey * value.h (value_literal_complex): Add comment. * valops.c (value_literal_complex): Refer to value.h. Diff: --- gdb/ChangeLog | 5 +++++ gdb/valops.c | 6 ++---- gdb/value.h | 4 ++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 61d30070e37..12f099559b8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-04-01 Tom Tromey + + * value.h (value_literal_complex): Add comment. + * valops.c (value_literal_complex): Refer to value.h. + 2020-04-01 Tom Tromey * c-exp.y (FLOAT_KEYWORD, COMPLEX): New tokens. diff --git a/gdb/valops.c b/gdb/valops.c index 83fd2584b59..03c6482ee1e 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -3854,12 +3854,10 @@ value_slice (struct value *array, int lowbound, int length) return slice; } -/* Create a value for a FORTRAN complex number. Currently most of the - time values are coerced to COMPLEX*16 (i.e. a complex number - composed of 2 doubles. */ +/* See value.h. */ struct value * -value_literal_complex (struct value *arg1, +value_literal_complex (struct value *arg1, struct value *arg2, struct type *type) { diff --git a/gdb/value.h b/gdb/value.h index 85fe6c297f5..247be13a0d9 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -1138,6 +1138,10 @@ extern struct value *varying_to_slice (struct value *); extern struct value *value_slice (struct value *, int, int); +/* Create a complex number. The type is the complex type; the values + are cast to the underlying scalar type before the complex number is + created. */ + extern struct value *value_literal_complex (struct value *, struct value *, struct type *);