Commit 6e835d05 6e835d05151eb2f9523d34611e6f5b04b50780bf by Sergey Poznyakoff

Minor changes.

* guimb/main.c (main_sym): Remove const qualifier.
* imap4d/imap4d.h (util_getfullpath): 1st arg is const.
* imap4d/util.c: Likewise.
* include/mailutils/guile.h (mu_guile_load): 1st arg is const.
* include/mailutils/sql.h (mu_sql_get_field): 3rd arg is const.
* libmu_auth/radius.c: Cleanup trailing whitespace.
* libmu_scm/mu_guile.c (mu_guile_load): 1st arg is const.
(struct load_closure): Filename is const. All uses updated.
* mailbox/monitor.c (RWLOCK_TRYRDLOCK, RWLOCK_TRYWRLOCK): Remove
[!WITH_PTHREAD] (RWLOCK_DESTROY): Empty define.
* mailbox/mutil.c (mu_aget_user_email_domain): Minor fix.
* sql/sql.c (mu_sql_get_field): 3rd arg is const.
1 parent 558a5b14
......@@ -146,7 +146,7 @@ static const char *guimb_argp_capa[] = {
NULL
};
const char *main_sym = "mailutils-main";
char *main_sym = "mailutils-main";
int
main (int argc, char *argv[])
......
......@@ -338,7 +338,7 @@ extern int util_finish (struct imap4d_command *, int, const char *, ...)
extern int util_getstate (void);
extern int util_do_command (imap4d_tokbuf_t);
extern char *util_tilde_expansion (const char *, const char *);
extern char *util_getfullpath (char *, const char *);
extern char *util_getfullpath (const char *, const char *);
extern int util_msgset (char *, size_t **, int *, int);
extern int util_upper (char *);
extern struct imap4d_command *util_getcommand (char *,
......
......@@ -36,7 +36,7 @@ util_tilde_expansion (const char *ref, const char *delim)
/* Get the absolute path. */
/* NOTE: Path is allocated and must be free()d by the caller. */
char *
util_getfullpath (char *name, const char *delim)
util_getfullpath (const char *name, const char *delim)
{
char *p = util_tilde_expansion (name, delim);
if (*p != delim[0])
......
......@@ -76,7 +76,7 @@ void mu_scm_debug_port_init (void);
extern void mu_guile_init (int debug);
extern int mu_guile_load (char *filename, int argc, char **argv);
extern int mu_guile_load (const char *filename, int argc, char **argv);
extern int mu_guile_eval (const char *string);
extern int mu_guile_mailbox_apply (mu_mailbox_t mbx, char *funcname);
extern int mu_guile_message_apply (mu_message_t msg, char *funcname);
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -151,7 +151,7 @@ int mu_sql_num_columns (mu_sql_connection_t conn, size_t *np);
int mu_sql_get_column (mu_sql_connection_t conn, size_t nrow, size_t ncol,
char **pdata);
int mu_sql_get_field (mu_sql_connection_t conn, size_t nrow, char *fname,
int mu_sql_get_field (mu_sql_connection_t conn, size_t nrow, const char *fname,
char **pdata);
const char *mu_sql_strerror (mu_sql_connection_t conn);
......
......@@ -559,4 +559,3 @@ struct mu_auth_module mu_auth_radius_module = {
mu_auth_radius_user_by_uid,
NULL
};
......
......@@ -119,7 +119,7 @@ mu_guile_init (int debug)
struct load_closure
{
char *filename;
const char *filename;
int argc;
char **argv;
};
......@@ -129,13 +129,13 @@ load_path_handler (void *data)
{
struct load_closure *lp = data;
scm_set_program_arguments (lp->argc, lp->argv, lp->filename);
scm_set_program_arguments (lp->argc, lp->argv, (char*)lp->filename);
scm_primitive_load (scm_makfrom0str (lp->filename));
return SCM_UNDEFINED;
}
int
mu_guile_load (char *filename, int argc, char **argv)
mu_guile_load (const char *filename, int argc, char **argv)
{
struct load_closure lc;
lc.filename = filename;
......
......@@ -212,29 +212,23 @@ mu_monitor_notify (mu_monitor_t monitor MU_ARG_UNUSED)
# define RWLOCK_INIT(rwl, attr) pthread_rwlock_init (rwl, attr)
# define RWLOCK_DESTROY(rwl) pthread_rwlock_destroy (rwl)
# define RWLOCK_RDLOCK(rwl) pthread_rwlock_rdlock (rwl)
# define RWLOCK_TRYRDLOCK(rwl) pthread_rwlock_tryrdlock (rwl)
# define RWLOCK_WRLOCK(rwl) pthread_rwlock_wrlock (rwl)
# define RWLOCK_TRYWRLOCK(rwl) pthread_rwlock_trywrlock (rwl)
# define RWLOCK_UNLOCK(rwl) pthread_rwlock_unlock (rwl)
# else
# define RWLOCK_INIT(rwl, attr) pthread_mutex_init (rwl, attr)
# define RWLOCK_DESTROY(rwl) pthread_mutex_destroy (rwl)
# define RWLOCK_RDLOCK(rwl) pthread_mutex_lock (rwl)
# define RWLOCK_TRYRDLOCK(rwl) pthread_mutex_trylock (rwl)
# define RWLOCK_WRLOCK(rwl) pthread_mutex_lock (rwl)
# define RWLOCK_TRYWRLOCK(rwl) pthread_mutex_trylock (rwl)
# define RWLOCK_UNLOCK(rwl) pthread_mutex_unlock (rwl)
# endif
#else
# define RWLOCK_INIT(rwl, attr) 0
# define RWLOCK_DESTROY(rwl) 0
# define RWLOCK_DESTROY(rwl)
# define RWLOCK_RDLOCK(rwl) 0
# define RWLOCK_TRYRDLOCK(rwl) 0
# define RWLOCK_WRLOCK(rwl) 0
# define RWLOCK_TRYWRLOCK(rwl) 0
# define RWLOCK_UNLOCK(rwl) 0
# define flockfile(arg) 0
# define funlockfile(arg) 0
# define flockfile(arg)
# define funlockfile(arg)
#endif
......
......@@ -437,7 +437,7 @@ mu_aget_user_email_domain (char **pdomain)
if (status)
return status;
if (domain == NULL)
*pdomain = domain;
*pdomain = NULL;
else
{
*pdomain = strdup (domain);
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -365,7 +365,7 @@ mu_sql_get_column (mu_sql_connection_t conn, size_t nrow, size_t ncol,
}
int
mu_sql_get_field (mu_sql_connection_t conn, size_t nrow, char *fname,
mu_sql_get_field (mu_sql_connection_t conn, size_t nrow, const char *fname,
char **pdata)
{
int rc;
......@@ -402,4 +402,3 @@ mu_sql_strerror (mu_sql_connection_t conn)
return strerror (EINVAL);
return SQL_F (conn, errstr) (conn);
}
......