1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-27 06:16:37 +02:00

Const const const

This commit is contained in:
Bram Matthys
2021-09-11 08:17:12 +02:00
parent ac84d4f207
commit 7cabd4b79e
21 changed files with 88 additions and 88 deletions
+7 -7
View File
@@ -23,8 +23,8 @@
#include "unrealircd.h"
/* Forward declarations */
static Command *CommandAddInternal(Module *module, char *cmd, CmdFunc func, AliasCmdFunc aliasfunc, unsigned char params, int flags);
static RealCommand *add_Command_backend(char *cmd);
static Command *CommandAddInternal(Module *module, const char *cmd, CmdFunc func, AliasCmdFunc aliasfunc, unsigned char params, int flags);
static RealCommand *add_Command_backend(const char *cmd);
/** @defgroup CommandAPI Command API
* @{
@@ -53,7 +53,7 @@ int CommandExists(const char *name)
* @param flags Who may execute this command - one or more CMD_* flags
* @returns The newly registered command, or NULL in case of error (eg: already exist)
*/
Command *CommandAdd(Module *module, char *cmd, CmdFunc func, unsigned char params, int flags)
Command *CommandAdd(Module *module, const char *cmd, CmdFunc func, unsigned char params, int flags)
{
if (flags & CMD_ALIAS)
{
@@ -75,7 +75,7 @@ Command *CommandAdd(Module *module, char *cmd, CmdFunc func, unsigned char param
* @param flags Who may execute this command - one or more CMD_* flags
* @returns The newly registered command (alias), or NULL in case of error (eg: already exist)
*/
Command *AliasAdd(Module *module, char *cmd, AliasCmdFunc aliasfunc, unsigned char params, int flags)
Command *AliasAdd(Module *module, const char *cmd, AliasCmdFunc aliasfunc, unsigned char params, int flags)
{
if (!(flags & CMD_ALIAS))
flags |= CMD_ALIAS;
@@ -84,7 +84,7 @@ Command *AliasAdd(Module *module, char *cmd, AliasCmdFunc aliasfunc, unsigned ch
/** @} */
static Command *CommandAddInternal(Module *module, char *cmd, CmdFunc func, AliasCmdFunc aliasfunc, unsigned char params, int flags)
static Command *CommandAddInternal(Module *module, const char *cmd, CmdFunc func, AliasCmdFunc aliasfunc, unsigned char params, int flags)
{
Command *command = NULL;
RealCommand *c;
@@ -191,7 +191,7 @@ void CommandDel(Command *command)
* @note If mtags is NULL then new message tags are created for the command
* (and destroyed before return).
*/
void do_cmd(Client *client, MessageTag *mtags, char *cmd, int parc, char *parv[])
void do_cmd(Client *client, MessageTag *mtags, const char *cmd, int parc, char *parv[])
{
RealCommand *cmptr;
@@ -233,7 +233,7 @@ void init_CommandHash(void)
CommandAdd(NULL, MSG_MODULE, cmd_module, MAXPARA, CMD_USER);
}
static RealCommand *add_Command_backend(char *cmd)
static RealCommand *add_Command_backend(const char *cmd)
{
RealCommand *c = safe_alloc(sizeof(RealCommand));