diff options
author | vincent <vincent> | 2006-01-17 23:39:04 +0000 |
---|---|---|
committer | vincent <vincent> | 2006-01-17 23:39:04 +0000 |
commit | ebcdb58192d71f5a83fd687e63a0fa53a283391c (patch) | |
tree | 6a353a0955459f02cc08ab6f3aedf99b34c8e5ea | |
parent | cce142d32410a9f16a7beaf68ec068141ab25f77 (diff) | |
download | quagga-ebcdb58192d71f5a83fd687e63a0fa53a283391c.tar.bz2 quagga-ebcdb58192d71f5a83fd687e63a0fa53a283391c.tar.xz |
2006-01-17 Vincent Jardin <vincent.jardin@6wind.com>
* md5.c: Don't forget to keep const.
* regex.c: Cleanup code and remove warnings.
-rw-r--r-- | lib/ChangeLog | 5 | ||||
-rw-r--r-- | lib/md5.c | 2 | ||||
-rw-r--r-- | lib/regex.c | 18 |
3 files changed, 17 insertions, 8 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index 1fa8eb59..aae83dcb 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2006-01-17 Vincent Jardin <vincent.jardin@6wind.com> + + * md5.c: Don't forget to keep const. + * regex.c: Cleanup code and remove warnings. + 2006-01-17 Paul Jakma <paul.jakma@sun.com> * md5.{c,h}: (md5_loop) Is better off taking a void * and doing @@ -149,7 +149,7 @@ void md5_init(md5_ctxt *ctxt) void md5_loop(md5_ctxt *ctxt, const void *vinput, uint len) { uint gap, i; - uint8_t *input = vinput; + const uint8_t *input = vinput; ctxt->md5_n += len * 8; /* byte to bit */ gap = MD5_BUFLEN - ctxt->md5_i; diff --git a/lib/regex.c b/lib/regex.c index 2f90dded..a22e03f6 100644 --- a/lib/regex.c +++ b/lib/regex.c @@ -30,6 +30,10 @@ #ifdef HAVE_CONFIG_H # include <config.h> #endif +#ifdef _WIN32 +/* Windows does not provide unistd.h, which is required for abort() */ +#include <process.h> +#endif /* _WIN32 */ #ifndef PARAMS # if defined __GNUC__ || (defined __STDC__ && __STDC__) @@ -1025,7 +1029,7 @@ static const char re_error_msgid[] = gettext_noop ("Invalid regular expression") /* REG_BADPAT */ "\0" #define REG_ECOLLATE_IDX (REG_BADPAT_IDX + sizeof "Invalid regular expression") - gettext_noop ("Invalid collation character"), /* REG_ECOLLATE */ + gettext_noop ("Invalid collation character") /* REG_ECOLLATE */ "\0" #define REG_ECTYPE_IDX (REG_ECOLLATE_IDX + sizeof "Invalid collation character") gettext_noop ("Invalid character class name") /* REG_ECTYPE */ @@ -1670,7 +1674,7 @@ static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr, MSC and drop MAX_BUF_SIZE a bit. Otherwise you may end up reallocating to 0 bytes. Such thing is not going to work too well. You have been warned!! */ -#if defined _MSC_VER && !defined WIN32 +#if defined _MSC_VER && !defined _WIN32 /* Microsoft C 16-bit versions limit malloc to approx 65512 bytes. The REALLOC define eliminates a flurry of conversion warnings, but is not required. */ @@ -5818,8 +5822,8 @@ weak_alias (__regexec, regexec) from either regcomp or regexec. We don't use PREG here. */ size_t -regerror (errcode, preg, errbuf, errbuf_size) - int errcode; +regerror (err, preg, errbuf, errbuf_size) + int err; const regex_t *preg; char *errbuf; size_t errbuf_size; @@ -5827,8 +5831,8 @@ regerror (errcode, preg, errbuf, errbuf_size) const char *msg; size_t msg_size; - if (errcode < 0 - || errcode >= (int) (sizeof (re_error_msgid_idx) + if (err < 0 + || err >= (int) (sizeof (re_error_msgid_idx) / sizeof (re_error_msgid_idx[0]))) /* Only error codes returned by the rest of the code should be passed to this routine. If we are given anything else, or if other regex @@ -5836,7 +5840,7 @@ regerror (errcode, preg, errbuf, errbuf_size) Dump core so we can fix it. */ abort (); - msg = gettext (re_error_msgid + re_error_msgid_idx[errcode]); + msg = gettext (re_error_msgid + re_error_msgid_idx[err]); msg_size = strlen (msg) + 1; /* Includes the null. */ |