diff options
author | Ludovic Ferrandis <ludovic.ferrandis@intel.com> | 2013-03-01 15:20:06 +0100 |
---|---|---|
committer | Regis Merlino <regis.merlino@intel.com> | 2013-03-01 15:40:07 +0100 |
commit | da541b3f5fb1cbc970e379d51b30910376afd721 (patch) | |
tree | cce37e2e4f18b76f99ab22ac678269ba936cfff0 | |
parent | ac42eb6a8309e1ea90c3c4be8ca751f70c7a3425 (diff) | |
download | dleyna-renderer-da541b3f5fb1cbc970e379d51b30910376afd721.tar.gz |
[Coding Guidelines] Fix issue #12: Make error strings single line
Fix https://github.com/01org/dleyna-renderer/issues/12
Fix also 2 checkpatch issues about parameters alignment.
Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
-rw-r--r-- | lib/device.c | 24 | ||||
-rw-r--r-- | lib/host-service.c | 15 | ||||
-rw-r--r-- | lib/server.c | 3 | ||||
-rw-r--r-- | lib/task.c | 2 | ||||
-rw-r--r-- | lib/upnp.c | 75 |
5 files changed, 51 insertions, 68 deletions
diff --git a/lib/device.c b/lib/device.c index 0bea47a..7ff06b8 100644 --- a/lib/device.c +++ b/lib/device.c @@ -726,7 +726,8 @@ DLEYNA_LOG_DEBUG("Exit"); return NULL; } -dlr_device_t * dlr_device_new(dleyna_connector_id_t connection, +dlr_device_t *dlr_device_new( + dleyna_connector_id_t connection, GUPnPDeviceProxy *proxy, const gchar *ip_address, guint counter, @@ -1479,8 +1480,8 @@ static void prv_get_position_info_cb(GUPnPServiceProxy *proxy, G_TYPE_STRING, &rel_pos, NULL)) { cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_OPERATION_FAILED, - "GetPositionInfo operation " - "failed: %s", upnp_error->message); + "GetPositionInfo operation failed: %s", + upnp_error->message); g_error_free(upnp_error); goto on_error; @@ -1885,8 +1886,8 @@ static void prv_simple_call_cb(GUPnPServiceProxy *proxy, &upnp_error, NULL)) { cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_OPERATION_FAILED, - "Operation " - "failed: %s", upnp_error->message); + "Operation failed: %s", + upnp_error->message); g_error_free(upnp_error); } @@ -1932,8 +1933,7 @@ static GVariant *prv_get_rate_value_from_double(GVariant *params, if (tps == NULL) { cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_OPERATION_FAILED, - "TransportPlaySpeeds list" - " is empty"); + "TransportPlaySpeeds list is empty"); goto exit; } @@ -2014,8 +2014,7 @@ void dlr_device_set_prop(dlr_device_t *device, dlr_task_t *task, g_strcmp0(set_prop->interface_name, "") != 0) { cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_UNKNOWN_INTERFACE, - "Interface %s not managed " - "for property setting", + "Interface %s not managed for property setting", set_prop->interface_name); goto exit; } @@ -2028,8 +2027,8 @@ void dlr_device_set_prop(dlr_device_t *device, dlr_task_t *task, if (g_strcmp0(set_prop->prop_name, DLR_INTERFACE_PROP_VOLUME) != 0) { cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_UNKNOWN_PROPERTY, - "Property %s not managed for" - " setting", set_prop->prop_name); + "Property %s not managed for setting", + set_prop->prop_name); goto exit; } @@ -2367,8 +2366,7 @@ void dlr_device_remove_uri(dlr_device_t *device, dlr_task_t *task, host_uri->client, host_uri->uri)) { cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_OBJECT_NOT_FOUND, - "File not hosted for specified " - " device"); + "File not hosted for specified device"); } (void) g_idle_add(dlr_async_task_complete, cb_data); diff --git a/lib/host-service.c b/lib/host-service.c index 94fa019..9f0d65d 100644 --- a/lib/host-service.c +++ b/lib/host-service.c @@ -182,8 +182,8 @@ static dlr_host_file_t *prv_host_file_new(const gchar *file, unsigned int id, if (!g_file_test(file, G_FILE_TEST_IS_REGULAR | G_FILE_TEST_EXISTS)) { *error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_OBJECT_NOT_FOUND, - "File %s does not exist or is not" - " a regular file", file); + "File %s does not exist or is not a regular file", + file); goto on_error; } @@ -195,8 +195,8 @@ static dlr_host_file_t *prv_host_file_new(const gchar *file, unsigned int id, if (!content_type) { *error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_BAD_MIME, - "Unable to determine Content Type for" - " %s", file); + "Unable to determine Content Type for %s", + file); goto on_error; } @@ -204,8 +204,8 @@ static dlr_host_file_t *prv_host_file_new(const gchar *file, unsigned int id, if (!hf->mime_type) { *error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_BAD_MIME, - "Unable to determine MIME Type for" - " %s", file); + "Unable to determine MIME Type for %s", + file); goto on_error; } @@ -332,7 +332,8 @@ static void prv_soup_server_cb(SoupServer *server, SoupMessage *msg, g_signal_connect(msg, "finished", G_CALLBACK(prv_soup_message_finished_cb), hf); - soup_message_set_response(msg, hf->mime_type, + soup_message_set_response( + msg, hf->mime_type, SOUP_MEMORY_STATIC, g_mapped_file_get_contents(hf->mapped_file), g_mapped_file_get_length(hf->mapped_file)); diff --git a/lib/server.c b/lib/server.c index be8fa66..75bb358 100644 --- a/lib/server.c +++ b/lib/server.c @@ -626,8 +626,7 @@ static const gchar *prv_get_device_id(const gchar *object, GError **error) *error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_OBJECT_NOT_FOUND, - "Cannot locate device corresponding to" - " the specified path"); + "Cannot locate device corresponding to the specified path"); goto on_error; } @@ -322,7 +322,7 @@ void dlr_task_fail(dlr_task_t *task, GError *error) if (task->invocation) { dlr_renderer_get_connector()->return_error(task->invocation, - error); + error); task->invocation = NULL; } @@ -379,9 +379,8 @@ void dlr_upnp_set_prop(dlr_upnp_t *upnp, dlr_task_t *task, cb_data->cb = cb; cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_OBJECT_NOT_FOUND, - "Cannot locate a device" - " for the specified " - "object"); + "Cannot locate a device for the specified object"); + (void) g_idle_add(dlr_async_task_complete, cb_data); } else { dlr_device_set_prop(device, task, cb); @@ -408,9 +407,8 @@ void dlr_upnp_get_prop(dlr_upnp_t *upnp, dlr_task_t *task, cb_data->cb = cb; cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_OBJECT_NOT_FOUND, - "Cannot locate a device" - " for the specified " - "object"); + "Cannot locate a device for the specified object"); + (void) g_idle_add(dlr_async_task_complete, cb_data); } else { dlr_device_get_prop(device, task, cb); @@ -436,9 +434,8 @@ void dlr_upnp_get_all_props(dlr_upnp_t *upnp, dlr_task_t *task, cb_data->cb = cb; cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_OBJECT_NOT_FOUND, - "Cannot locate a device" - " for the specified " - "object"); + "Cannot locate a device for the specified object"); + (void) g_idle_add(dlr_async_task_complete, cb_data); } else { dlr_device_get_all_props(device, task, cb); @@ -461,9 +458,8 @@ void dlr_upnp_play(dlr_upnp_t *upnp, dlr_task_t *task, cb_data->cb = cb; cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_OBJECT_NOT_FOUND, - "Cannot locate a device" - " for the specified " - "object"); + "Cannot locate a device for the specified object"); + (void) g_idle_add(dlr_async_task_complete, cb_data); } else { dlr_device_play(device, task, cb); @@ -486,9 +482,8 @@ void dlr_upnp_pause(dlr_upnp_t *upnp, dlr_task_t *task, cb_data->cb = cb; cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_OBJECT_NOT_FOUND, - "Cannot locate a device" - " for the specified " - "object"); + "Cannot locate a device for the specified object"); + (void) g_idle_add(dlr_async_task_complete, cb_data); } else { dlr_device_pause(device, task, cb); @@ -511,9 +506,8 @@ void dlr_upnp_play_pause(dlr_upnp_t *upnp, dlr_task_t *task, cb_data->cb = cb; cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_OBJECT_NOT_FOUND, - "Cannot locate a device" - " for the specified " - "object"); + "Cannot locate a device for the specified object"); + (void) g_idle_add(dlr_async_task_complete, cb_data); } else { dlr_device_play_pause(device, task, cb); @@ -536,9 +530,8 @@ void dlr_upnp_stop(dlr_upnp_t *upnp, dlr_task_t *task, cb_data->cb = cb; cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_OBJECT_NOT_FOUND, - "Cannot locate a device" - " for the specified " - "object"); + "Cannot locate a device for the specified object"); + (void) g_idle_add(dlr_async_task_complete, cb_data); } else { dlr_device_stop(device, task, cb); @@ -561,9 +554,8 @@ void dlr_upnp_next(dlr_upnp_t *upnp, dlr_task_t *task, cb_data->cb = cb; cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_OBJECT_NOT_FOUND, - "Cannot locate a device" - " for the specified " - "object"); + "Cannot locate a device for the specified object"); + (void) g_idle_add(dlr_async_task_complete, cb_data); } else { dlr_device_next(device, task, cb); @@ -586,9 +578,8 @@ void dlr_upnp_previous(dlr_upnp_t *upnp, dlr_task_t *task, cb_data->cb = cb; cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_OBJECT_NOT_FOUND, - "Cannot locate a device" - " for the specified " - "object"); + "Cannot locate a device for the specified object"); + (void) g_idle_add(dlr_async_task_complete, cb_data); } else { dlr_device_previous(device, task, cb); @@ -611,9 +602,8 @@ void dlr_upnp_open_uri(dlr_upnp_t *upnp, dlr_task_t *task, cb_data->cb = cb; cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_OBJECT_NOT_FOUND, - "Cannot locate a device" - " for the specified " - "object"); + "Cannot locate a device for the specified object"); + (void) g_idle_add(dlr_async_task_complete, cb_data); } else { dlr_device_open_uri(device, task, cb); @@ -636,9 +626,8 @@ void dlr_upnp_seek(dlr_upnp_t *upnp, dlr_task_t *task, cb_data->cb = cb; cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_OBJECT_NOT_FOUND, - "Cannot locate a device" - " for the specified " - "object"); + "Cannot locate a device for the specified object"); + (void) g_idle_add(dlr_async_task_complete, cb_data); } else { dlr_device_seek(device, task, cb); @@ -661,9 +650,8 @@ void dlr_upnp_set_position(dlr_upnp_t *upnp, dlr_task_t *task, cb_data->cb = cb; cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_OBJECT_NOT_FOUND, - "Cannot locate a device" - " for the specified " - "object"); + "Cannot locate a device for the specified object"); + (void) g_idle_add(dlr_async_task_complete, cb_data); } else { dlr_device_set_position(device, task, cb); @@ -686,9 +674,8 @@ void dlr_upnp_goto_track(dlr_upnp_t *upnp, dlr_task_t *task, cb_data->cb = cb; cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_OBJECT_NOT_FOUND, - "Cannot locate a device" - " for the specified " - "object"); + "Cannot locate a device for the specified object"); + (void) g_idle_add(dlr_async_task_complete, cb_data); } else { dlr_device_goto_track(device, task, cb); @@ -711,9 +698,8 @@ void dlr_upnp_host_uri(dlr_upnp_t *upnp, dlr_task_t *task, cb_data->cb = cb; cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_OBJECT_NOT_FOUND, - "Cannot locate a device" - " for the specified " - "object"); + "Cannot locate a device for the specified object"); + (void) g_idle_add(dlr_async_task_complete, cb_data); } else { dlr_device_host_uri(device, task, upnp->host_service, cb); @@ -736,9 +722,8 @@ void dlr_upnp_remove_uri(dlr_upnp_t *upnp, dlr_task_t *task, cb_data->cb = cb; cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_OBJECT_NOT_FOUND, - "Cannot locate a device" - " for the specified " - "object"); + "Cannot locate a device for the specified object"); + (void) g_idle_add(dlr_async_task_complete, cb_data); } else { dlr_device_remove_uri(device, task, upnp->host_service, cb); |