declare constant function parameters const (as well as constant function return values)
This commit is contained in:
@@ -175,9 +175,9 @@ int process_command_line(int argc, char **argv)
|
||||
return error;
|
||||
}
|
||||
|
||||
int process_configfile(char * configfile)
|
||||
int process_configfile(char *configfile)
|
||||
{
|
||||
char * tmp;
|
||||
const char *tmp;
|
||||
|
||||
if (configfile == NULL)
|
||||
configfile = DEFAULT_CONFIGFILE;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "menu.h"
|
||||
|
||||
/* recursively read the menu hierarchy */
|
||||
MenuEntry *menu_read(MenuEntry *parent, char *name)
|
||||
MenuEntry *menu_read(MenuEntry *parent, const char *name)
|
||||
{
|
||||
static int id = 0;
|
||||
|
||||
@@ -50,7 +50,7 @@ MenuEntry *menu_read(MenuEntry *parent, char *name)
|
||||
|
||||
if (config_get_string(name, "Entry", 0, NULL) != NULL) {
|
||||
MenuEntry **addr = &me->entries;
|
||||
char *entryname;
|
||||
const char *entryname;
|
||||
int index = 0;
|
||||
|
||||
// it is a sub-menu
|
||||
|
||||
@@ -41,7 +41,7 @@ typedef struct menu_entry {
|
||||
} MenuEntry;
|
||||
|
||||
|
||||
MenuEntry *menu_read(MenuEntry *parent, char *name);
|
||||
MenuEntry *menu_read(MenuEntry *parent, const char *ame);
|
||||
int menu_sock_send(MenuEntry *me, MenuEntry *parent, int sock);
|
||||
MenuEntry *menu_find_by_id(MenuEntry *me, int id);
|
||||
const char *menu_command(MenuEntry *me);
|
||||
|
||||
@@ -67,7 +67,7 @@ static struct option const long_options[] =
|
||||
static int
|
||||
iface_process_configfile()
|
||||
{
|
||||
char *unit;
|
||||
const char *unit;
|
||||
|
||||
debug( RPT_DEBUG, "%s()", __FUNCTION__ );
|
||||
|
||||
|
||||
@@ -15,6 +15,17 @@
|
||||
#include <sys/statvfs.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
# if HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
# else
|
||||
# include <time.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef USE_GETLOADAVG
|
||||
# include <sys/loadavg.h>
|
||||
#endif
|
||||
|
||||
@@ -330,7 +330,7 @@ static int
|
||||
process_configfile(char *configfile)
|
||||
{
|
||||
int k;
|
||||
char *tmp;
|
||||
const char *tmp;
|
||||
|
||||
debug(RPT_DEBUG, "%s(%s)", __FUNCTION__, (configfile) ? configfile : "<null>");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user