Fix build warnings submit/tizen/20131025.175040 submit/tizen_ivi_stable/20131116.010031
authorRusty Lynch <rusty.lynch@intel.com>
Thu, 24 Oct 2013 19:58:59 +0000 (12:58 -0700)
committerRusty Lynch <rusty.lynch@intel.com>
Fri, 25 Oct 2013 17:43:40 +0000 (10:43 -0700)
 - Stop using deprecated gets
 - Fix prototype for notification callback

Change-Id: I56b088c461d04bf26ae568ce9074e0b680e57847
Signed-off-by: Rusty Lynch <rusty.lynch@intel.com>
bluetooth_notification_client.c
packaging/notification-service.changes

index 50a3095..2ccd5ad 100644 (file)
@@ -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
index 01b10c1..27d4d6b 100644 (file)
@@ -1,3 +1,7 @@
+* Thu Oct 24 2013 Rusty Lynch <rusty.lynch@intel.com> 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 <rusty.lynch@intel.com> accepted/tizen/20130917.000007@6b2a8d7
 - Add Bluetooth-client-notification to test bluetooth pairing
 - Send and display content from notification