32737, 32736 (32741), 32735, 32734, 32733, 32732 (32739): Strict compilation

fixes

	Src/utils.c: properly ifdef declarations
	Src/zsh_system.h: memmove() should return its dest argument
	Src/signals.c: define ret before use
	Src/mem.c: remove unused pointers
	Src/prototypes.h: use size_t in bcopy()
	Src/compat.c: fix const declaration inconsistency
This commit is contained in:
Nikolas Garofil 2014-06-07 13:48:40 -07:00 committed by Barton E. Schaefer
parent 37ccdf58c0
commit 4f4d2b8247
7 changed files with 31 additions and 10 deletions

View file

@ -1,3 +1,19 @@
2014-06-07 Barton E. Schaefer <schaefer@zsh.org>
* Nikolas Garofil: 32737: Src/utils.c: properly ifdef declarations
* Nikolas Garofil: 32736 (tweak per 32741): Src/zsh_system.h:
memmove() should return its dest argument
* Nikolas Garofil: 32735: Src/signals.c: define ret before use
* Nikolas Garofil: 32734: Src/mem.c: remove unused pointers
* Nikolas Garofil: 32733: Src/prototypes.h: use size_t in bcopy()
* Nikolas Garofil: 32732 (tweak per 32739): Src/compat.c: fix
const declaration inconsistency
2014-06-06 Peter Stephenson <p.w.stephenson@ntlworld.com>
* Jun T: 32719: Doc/Zsh/contrib.yo: minor issues.

View file

@ -37,7 +37,7 @@
char *
strstr(const char *s, const char *t)
{
char *p1, *p2;
const char *p1, *p2;
for (; *s; s++) {
for (p1 = s, p2 = t; *p2; p1++, p2++)

View file

@ -1508,7 +1508,7 @@ zsfree(char *p)
MALLOC_RET_T
realloc(MALLOC_RET_T p, MALLOC_ARG_T size)
{
struct m_hdr *m = (struct m_hdr *)(((char *)p) - M_ISIZE), *mp, *mt;
struct m_hdr *m = (struct m_hdr *)(((char *)p) - M_ISIZE), *mt;
char *r;
int i, l = 0;
@ -1524,10 +1524,10 @@ realloc(MALLOC_RET_T p, MALLOC_ARG_T size)
/* check if we are reallocating a small block, if we do, we have
to compute the size of the block from the sort of block it is in */
for (i = 0; i < M_NSMALL; i++) {
for (mp = NULL, mt = m_small[i];
for (mt = m_small[i];
mt && (((char *)mt) > ((char *)p) ||
(((char *)mt) + mt->len) < ((char *)p));
mp = mt, mt = mt->next);
mt = mt->next);
if (mt) {
l = M_BSLEN(mt->len);

View file

@ -130,5 +130,5 @@ extern char *strerror _((int errnum));
/***************************************************/
#ifndef HAVE_MEMMOVE
extern void bcopy _((const void *, void *, int));
extern void bcopy _((const void *, void *, size_t));
#endif

View file

@ -369,7 +369,7 @@ signal_suspend(UNUSED(int sig), int wait_cmd)
#ifdef POSIX_SIGNALS
# ifdef BROKEN_POSIX_SIGSUSPEND
sigprocmask(SIG_SETMASK, &set, &oset);
pause();
ret = pause();
sigprocmask(SIG_SETMASK, &oset, NULL);
# else /* not BROKEN_POSIX_SIGSUSPEND */
ret = sigsuspend(&set);

View file

@ -2712,8 +2712,11 @@ ztrftimebuf(int *bufsizeptr, int decr)
mod_export int
ztrftime(char *buf, int bufsize, char *fmt, struct tm *tm)
{
int hr12, decr;
#ifndef HAVE_STRFTIME
int hr12;
#ifdef HAVE_STRFTIME
int decr;
char tmp[4];
#else
static char *astr[] =
{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
static char *estr[] =
@ -2721,7 +2724,6 @@ ztrftime(char *buf, int bufsize, char *fmt, struct tm *tm)
"Aug", "Sep", "Oct", "Nov", "Dec"};
#endif
char *origbuf = buf;
char tmp[4];
while (*fmt)

View file

@ -708,7 +708,10 @@ struct timezone {
#endif
#ifndef HAVE_MEMMOVE
# define memmove(dest, src, len) bcopy((src), (dest), (len))
# ifndef memmove
static char *zmmv;
# define memmove(dest, src, len) (bcopy((src), zmmv = (dest), (len)), zmmv)
# endif
#endif
#ifndef offsetof