summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-07-24 20:25:20 (GMT)
committerMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-07-24 20:25:20 (GMT)
commit868bf74410decfe1fc71bb7289e8975fd87ce713 (patch)
tree0386fbfd7f0113f9bdded3db5b0246735f784f50
parente7697a35d1d3be3f2e4f0ce87cc0d45678051965 (diff)
Fix usage of string constants
-rw-r--r--generators/plucker/unpluck/config.cpp32
-rw-r--r--generators/plucker/unpluck/unpluck.cpp4
-rw-r--r--generators/plucker/unpluck/unpluck.h18
-rw-r--r--generators/plucker/unpluck/unpluckint.h9
-rw-r--r--generators/plucker/unpluck/util.cpp14
5 files changed, 37 insertions, 40 deletions
diff --git a/generators/plucker/unpluck/config.cpp b/generators/plucker/unpluck/config.cpp
index bba93b5..5a21ba8 100644
--- a/generators/plucker/unpluck/config.cpp
+++ b/generators/plucker/unpluck/config.cpp
@@ -53,7 +53,7 @@ HashTable *SectionsTable = NULL;
static HashTable* GetOrCreateSegment
(
- char* name
+ const char* name
)
{
HashTable* target;
@@ -71,7 +71,7 @@ static HashTable* GetOrCreateSegment
static int ReadConfigFile
(
- char* filename
+ const char* filename
)
{
HashTable* current_segment = NULL;
@@ -245,8 +245,8 @@ static int ReadConfigFile
static void TryReadConfigFile
(
- char* dir,
- char* name
+ const char* dir,
+ const char* name
)
{
char* filename;
@@ -266,9 +266,9 @@ static void TryReadConfigFile
static void InitializeConfigInfo ()
{
- char *config_dir = STRINGIFY (PLUCKER_CONFIG_DIR);
- char *system_config_file_name = STRINGIFY (SYS_CONFIG_FILE_NAME);
- char *user_config_filename = STRINGIFY (USER_CONFIG_FILE_NAME);
+ const char *config_dir = STRINGIFY (PLUCKER_CONFIG_DIR);
+ const char *system_config_file_name = STRINGIFY (SYS_CONFIG_FILE_NAME);
+ const char *user_config_filename = STRINGIFY (USER_CONFIG_FILE_NAME);
char *home = getenv ("HOME");
TryReadConfigFile (config_dir, system_config_file_name);
@@ -278,8 +278,8 @@ static void InitializeConfigInfo ()
char* plkr_GetConfigString
(
- char* section_name,
- char* option_name,
+ const char* section_name,
+ const char* option_name,
char* default_value
)
{
@@ -319,8 +319,8 @@ char* plkr_GetConfigString
long int plkr_GetConfigInt
(
- char* section_name,
- char* option_name,
+ const char* section_name,
+ const char* option_name,
long int default_value
)
{
@@ -344,9 +344,8 @@ long int plkr_GetConfigInt
}
double plkr_GetConfigFloat
- (
- char* section_name,
- char* option_name,
+ (const char *section_name,
+ const char *option_name,
double default_value
)
{
@@ -370,9 +369,8 @@ double plkr_GetConfigFloat
}
int plkr_GetConfigBoolean
- (
- char* section_name,
- char* option_name,
+ (const char *section_name,
+ const char *option_name,
int default_value
)
{
diff --git a/generators/plucker/unpluck/unpluck.cpp b/generators/plucker/unpluck/unpluck.cpp
index 8f52e2a..143fa3a 100644
--- a/generators/plucker/unpluck/unpluck.cpp
+++ b/generators/plucker/unpluck/unpluck.cpp
@@ -44,7 +44,7 @@
/***** *****/
/***** Decompression code (taken from the Plucker PalmOS viewer *****/
/***** sources, Copyright (c) 1998-2002, by Mark Ian Lillywhite *****/
-/***** and Michael Nordström, also under the GPL) *****/
+/***** and Michael Nordstr�m, also under the GPL) *****/
/***** *****/
/***********************************************************************/
/***********************************************************************/
@@ -963,7 +963,7 @@ static long FpSize
plkr_Document* plkr_OpenDBFile
(
- char* filename
+ const char* filename
)
{
plkr_DBHandle handle;
diff --git a/generators/plucker/unpluck/unpluck.h b/generators/plucker/unpluck/unpluck.h
index 62b622b..6e77cfc 100644
--- a/generators/plucker/unpluck/unpluck.h
+++ b/generators/plucker/unpluck/unpluck.h
@@ -144,7 +144,7 @@ typedef struct plkr_Document_s plkr_Document;
call to plkr_CloseDoc.
*/
plkr_Document *plkr_OpenDBFile (
- char * /* filename */
+ const char * /* filename */
);
@@ -364,8 +364,8 @@ int plkr_ShowMessages (
names and option names should be all lowercase.
*/
char *plkr_GetConfigString (
- char *section_name,
- char *option_name,
+ const char *section_name,
+ const char *option_name,
char *default_value
);
@@ -378,8 +378,8 @@ char *plkr_GetConfigString (
names and option names should be all lowercase.
*/
long int plkr_GetConfigInt (
- char *section_name,
- char *option_name,
+ const char *section_name,
+ const char *option_name,
long int default_value
);
@@ -392,8 +392,8 @@ long int plkr_GetConfigInt (
names and option names should be all lowercase.
*/
double plkr_GetConfigFloat (
- char *section_name,
- char *option_name,
+ const char *section_name,
+ const char *option_name,
double default_value
);
@@ -406,8 +406,8 @@ double plkr_GetConfigFloat (
names and option names should be all lowercase.
*/
int plkr_GetConfigBoolean (
- char *section_name,
- char *option_name,
+ const char *section_name,
+ const char *option_name,
int default_value
);
#endif
diff --git a/generators/plucker/unpluck/unpluckint.h b/generators/plucker/unpluck/unpluckint.h
index f15f998..a3bfb79 100644
--- a/generators/plucker/unpluck/unpluckint.h
+++ b/generators/plucker/unpluck/unpluckint.h
@@ -138,8 +138,7 @@ void _plkr_message (
;
/* Display the message to stderr */
-char *_plkr_strndup (
- char *str,
+char *_plkr_strndup (const char *str,
int len
);
/* return a freshly-malloced copy of str */
@@ -152,20 +151,20 @@ HashTable *_plkr_NewHashTable (
void *_plkr_FindInTable (
HashTable * ht,
- char *key
+ const char *key
);
/* lookup the specified "key" in the specified "ht". */
void *_plkr_RemoveFromTable (
HashTable * ht,
- char *key
+ const char *key
);
/* remove the entry with "key" from the table, if present, and return
the value as the result. */
int _plkr_AddToTable (
HashTable * ht,
- char *key,
+ const char *key,
void *obj
);
/* Add the specified "obj" to the table with key "key". Returns
diff --git a/generators/plucker/unpluck/util.cpp b/generators/plucker/unpluck/util.cpp
index 1751c63..5408967 100644
--- a/generators/plucker/unpluck/util.cpp
+++ b/generators/plucker/unpluck/util.cpp
@@ -90,7 +90,7 @@ int plkr_ShowMessages
char* _plkr_strndup
(
- char* str,
+ const char* str,
int len
)
{
@@ -135,8 +135,8 @@ struct HashTable {
static int CompareStrings
(
- char* key1,
- char* key2
+ const char* key1,
+ const char* key2
)
{
return (strcmp (key1, key2) == 0);
@@ -144,7 +144,7 @@ static int CompareStrings
static int HashString
(
- char* str,
+ const char* str,
int size
)
{
@@ -158,7 +158,7 @@ static int HashString
void* _plkr_FindInTable
(
HashTable* ht,
- char* key
+ const char* key
)
{
HashTableSlot* slot;
@@ -177,7 +177,7 @@ void* _plkr_FindInTable
void* _plkr_RemoveFromTable
(
HashTable* ht,
- char* key
+ const char* key
)
{
HashTableSlot* slot;
@@ -210,7 +210,7 @@ void* _plkr_RemoveFromTable
int _plkr_AddToTable
(
HashTable* ht,
- char* key,
+ const char* key,
void* obj
)
{