From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIIy1-0007Tl-Nl for qemu-devel@nongnu.org; Fri, 06 May 2011 07:13:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QIIy0-00043L-PZ for qemu-devel@nongnu.org; Fri, 06 May 2011 07:13:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIIy0-00043G-F6 for qemu-devel@nongnu.org; Fri, 06 May 2011 07:13:04 -0400 Message-ID: <4DC3D77C.4030703@redhat.com> Date: Fri, 06 May 2011 13:11:56 +0200 From: Jes Sorensen MIME-Version: 1.0 References: <1304674751-19111-1-git-send-email-Jes.Sorensen@redhat.com> <1304674751-19111-2-git-send-email-Jes.Sorensen@redhat.com> <201105062040.00128.bradh@frogmouth.net> In-Reply-To: <201105062040.00128.bradh@frogmouth.net> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] Add documentation for qemu_progres_print() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Brad Hards Cc: qemu-devel@nongnu.org On 05/06/11 12:40, Brad Hards wrote: > On Fri, 6 May 2011 07:39:10 PM Jes.Sorensen@redhat.com wrote: >> +/* >> + * Add delta to current state, and print the output if the current >> + * state has progressed more than min_skip since the last value was >> + * printed. 'max' specifies the relative percentage, ie. a function >> + * can count for 30% of the total work, and still count from 0-100, by >> + * setting max to 30. If max is set to zero, the percent argument >> + * becomes an absolute value for current state. >> + */ >> void qemu_progress_print(float percent, int max) > I hate to critique anyone adding docs, but this makes no sense at all to me > without reading the code. Is "percent" the amount we are adding (i.e. the > delta) or the result (i.e. absolute progress)? Or does it vary according to > the value of max? What you add is a delta, which is relative to the max. We can change the argument name of the function to be delta instead if that makes it easier to follow. Cheers, Jes