[comp.windows.x] Fixes for HP Widgets On SPARC Machines

drapeau@jessica.stanford.edu (George D. Drapeau) (04/08/89)

I'm posting this for Dan Myers, a colleague.  Here's what he has to say:


The following changes are necessary to allow HP's libXw to work on Sun4's
(probably for any machine using SPARC) under X11R3. The affected functions 
apparently took advantage of a quirk of some C compilers which provide that
when no return value is specified, the last expression evaluated is returned.
This is not the case with SPARC compilers (at least, not the ones we use),
and as a result the functions below ALWAYS returned 0!  
	Dan Myers (myers@jessica.stanford.EDU)
	Academic Information Resources
	Stanford University
	4/5/89

*** contrib/widgets/Xhp/Xw/TextEdit.c.old	Wed Apr  5 14:54:37 1989
--- contrib/widgets/Xhp/Xw/TextEdit.c	Wed Apr  5 16:37:31 1989
***************
*** 1920,1929 ****
  /*--------------------------------------------------------------------------+*/
     XwTextEditWidget w;
  {
!   
    (*((XwTextEditClassRec *)(w->core.widget_class))->textedit_class.copy_substring)
!            ((XwTextEditWidget)w, 0, GETLASTPOS(w));
! 
  }
    
  /*--------------------------------------------------------------------------+*/
--- 1920,1929 ----
  /*--------------------------------------------------------------------------+*/
     XwTextEditWidget w;
  {
!  return(
    (*((XwTextEditClassRec *)(w->core.widget_class))->textedit_class.copy_substring)
!            ((XwTextEditWidget)w, 0, GETLASTPOS(w))
!        );
  }
    
  /*--------------------------------------------------------------------------+*/
***************
*** 1931,1938 ****
  /*--------------------------------------------------------------------------+*/
     XwTextEditWidget w;
  {
    (*((XwTextEditClassRec *)(w->core.widget_class))->textedit_class.copy_selection)
!     ((XwTextEditWidget)w);
  }
  
  /*--------------------------------------------------------------------------+*/
--- 1931,1940 ----
  /*--------------------------------------------------------------------------+*/
     XwTextEditWidget w;
  {
+  return(
    (*((XwTextEditClassRec *)(w->core.widget_class))->textedit_class.copy_selection)
!     ((XwTextEditWidget)w)
!        );
  }
  
  /*--------------------------------------------------------------------------+*/
***************
*** 2103,2110 ****
    XwTextEditWidget w;
    XwTextPosition left, right;
  {
    (*((XwTextEditClassRec *)(w->core.widget_class))->textedit_class.copy_substring)
!     ((XwTextEditWidget)w, left, right);
  }
  
  /*--------------------------------------------------------------------------+*/
--- 2105,2114 ----
    XwTextEditWidget w;
    XwTextPosition left, right;
  {
+  return(
    (*((XwTextEditClassRec *)(w->core.widget_class))->textedit_class.copy_substring)
! 	((XwTextEditWidget)w, left, right)
! 	);
  }
  
  /*--------------------------------------------------------------------------+*/


______________________________________________________________________________
George D. Drapeau			Internet: drapeau@jessica.stanford.edu
Academic Information Resources
Stanford University