summaryrefslogtreecommitdiff
path: root/utils/loc_cfg.cpp
diff options
context:
space:
mode:
authorValeri Atamaniouk <valeria@codeaurora.org>2015-10-21 18:53:58 +0300
committerValeri Atamaniouk <valeria@codeaurora.org>2015-11-09 11:33:15 +0200
commit78bb13288e9ac69a985cf8a4b8c15b21770b59c5 (patch)
tree16c9b3b8582db269f758c24b3a44c439539fa7ff /utils/loc_cfg.cpp
parent15ea4fca381ca7cc2085fae72318a9b0c1cedbed (diff)
downloadgps-78bb13288e9ac69a985cf8a4b8c15b21770b59c5.tar.gz
Location: reduce memory footprint
Reduce memory footprint by moving data sets into const data segments. Update function parameters to accept const parameters when appropriate. CRs-fixed: 928770 Change-Id: I42955cf18de2b0541cfaed89359cdcf9ae6fea8a
Diffstat (limited to 'utils/loc_cfg.cpp')
-rw-r--r--utils/loc_cfg.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp
index 5c33320..967d2f3 100644
--- a/utils/loc_cfg.cpp
+++ b/utils/loc_cfg.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -56,12 +56,12 @@ static uint32_t DEBUG_LEVEL = 0xff;
static uint32_t TIMESTAMP = 0;
/* Parameter spec table */
-static loc_param_s_type loc_param_table[] =
+static const loc_param_s_type loc_param_table[] =
{
{"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'},
{"TIMESTAMP", &TIMESTAMP, NULL, 'n'},
};
-int loc_param_num = sizeof(loc_param_table) / sizeof(loc_param_s_type);
+static const int loc_param_num = sizeof(loc_param_table) / sizeof(loc_param_s_type);
typedef struct loc_param_v_type
{
@@ -92,7 +92,7 @@ RETURN VALUE
SIDE EFFECTS
N/A
===========================================================================*/
-int loc_set_config_entry(loc_param_s_type* config_entry, loc_param_v_type* config_value)
+int loc_set_config_entry(const loc_param_s_type* config_entry, loc_param_v_type* config_value)
{
int ret=-1;
if(NULL == config_entry || NULL == config_value)
@@ -181,7 +181,7 @@ SIDE EFFECTS
N/A
===========================================================================*/
int loc_fill_conf_item(char* input_buf,
- loc_param_s_type* config_table, uint32_t table_length)
+ const loc_param_s_type* config_table, uint32_t table_length)
{
int ret = 0;
@@ -258,7 +258,7 @@ RETURN VALUE
SIDE EFFECTS
N/A
===========================================================================*/
-int loc_read_conf_r(FILE *conf_fp, loc_param_s_type* config_table, uint32_t table_length)
+int loc_read_conf_r(FILE *conf_fp, const loc_param_s_type* config_table, uint32_t table_length)
{
int ret=0;
@@ -322,7 +322,7 @@ SIDE EFFECTS
N/A
===========================================================================*/
int loc_update_conf(const char* conf_data, int32_t length,
- loc_param_s_type* config_table, uint32_t table_length)
+ const loc_param_s_type* config_table, uint32_t table_length)
{
int ret = -1;
@@ -377,7 +377,7 @@ RETURN VALUE
SIDE EFFECTS
N/A
===========================================================================*/
-void loc_read_conf(const char* conf_file_name, loc_param_s_type* config_table,
+void loc_read_conf(const char* conf_file_name, const loc_param_s_type* config_table,
uint32_t table_length)
{
FILE *conf_fp = NULL;