home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / isis / 241 < prev    next >
Encoding:
Text File  |  1992-09-08  |  1.6 KB  |  45 lines

  1. Newsgroups: comp.sys.isis
  2. Path: sparky!uunet!paladin.american.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!rpi!batcomputer!cornell!honir!rcbc
  3. From: rcbc@honir.cs.cornell.edu (Robert Cooper)
  4. Subject: Re: ISIS3.0 and C++
  5. In-Reply-To: adc@tardis.msu.edu's message of Tue, 8 Sep 92 01:17:40 GMT
  6. Message-ID: <RCBC.92Sep8151749@honir.cs.cornell.edu>
  7. Sender: rcbc@cs.cornell.edu (Robert Cooper)
  8. Reply-To: rcbc@cs.cornell.edu
  9. Organization: Cornell Univ. CS Dept, Ithaca NY 14853
  10. References: <1992Sep8.011740.2412@msuinfo.cl.msu.edu>
  11. Date: Tue, 8 Sep 1992 20:17:49 GMT
  12. Lines: 31
  13.  
  14. In article <1992Sep8.011740.2412@msuinfo.cl.msu.edu> adc@tardis.msu.edu (Alan D. Cabrera) writes:
  15.  
  16.    I'm registering some routines in C++ with isis_task and it seems that I
  17.    must cast the routines to F570810ac.  Am I doing something wrong?  I'd
  18.    like to use something more mnemonic.
  19.  
  20. If you cast the parameter as a void (*)(void *) you should be OK.
  21. E.g.
  22.  
  23.      isis_task(void (*foobar)(void *), "foobar")
  24.  
  25. A shorthard typedef for this function type is declared isis.h but
  26. unfortunately the typedef's name "v_routine_vs" was accidentally obscured
  27. by our obscurifier, to become the highly mnemonic "F570810ac". We'll fix
  28. this in the next release.
  29.  
  30. An alternative to casting the isis_task call (and the t_fork call as well)
  31. is to declare the function itself with the types that isis_task expects:
  32.  
  33. void foobar (void *arg_void) {
  34.    wombat *arg = arg_void;
  35.    ....
  36. }
  37.  
  38. ...and then cast the void * argument to whatever type was actually passed
  39. in. Most optimizing compilers won't create an extra variable or any extra
  40. code for this example.
  41.  
  42. -- Robert Cooper
  43. --
  44. -- 
  45.