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[] = { ...@@ -146,7 +146,7 @@ static const char *guimb_argp_capa[] = {
146 NULL 146 NULL
147 }; 147 };
148 148
149 const char *main_sym = "mailutils-main"; 149 char *main_sym = "mailutils-main";
150 150
151 int 151 int
152 main (int argc, char *argv[]) 152 main (int argc, char *argv[])
......
...@@ -338,7 +338,7 @@ extern int util_finish (struct imap4d_command *, int, const char *, ...) ...@@ -338,7 +338,7 @@ extern int util_finish (struct imap4d_command *, int, const char *, ...)
338 extern int util_getstate (void); 338 extern int util_getstate (void);
339 extern int util_do_command (imap4d_tokbuf_t); 339 extern int util_do_command (imap4d_tokbuf_t);
340 extern char *util_tilde_expansion (const char *, const char *); 340 extern char *util_tilde_expansion (const char *, const char *);
341 extern char *util_getfullpath (char *, const char *); 341 extern char *util_getfullpath (const char *, const char *);
342 extern int util_msgset (char *, size_t **, int *, int); 342 extern int util_msgset (char *, size_t **, int *, int);
343 extern int util_upper (char *); 343 extern int util_upper (char *);
344 extern struct imap4d_command *util_getcommand (char *, 344 extern struct imap4d_command *util_getcommand (char *,
......
...@@ -36,7 +36,7 @@ util_tilde_expansion (const char *ref, const char *delim) ...@@ -36,7 +36,7 @@ util_tilde_expansion (const char *ref, const char *delim)
36 /* Get the absolute path. */ 36 /* Get the absolute path. */
37 /* NOTE: Path is allocated and must be free()d by the caller. */ 37 /* NOTE: Path is allocated and must be free()d by the caller. */
38 char * 38 char *
39 util_getfullpath (char *name, const char *delim) 39 util_getfullpath (const char *name, const char *delim)
40 { 40 {
41 char *p = util_tilde_expansion (name, delim); 41 char *p = util_tilde_expansion (name, delim);
42 if (*p != delim[0]) 42 if (*p != delim[0])
......
...@@ -76,7 +76,7 @@ void mu_scm_debug_port_init (void); ...@@ -76,7 +76,7 @@ void mu_scm_debug_port_init (void);
76 76
77 77
78 extern void mu_guile_init (int debug); 78 extern void mu_guile_init (int debug);
79 extern int mu_guile_load (char *filename, int argc, char **argv); 79 extern int mu_guile_load (const char *filename, int argc, char **argv);
80 extern int mu_guile_eval (const char *string); 80 extern int mu_guile_eval (const char *string);
81 extern int mu_guile_mailbox_apply (mu_mailbox_t mbx, char *funcname); 81 extern int mu_guile_mailbox_apply (mu_mailbox_t mbx, char *funcname);
82 extern int mu_guile_message_apply (mu_message_t msg, char *funcname); 82 extern int mu_guile_message_apply (mu_message_t msg, char *funcname);
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. 2 Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
3 3
4 This library is free software; you can redistribute it and/or 4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public 5 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); ...@@ -151,7 +151,7 @@ int mu_sql_num_columns (mu_sql_connection_t conn, size_t *np);
151 151
152 int mu_sql_get_column (mu_sql_connection_t conn, size_t nrow, size_t ncol, 152 int mu_sql_get_column (mu_sql_connection_t conn, size_t nrow, size_t ncol,
153 char **pdata); 153 char **pdata);
154 int mu_sql_get_field (mu_sql_connection_t conn, size_t nrow, char *fname, 154 int mu_sql_get_field (mu_sql_connection_t conn, size_t nrow, const char *fname,
155 char **pdata); 155 char **pdata);
156 156
157 const char *mu_sql_strerror (mu_sql_connection_t conn); 157 const char *mu_sql_strerror (mu_sql_connection_t conn);
......
...@@ -559,4 +559,3 @@ struct mu_auth_module mu_auth_radius_module = { ...@@ -559,4 +559,3 @@ struct mu_auth_module mu_auth_radius_module = {
559 mu_auth_radius_user_by_uid, 559 mu_auth_radius_user_by_uid,
560 NULL 560 NULL
561 }; 561 };
562
......
...@@ -119,7 +119,7 @@ mu_guile_init (int debug) ...@@ -119,7 +119,7 @@ mu_guile_init (int debug)
119 119
120 struct load_closure 120 struct load_closure
121 { 121 {
122 char *filename; 122 const char *filename;
123 int argc; 123 int argc;
124 char **argv; 124 char **argv;
125 }; 125 };
...@@ -129,13 +129,13 @@ load_path_handler (void *data) ...@@ -129,13 +129,13 @@ load_path_handler (void *data)
129 { 129 {
130 struct load_closure *lp = data; 130 struct load_closure *lp = data;
131 131
132 scm_set_program_arguments (lp->argc, lp->argv, lp->filename); 132 scm_set_program_arguments (lp->argc, lp->argv, (char*)lp->filename);
133 scm_primitive_load (scm_makfrom0str (lp->filename)); 133 scm_primitive_load (scm_makfrom0str (lp->filename));
134 return SCM_UNDEFINED; 134 return SCM_UNDEFINED;
135 } 135 }
136 136
137 int 137 int
138 mu_guile_load (char *filename, int argc, char **argv) 138 mu_guile_load (const char *filename, int argc, char **argv)
139 { 139 {
140 struct load_closure lc; 140 struct load_closure lc;
141 lc.filename = filename; 141 lc.filename = filename;
......
...@@ -212,29 +212,23 @@ mu_monitor_notify (mu_monitor_t monitor MU_ARG_UNUSED) ...@@ -212,29 +212,23 @@ mu_monitor_notify (mu_monitor_t monitor MU_ARG_UNUSED)
212 # define RWLOCK_INIT(rwl, attr) pthread_rwlock_init (rwl, attr) 212 # define RWLOCK_INIT(rwl, attr) pthread_rwlock_init (rwl, attr)
213 # define RWLOCK_DESTROY(rwl) pthread_rwlock_destroy (rwl) 213 # define RWLOCK_DESTROY(rwl) pthread_rwlock_destroy (rwl)
214 # define RWLOCK_RDLOCK(rwl) pthread_rwlock_rdlock (rwl) 214 # define RWLOCK_RDLOCK(rwl) pthread_rwlock_rdlock (rwl)
215 # define RWLOCK_TRYRDLOCK(rwl) pthread_rwlock_tryrdlock (rwl)
216 # define RWLOCK_WRLOCK(rwl) pthread_rwlock_wrlock (rwl) 215 # define RWLOCK_WRLOCK(rwl) pthread_rwlock_wrlock (rwl)
217 # define RWLOCK_TRYWRLOCK(rwl) pthread_rwlock_trywrlock (rwl)
218 # define RWLOCK_UNLOCK(rwl) pthread_rwlock_unlock (rwl) 216 # define RWLOCK_UNLOCK(rwl) pthread_rwlock_unlock (rwl)
219 # else 217 # else
220 # define RWLOCK_INIT(rwl, attr) pthread_mutex_init (rwl, attr) 218 # define RWLOCK_INIT(rwl, attr) pthread_mutex_init (rwl, attr)
221 # define RWLOCK_DESTROY(rwl) pthread_mutex_destroy (rwl) 219 # define RWLOCK_DESTROY(rwl) pthread_mutex_destroy (rwl)
222 # define RWLOCK_RDLOCK(rwl) pthread_mutex_lock (rwl) 220 # define RWLOCK_RDLOCK(rwl) pthread_mutex_lock (rwl)
223 # define RWLOCK_TRYRDLOCK(rwl) pthread_mutex_trylock (rwl)
224 # define RWLOCK_WRLOCK(rwl) pthread_mutex_lock (rwl) 221 # define RWLOCK_WRLOCK(rwl) pthread_mutex_lock (rwl)
225 # define RWLOCK_TRYWRLOCK(rwl) pthread_mutex_trylock (rwl)
226 # define RWLOCK_UNLOCK(rwl) pthread_mutex_unlock (rwl) 222 # define RWLOCK_UNLOCK(rwl) pthread_mutex_unlock (rwl)
227 # endif 223 # endif
228 #else 224 #else
229 # define RWLOCK_INIT(rwl, attr) 0 225 # define RWLOCK_INIT(rwl, attr) 0
230 # define RWLOCK_DESTROY(rwl) 0 226 # define RWLOCK_DESTROY(rwl)
231 # define RWLOCK_RDLOCK(rwl) 0 227 # define RWLOCK_RDLOCK(rwl) 0
232 # define RWLOCK_TRYRDLOCK(rwl) 0
233 # define RWLOCK_WRLOCK(rwl) 0 228 # define RWLOCK_WRLOCK(rwl) 0
234 # define RWLOCK_TRYWRLOCK(rwl) 0
235 # define RWLOCK_UNLOCK(rwl) 0 229 # define RWLOCK_UNLOCK(rwl) 0
236 # define flockfile(arg) 0 230 # define flockfile(arg)
237 # define funlockfile(arg) 0 231 # define funlockfile(arg)
238 #endif 232 #endif
239 233
240 234
......
...@@ -437,7 +437,7 @@ mu_aget_user_email_domain (char **pdomain) ...@@ -437,7 +437,7 @@ mu_aget_user_email_domain (char **pdomain)
437 if (status) 437 if (status)
438 return status; 438 return status;
439 if (domain == NULL) 439 if (domain == NULL)
440 *pdomain = domain; 440 *pdomain = NULL;
441 else 441 else
442 { 442 {
443 *pdomain = strdup (domain); 443 *pdomain = strdup (domain);
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. 2 Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
3 3
4 This library is free software; you can redistribute it and/or 4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public 5 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, ...@@ -365,7 +365,7 @@ mu_sql_get_column (mu_sql_connection_t conn, size_t nrow, size_t ncol,
365 } 365 }
366 366
367 int 367 int
368 mu_sql_get_field (mu_sql_connection_t conn, size_t nrow, char *fname, 368 mu_sql_get_field (mu_sql_connection_t conn, size_t nrow, const char *fname,
369 char **pdata) 369 char **pdata)
370 { 370 {
371 int rc; 371 int rc;
...@@ -402,4 +402,3 @@ mu_sql_strerror (mu_sql_connection_t conn) ...@@ -402,4 +402,3 @@ mu_sql_strerror (mu_sql_connection_t conn)
402 return strerror (EINVAL); 402 return strerror (EINVAL);
403 return SQL_F (conn, errstr) (conn); 403 return SQL_F (conn, errstr) (conn);
404 } 404 }
405
......