From: Rusty Lynch Date: Thu, 24 Oct 2013 19:58:59 +0000 (-0700) Subject: Fix build warnings X-Git-Tag: submit/tizen/20131025.175040^0 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fappfw%2Fnotification-service.git;a=commitdiff_plain;h=81d8b0c9e8437729b0838433673a4fc1c792f613 Fix build warnings - Stop using deprecated gets - Fix prototype for notification callback Change-Id: I56b088c461d04bf26ae568ce9074e0b680e57847 Signed-off-by: Rusty Lynch --- diff --git a/bluetooth_notification_client.c b/bluetooth_notification_client.c index 50a3095..2ccd5ad 100644 --- a/bluetooth_notification_client.c +++ b/bluetooth_notification_client.c @@ -100,11 +100,12 @@ __display_notification(bt_notification cb_1, bt_notification cb_2, DBusGProxy *p notification_error_e err = NOTIFICATION_ERROR_NONE; int bt_yesno; bt_yesno = 1; - char line[256]; + char line[4]; fprintf(stdout, "Do you confirm yes or no ? "); while ( bt_yesno != 0){ - gets(line); + if (!fgets(line, sizeof(line), stdin)) + continue; if ( strcmp(line,"yes") == 0){ (cb_1) (proxy); bt_yesno = 0; @@ -122,7 +123,7 @@ __display_notification(bt_notification cb_1, bt_notification cb_2, DBusGProxy *p } -static int __noti_changed_cb(void *data, notification_type_e type) +static void __noti_changed_cb(void *data, notification_type_e type) { notification_h noti = NULL; notification_list_h notification_list = NULL; @@ -180,13 +181,13 @@ static int __noti_changed_cb(void *data, notification_type_e type) sys_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL); if (sys_conn == NULL) { fprintf(stdout,"ERROR: Can't get on system bus"); - return EXIT_FAILURE; + return; } agent_proxy = __bluetooth_create_agent_proxy(sys_conn, agent_path); if (!agent_proxy){ fprintf(stdout,"create new agent_proxy failed\n"); - return EXIT_FAILURE; + return; } __display_notification(__notify_passkey_confirm_request_accept_cb, __notify_passkey_confirm_request_cancel_cb,agent_proxy); @@ -205,13 +206,13 @@ static int __noti_changed_cb(void *data, notification_type_e type) sys_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL); if (sys_conn == NULL) { fprintf(stdout,"ERROR: Can't get on system bus"); - return EXIT_FAILURE; + return; } agent_proxy = __bluetooth_create_agent_proxy(sys_conn, agent_path); if (!agent_proxy){ fprintf(stdout,"create new agent_proxy failed\n"); - return EXIT_FAILURE; + return; } __display_notification( __notify_authorize_request_accept_cb, __notify_authorize_request_cancel_cb,agent_proxy); @@ -226,13 +227,13 @@ static int __noti_changed_cb(void *data, notification_type_e type) sys_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL); if (sys_conn == NULL) { fprintf(stdout,"ERROR: Can't get on system bus"); - return EXIT_FAILURE; + return; } obex_proxy = __bluetooth_create_obex_proxy(sys_conn); if (!obex_proxy){ fprintf(stdout,"create new obex_proxy failed\n"); - return EXIT_FAILURE; + return; } __display_notification( __notify_push_authorize_request_accept_cb, __notify_push_authorize_request_cancel_cb,obex_proxy); @@ -255,13 +256,13 @@ static int __noti_changed_cb(void *data, notification_type_e type) sys_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL); if (sys_conn == NULL) { fprintf(stdout,"ERROR: Can't get on system bus"); - return EXIT_FAILURE; + return; } agent_proxy = __bluetooth_create_agent_proxy(sys_conn, agent_path); if (!agent_proxy){ fprintf(stdout,"create new agent_proxy failed\n"); - return EXIT_FAILURE; + return; } __display_notification( __notify_authorize_request_accept_cb, __notify_authorize_request_cancel_cb,agent_proxy); @@ -272,13 +273,13 @@ static int __noti_changed_cb(void *data, notification_type_e type) sys_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL); if (sys_conn == NULL) { fprintf(stdout,"ERROR: Can't get on system bus"); - return EXIT_FAILURE; + return; } agent_proxy = __bluetooth_create_agent_proxy(sys_conn, agent_path); if (!agent_proxy){ fprintf(stdout,"create new agent_proxy failed\n"); - return EXIT_FAILURE; + return; } __display_notification( __notify_authorize_request_accept_cb, __notify_authorize_request_cancel_cb,agent_proxy); @@ -289,13 +290,13 @@ static int __noti_changed_cb(void *data, notification_type_e type) sys_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL); if (sys_conn == NULL) { fprintf(stdout,"ERROR: Can't get on system bus"); - return EXIT_FAILURE; + return; } agent_proxy = __bluetooth_create_agent_proxy(sys_conn, agent_path); if (!agent_proxy){ fprintf(stdout,"create new agent_proxy failed\n"); - return EXIT_FAILURE; + return; } __display_notification( __notify_authorize_request_accept_cb, __notify_authorize_request_cancel_cb,agent_proxy); @@ -306,7 +307,7 @@ static int __noti_changed_cb(void *data, notification_type_e type) notification_list = NULL; } - return EXIT_SUCCESS; + return; } int diff --git a/packaging/notification-service.changes b/packaging/notification-service.changes index 01b10c1..27d4d6b 100644 --- a/packaging/notification-service.changes +++ b/packaging/notification-service.changes @@ -1,3 +1,7 @@ +* Thu Oct 24 2013 Rusty Lynch accepted/tizen/20130920.213625@237321e +- Fix build warnings by no longer using 'gets' and fixing the + prototype for notification callback + * Fri Sep 20 2013 Rusty Lynch accepted/tizen/20130917.000007@6b2a8d7 - Add Bluetooth-client-notification to test bluetooth pairing - Send and display content from notification