[prev in list] [next in list] [prev in thread] [next in thread] 

List:       viavoice
Subject:    [viavoice] External Notifier Safety
From:       "Scott A. Colcord" <sacolcor () soartech ! com>
Date:       2001-05-29 23:33:40
[Download RAW message or body]

I have a question about the safety of one of the samples supplied
with viavoice...

In the gtkhello sample, the viavoice engine is integrated
into the Gtk message loop via registering this notification
function in the initial SmOpen() call:

static int myNotifier ( int socket_handle, int ( * recv_fn ) ( ),
                        void * recv_data, void * client_data )
{
  int * x_input_id = ( int * ) client_data;

  if ( recv_fn == NULL )
  {
    gdk_input_remove ( * x_input_id );

    return ( SM_RC_OK );
  }

  * x_input_id = gdk_input_add ( socket_handle, 1,
                             ( GdkInputFunction ) recv_fn, recv_data );
  return ( SM_RC_OK) ;
}

My concern is with the cast of recv_fn to type 'GdkInputFunction'.

recv_fn is of type int(*)().
GdkInputFunction is type void(*)(void*, gint, GdkInputCondition)

If Gtk calls back this function, it seems like it might cause some
problems.  Does anyone know what actual parameters viavoice is expecting
from this callback, and also whether the difference in return types
could cause trouble?

-- 
Scott A. Colcord        Software Engineer
Soar Technology, Inc.   sacolcor@soartech.com    (734)327-8000
["sacolcor.vcf" (text/x-vcard)]

---
For information about the IBM ViaVoice SDKs and Run Time Kits for Linux visit: \
http://www.ibm.com/software/speech/dev/sdk_linux.html To view the archive of \
submissions visit: http://viavoice.sparklist.com  To view the Frequently Asked \
Questions visit: http://www.ibm.com/software/speech/dev/faq_linux.html To remove your \
subscription to this list, simply send a note to: \
remove-viavoice@laser.sparklist.com. If you are experiencing any problems using the \
list, please send a note to viavoice-owner@laser.sparklist.com.



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic