Skip to content

Commit 21ce1f1

Browse files
jscott0tillkamppeter
authored andcommitted
Use standard Autoconf macro to detect 'long long' availability and remove now-unused CUPS_LL{CAST, FMT} macros
Using Autoconf's shipped macros is good practice and aids static analysis; quick web searching suggests AC_TYPE_LONG_LONG_INT has been part of Autoconf proper for a very long time. This Autoconf macro refers to the type as 'long long int', and this isn't objectionable, so change our couple of sources to do the same to match. 'long long' has been mandatory standard since C99 (and hence POSIX.1-2001). In all likelihood this cruft can be dropped altogether, but I'll leave that for another day.
1 parent 0b266ea commit 21ce1f1

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

configure.ac

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@ AC_LANG([C++])
2323
AC_CONFIG_HEADERS([config.h])
2424
# Extra defines for the config.h
2525
AH_BOTTOM([
26-
#ifdef HAVE_LONG_LONG
27-
# define CUPS_LLFMT "%lld"
28-
# define CUPS_LLCAST (long long)
29-
#else
30-
# define CUPS_LLFMT "%ld"
31-
# define CUPS_LLCAST (long)
32-
#endif /* HAVE_LONG_LONG */
33-
3426
#ifdef HAVE_ARC4RANDOM
3527
# define CUPS_RAND() arc4random()
3628
# define CUPS_SRAND(v) arc4random_stir()
@@ -242,10 +234,7 @@ AS_IF([test x"$enable_largefile" != "xno"], [
242234
])
243235
AC_SUBST(LARGEFILE)
244236

245-
AC_CHECK_TYPE(long long, [long_long_found=yes], [long_long_found=no])
246-
AS_IF([test x"$long_long_found" = "xyes"], [
247-
AC_DEFINE([HAVE_LONG_LONG], [], [Platform supports long long type])
248-
])
237+
AC_TYPE_LONG_LONG_INT
249238

250239
# =====================================================
251240
# Check for Ghostscript and PDF-to-PostScript converter

ppd/debug.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,11 +481,11 @@ _ppd_safe_vsnprintf(
481481
if ((size_t)(width + 2) > sizeof(temp))
482482
break;
483483

484-
# ifdef HAVE_LONG_LONG
484+
# ifdef HAVE_LONG_LONG_INT
485485
if (size == 'L')
486486
snprintf(temp, sizeof(temp), tformat, va_arg(ap, long long));
487487
else
488-
# endif // HAVE_LONG_LONG
488+
# endif // HAVE_LONG_LONG_INT
489489
if (size == 'l')
490490
snprintf(temp, sizeof(temp), tformat, va_arg(ap, long));
491491
else

ppd/ppdc-source.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,11 +2279,11 @@ ppdcSource::quotef(cups_file_t *fp, // I - File to write to
22792279
memcpy(tformat, bufformat, (size_t)(format - bufformat));
22802280
tformat[format - bufformat] = '\0';
22812281

2282-
# ifdef HAVE_LONG_LONG
2282+
# ifdef HAVE_LONG_LONG_INT
22832283
if (size == 'L')
22842284
bytes += cupsFilePrintf(fp, tformat, va_arg(ap, long long));
22852285
else
2286-
# endif // HAVE_LONG_LONG
2286+
# endif // HAVE_LONG_LONG_INT
22872287
if (size == 'l')
22882288
bytes += cupsFilePrintf(fp, tformat, va_arg(ap, long));
22892289
else

0 commit comments

Comments
 (0)