Skip to content

Commit

Permalink
fix discarded-qualifier compiler warnings (#36)
Browse files Browse the repository at this point in the history
* fix discarded-qualifier compler warnings

* fixed compiler warnings/errors
  • Loading branch information
mbhangui authored May 10, 2024
1 parent 1bcfcb6 commit cb1a4f3
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 20 deletions.
2 changes: 1 addition & 1 deletion courier-imap-x/libs/rfc1035/rfc1035str.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

#include "rfc1035.h"
#include <string.h>
#include <strings.h>


static struct { const char *name; int num; } typetab[]={
Expand Down
3 changes: 3 additions & 0 deletions indimail-access/doc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Release @version@-@release@ Start 28/11/2024 End 03/12/2023
04. upgraded courier-imap to 5.2.6
05. upgraded maildrop to 3.1.6
- 01/01/2024 - indimail-3.4.6
- 10/05/2024
06. courier-imap/libs/rfc1035/rfc1035str.c: Fix missing prototype for
strcasecmp

* Tue Nov 28 2023 11:04:28 +0000 Manvendra Bhangui <[email protected]> 1.1.1-1.1%{?dist}
Release 1.1.1-1.1 Start 01/03/2021 End 28/11/2023
Expand Down
7 changes: 5 additions & 2 deletions indimail-x/atrn_access.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: atrn_access.c,v $
* Revision 1.2 2024-05-10 11:43:51+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.1 2019-04-14 23:09:14+05:30 Cprogrammer
* Initial revision
*
Expand All @@ -23,7 +26,7 @@
#include "variables.h"

#ifndef lint
static char sccsid[] = "$Id: atrn_access.c,v 1.1 2019-04-14 23:09:14+05:30 Cprogrammer Exp mbhangui $";
static char sccsid[] = "$Id: atrn_access.c,v 1.2 2024-05-10 11:43:51+05:30 mbhangui Exp mbhangui $";
#endif

static void
Expand All @@ -34,7 +37,7 @@ die_nomem()
}

int
atrn_access(char *email, char *domain)
atrn_access(const char *email, const char *domain)
{
static stralloc SqlBuf = {0}, User = {0}, Domain = {0}, Email = {0};
int len, num;
Expand Down
7 changes: 5 additions & 2 deletions indimail-x/inquery.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: inquery.c,v $
* Revision 1.12 2024-05-10 11:43:51+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.11 2023-06-08 17:46:57+05:30 Cprogrammer
* renamed fifo directory from FIFODIR to INFIFODIR
*
Expand Down Expand Up @@ -67,7 +70,7 @@
#include "strToPw.h"

#ifndef lint
static char sccsid[] = "$Id: inquery.c,v 1.11 2023-06-08 17:46:57+05:30 Cprogrammer Exp mbhangui $";
static char sccsid[] = "$Id: inquery.c,v 1.12 2024-05-10 11:43:51+05:30 mbhangui Exp mbhangui $";
#endif

#define FATAL "inquery: fatal: "
Expand Down Expand Up @@ -95,7 +98,7 @@ cleanup(int rfd, int wfd, void (*sig_pipe_save)(), char *fifo)
* (len of string: int|QueryType: 1|NULL: 1|EmailId: len1|NULL: 1|Fifo: len2|NULL: 1|IP: len3|NULL: 1)
*/
void *
inquery(char query_type, char *email, char *ip)
inquery(char query_type, const char *email, const char *ip)
{
int rfd, wfd, len, bytes, idx, readTimeout, writeTimeout,
pipe_size, fd;
Expand Down
5 changes: 4 additions & 1 deletion indimail-x/inquery.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
/*
* $Log: inquery.h,v $
* Revision 1.2 2024-05-10 11:43:51+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.1 2019-04-13 23:39:27+05:30 Cprogrammer
* inquery.h
*
*/
#ifndef INQUERY_H
#define INQUERY_H

void *inquery(char, char *, char *);
void *inquery(char, const char *, const char *);

#endif
9 changes: 6 additions & 3 deletions indimail-x/parse_email.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: parse_email.c,v $
* Revision 1.4 2024-05-10 11:43:51+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.3 2021-07-27 18:06:44+05:30 Cprogrammer
* set default domain using vset_default_domain
*
Expand All @@ -22,7 +25,7 @@
#include "indimail.h"

#ifndef lint
static char sccsid[] = "$Id: parse_email.c,v 1.3 2021-07-27 18:06:44+05:30 Cprogrammer Exp mbhangui $";
static char sccsid[] = "$Id: parse_email.c,v 1.4 2024-05-10 11:43:51+05:30 mbhangui Exp mbhangui $";
#endif

/*
Expand All @@ -35,9 +38,9 @@ static char sccsid[] = "$Id: parse_email.c,v 1.3 2021-07-27 18:06:44+05:30 C
* -1 if either user or domain was truncated due to buff_size being reached
*/
int
parse_email(char *email, stralloc *user, stralloc *domain)
parse_email(const char *email, stralloc *user, stralloc *domain)
{
char *ptr;
const char *ptr;
int i, len;

for (len = 0, ptr = email; *ptr; ptr++, len++) {
Expand Down
5 changes: 4 additions & 1 deletion indimail-x/parse_email.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: parse_email.h,v $
* Revision 1.2 2024-05-10 11:43:51+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.1 2019-04-13 23:39:27+05:30 Cprogrammer
* parse_email.h
*
Expand All @@ -13,6 +16,6 @@
#include <stralloc.h>
#endif

int parse_email(char *, stralloc *, stralloc *);
int parse_email(const char *, stralloc *, stralloc *);

#endif
13 changes: 8 additions & 5 deletions indimail-x/qmailmrtg.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: qmailmrtg.c,v $
* Revision 1.8 2024-05-10 11:44:24+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.7 2023-09-17 22:36:34+05:30 Cprogrammer
* removed leading white space to correct current concurrency
*
Expand Down Expand Up @@ -70,7 +73,7 @@
#include <no_of_days.h>

#ifndef lint
static char sccsid[] = "$Id: qmailmrtg.c,v 1.7 2023-09-17 22:36:34+05:30 Cprogrammer Exp mbhangui $";
static char sccsid[] = "$Id: qmailmrtg.c,v 1.8 2024-05-10 11:44:24+05:30 mbhangui Exp mbhangui $";
#endif

#define FATAL "qmailmrtg: fatal: "
Expand Down Expand Up @@ -430,7 +433,7 @@ process_file(char *file_name, char type, char inquery_type)
* -3 - name too long
*/
int
run_init(char *service_dir)
run_init(const char *service_dir)
{
char *run_dir, *p, *s;
char buf[256], dirbuf[256];
Expand Down Expand Up @@ -529,7 +532,7 @@ run_init(char *service_dir)
}

void
print_status(char *dir, char status[])
print_status(const char *dir, char status[])
{
unsigned long pid;
unsigned char want, paused;
Expand Down Expand Up @@ -611,9 +614,9 @@ print_status(char *dir, char status[])
}

void
print_uptime(char *sdir, char status[], int len)
print_uptime(const char *sdir, char status[], int len)
{
char *x;
const char *x;
int fd, r;

if (!sdir) {
Expand Down
11 changes: 7 additions & 4 deletions indimail-x/vchkpass.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: vchkpass.c,v 1.19 2023-07-15 12:50:01+05:30 Cprogrammer Exp mbhangui $
* $Id: vchkpass.c,v 1.20 2024-05-10 11:43:51+05:30 mbhangui Exp mbhangui $
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
Expand Down Expand Up @@ -44,7 +44,7 @@
#include "runcmmd.h"

#ifndef lint
static char sccsid[] = "$Id: vchkpass.c,v 1.19 2023-07-15 12:50:01+05:30 Cprogrammer Exp mbhangui $";
static char sccsid[] = "$Id: vchkpass.c,v 1.20 2024-05-10 11:43:51+05:30 mbhangui Exp mbhangui $";
#endif

#ifdef AUTH_SIZE
Expand Down Expand Up @@ -333,14 +333,14 @@ main(int argc, char **argv)
}
module_pid[fmt_ulong(module_pid, getpid())] = 0;
if ((ptr = env_get("DEBUG_LOGIN")) && *ptr > '0') {
ptr = get_authmethod(auth_method);
ptr = (char *) get_authmethod(auth_method);
strerr_warn16("vchkpass: ", "pid [", module_pid, "]: login [", login,
"] challenge [", challenge, "] response [", response,
"] password [", pass ? pass : "cram-disabled", "] crypted [",
crypt_pass, "] authmethod [", ptr, "]", 0);
} else
if (env_get("DEBUG")) {
ptr = get_authmethod(auth_method);
ptr = (char *) get_authmethod(auth_method);
strerr_warn8("vchkpass: ", "pid [", module_pid, "]: login [", login,
"] authmethod [", ptr, "]", 0);
}
Expand Down Expand Up @@ -428,6 +428,9 @@ main(int argc, char **argv)

/*
* $Log: vchkpass.c,v $
* Revision 1.20 2024-05-10 11:43:51+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.19 2023-07-15 12:50:01+05:30 Cprogrammer
* authenticate using CRAM when password field starts with {CRAM}
*
Expand Down
2 changes: 2 additions & 0 deletions logalert-x/doc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Release 0.4.0-1.1 Start 13/04/2023 End 15/10/2023
- 01/01/2024 - indimail-3.4.6
- 29/04/2024
6. logclient.c: fixed compilation warnings
- 10/05/2024
7. parser.y: added missing prototype for yylex()

* Thu 08 Sep 2022 14:38:16 +0000 Manvendra Bhangui <[email protected]> 0.3.0-1.1%{?dist}
Release 0.3.0-1.1 Start 25/02/2010
Expand Down
3 changes: 2 additions & 1 deletion logalert-x/lex.l
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <string.h>
#include "parser.h"
#include "parsers.h"

unsigned int in_block = 0;
extern unsigned int lineno;
Expand All @@ -26,7 +27,7 @@ extern unsigned int lineno;
in_block = 0;
printf("finished block\n");
} else {
yyerror("ERRO: NOT in block");
yyerror("ERROR: NOT in block");
}
}
<INBLOCK>match|regex { printf("OPA MATCH %d\n",in_block); return MATCH; }
Expand Down
1 change: 1 addition & 0 deletions logalert-x/parsers.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ void handle_entry_args(unsigned int a_id, char *value);
int new_entry_conf(struct entry_conf **new, char *name);
int handle_entry_conf(char *pname);
int yyerror(char *fmt, ...);
int yylex (void);
int handle_conf_file(const char *file);
int exec_parser(struct entry_conf *p, char *value);
int regex_parser(struct entry_conf *p, char *value);
Expand Down

0 comments on commit cb1a4f3

Please sign in to comment.