From dcd260f19108b1581242296d1dfa1a9bf429676b Mon Sep 17 00:00:00 2001 From: mux Date: Fri, 3 Mar 2006 18:45:12 +0000 Subject: [PATCH] Import today's csup sources to get the warning fix for queue.h. We probably want to do something similar in sys/queue.h; it's bad to have STAILQ_LAST() generate GCC warnings. --- contrib/csup/misc.c | 2 +- contrib/csup/queue.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/csup/misc.c b/contrib/csup/misc.c index ff9403e0c794..b97a54288036 100644 --- a/contrib/csup/misc.c +++ b/contrib/csup/misc.c @@ -204,7 +204,7 @@ rcsdatetotm(const char *revdate, struct tm *tm) if (cp == NULL) return (-1); len = cp - revdate; - if (len == 4) + if (len >= 4) cp = strptime(revdate, "%Y.%m.%d.%H.%M.%S", tm); else if (len == 2) cp = strptime(revdate, "%y.%m.%d.%H.%M.%S", tm); diff --git a/contrib/csup/queue.h b/contrib/csup/queue.h index 369c013f7546..7ae77bcf0417 100644 --- a/contrib/csup/queue.h +++ b/contrib/csup/queue.h @@ -107,7 +107,7 @@ struct { \ #define STAILQ_LAST(head, type, field) \ (STAILQ_EMPTY((head)) ? \ NULL : \ - ((struct type *) \ + ((struct type *)(void *) \ ((char *)((head)->stqh_last) - __offsetof(struct type, field)))) #undef STAILQ_NEXT