const'ify IRC_WriteStrXXX() and Get_Prefix() functions

This commit is contained in:
Alexander Barton 2010-06-26 00:38:20 +02:00
parent 8605e9c0fe
commit 0c0d4af55a
2 changed files with 40 additions and 34 deletions

View File

@ -37,19 +37,19 @@
#define SEND_TO_SERVER 2 #define SEND_TO_SERVER 2
static char *Get_Prefix PARAMS((CLIENT *Target, CLIENT *Client)); static const char *Get_Prefix PARAMS((CLIENT *Target, CLIENT *Client));
static void cb_writeStrServersPrefixFlag PARAMS((CLIENT *Client, static void cb_writeStrServersPrefixFlag PARAMS((CLIENT *Client,
CLIENT *Prefix, void *Buffer)); CLIENT *Prefix, void *Buffer));
#ifdef PROTOTYPES #ifdef PROTOTYPES
GLOBAL bool GLOBAL bool
IRC_WriteStrClient( CLIENT *Client, char *Format, ... ) IRC_WriteStrClient( CLIENT *Client, const char *Format, ... )
#else #else
GLOBAL bool GLOBAL bool
IRC_WriteStrClient( Client, Format, va_alist ) IRC_WriteStrClient( Client, Format, va_alist )
CLIENT *Client; CLIENT *Client;
char *Format; const char *Format;
va_dcl va_dcl
#endif #endif
{ {
@ -77,13 +77,13 @@ va_dcl
#ifdef PROTOTYPES #ifdef PROTOTYPES
GLOBAL bool GLOBAL bool
IRC_WriteStrClientPrefix( CLIENT *Client, CLIENT *Prefix, char *Format, ... ) IRC_WriteStrClientPrefix(CLIENT *Client, CLIENT *Prefix, const char *Format, ...)
#else #else
GLOBAL bool GLOBAL bool
IRC_WriteStrClientPrefix(Client, Prefix, Format, va_alist) IRC_WriteStrClientPrefix(Client, Prefix, Format, va_alist)
CLIENT *Client; CLIENT *Client;
CLIENT *Prefix; CLIENT *Prefix;
char *Format; const char *Format;
va_dcl va_dcl
#endif #endif
{ {
@ -110,14 +110,15 @@ va_dcl
#ifdef PROTOTYPES #ifdef PROTOTYPES
GLOBAL bool GLOBAL bool
IRC_WriteStrChannel( CLIENT *Client, CHANNEL *Chan, bool Remote, char *Format, ... ) IRC_WriteStrChannel(CLIENT *Client, CHANNEL *Chan, bool Remote,
const char *Format, ...)
#else #else
GLOBAL bool GLOBAL bool
IRC_WriteStrChannel(Client, Chan, Remote, Format, va_alist) IRC_WriteStrChannel(Client, Chan, Remote, Format, va_alist)
CLIENT *Client; CLIENT *Client;
CHANNEL *Chan; CHANNEL *Chan;
bool Remote; bool Remote;
char *Format; const char *Format;
va_dcl va_dcl
#endif #endif
{ {
@ -146,7 +147,8 @@ va_dcl
*/ */
#ifdef PROTOTYPES #ifdef PROTOTYPES
GLOBAL bool GLOBAL bool
IRC_WriteStrChannelPrefix( CLIENT *Client, CHANNEL *Chan, CLIENT *Prefix, bool Remote, char *Format, ... ) IRC_WriteStrChannelPrefix(CLIENT *Client, CHANNEL *Chan, CLIENT *Prefix,
bool Remote, const char *Format, ...)
#else #else
GLOBAL bool GLOBAL bool
IRC_WriteStrChannelPrefix(Client, Chan, Prefix, Remote, Format, va_alist) IRC_WriteStrChannelPrefix(Client, Chan, Prefix, Remote, Format, va_alist)
@ -154,7 +156,7 @@ CLIENT *Client;
CHANNEL *Chan; CHANNEL *Chan;
CLIENT *Prefix; CLIENT *Prefix;
bool Remote; bool Remote;
char *Format; const char *Format;
va_dcl va_dcl
#endif #endif
{ {
@ -218,12 +220,12 @@ va_dcl
#ifdef PROTOTYPES #ifdef PROTOTYPES
GLOBAL void GLOBAL void
IRC_WriteStrServers( CLIENT *ExceptOf, char *Format, ... ) IRC_WriteStrServers(CLIENT *ExceptOf, const char *Format, ...)
#else #else
GLOBAL void GLOBAL void
IRC_WriteStrServers(ExceptOf, Format, va_alist) IRC_WriteStrServers(ExceptOf, Format, va_alist)
CLIENT *ExceptOf; CLIENT *ExceptOf;
char *Format; const char *Format;
va_dcl va_dcl
#endif #endif
{ {
@ -246,13 +248,14 @@ va_dcl
#ifdef PROTOTYPES #ifdef PROTOTYPES
GLOBAL void GLOBAL void
IRC_WriteStrServersPrefix( CLIENT *ExceptOf, CLIENT *Prefix, char *Format, ... ) IRC_WriteStrServersPrefix(CLIENT *ExceptOf, CLIENT *Prefix,
const char *Format, ...)
#else #else
GLOBAL void GLOBAL void
IRC_WriteStrServersPrefix(ExceptOf, Prefix, Format, va_alist) IRC_WriteStrServersPrefix(ExceptOf, Prefix, Format, va_alist)
CLIENT *ExceptOf; CLIENT *ExceptOf;
CLIENT *Prefix; CLIENT *Prefix;
char *Format; const char *Format;
va_dcl va_dcl
#endif #endif
{ {
@ -276,14 +279,15 @@ va_dcl
#ifdef PROTOTYPES #ifdef PROTOTYPES
GLOBAL void GLOBAL void
IRC_WriteStrServersPrefixFlag( CLIENT *ExceptOf, CLIENT *Prefix, char Flag, char *Format, ... ) IRC_WriteStrServersPrefixFlag(CLIENT *ExceptOf, CLIENT *Prefix, char Flag,
const char *Format, ...)
#else #else
GLOBAL void GLOBAL void
IRC_WriteStrServersPrefixFlag(ExceptOf, Prefix, Flag, Format, va_alist) IRC_WriteStrServersPrefixFlag(ExceptOf, Prefix, Flag, Format, va_alist)
CLIENT *ExceptOf; CLIENT *ExceptOf;
CLIENT *Prefix; CLIENT *Prefix;
char Flag; char Flag;
char *Format; const char *Format;
va_dcl va_dcl
#endif #endif
{ {
@ -331,14 +335,15 @@ IRC_WriteStrServersPrefixFlag_CB(CLIENT *ExceptOf, CLIENT *Prefix, char Flag,
*/ */
#ifdef PROTOTYPES #ifdef PROTOTYPES
GLOBAL bool GLOBAL bool
IRC_WriteStrRelatedPrefix( CLIENT *Client, CLIENT *Prefix, bool Remote, char *Format, ... ) IRC_WriteStrRelatedPrefix(CLIENT *Client, CLIENT *Prefix, bool Remote,
const char *Format, ...)
#else #else
GLOBAL bool GLOBAL bool
IRC_WriteStrRelatedPrefix(Client, Prefix, Remote, Format, va_alist) IRC_WriteStrRelatedPrefix(Client, Prefix, Remote, Format, va_alist)
CLIENT *Client; CLIENT *Client;
CLIENT *Prefix; CLIENT *Prefix;
bool Remote; bool Remote;
char *Format; const char *Format;
va_dcl va_dcl
#endif #endif
{ {
@ -416,7 +421,7 @@ GLOBAL void
IRC_SendWallops(Client, From, Format, va_alist ) IRC_SendWallops(Client, From, Format, va_alist )
CLIENT *Client; CLIENT *Client;
CLIENT *From; CLIENT *From;
char *Format; const char *Format;
va_dcl va_dcl
#endif #endif
{ {
@ -468,7 +473,7 @@ IRC_SetPenalty( CLIENT *Client, time_t Seconds )
} /* IRC_SetPenalty */ } /* IRC_SetPenalty */
static char * static const char *
Get_Prefix( CLIENT *Target, CLIENT *Client ) Get_Prefix( CLIENT *Target, CLIENT *Client )
{ {
assert( Target != NULL ); assert( Target != NULL );

View File

@ -14,26 +14,27 @@
#ifndef __irc_write_h__ #ifndef __irc_write_h__
#define __irc_write_h__ #define __irc_write_h__
GLOBAL bool IRC_WriteStrClient PARAMS((CLIENT *Client, char *Format, ...)); GLOBAL bool IRC_WriteStrClient PARAMS((CLIENT *Client, const char *Format, ...));
GLOBAL bool IRC_WriteStrClientPrefix PARAMS((CLIENT *Client, CLIENT *Prefix, GLOBAL bool IRC_WriteStrClientPrefix PARAMS((CLIENT *Client, CLIENT *Prefix,
char *Format, ...)); const char *Format, ...));
GLOBAL bool IRC_WriteStrChannel PARAMS((CLIENT *Client, CHANNEL *Chan, GLOBAL bool IRC_WriteStrChannel PARAMS((CLIENT *Client, CHANNEL *Chan,
bool Remote, char *Format, ...)); bool Remote, const char *Format, ...));
GLOBAL bool IRC_WriteStrChannelPrefix PARAMS((CLIENT *Client, CHANNEL *Chan, GLOBAL bool IRC_WriteStrChannelPrefix PARAMS((CLIENT *Client, CHANNEL *Chan,
CLIENT *Prefix, bool Remote, char *Format, ...)); CLIENT *Prefix, bool Remote, const char *Format, ...));
GLOBAL void IRC_WriteStrServers PARAMS((CLIENT *ExceptOf, char *Format, ...)); GLOBAL void IRC_WriteStrServers PARAMS((CLIENT *ExceptOf,
const char *Format, ...));
GLOBAL void IRC_WriteStrServersPrefix PARAMS((CLIENT *ExceptOf, CLIENT *Prefix, GLOBAL void IRC_WriteStrServersPrefix PARAMS((CLIENT *ExceptOf, CLIENT *Prefix,
char *Format, ...)); const char *Format, ...));
GLOBAL void IRC_WriteStrServersPrefixFlag PARAMS((CLIENT *ExceptOf, GLOBAL void IRC_WriteStrServersPrefixFlag PARAMS((CLIENT *ExceptOf,
CLIENT *Prefix, char Flag, char *Format, ...)); CLIENT *Prefix, char Flag, const char *Format, ...));
GLOBAL void IRC_WriteStrServersPrefixFlag_CB PARAMS((CLIENT *ExceptOf, GLOBAL void IRC_WriteStrServersPrefixFlag_CB PARAMS((CLIENT *ExceptOf,
CLIENT *Prefix, char Flag, CLIENT *Prefix, char Flag,
void (*callback)(CLIENT *, CLIENT *, void *), void *cb_data)); void (*callback)(CLIENT *, CLIENT *, void *), void *cb_data));
GLOBAL bool IRC_WriteStrRelatedPrefix PARAMS((CLIENT *Client, CLIENT *Prefix, GLOBAL bool IRC_WriteStrRelatedPrefix PARAMS((CLIENT *Client, CLIENT *Prefix,
bool Remote, char *Format, ...)); bool Remote, const char *Format, ...));
GLOBAL void IRC_SendWallops PARAMS((CLIENT *Client, CLIENT *From, GLOBAL void IRC_SendWallops PARAMS((CLIENT *Client, CLIENT *From,
const char *Format, ...)); const char *Format, ...));