Cleanup compiler warnings.

This commit is contained in:
Jonathan Moore Liles 2012-02-26 19:35:31 -08:00
parent 2f67b1bee4
commit 250b7db644
17 changed files with 69 additions and 57 deletions

View File

@ -17,6 +17,10 @@
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*******************************************************************************/ /*******************************************************************************/
#pragma GCC diagnostic ignored "-Wchar-subscripts"
#include "Boxtypes.H" #include "Boxtypes.H"
#include <FL/fl_draw.H> #include <FL/fl_draw.H>
#include <string.h> #include <string.h>

View File

@ -82,8 +82,9 @@ extern NSM_Client *nsm;
#define OSC_REPLY_OK() ((OSC::Endpoint*)user_data)->send( lo_message_get_source( msg ), path, 0, "OK" ) #define OSC_REPLY_OK() ((OSC::Endpoint*)user_data)->send( lo_message_get_source( msg ), path, 0, "OK" )
#define OSC_REPLY( value ) ((OSC::Endpoint*)user_data)->send( lo_message_get_source( msg ), path, value ) #define OSC_REPLY( value ) ((OSC::Endpoint*)user_data)->send( lo_message_get_source( msg ), path, value )
#define OSC_REPLY_ERR(errcode, value) ((OSC::Endpoint*)user_data)->send( lo_message_get_source( msg ), path,errcode, value ) #define OSC_REPLY_ERR(errcode, value) ((OSC::Endpoint*)user_data)->send( lo_message_get_source( msg ), path,errcode, value )
#define OSC_ENDPOINT() ((OSC::Endpoint*)user_data)
OSC_HANDLER( add_strip ) static int osc_add_strip ( const char *path, const char *, lo_arg **, int , lo_message msg, void *user_data )
{ {
OSC_DMSG(); OSC_DMSG();
@ -200,7 +201,7 @@ void Mixer::cb_menu(Fl_Widget* o) {
// read_line( user_config_dir, "default_path", &path ); // read_line( user_config_dir, "default_path", &path );
const char *name = fl_dir_chooser( "Open Project", path, NULL ); const char *name = fl_dir_chooser( "Open Project", path );
free( path ); free( path );
@ -402,7 +403,7 @@ Mixer::init_osc ( const char *osc_port )
printf( "OSC=%s\n", osc_endpoint->url() ); printf( "OSC=%s\n", osc_endpoint->url() );
osc_endpoint->add_method( "/non/mixer/add_strip", "", OSC_NAME( add_strip ), osc_endpoint, "" ); osc_endpoint->add_method( "/non/mixer/add_strip", "", osc_add_strip, osc_endpoint, "" );
// osc_endpoint->start(); // osc_endpoint->start();
@ -712,7 +713,7 @@ Mixer::command_load ( const char *path, const char *display_name )
{ {
mixer->hide(); mixer->hide();
if ( int err = Project::open( path ) ) if ( Project::open( path ) )
{ {
// fl_alert( "Error opening project specified on commandline: %s", Project::errstr( err ) ); // fl_alert( "Error opening project specified on commandline: %s", Project::errstr( err ) );
return false; return false;

View File

@ -254,7 +254,7 @@ Module::Port::generate_osc_path ()
} }
void void
Module::Port::handle_signal_connection_state_changed ( OSC::Signal *s ) Module::Port::handle_signal_connection_state_changed ( OSC::Signal * )
{ {
module()->redraw(); module()->redraw();
} }

View File

@ -41,7 +41,7 @@ int
NSM_Client::command_broadcast ( const char *path, lo_message msg ) NSM_Client::command_broadcast ( const char *path, lo_message msg )
{ {
int argc = lo_message_get_argc( msg ); int argc = lo_message_get_argc( msg );
lo_arg **argv = lo_message_get_argv( msg ); // lo_arg **argv = lo_message_get_argv( msg );
if ( argc == 1 && !strcmp( path, "/non/finger" ) ) if ( argc == 1 && !strcmp( path, "/non/finger" ) )
{ {

View File

@ -81,7 +81,7 @@ ensure_dirs ( void )
#include <signal.h> #include <signal.h>
static void cb_main ( Fl_Double_Window *o, void *) static void cb_main ( Fl_Double_Window *, void *)
{ {
if ( Fl::event() == FL_SHORTCUT && Fl::event_key() == FL_Escape ) if ( Fl::event() == FL_SHORTCUT && Fl::event_key() == FL_Escape )
return; return;
@ -164,8 +164,10 @@ main ( int argc, char **argv )
{ {
main_window->xclass( APP_NAME ); main_window->xclass( APP_NAME );
Fl_Widget *o = mixer = new Mixer( 0, 0, main_window->w(), main_window->h(), NULL ); {
Fl_Group::current()->resizable(o); Fl_Widget *o = mixer = new Mixer( 0, 0, main_window->w(), main_window->h(), NULL );
Fl_Group::current()->resizable(o);
}
} }
o->end(); o->end();

View File

@ -24,6 +24,8 @@
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#pragma GCC diagnostic ignored "-Wunused-parameter"
namespace NSM namespace NSM
{ {

View File

@ -88,12 +88,12 @@ namespace NSM
virtual int command_open ( const char *name, const char *display_name, const char *client_id, char **out_msg ) = 0; virtual int command_open ( const char *name, const char *display_name, const char *client_id, char **out_msg ) = 0;
virtual int command_save ( char **out_msg ) = 0; virtual int command_save ( char **out_msg ) = 0;
virtual void command_active ( bool active ) { } virtual void command_active ( bool ) { }
virtual void command_session_is_loaded ( void ) { } virtual void command_session_is_loaded ( void ) { }
/* invoked when an unrecognized message is received. Should return 0 if you handled it, -1 otherwise. */ /* invoked when an unrecognized message is received. Should return 0 if you handled it, -1 otherwise. */
virtual int command_broadcast ( const char *path, lo_message msg ) { return -1; } virtual int command_broadcast ( const char *, lo_message ) { return -1; }
private: private:

View File

@ -28,6 +28,8 @@
#include "Thread.H" #include "Thread.H"
#pragma GCC diagnostic ignored "-Wunused-parameter"
namespace OSC namespace OSC
{ {

View File

@ -364,12 +364,12 @@ namespace OSC
}; };
/* helper macros for defining OSC handlers */ /* helper macros for defining OSC handlers */
#define OSC_NAME( name ) osc_ ## name /* #define OSC_NAME( name ) osc_ ## name */
#define OSC_DMSG() DMESSAGE( "Got OSC message: %s", path ); #define OSC_DMSG() DMESSAGE( "Got OSC message: %s", path );
#define OSC_HANDLER( name ) static int OSC_NAME( name ) ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data ) // #define OSC_HANDLER( name ) static int OSC_NAME( name ) ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data )
#define OSC_REPLY_OK() ((OSC::Endpoint*)user_data)->send( lo_message_get_source( msg ), path, "ok" ) /* #define OSC_REPLY_OK() ((OSC::Endpoint*)user_data)->send( lo_message_get_source( msg ), path, "ok" ) */
#define OSC_REPLY( value ) ((OSC::Endpoint*)user_data)->send( lo_message_get_source( msg ), path, value ) /* #define OSC_REPLY( value ) ((OSC::Endpoint*)user_data)->send( lo_message_get_source( msg ), path, value ) */
#define OSC_REPLY_ERR() ((OSC::Endpoint*)user_data)->send( lo_message_get_source( msg ), path, "err" ) /* #define OSC_REPLY_ERR() ((OSC::Endpoint*)user_data)->send( lo_message_get_source( msg ), path, "err" ) */
#define OSC_ENDPOINT() ((OSC::Endpoint*)user_data) /* #define OSC_ENDPOINT() ((OSC::Endpoint*)user_data) */

View File

@ -304,7 +304,7 @@ mkpath ( const char *path, bool create_final_directory )
char *i = p + 1; char *i = p + 1;
while ( i = index( i, '/' ) ) while ( ( i = index( i, '/' ) ) )
{ {
*i = 0; *i = 0;
@ -1206,8 +1206,6 @@ OSC_HANDLER( duplicate )
// save_session_file(); // save_session_file();
const char *src = session_path;
char *spath; char *spath;
asprintf( &spath, "%s/%s", session_root, &argv[0]->s ); asprintf( &spath, "%s/%s", session_root, &argv[0]->s );
@ -1615,7 +1613,7 @@ OSC_HANDLER( error )
{ {
Client *c = get_client_by_address( lo_message_get_source( msg ) ); Client *c = get_client_by_address( lo_message_get_source( msg ) );
const char *rpath = &argv[0]->s; // const char *rpath = &argv[0]->s;
int err_code = argv[1]->i; int err_code = argv[1]->i;
@ -1637,7 +1635,7 @@ OSC_HANDLER( reply )
{ {
Client *c = get_client_by_address( lo_message_get_source( msg ) ); Client *c = get_client_by_address( lo_message_get_source( msg ) );
const char *rpath = &argv[0]->s; // const char *rpath = &argv[0]->s;
const char *message = &argv[1]->s; const char *message = &argv[1]->s;
if ( c ) if ( c )

View File

@ -26,23 +26,17 @@
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
/* helper macros for defining OSC handlers */
#define OSC_NAME( name ) osc_ ## name
// #define OSCDMSG() DMESSAGE( "Got OSC message: %s", path );
#define OSC_HANDLER( name ) static int OSC_NAME( name ) ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data )
static bool got_response = false; static bool got_response = false;
/************************/ /************************/
/* OSC Message Handlers */ /* OSC Message Handlers */
/************************/ /************************/
OSC_HANDLER( reply ) static int osc_reply ( const char *path, const char *types, lo_arg **argv, int argc, lo_message, void * )
{ {
// OSCDMSG(); // OSCDMSG();
printf( "Reply: " ); printf( "%s : ", path );
for ( int i = 0; i < argc; ++i ) for ( int i = 0; i < argc; ++i )
{ {
@ -73,11 +67,9 @@ int main(int argc, char *argv[])
{ {
OSC::Endpoint s; OSC::Endpoint s;
s.init( NULL ); s.init( LO_UDP );
s.add_method( NULL, NULL, OSC_NAME( reply ), 0, ""); s.add_method( NULL, NULL, osc_reply, 0, "");
int r;
std::list<OSC::OSC_Value> args; std::list<OSC::OSC_Value> args;

View File

@ -254,7 +254,7 @@ public:
}; };
void void
browser_callback ( Fl_Widget *w, void *v ) browser_callback ( Fl_Widget *w, void * )
{ {
w->window()->hide(); w->window()->hide();
} }
@ -731,8 +731,12 @@ public:
private: private:
static int osc_broadcast_handler ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data ) static int osc_broadcast_handler ( const char *path, const char *, lo_arg **, int argc, lo_message msg, void * )
{ {
if ( ! argc )
/* need at least one argument... */
return 0;
DMESSAGE( "Relaying broadcast" ); DMESSAGE( "Relaying broadcast" );
foreach_daemon( d ) foreach_daemon( d )
@ -760,7 +764,8 @@ private:
Fl::lock(); Fl::lock();
if ( !strcmp( path, "/nsm/gui/session/session" ) ) if ( !strcmp( path, "/nsm/gui/session/session" ) &&
! strcmp( types, "s" ) )
{ {
controller->add_session_to_list( &argv[0]->s ); controller->add_session_to_list( &argv[0]->s );
controller->sort_sessions(); controller->sort_sessions();
@ -790,18 +795,20 @@ private:
osc->send( d->addr, "/nsm/server/list" ); osc->send( d->addr, "/nsm/server/list" );
} }
else if ( !strcmp( path, "/nsm/gui/session/name" )) else if ( !strcmp( path, "/nsm/gui/session/name" ) &&
!strcmp( types, "s" ))
{ {
controller->session_name( &argv[0]->s ); controller->session_name( &argv[0]->s );
} }
else if (!strcmp( path, "/error" )) else if (!strcmp( path, "/error" ) &&
!strcmp( types, "sis" ) )
{ {
int err = argv[1]->i; int err = argv[1]->i;
if ( err != 0 ) if ( err != 0 )
fl_alert( "Command %s failed with:\n\n%s", &argv[0]->s, &argv[2]->s ); fl_alert( "Command %s failed with:\n\n%s", &argv[0]->s, &argv[2]->s );
} }
else if (!strcmp( path, "/reply" )) else if (!strcmp( path, "/reply" ) && argc && 's' == *types )
{ {
if ( !strcmp( &argv[0]->s, "/nsm/server/list" ) ) if ( !strcmp( &argv[0]->s, "/nsm/server/list" ) )
{ {
@ -812,13 +819,14 @@ private:
{ {
last_ping_response = time( NULL ); last_ping_response = time( NULL );
} }
else else if ( ! strcmp( types, "ss" ) )
MESSAGE( "%s says %s", &argv[0]->s, &argv[1]->s); MESSAGE( "%s says %s", &argv[0]->s, &argv[1]->s);
} }
if ( !strncmp( path, "/nsm/gui/client/", strlen( "/nsm/gui/client/" ) ) ) if ( !strncmp( path, "/nsm/gui/client/", strlen( "/nsm/gui/client/" ) ) )
{ {
if ( !strcmp( path, "/nsm/gui/client/new" )) if ( !strcmp( path, "/nsm/gui/client/new" ) &&
!strcmp( types, "ss" ) )
{ {
controller->client_new( &argv[0]->s, &argv[1]->s ); controller->client_new( &argv[0]->s, &argv[1]->s );
} }
@ -828,19 +836,23 @@ private:
if ( c ) if ( c )
{ {
if ( !strcmp( path, "/nsm/gui/client/status" )) if ( !strcmp( path, "/nsm/gui/client/status" ) &&
!strcmp( types, "ss" ))
{ {
controller->client_pending_command( c, &argv[1]->s ); controller->client_pending_command( c, &argv[1]->s );
} }
else if ( !strcmp( path, "/nsm/gui/client/progress" )) else if ( !strcmp( path, "/nsm/gui/client/progress" ) &&
!strcmp( types, "sf" ))
{ {
c->progress( argv[1]->f ); c->progress( argv[1]->f );
} }
else if ( !strcmp( path, "/nsm/gui/client/dirty" )) else if ( !strcmp( path, "/nsm/gui/client/dirty" ) &&
!strcmp( types, "si" ))
{ {
c->dirty( argv[1]->i ); c->dirty( argv[1]->i );
} }
else if ( !strcmp( path, "/nsm/gui/client/switch" ) ) else if ( !strcmp( path, "/nsm/gui/client/switch" ) &&
!strcmp( types, "ss" ))
{ {
c->client_id( &argv[1]->s ); c->client_id( &argv[1]->s );
} }
@ -861,7 +873,7 @@ private:
static NSM_Controller *controller; static NSM_Controller *controller;
void void
ping ( void *v ) ping ( void * )
{ {
controller->ping(); controller->ping();
Fl::repeat_timeout( 1.0, ping, NULL ); Fl::repeat_timeout( 1.0, ping, NULL );
@ -907,7 +919,6 @@ main (int argc, char **argv )
int option_index = 0; int option_index = 0;
int c = 0; int c = 0;
const char *osc_port = NULL;
while ( ( c = getopt_long_only( argc, argv, "", long_options, &option_index ) ) != -1 ) while ( ( c = getopt_long_only( argc, argv, "", long_options, &option_index ) ) != -1 )
{ {
switch ( c ) switch ( c )
@ -970,8 +981,8 @@ main (int argc, char **argv )
char **args = (char **)malloc( 4 + argc - option_index ); char **args = (char **)malloc( 4 + argc - option_index );
int i = 0; int i = 0;
args[i++] = "nsmd"; args[i++] = (char*)"nsmd";
args[i++] = "--gui-url"; args[i++] = (char*)"--gui-url";
args[i++] = url; args[i++] = url;

View File

@ -150,7 +150,7 @@ deurlify ( char *url )
*w = *r; *w = *r;
} }
*w = NULL; *w = 0;
} }
void void

View File

@ -101,7 +101,7 @@ int
NSM_Client::command_broadcast ( const char *path, lo_message msg ) NSM_Client::command_broadcast ( const char *path, lo_message msg )
{ {
int argc = lo_message_get_argc( msg ); int argc = lo_message_get_argc( msg );
lo_arg **argv = lo_message_get_argv( msg ); // lo_arg **argv = lo_message_get_argv( msg );
if ( argc == 1 && !strcmp( path, "/non/finger" ) ) if ( argc == 1 && !strcmp( path, "/non/finger" ) )
{ {

View File

@ -322,7 +322,7 @@ main_window->redraw();}
read_line( user_config_dir, "default_path", &path ); read_line( user_config_dir, "default_path", &path );
const char *name = fl_dir_chooser( "Open Project", path, NULL ); const char *name = fl_dir_chooser( "Open Project", path );
free( path ); free( path );
@ -863,7 +863,7 @@ project_name->redraw();} {}
((TLE*)v)->update_status();} {} ((TLE*)v)->update_status();} {}
} }
Function {capture_format_cb( Fl_Widget *w, void *v )} {private return_type {static void} Function {capture_format_cb( Fl_Widget *, void *v )} {private return_type {static void}
} { } {
code {((TLE*)v)->capture_format_cb();} {} code {((TLE*)v)->capture_format_cb();} {}
} }

View File

@ -1607,7 +1607,7 @@ Timeline::init_osc ( const char *osc_port )
} }
int int
Timeline::osc_non_hello ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data ) Timeline::osc_non_hello ( const char *path, const char *, lo_arg **argv, int argc, lo_message, void * )
{ {
OSC_DMSG(); OSC_DMSG();

View File

@ -201,13 +201,13 @@ main ( int argc, char **argv )
tle->run(); tle->run();
timeline->init_osc( NULL ); timeline->init_osc( osc_port );
char *nsm_url = getenv( "NSM_URL" ); char *nsm_url = getenv( "NSM_URL" );
if ( nsm_url ) if ( nsm_url )
{ {
if ( ! nsm->init( nsm_url ) ); if ( ! nsm->init( nsm_url ) )
{ {
nsm->announce( APP_NAME, ":progress:switch:", argv[0] ); nsm->announce( APP_NAME, ":progress:switch:", argv[0] );