[pan: 7/9] Clean up autoconf and warnings
- From: Dominique Dumont <ddumont src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pan: 7/9] Clean up autoconf and warnings
- Date: Sun, 19 Jun 2022 10:30:44 +0000 (UTC)
commit 8202c89c9556b4a0d86de224cf18026b4eda8075
Author: Thomas Tanner <thosrtanner googlemail com>
Date: Fri Jun 17 20:38:28 2022 +0100
Clean up autoconf and warnings
acinclude.m4 | 18 +++++------
configure.ac | 5 ++-
uulib/fptools.c | 2 --
uulib/uucheck.c | 96 +++++++++++++++++++++++++++-----------------------------
uulib/uuencode.c | 2 --
uulib/uuint.h | 13 +++-----
uulib/uulib.c | 38 ++--------------------
uulib/uunconc.c | 3 +-
uulib/uuscan.c | 2 --
uulib/uustring.c | 4 +--
uulib/uuutil.c | 6 ++--
11 files changed, 66 insertions(+), 123 deletions(-)
---
diff --git a/acinclude.m4 b/acinclude.m4
index 61d3115..8e68881 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -5,9 +5,8 @@ AC_DEFUN([AC_CXX_HEADER_TR1_UNORDERED_SET], [
AC_CACHE_CHECK(for tr1/unordered_set,
ac_cv_cxx_tr1_unordered_set,
[AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <tr1/unordered_set>], [using std::tr1::unordered_set;],
- ac_cv_cxx_tr1_unordered_set=yes, ac_cv_cxx_tr1_unordered_set=no)
+ AC_LANG([C++])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <tr1/unordered_set>]], [[using
std::tr1::unordered_set;]])],[ac_cv_cxx_tr1_unordered_set=yes],[ac_cv_cxx_tr1_unordered_set=no])
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_tr1_unordered_set" = yes; then
@@ -21,10 +20,8 @@ AC_DEFUN([AC_CXX_NAMESPACES],
[AC_CACHE_CHECK(whether the compiler implements namespaces,
ac_cv_cxx_namespaces,
[AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}],
- [using namespace Outer::Inner; return i;],
- ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no)
+ AC_LANG([C++])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[namespace Outer { namespace Inner { int i = 0; }}]], [[using namespace
Outer::Inner; return i;]])],[ac_cv_cxx_namespaces=yes],[ac_cv_cxx_namespaces=no])
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_namespaces" = yes; then
@@ -40,12 +37,11 @@ AC_DEFUN([AC_CXX_HAVE_EXT_HASH_SET],
ac_cv_cxx_have_ext_hash_set,
[AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <ext/hash_set>
+ AC_LANG([C++])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ext/hash_set>
#ifdef HAVE_NAMESPACES
using namespace __gnu_cxx;
-#endif],[hash_set<int, int> t; return 0;],
- ac_cv_cxx_have_ext_hash_set=yes, ac_cv_cxx_have_ext_hash_set=no)
+#endif]], [[hash_set<int, int> t; return
0;]])],[ac_cv_cxx_have_ext_hash_set=yes],[ac_cv_cxx_have_ext_hash_set=no])
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_have_ext_hash_set" = yes; then
diff --git a/configure.ac b/configure.ac
index 0feca35..becf549 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@ AC_DEFINE(VERSION_MAJOR,0,[Major part of version number])
AC_DEFINE(VERSION_MINOR,150,[Minor part of version number])
AC_DEFINE(VERSION_REVISION,0,[Revision part of version number])
AC_DEFINE(VERSION_TITLE,["Moucherotte"],[Release Name])
-AC_PREREQ([2.64])
+AC_PREREQ([2.71])
dnl Get git info for pan-git.version
GIT_HASH='$Format:%h$'
@@ -75,8 +75,7 @@ AC_SUBST(GCR_REQUIRED)
AC_SUBST(WEBKIT_REQUIRED)
AC_PROG_CXX
-AC_HEADER_STDC
-AC_HEADER_TIME
+
AC_CHECK_FUNCS([localtime_r close])
AC_CXX_HEADER_TR1_UNORDERED_SET
AC_CXX_HAVE_EXT_HASH_SET
diff --git a/uulib/fptools.c b/uulib/fptools.c
index 6358390..6c01e8b 100644
--- a/uulib/fptools.c
+++ b/uulib/fptools.c
@@ -36,10 +36,8 @@
#include <stdio.h>
#include <ctype.h>
-#ifdef STDC_HEADERS
#include <stdlib.h>
#include <string.h>
-#endif
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
diff --git a/uulib/uucheck.c b/uulib/uucheck.c
index 0f128d0..37d4b67 100644
--- a/uulib/uucheck.c
+++ b/uulib/uucheck.c
@@ -34,10 +34,8 @@
#include <stdio.h>
#include <ctype.h>
-#ifdef STDC_HEADERS
#include <stdlib.h>
#include <string.h>
-#endif
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
@@ -103,7 +101,7 @@ static char *brackchr[] = {
/*
* Extract a filename from the subject line. We need anything to identify
- * the name of the program for sorting. If a nice filename cannot be found,
+ * the name of the program for sorting. If a nice filename cannot be found,
* the subject line itself is used
* ptonum is, if not NULL, a pointer to the part number in the subject line,
* so that it won't be used as filename.
@@ -173,7 +171,7 @@ UUGetFileName (char *subject, char *ptonum, char *ptonend)
while (isspace (*iter))
iter++;
count = length = alflag = 0;
- while (iter[count] &&
+ while (iter[count] &&
(strchr (fnqchars, iter[count])==NULL)) {
if (isalpha (iter[count]))
alflag++;
@@ -276,19 +274,19 @@ UUGetFileName (char *subject, char *ptonum, char *ptonend)
while (*ptr && *ptr != 0x0a && *ptr != 0x0d && ptr != part) {
iter = ptr;
count = length = alflag = 0;
-
+
if (_FP_strnicmp (ptr, "ftp", 3) == 0) {
/* hey, that's an ftp address */
while (isalpha (*ptr) || isdigit (*ptr) || *ptr == '.')
ptr++;
continue;
}
-
+
while ((isalnum(*iter)||strchr(fnchars, *iter)!=NULL||
*iter=='/') && *iter && iter != ptonum && *iter != '.') {
if (isalpha (*iter))
alflag = 1;
-
+
count++; iter++;
}
if (*iter == '\0' || iter == ptonum) {
@@ -305,7 +303,7 @@ UUGetFileName (char *subject, char *ptonum, char *ptonend)
length = 0;
continue;
}
- if (_FP_strnicmp (iter, "edu", 3) == 0 ||
+ if (_FP_strnicmp (iter, "edu", 3) == 0 ||
_FP_strnicmp (iter, "gov", 3) == 0) {
/* hey, that's an ftp address */
while (isalpha (*iter) || isdigit (*iter) || *iter == '.')
@@ -314,21 +312,21 @@ UUGetFileName (char *subject, char *ptonum, char *ptonend)
length = 0;
continue;
}
-
+
length += count + 1;
count = 0;
-
+
while ((isalnum(iter[count])||strchr(fnchars, iter[count])!=NULL||
iter[count]=='/') && iter[count] && iter[count] != '.')
count++;
-
+
if (iter[count]==':' && iter[count+1]=='/') {
/* looks like stuff from a mail server */
ptr = iter + 1;
length = 0;
continue;
}
-
+
if (count > 8 || iter == ptonum) {
ptr = iter;
length = 0;
@@ -339,19 +337,19 @@ UUGetFileName (char *subject, char *ptonum, char *ptonend)
length += count;
break;
}
-
+
while (iter[count] &&
(isalnum(iter[count])||strchr(fnchars, iter[count])!=NULL||
iter[count]=='/'))
count++;
-
+
if (iter[count]==':' && iter[count+1]=='/') {
/* looks like stuff from a mail server */
ptr = iter + 1;
length = 0;
continue;
}
-
+
if (count < 12 && iter != ptonum) {
length += count;
break;
@@ -369,7 +367,7 @@ UUGetFileName (char *subject, char *ptonum, char *ptonend)
ptr++;
while ((isalnum(ptr[length])||strchr(fnchars,ptr[length])!=NULL||
- ptr[length] == '/') &&
+ ptr[length] == '/') &&
ptr[length] && ptr+length!=part && ptr+length!=ptonum)
length++;
@@ -406,10 +404,10 @@ UUGetFileName (char *subject, char *ptonum, char *ptonend)
uustring (S_OUT_OF_MEMORY), length+1);
return NULL;
}
-
+
memcpy (result, ptr, length);
result[length] = '\0';
-
+
return result;
}
@@ -466,7 +464,7 @@ UUGetPartNo (char *subject, char **where, char **whend)
while (isdigit (iter[count]))
count++;
length = count;
-
+
if (iter[count] == '\0' || iter[count+1] == '\0') {
iter += count;
length = 0;
@@ -478,24 +476,24 @@ UUGetPartNo (char *subject, char **where, char **whend)
delim = bdel;
break;
}
-
+
while (iter[count] == ' ' || iter[count] == '#' ||
iter[count] == '/' || iter[count] == '\\') count++;
-
+
if (_FP_strnicmp (iter + count, "of", 2) == 0)
count += 2;
-
+
while (iter[count] == ' ') count++;
while (isdigit (iter[count])) count++;
while (iter[count] == ' ') count++;
-
+
if (iter[count] == brackchr[uu_bracket_policy][bpc+1]) {
*where = iter;
bdel[0] = brackchr[uu_bracket_policy][bpc+1];
delim = bdel;
break;
}
-
+
length = 0;
ptr = iter;
}
@@ -646,7 +644,7 @@ UUGetPartNo (char *subject, char **where, char **whend)
if (length == 0) {
count = strlen(subject) - 1;
ptr = subject;
-
+
while (count > 0) {
if (!isdigit(ptr[count])||isalpha(ptr[count+1])||ptr[count+1] == '.') {
count--;
@@ -657,10 +655,10 @@ UUGetPartNo (char *subject, char **where, char **whend)
while (count >= 0 && isdigit (ptr[count])) {
count--; length++;
}
- if (count>=0 && ((isalpha (ptr[count]) &&
+ if (count>=0 && ((isalpha (ptr[count]) &&
(ptr[count] != 's' || ptr[count+1] != 't') &&
- (ptr[count] != 'n' || ptr[count+1] != 'd')) ||
- ptr[count] == '/' || ptr[count] == '.' ||
+ (ptr[count] != 'n' || ptr[count+1] != 'd')) ||
+ ptr[count] == '/' || ptr[count] == '.' ||
ptr[count] == '-' || ptr[count] == '_')) {
length = 0;
continue;
@@ -791,7 +789,7 @@ UUPreProcessPart (fileread *data, int *ret)
result->mimeid = _FP_strdup (data->mimeid);
result->mimetype = _FP_strdup (data->mimetype);
- if (result->partno == -1 &&
+ if (result->partno == -1 &&
(data->uudet == PT_ENCODED || data->uudet == QP_ENCODED))
result->partno = 1;
@@ -806,7 +804,7 @@ UUPreProcessPart (fileread *data, int *ret)
if (result->subfname == NULL)
result->subfname = _FP_strdup (result->filename);
- if (result->filename == NULL ||
+ if (result->filename == NULL ||
result->subfname == NULL) {
UUMessage (uucheck_id, __LINE__, UUMSG_ERROR,
uustring (S_OUT_OF_MEMORY),
@@ -820,8 +818,8 @@ UUPreProcessPart (fileread *data, int *ret)
result->partno = 1;
}
else if (result->subfname == NULL && data->uudet &&
- (data->begin || result->partno == 1 ||
- (!uu_dumbness && result->partno == -1 &&
+ (data->begin || result->partno == 1 ||
+ (!uu_dumbness && result->partno == -1 &&
(data->subject != NULL || result->filename != NULL)))) {
/*
* If it's the first part of something and has some valid data, but
@@ -914,8 +912,8 @@ UUPreProcessPart (fileread *data, int *ret)
else if (data->partno != -1 && result->filename) {
result->subfname = _FP_strdup (result->filename);
}
- else {
- /*
+ else {
+ /*
* it's got no info, it's got no begin, and we don't know anything
* about this part. Let's forget all about it.
*/
@@ -951,7 +949,7 @@ UUPreProcessPart (fileread *data, int *ret)
if (result->partno == -1 && data->begin) {
/*
- * hmm, this is reason enough to initialize lastvalid, at least
+ * hmm, this is reason enough to initialize lastvalid, at least
* if we have no end
*/
if (!data->end) {
@@ -1087,7 +1085,7 @@ UUInsertPartToList (uufile *data)
* file was really XX
*/
- if (data->data->uudet == B64ENCODED &&
+ if (data->data->uudet == B64ENCODED &&
iter->uudet == XX_ENCODED && iter->begin) {
data->data->uudet = XX_ENCODED;
}
@@ -1179,7 +1177,7 @@ UUInsertPartToList (uufile *data)
* if at the end of the part list, add it
*/
- if (fiter->NEXT == NULL ||
+ if (fiter->NEXT == NULL ||
(data->partno != -1 && data->partno < fiter->NEXT->partno)) {
data->NEXT = fiter->NEXT;
fiter->NEXT = data;
@@ -1192,14 +1190,14 @@ UUInsertPartToList (uufile *data)
last = fiter;
fiter = fiter->NEXT;
}
-
+
return UURET_OK; /* Shouldn't get here */
}
goahead:
/*
* we need iter below
*/
- if (iter->NEXT == NULL)
+ if (iter->NEXT == NULL)
break;
iter = iter->NEXT;
@@ -1306,7 +1304,7 @@ UUCheckGlobalList (void)
continue;
}
else if ((liter->uudet == QP_ENCODED ||
- liter->uudet == PT_ENCODED) &&
+ liter->uudet == PT_ENCODED) &&
(liter->flags & FL_SINGLE)) {
if ((liter->flags&FL_PROPER)==0)
liter->size = -1;
@@ -1378,7 +1376,7 @@ UUCheckGlobalList (void)
if (fiter->data->begin) flag |= 1;
if (fiter->data->end) flag |= 2;
- if (fiter->data->uudet) flag |= 4;
+ if (fiter->data->uudet) flag |= 4;
/*
* guess size of part
@@ -1399,7 +1397,7 @@ UUCheckGlobalList (void)
thesize += fiter->data->length;
break;
}
-
+
fiter = fiter->NEXT;
while (fiter != NULL) {
@@ -1407,7 +1405,7 @@ UUCheckGlobalList (void)
misparts[miscount++] = count;
part = fiter->partno;
-
+
if (havecount<MAXPLIST)
haveparts[havecount++]=part;
@@ -1433,7 +1431,7 @@ UUCheckGlobalList (void)
if (fiter->data->end)
break;
-
+
fiter = fiter->NEXT;
}
@@ -1442,7 +1440,7 @@ UUCheckGlobalList (void)
* encoded, there's a begin line and encoded data, assume it's
* there.
*/
-
+
if (uu_fast_scanning && (flag & 0x01) && (flag & 0x04) &&
(liter->uudet == UU_ENCODED || liter->uudet == XX_ENCODED))
flag |= 2;
@@ -1456,14 +1454,14 @@ UUCheckGlobalList (void)
liter->haveparts = NULL;
liter->misparts = NULL;
-
+
if (havecount) {
if ((liter->haveparts=(int*)malloc((havecount+1)*sizeof(int)))!=NULL) {
memcpy (liter->haveparts, haveparts, havecount*sizeof(int));
liter->haveparts[havecount] = 0;
}
}
-
+
if (miscount) {
if ((liter->misparts=(int*)malloc((miscount+1)*sizeof(int)))!=NULL) {
memcpy (liter->misparts, misparts, miscount*sizeof(int));
@@ -1479,7 +1477,7 @@ UUCheckGlobalList (void)
if ((flag & 4) == 0) liter->state |= UUFILE_NODATA;
if ((flag & 1) == 0) liter->state |= UUFILE_NOBEGIN;
if ((flag & 2) == 0) liter->state |= UUFILE_NOEND;
-
+
if ((flag & 7) == 7 && miscount==0) {
liter->state = UUFILE_OK;
}
@@ -1489,7 +1487,7 @@ UUCheckGlobalList (void)
else
liter->size = thesize;
- if (liter->state==UUFILE_OK &&
+ if (liter->state==UUFILE_OK &&
(liter->filename==NULL || liter->filename[0]=='\0')) {
/*
* Emergency backup if the file does not have a filename
diff --git a/uulib/uuencode.c b/uulib/uuencode.c
index 2768771..e073884 100644
--- a/uulib/uuencode.c
+++ b/uulib/uuencode.c
@@ -32,10 +32,8 @@
#include <time.h>
#include <math.h>
-#ifdef STDC_HEADERS
#include <stdlib.h>
#include <string.h>
-#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
diff --git a/uulib/uuint.h b/uulib/uuint.h
index af187f0..0dbce48 100644
--- a/uulib/uuint.h
+++ b/uulib/uuint.h
@@ -77,7 +77,7 @@
#define UUPERCENT(a,b) ((int) ((unsigned long)(a) / \
(((unsigned long)(b)/100)+1)))
-
+
/*
* Make the Busy Callback easier. The macro returns true if the BusyCallback
* wants us to terminate.
@@ -277,13 +277,8 @@ extern char * (*uu_FNameFilter) _ANSI_ARGS_((void *, char *));
* Be careful about the definition with variable arguments.
*/
-#if defined(STDC_HEADERS) || defined(HAVE_STDARG_H)
-int UUMessage _ANSI_ARGS_((char *, int,
- int, char *, ...));
-#else
-int UUMessage ();
-#endif
-int UUBusyPoll _ANSI_ARGS_((void));
+int UUMessage _ANSI_ARGS_((char *, int, int, char *, ...));
+int UUBusyPoll _ANSI_ARGS_((void));
/*
* Functions from uucheck.c
@@ -306,7 +301,7 @@ fileread * ScanPart _ANSI_ARGS_((FILE *, char *, int *));
int UUbhdecomp _ANSI_ARGS_((char *, char *,
char *, int *,
- size_t, size_t,
+ size_t, size_t,
size_t *));
size_t UUbhwrite _ANSI_ARGS_((char *, size_t, size_t,
FILE *));
diff --git a/uulib/uulib.c b/uulib/uulib.c
index 1286f43..a62a89b 100644
--- a/uulib/uulib.c
+++ b/uulib/uulib.c
@@ -38,34 +38,18 @@
#include <fcntl.h>
#endif
-#ifdef STDC_HEADERS
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
-#else
-#ifdef HAVE_STDARG_H
-#include <stdarg.h>
-#else
-#ifdef HAVE_VARARGS_H
-#include <varargs.h>
-#endif
-#endif
-#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef TIME_WITH_SYS_TIME
+#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
-# include <time.h>
-#else
-# ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
#endif
+#include <time.h>
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -257,31 +241,13 @@ static allomap toallocate[] = {
* Handle the printing of messages. Works like printf.
*/
-#if defined(STDC_HEADERS) || defined(HAVE_STDARG_H)
int
UUMessage (char *file, int line, int level, char *format, ...)
-#else
-int
-UUMessage (va_alist)
- va_dcl
-#endif
{
char *msgptr;
-#if defined(STDC_HEADERS) || defined(HAVE_STDARG_H)
va_list ap;
va_start (ap, format);
-#else
- char *file, *format;
- int line, level;
- va_list ap;
-
- va_start (ap);
- file = va_arg (ap, char *);
- line = va_arg (ap, int);
- level = va_arg (ap, int);
- format = va_arg (ap, char *);
-#endif
if (uu_debug) {
sprintf (uulib_msgstring, "%s(%d): %s", file, line, msgnames[level]);
diff --git a/uulib/uunconc.c b/uulib/uunconc.c
index 1d3f42d..d30f3e2 100644
--- a/uulib/uunconc.c
+++ b/uulib/uunconc.c
@@ -40,10 +40,9 @@
#include <stdio.h>
#include <ctype.h>
-#ifdef STDC_HEADERS
#include <stdlib.h>
#include <string.h>
-#endif
+
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
diff --git a/uulib/uuscan.c b/uulib/uuscan.c
index 0b1b3ce..d92acdd 100644
--- a/uulib/uuscan.c
+++ b/uulib/uuscan.c
@@ -35,10 +35,8 @@
#include <stdio.h>
#include <ctype.h>
-#ifdef STDC_HEADERS
#include <stdlib.h>
#include <string.h>
-#endif
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
diff --git a/uulib/uustring.c b/uulib/uustring.c
index bb251bb..4b1923e 100644
--- a/uulib/uustring.c
+++ b/uulib/uustring.c
@@ -32,10 +32,8 @@
#include <stdio.h>
#include <ctype.h>
-#ifdef STDC_HEADERS
#include <stdlib.h>
#include <string.h>
-#endif
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
@@ -102,7 +100,7 @@ static stringmap messages[] = {
{ S_BINHEX_SIZES, "BinHex file: data/resource fork sizes %ld/%ld" },
{ S_BINHEX_BOTH, "BinHex file: both forks non-empty, decoding data fork" },
{ S_SMERGE_MERGED, "Parts of '%s' merged with parts of '%s' (%d)" },
-
+
/* MIME-related messages */
{ S_MIME_NO_BOUNDARY, "Multipart message without boundary ignored" },
{ S_MIME_B_NOT_FOUND, "Boundary expected on Multipart message but found EOF" },
diff --git a/uulib/uuutil.c b/uulib/uuutil.c
index f1779b2..aa2de68 100644
--- a/uulib/uuutil.c
+++ b/uulib/uuutil.c
@@ -32,10 +32,8 @@
#include <stdio.h>
#include <ctype.h>
-#ifdef STDC_HEADERS
#include <stdlib.h>
#include <string.h>
-#endif
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
@@ -215,7 +213,7 @@ UUSMPKnownExt (char *filename)
*/
int
-UUbhdecomp (char *in, char *out, char *last, int *rpc,
+UUbhdecomp (char *in, char *out, char *last, int *rpc,
size_t inc, size_t max, size_t *opc)
{
size_t count, used=0, dummy;
@@ -446,7 +444,7 @@ UUSmerge (int pass)
uustring (S_SMERGE_MERGED),
(iter->subfname) ? iter->subfname : "",
(res->subfname) ? res->subfname : "", pass);
-
+
temp = iter->NEXT;
iter->NEXT = NULL;
UUkilllist (iter);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]