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] Refine read_string


Hi Yao,

> In read_string, we have this line
> 
>   chunksize = (len == -1 ? min (8, fetchlimit) : fetchlimit);
> 
> but chunksize is only used in the block that lne == -1, so IWBN to
> move chunksize to the block in which it is used, and simplify the
> condition setting chunksize.  This patch also moves 'found_nul' to
> inner block.  This patch also splits a paragraph of comment into two,
> and move them to different condition blocks (len > 0 and len == -1)
> respectively.
> 
> Rebuild GDB on x86-linux.  Is it OK?
> 
> gdb:
> 
> 2014-08-21  Yao Qi  <yao@codesourcery.com>
> 
> 	* valprint.c (read_string): Move local variables 'found_nul',
> 	'chunksize' and 'limit' to inner scope.  Update comments.

Sorry for the delay in reviewing this.

I like this small improvement. Would you mind applying it?

-- 
Joel


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