changeset 3968:16b17fd1dc93

[xemacs-hg @ 2007-05-20 15:56:30 by stephent] Fix type declarations in progress gauge widget. <873b1r8owl.fsf@uwakimon.sk.tsukuba.ac.jp>
author stephent
date Sun, 20 May 2007 15:56:36 +0000
parents e6ca8521a705
children a7c03016302e
files lisp/ChangeLog lisp/gutter-items.el lwlib/ChangeLog lwlib/xlwgauge.c lwlib/xlwgauge.h
diffstat 5 files changed, 38 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat May 19 21:51:03 2007 +0000
+++ b/lisp/ChangeLog	Sun May 20 15:56:36 2007 +0000
@@ -1,3 +1,7 @@
+2007-05-20  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* gutter-items.el (progress-feedback-with-label): Clarify docstring.
+
 2007-05-13  Adrian Aichner  <adrian@xemacs.org>
 
 	* abbrev.el: Sort abbrev-table-name-list entries by name.  Unlike
@@ -31,7 +35,7 @@
 	* dumped-lisp.el (preloaded-file-list): Move resize-minibuffer
 	before simple.
 
-	* resize-minibuffer.el: Remove CVS $Id: ChangeLog,v 1.796 2007/05/19 18:41:56 adrian Exp $ cookie..
+	* resize-minibuffer.el: Remove CVS $Id: ChangeLog,v 1.797 2007/05/20 15:56:30 stephent Exp $ cookie..
 
 	* resize-minibuffer.el (resize-minibuffer-mode): Remove autoload.
 
--- a/lisp/gutter-items.el	Sat May 19 21:51:03 2007 +0000
+++ b/lisp/gutter-items.el	Sun May 20 15:56:36 2007 +0000
@@ -679,8 +679,10 @@
 
 (defun progress-feedback-with-label (label fmt &optional value &rest args)
   "Print a progress gauge and message in the bottom gutter area of the frame.
-First argument LABEL is an identifier for this progress gauge.  The rest of the
-arguments are the same as to `format'."
+LABEL is an identifier for this progress gauge.
+FMT is a format string to be passed to `format' along with ARGS.
+Optional VALUE is the current degree of progress, an integer 0-100.
+The remaining ARGS are passed with FMT `(apply #'format FMT ARGS)'."
   ;; #### sometimes the buffer gets changed temporarily. I don't know
   ;; why this is, so protect against it.
   (save-excursion
--- a/lwlib/ChangeLog	Sat May 19 21:51:03 2007 +0000
+++ b/lwlib/ChangeLog	Sun May 20 15:56:36 2007 +0000
@@ -1,3 +1,16 @@
+2007-05-20  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	Gauge values are signed integers (ints).
+	
+	* xlwgauge.h: Get rid of references to Cardinal in comment.
+	(XawGaugeGetValue): Declare return value as int.
+	(XawGaugeSetValue): Declare value as int.
+
+	* xlwgauge.c (GaugeGetValue): Declare value as int.
+	(GaugeMercury): Declare val0 and val1 as int.  Remove redundant casts.
+	(XawGaugeGetValue): Declare return value as int.
+	(XawGaugeSetValue): Declare value as int.
+
 2007-05-17  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* lwlib-Xaw.c (wm_delete_window): Iterate over children of shell
--- a/lwlib/xlwgauge.c	Sat May 19 21:51:03 2007 +0000
+++ b/lwlib/xlwgauge.c	Sun May 20 15:56:36 2007 +0000
@@ -132,7 +132,7 @@
 static void DisableUpdate (GaugeWidget);
 
 static void GaugeGetValue (XtPointer, XtIntervalId *);
-static void GaugeMercury (Display *, Window, GC, GaugeWidget, Cardinal, Cardinal);
+static void GaugeMercury (Display *, Window, GC, GaugeWidget, int, int);
 
 static Boolean GaugeConvert (Widget, Atom *, Atom *, Atom *,
 			     XtPointer *, unsigned long *, int *);
@@ -817,8 +817,7 @@
 	 */
 
 void
-XawGaugeSetValue (Widget   w,
-		  Cardinal value)
+XawGaugeSetValue (Widget w, int value)
 {
 	GaugeWidget gw = (GaugeWidget)w ;
 	int	oldvalue ;
@@ -850,7 +849,7 @@
 }
 
 
-Cardinal
+int
 XawGaugeGetValue (Widget w)
 {
 	GaugeWidget gw = (GaugeWidget)w ;
@@ -873,8 +872,8 @@
 	      Window      win,
 	      GC          gc,
 	      GaugeWidget gw,
-	      Cardinal    val0,
-	      Cardinal    val1)
+	      int    val0,
+	      int    val1)
 {
 	int	v0 = gw->gauge.v0 ;
 	int	v1 = gw->gauge.v1 ;
@@ -893,10 +892,10 @@
 
 	if( vd <= 0 ) vd = 1 ;
 
-	if( (int) val0 < v0 ) val0 = v0 ;
-	else if( (int) val0 > v1 ) val0 = v1 ;
-	if( (int) val1 < v0 ) val1 = v0 ;
-	else if( (int) val1 > v1 ) val1 = v1 ;
+	if( val0 < v0 ) val0 = v0 ;
+	else if( val0 > v1 ) val0 = v1 ;
+	if( val1 < v0 ) val1 = v0 ;
+	else if( val1 > v1 ) val1 = v1 ;
 
 	p0 = (val0-v0)*(e1-e0-1)/vd ;
 	p1 = (val1-v0)*(e1-e0-1)/vd ;
@@ -1108,7 +1107,7 @@
 	       XtIntervalId *UNUSED (intervalId))
 {
 	GaugeWidget	gw = (GaugeWidget)clientData ;
-	Cardinal	value ;
+	int	value ;
 
 	if( gw->gauge.update > 0 )
 	  EnableUpdate(gw) ;
--- a/lwlib/xlwgauge.h	Sat May 19 21:51:03 2007 +0000
+++ b/lwlib/xlwgauge.h	Sun May 20 15:56:36 2007 +0000
@@ -48,9 +48,9 @@
 
  Name			Class		RepType		Default Value
  ----			-----		-------		-------------
- value			Value		Cardinal	0
- minValue		MinValue	Cardinal	0
- maxValue		MaxValue	Cardinal	100
+ value			Value		Int	0
+ minValue		Int	Cardinal	0
+ maxValue		Int	Cardinal	100
  ntics			NTics		Cardinal	0	+
  nlabels		NLabels		Cardinal	0	++
  labels			Labels		String *	NULL	+++
@@ -100,7 +100,7 @@
 		XtPointer client ;
 		XtPointer rval ;
 	{
-	  *(Cardinal *)rval = value ;
+	  *(int *)rval = value ;
 	}
 
 */
@@ -169,11 +169,11 @@
 extern	void	XawGaugeSetValue(
 #if NeedFunctionPrototypes
 	Widget	gauge,
-	Cardinal value
+	int value
 #endif
 );
 
-extern	Cardinal XawGaugeGetValue(
+extern	int XawGaugeGetValue(
 #if NeedFunctionPrototypes
 	Widget	gauge
 #endif