git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Really *do* nothing in while loop

From
JPJames Purser <purserj@ksit.dynalias.com>
Date
May 8, 2005, 11:20 UTC
Message-ID
<1115551204.3085.0.camel@kryten>
In-Reply-To
<427DE086.40307@tls.msk.ru>
On Sun, 2005-05-08 at 19:48, Michael Tokarev wrote:
Show 30 quoted lines
> Thomas Glanzmann wrote:
> > [PATCH] Really *do* nothing in while loop
> > 
> > Signed-Off-by: Thomas Glanzmann <sithglan@stud.uni-erlangen.de>
> > 
> > --- a/sha1_file.c
> > +++ b/sha1_file.c
> > @@ -335,7 +335,7 @@
> >  	stream.next_in = hdr;
> >  	stream.avail_in = hdrlen;
> >  	while (deflate(&stream, 0) == Z_OK)
> > -		/* nothing */
> > +		/* nothing */;
> >  
> >  	/* Then the data itself.. */
> >  	stream.next_in = buf;
> 
> Well, the lack of semicolon is wrong really (and funny).
> 
> But is the whole while loop needed at all?  deflate()
> consumes as much input as it can, producing as much output
> as it can.  So without the loop, and without updating the
> buffer pointers ({next,avail}_{in,out}) it will do just
> fine without the loop, and will return something != Z_OK
> on next iteration.  If this is to mean to flush output,
> it should be deflate(&stream, Z_FLUSH) or something.
> 
> /mjt
> 
> P.S.  What's git@vger.kernel.org for ?
Its the mailing list for git development.
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-- 
James Purser
http://ksit.dynalias.com
Previous: Thomas GlanzmannNext: jdow
Message 4 of 9 in “Really *do* nothing in while loop”
  1. Really *do* nothing in while loopThomas Glanzmann, May 8, 2005
  2. Michael TokarevMay 8, 2005
  3. Thomas GlanzmannMay 8, 2005
  4. James PurserMay 8, 2005
  5. jdowMay 8, 2005
  6. Michael TokarevMay 8, 2005
  7. Junio C HamanoMay 8, 2005
  8. Daniel BarkalowMay 8, 2005
  9. Junio C HamanoMay 8, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.