This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Add fseek to ui-file
- From: Tom Tromey <tromey at redhat dot com>
- To: Hui Zhu <teawater at gmail dot com>
- Cc: gdb-patches ml <gdb-patches at sourceware dot org>, Hui Zhu <hui_zhu at mentor dot com>
- Date: Thu, 06 Dec 2012 14:48:07 -0700
- Subject: Re: [PATCH] Add fseek to ui-file
- References: <CANFwon0Nv=Dk7-1kmxwjwv9zd-qoWUL18mpqH9vazRzBnkd10g@mail.gmail.com>
>>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes:
Hui> And stdio_file_fseek has a place different from the other stdio_file
Hui> functions. It check the return of fseek. If it got error, it will
Hui> throw error.
Hui> If you think it is OK, I will post patch for other stdio_file functions.
Hui> If not, it will update this patch.
Thanks.
Hui> void
Hui> +set_ui_file_fseek (struct ui_file *file, ui_file_fseek_ftype *fseek)
Hui> +{
Hui> + file->to_fseek = fseek;
I found the argument name 'fseek' confusing here, since this mimics a
global function of the same name. Could you rename the argument?
Hui> +static void stdio_file_fseek (struct ui_file * file, long offset, int whence)
Hui> +{
Newline after 'void'.
I wonder whether the null fseek ought to unconditionally throw an
exception. It seems to me that it can't really be successful.
I think this should go in conditionally based on the other patches -- no
need to put it in if it turns out you can't use ui_file after all for
some reason.
Tom