Commit 868bf744 authored by Martin Tobias Holmedahl Sandsmark's avatar Martin Tobias Holmedahl Sandsmark
Browse files

Fix usage of string constants

parent e7697a35
......@@ -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
)
{
......
......@@ -44,7 +44,7 @@
/***** *****/
/***** Decompression code (taken from the Plucker PalmOS viewer *****/
/***** sources, Copyright (c) 1998-2002, by Mark Ian Lillywhite *****/
/***** and Michael Nordstrm, also under the GPL) *****/
/***** and Michael Nordstrm, also under the GPL) *****/
/***** *****/
/***********************************************************************/
/***********************************************************************/
......@@ -963,7 +963,7 @@ static long FpSize
plkr_Document* plkr_OpenDBFile
(
char* filename
const char* filename
)
{
plkr_DBHandle handle;
......
......@@ -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
......@@ -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
......
......@@ -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
)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment