Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change API to use const char where appropriate #97

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ then
m4_ifdef([AX_IS_RELEASE], [
AX_IS_RELEASE([git-directory])
m4_ifdef([AX_COMPILER_FLAGS], [
AX_COMPILER_FLAGS(,,,,[-pedantic -Wunused-parameter -Wmissing-field-initializers])
AX_COMPILER_FLAGS(,,,,[-pedantic -Wwrite-strings -Wunused-parameter -Wmissing-field-initializers])
# unfortunately, AX_COMPILER_FLAGS does not provide a way to override
# the default -Wno-error=warning" flags. So we do this via sed below.
# Note: we *really* want to have this error out during CI testing!
Expand Down
2 changes: 1 addition & 1 deletion src/librelp.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ relpRetVal relpEngineSetDnsLookupMode(relpEngine_t *pThis, int iMode);
relpRetVal relpEngineSetOnAuthErr(relpEngine_t *pThis,
void (*pCB)(void*pUsr, char *authinfo, char*errmsg, relpRetVal errcode) );
relpRetVal relpEngineSetOnErr(relpEngine_t *pThis,
void (*pCB)(void*pUsr, char *objinfo, char*errmsg, relpRetVal errcode) );
void (*pCB)(void*pUsr, const char *objinfo, char*errmsg, relpRetVal errcode) );
relpRetVal relpEngineSetOnGenericErr(relpEngine_t *pThis,
void (*pCB)(char *objinfo, char*errmsg, relpRetVal errcode) );

Expand Down
2 changes: 1 addition & 1 deletion src/relp.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ relpEngineSetOnAuthErr(relpEngine_t *pThis, void (*pCB)(void*pUsr, char *authinf
* errcode - contains librelp error status
*/
relpRetVal
relpEngineSetOnErr(relpEngine_t *pThis, void (*pCB)(void*pUsr, char *objinfo, char*errmsg, relpRetVal errcode) )
relpEngineSetOnErr(relpEngine_t *pThis, void (*pCB)(void*pUsr, const char *objinfo, char*errmsg, relpRetVal errcode) )
{
ENTER_RELPFUNC;
RELPOBJ_assert(pThis, Engine);
Expand Down
16 changes: 8 additions & 8 deletions src/relp.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ typedef struct relpEngSessLst_s {
*/
struct relpEngine_s {
BEGIN_RELP_OBJ;
void (*dbgprint)(char *fmt, ...) __attribute__((format(printf, 1, 2)));
relpRetVal (*onSyslogRcv)(unsigned char*pHostname, unsigned char *pIP,
unsigned char *pMsg, size_t lenMsg); /**< callback for "syslog" cmd */
relpRetVal (*onSyslogRcv2)(void*, unsigned char*pHostname, unsigned char *pIP,
unsigned char *pMsg, size_t lenMsg); /**< callback for "syslog" cmd */
void (*onAuthErr)(void*pUsr, char *authinfo, char*errmsg, relpRetVal errcode);
void (*onErr)(void*pUsr, char *objinfo, char*errmsg, relpRetVal errcode);
void (*onGenericErr)(char *objinfo, char*errmsg, relpRetVal errcode);
void (*dbgprint)(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
relpRetVal (*onSyslogRcv)(unsigned const char*pHostname, unsigned const char *pIP,
unsigned const char *pMsg, size_t lenMsg); /**< callback for "syslog" cmd */
relpRetVal (*onSyslogRcv2)(void*, unsigned const char*pHostname, unsigned const char *pIP,
unsigned const char *pMsg, size_t lenMsg); /**< callback for "syslog" cmd */
void (*onAuthErr)(void*pUsr, const char *authinfo, const char*errmsg, relpRetVal errcode);
void (*onErr)(void*pUsr, const char *objinfo, const char*errmsg, relpRetVal errcode);
void (*onGenericErr)(const char *objinfo, const char*errmsg, relpRetVal errcode);
int protocolVersion; /**< version of the relp protocol supported by this engine */

/* Flags */
Expand Down