This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add fseek to ui-file


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]