]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix a bunch of warnings on Linux.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 9 Sep 2011 16:30:36 +0000 (16:30 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 9 Sep 2011 16:30:36 +0000 (16:30 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@9978 7a7537e8-13f0-0310-91df-b6672ffda945

config-scripts/cups-common.m4
cups/Makefile
cups/http.c
cups/testcups.c
cups/testhttp.c
filter/Makefile
ppdc/ppdc-source.cxx
scheduler/cups-driverd.cxx
systemv/Makefile
test/ipptool.c

index 78e4d82d30d28352815c441192331342c0f67922..d453e6caa214375bc8545387cdbd24b674aa2746 100644 (file)
@@ -92,6 +92,7 @@ dnl Check for pkg-config, which is used for some other tests later on...
 AC_PATH_PROG(PKGCONFIG, pkg-config)
 
 dnl Check for libraries...
+AC_SEARCH_LIBS(fmod, m)
 AC_SEARCH_LIBS(crypt, crypt)
 AC_SEARCH_LIBS(getspent, sec gen)
 
index 8e53cb15ed489484ddd1a8f40926b0cae86c6bae..ac1e04a2c27a4f5f8f6cfa1415678092ec945192 100644 (file)
@@ -377,7 +377,7 @@ libcups_s.a:        $(LIBOBJS) libcups_s.exp
        echo Creating $@...
        $(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o \
                $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
-               $(COMMONLIBS) $(LIBZ) -lm
+               $(COMMONLIBS) $(LIBZ)
        $(RM) $@
        $(AR) $(ARFLAGS) $@ libcups_s.o
 
index 7d801fe0574a93796f48beaf5955ac30e2700b7c..c081fadc3d4e3e8f47e1dda4ad3f9bb3c31ff3ad 100644 (file)
 
 #include "cups-private.h"
 #include <fcntl.h>
+#include <math.h>
 #ifdef WIN32
 #  include <tchar.h>
 #else
@@ -3907,6 +3908,8 @@ http_setup_ssl(http_t *http)              /* I - Connection to server */
   }
 
 #  elif defined(HAVE_GNUTLS)
+  (void)any_root;
+
   credentials = (gnutls_certificate_client_credentials *)
                     malloc(sizeof(gnutls_certificate_client_credentials));
   if (credentials == NULL)
@@ -4227,7 +4230,7 @@ http_setup_ssl(http_t *http)              /* I - Connection to server */
     return (-1);
   }
 
-  _sspiSetAllowsAnyRoot(http->tls_credentials, TRUE);
+  _sspiSetAllowsAnyRoot(http->tls_credentials, any_root);
   _sspiSetAllowsExpiredCerts(http->tls_credentials, TRUE);
 
   if (!_sspiConnect(http->tls_credentials, http->hostname))
index 74241666ab2bd6e1791e9286b82af2fcfcd2f298..e7dc9ea6d6f61b9e175212b3fb08a8cc1a76bafa 100644 (file)
@@ -117,7 +117,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
     cupsFileClose(fp);
 
-    if (cupsFinishDocument(CUPS_HTTP_DEFAULT, argv[1]) != HTTP_OK)
+    if (cupsFinishDocument(CUPS_HTTP_DEFAULT, argv[1]) > IPP_OK_SUBST)
     {
       puts("Unable to finish document!");
       return (1);
index bc80dd639b23dd1a8deb60c52b6bdb33d61143e3..fdc2224cf607c77dfc1501d5d9287c1567dea02e 100644 (file)
@@ -167,7 +167,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
 {
   int          i, j, k;                /* Looping vars */
   http_t       *http;                  /* HTTP connection */
-  http_encryption_t encrypt;           /* Encryption type */
+  http_encryption_t encryption;                /* Encryption type */
   http_status_t        status;                 /* Status of GET command */
   int          failures;               /* Number of test failures */
   char         buffer[8192];           /* Input buffer */
@@ -544,11 +544,11 @@ main(int  argc,                           /* I - Number of command-line arguments */
 
     if (!strcasecmp(scheme, "https") || !strcasecmp(scheme, "ipps") ||
         port == 443)
-      encrypt = HTTP_ENCRYPT_ALWAYS;
+      encryption = HTTP_ENCRYPT_ALWAYS;
     else
-      encrypt = HTTP_ENCRYPT_IF_REQUESTED;
+      encryption = HTTP_ENCRYPT_IF_REQUESTED;
 
-    http = httpConnectEncrypt(hostname, port, encrypt);
+    http = httpConnectEncrypt(hostname, port, encryption);
     if (http == NULL)
     {
       perror(hostname);
index ef1fda22bf3ef608f93861408c4e0e879123c592..1c883f2f6cbdd27fa42d24c2de6aba9101de431c 100644 (file)
@@ -298,7 +298,7 @@ gziptoany:  gziptoany.o ../Makedefs ../cups/$(LIBCUPS)
 libcupsimage.so.2 libcupsimage.sl.2:   $(IMAGEOBJS)
        echo Linking $@...
        $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) \
-               -L../cups $(LINKCUPS) -lm
+               -L../cups $(LINKCUPS)
        $(RM) `basename $@ .2`
        $(LN) $@ `basename $@ .2`
 
@@ -311,7 +311,7 @@ libcupsimage.so.2 libcupsimage.sl.2:        $(IMAGEOBJS)
        echo Linking 32-bit $@...
        -mkdir 32bit
        $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(IMAGE32OBJS) $(DSOLIBS) \
-               -L../cups/32bit $(LINKCUPS) -lm
+               -L../cups/32bit $(LINKCUPS)
 
 
 #
@@ -322,7 +322,7 @@ libcupsimage.so.2 libcupsimage.sl.2:        $(IMAGEOBJS)
        echo Linking 64-bit $@...
        -mkdir 64bit
        $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(IMAGE64OBJS) $(DSOLIBS) \
-               -L../cups/64bit $(LINKCUPS) -lm
+               -L../cups/64bit $(LINKCUPS)
 
 
 #
@@ -335,7 +335,7 @@ libcupsimage.2.dylib:       $(IMAGEOBJS) $(LIBCUPSIMAGEORDER)
                -install_name $(libdir)/$@ \
                -current_version 2.3.0 \
                -compatibility_version 2.0.0 \
-               $(IMAGEOBJS) $(DSOLIBS) -L../cups $(LINKCUPS) -lm
+               $(IMAGEOBJS) $(DSOLIBS) -L../cups $(LINKCUPS)
        $(RM) libcupsimage.dylib
        $(LN) $@ libcupsimage.dylib
 
@@ -347,7 +347,7 @@ libcupsimage.2.dylib:       $(IMAGEOBJS) $(LIBCUPSIMAGEORDER)
 libcupsimage_s.a:      $(IMAGEOBJS) libcupsimage_s.exp
        echo Linking $@...
        $(DSO) $(DSOFLAGS) -Wl,-berok,-bexport:libcupsimage_s.exp \
-               -o libcupsimage_s.o $(IMAGEOBJS) $(DSOLIBS) -lm
+               -o libcupsimage_s.o $(IMAGEOBJS) $(DSOLIBS)
        $(RM) $@
        $(AR) $(ARFLAGS) $@ libcupsimage_s.o
 
@@ -380,7 +380,7 @@ libcupsimage.a:     $(IMAGEOBJS)
 
 pstops:        pstops.o common.o ../cups/$(LIBCUPS)
        echo Linking $@...
-       $(CC) $(LDFLAGS) -o $@ pstops.o common.o $(LIBS) -lm
+       $(CC) $(LDFLAGS) -o $@ pstops.o common.o $(LIBS)
 
 
 #
index 2e4934a6330208ddafd8751be93fa32d3ecdf5b5..369dd55c659886c902bb82741c85869b286a32c9 100644 (file)
@@ -2309,7 +2309,15 @@ ppdcSource::quotef(cups_file_t *fp,      // I - File to write to
            strncpy(tformat, bufformat, format - bufformat);
            tformat[format - bufformat] = '\0';
 
-           bytes += cupsFilePrintf(fp, tformat, va_arg(ap, int));
+#  ifdef HAVE_LONG_LONG
+            if (size == 'L')
+             bytes += cupsFilePrintf(fp, tformat, va_arg(ap, long long));
+           else
+#  endif /* HAVE_LONG_LONG */
+            if (size == 'l')
+             bytes += cupsFilePrintf(fp, tformat, va_arg(ap, long));
+           else
+             bytes += cupsFilePrintf(fp, tformat, va_arg(ap, int));
            break;
 
        case 'p' : // Pointer value
index c8865dbde8aed2f62b57a54c9a393514fb1005b1..714871c85e15ecffa92171e194c79176f0253ecb 100644 (file)
@@ -1196,6 +1196,12 @@ list_ppds(int        request_id, /* I - Request ID */
            ppd->matches += 3;
            break;
          }
+         else if (!_cups_strncasecmp(ppd->record.products[i], product,
+                                     product_len))
+         {
+           ppd->matches += 2;
+           break;
+         }
       }
 
       if (psversion)
index c3997c8feea7fb4204d4586481f7b58e48e04fd9..06414a02df0f18befeee803c2d3a2f9aba7ea80a 100644 (file)
@@ -210,7 +210,7 @@ cupstestdsc:        cupstestdsc.o ../cups/$(LIBCUPS)
 
 cupstestppd:   cupstestppd.o ../cups/$(LIBCUPS) ../filter/$(LIBCUPSIMAGE)
        echo Linking $@...
-       $(CC) $(LDFLAGS) -o $@ cupstestppd.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS) -lm
+       $(CC) $(LDFLAGS) -o $@ cupstestppd.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
 
 cupstestppd-static:    cupstestppd.o ../cups/$(LIBCUPSSTATIC) ../filter/libcupsimage.a
        echo Linking $@...
index 0086a42f5605b99d67e51892a451e303d3ba8494..70b91e2cc1b3d0d570bf6bf9ed4bec9879a9b0e9 100644 (file)
@@ -53,7 +53,9 @@
 #include <cups/file-private.h>
 #include <regex.h>
 #include <sys/stat.h>
-
+#ifndef WIN32
+#  include <signal.h>
+#endif /* WIN32 */
 #ifndef O_BINARY
 #  define O_BINARY 0
 #endif /* !O_BINARY */
@@ -189,7 +191,9 @@ static void print_xml_string(const char *element, const char *s);
 static void    print_xml_trailer(int success, const char *message);
 static void    set_variable(_cups_vars_t *vars, const char *name,
                             const char *value);
+#ifndef WIN32
 static void    sigterm_handler(int sig);
+#endif /* WIN32 */
 static int     timeout_cb(http_t *http, void *user_data);
 static void    usage(void) __attribute__((noreturn));
 static int     validate_attr(ipp_attribute_t *attr, int print);
@@ -222,12 +226,14 @@ main(int  argc,                           /* I - Number of command-line args */
                                        /* Global data */
 
 
+#ifndef WIN32
  /*
   * Catch SIGINT and SIGTERM...
   */
 
   signal(SIGINT, sigterm_handler);
   signal(SIGTERM, sigterm_handler);
+#endif /* !WIN32 */
 
  /*
   * Initialize the locale and variables...
@@ -4012,6 +4018,7 @@ set_variable(_cups_vars_t *vars,  /* I - Variables */
 }
 
 
+#ifndef WIN32
 /*
  * 'sigterm_handler()' - Handle SIGINT and SIGTERM.
  */
@@ -4023,6 +4030,7 @@ sigterm_handler(int sig)          /* I - Signal number (unused) */
 
   Cancel = 1;
 }
+#endif /* !WIN32 */
 
 
 /*