Permalink
Browse files

First round of fixing unnecessary warnings

  • Loading branch information...
1 parent b44ee66 commit 1628980f6a5aca6ed427cc7d56cb0d5b318a9c4e @morphis committed Aug 8, 2012
Showing with 15 additions and 11 deletions.
  1. +2 −2 include/radio.h
  2. +6 −4 samsung-ipc/ipc_util.c
  3. +7 −5 samsung-ipc/rfs.c
View
@@ -100,9 +100,9 @@ void ipc_client_send_exec(struct ipc_client *client, const unsigned short comman
/* Utility functions */
void ipc_client_log_recv(struct ipc_client *client,
- struct ipc_message_info *response, char *prefix);
+ struct ipc_message_info *response, const char *prefix);
void ipc_client_log_send(struct ipc_client *client,
- struct ipc_message_info *request, char *prefix);
+ struct ipc_message_info *request, const char *prefix);
const char *ipc_response_type_to_str(int type);
const char *ipc_request_type_to_str(int type);
const char *ipc_command_to_str(int command);
View
@@ -35,7 +35,7 @@
#define IPC_STR(f) case f: return strdup(#f);
void ipc_client_log_recv(struct ipc_client *client,
- struct ipc_message_info *response, char *prefix)
+ struct ipc_message_info *response, const char *prefix)
{
switch (client->type) {
case IPC_CLIENT_TYPE_FMT:
@@ -68,7 +68,7 @@ void ipc_client_log_recv(struct ipc_client *client,
}
void ipc_client_log_send(struct ipc_client *client,
- struct ipc_message_info *request, char *prefix)
+ struct ipc_message_info *request, const char *prefix)
{
switch (client->type) {
case IPC_CLIENT_TYPE_FMT:
@@ -271,8 +271,10 @@ void ipc_client_hex_dump(struct ipc_client *client, void *data, int size)
for (n=1;n<=size;n++) {
if (n%16 == 1) {
/* store address for this line */
- snprintf(addrstr, sizeof(addrstr), "%.4x",
- ((unsigned int)p-(unsigned int)data) );
+ unsigned int end = 0, start = 0;
+ end = *((unsigned int*) p);
+ start = *((unsigned int*) data);
+ snprintf(addrstr, sizeof(addrstr), "%.4x", end - start);
}
c = *p;
View
@@ -113,7 +113,7 @@ int nv_data_size(struct ipc_client *client)
{
if (client == NULL ||
client->nv_data_specs == NULL ||
- client->nv_data_specs->nv_data_size == NULL)
+ client->nv_data_specs->nv_data_size == 0)
return NV_DATA_SIZE_DEFAULT;
return client->nv_data_specs->nv_data_size;
@@ -123,7 +123,7 @@ int nv_data_chunk_size(struct ipc_client *client)
{
if (client == NULL ||
client->nv_data_specs == NULL ||
- client->nv_data_specs->nv_data_chunk_size == NULL)
+ client->nv_data_specs->nv_data_chunk_size == 0)
return NV_DATA_CHUNK_SIZE_DEFAULT;
return client->nv_data_specs->nv_data_chunk_size;
@@ -714,7 +714,7 @@ void ipc_rfs_send_io_confirm_for_nv_read_item(struct ipc_client *client, struct
if (rfs_io == NULL)
{
ipc_client_log(client, "ERROR: Request message is invalid: aseq = %i", info->aseq);
- return NULL;
+ return;
}
rfs_io_conf = malloc(rfs_io->length + sizeof(struct ipc_rfs_io_confirm));
@@ -734,7 +734,8 @@ void ipc_rfs_send_io_confirm_for_nv_read_item(struct ipc_client *client, struct
rfs_io_conf->offset = rfs_io->offset;
rfs_io_conf->length = rfs_io->length;
- ipc_client_send(client, IPC_RFS_NV_READ_ITEM, 0, rfs_io_conf, rfs_io->length + sizeof(struct ipc_rfs_io_confirm), info->aseq);
+ ipc_client_send(client, IPC_RFS_NV_READ_ITEM, 0, (unsigned char*) rfs_io_conf,
+ rfs_io->length + sizeof(struct ipc_rfs_io_confirm), info->aseq);
free(rfs_io_conf);
}
@@ -767,7 +768,8 @@ void ipc_rfs_send_io_confirm_for_nv_write_item(struct ipc_client *client, struct
rfs_io_conf->offset = rfs_io->offset;
rfs_io_conf->length = rfs_io->length;
- ipc_client_send(client, IPC_RFS_NV_WRITE_ITEM, 0, rfs_io_conf, sizeof(struct ipc_rfs_io_confirm), info->aseq);
+ ipc_client_send(client, IPC_RFS_NV_WRITE_ITEM, 0, (unsigned char*) rfs_io_conf,
+ sizeof(struct ipc_rfs_io_confirm), info->aseq);
free(rfs_io_conf);
}

0 comments on commit 1628980

Please sign in to comment.