Add casts to suppress compiler warnings observed on Darwin platform
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 8 Nov 2001 04:05:13 +0000 (04:05 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 8 Nov 2001 04:05:13 +0000 (04:05 +0000)
(surprised no one has reported these yet...)

src/backend/storage/page/bufpage.c
src/backend/utils/adt/varchar.c
src/bin/pg_dump/pg_backup_archiver.c
src/interfaces/libpq/fe-misc.c

index ada46e681722660e8b1eadeb5770cc0bd6772198..916071aa098eb463551cd47454633ae9050b7ec0 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/storage/page/bufpage.c,v 1.40 2001/10/28 06:25:51 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/storage/page/bufpage.c,v 1.41 2001/11/08 04:05:13 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -349,7 +349,7 @@ PageRepairFragmentation(Page page, OffsetNumber *unused)
 
        if (totallen > (Size) (pd_special - pd_lower))
            elog(ERROR, "PageRepairFragmentation: corrupted item lengths, total %u, avail %u",
-                totallen, pd_special - pd_lower);
+                (unsigned int) totallen, pd_special - pd_lower);
 
        /* sort itemIdSortData array into decreasing itemoff order */
        qsort((char *) itemidbase, nused, sizeof(struct itemIdSortData),
index a09bed915ff3c587973226ed5eeaeec0d8e3fd54..b7230b5bbd92421bf8daf0d88b6874187aa054e0 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.85 2001/10/25 05:49:46 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.86 2001/11/08 04:05:13 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -117,7 +117,8 @@ bpcharin(PG_FUNCTION_ARGS)
        if (strspn(s + mbmaxlen, " ") == len - mbmaxlen)
            len = mbmaxlen;
        else
-           elog(ERROR, "value too long for type character(%d)", maxlen);
+           elog(ERROR, "value too long for type character(%d)",
+                (int) maxlen);
 
        /*
         * XXX: at this point, maxlen is the necessary byte length, not
@@ -128,7 +129,8 @@ bpcharin(PG_FUNCTION_ARGS)
        if (strspn(s + maxlen, " ") == len - maxlen)
            len = maxlen;
        else
-           elog(ERROR, "value too long for type character(%d)", maxlen);
+           elog(ERROR, "value too long for type character(%d)",
+                (int) maxlen);
 #endif
    }
 #ifdef MULTIBYTE
@@ -443,7 +445,8 @@ varcharin(PG_FUNCTION_ARGS)
            len = maxlen;
 #endif
        else
-           elog(ERROR, "value too long for type character varying(%d)", maxlen);
+           elog(ERROR, "value too long for type character varying(%d)",
+                (int) maxlen);
    }
 
    result = palloc(len + VARHDRSZ);
index 939556a57204ce2897e66f780e7396e9aaa1b1d2..4c99d51bfedd7f23e0321517c7e5335208e7b5b3 100644 (file)
@@ -15,7 +15,7 @@
  *
  *
  * IDENTIFICATION
- *     $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.37 2001/11/05 17:46:30 momjian Exp $
+ *     $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.38 2001/11/08 04:05:12 tgl Exp $
  *
  * Modifications - 28-Jun-2000 - pjw@rhyme.com.au
  *
@@ -1226,10 +1226,11 @@ ahwrite(const void *ptr, size_t size, size_t nmemb, ArchiveHandle *AH)
    if (AH->writingBlob)
    {
        res = lo_write(AH->connection, AH->loFd, (void *) ptr, size * nmemb);
-       ahlog(AH, 5, "wrote %d bytes of large object data (result = %d)\n", size * nmemb, res);
-       if (res < size * nmemb)
+       ahlog(AH, 5, "wrote %d bytes of large object data (result = %d)\n",
+             (int) (size * nmemb), res);
+       if (res != size * nmemb)
            die_horribly(AH, modulename, "could not write to large object (result: %d, expected: %d)\n",
-                        res, size * nmemb);
+                        res, (int) (size * nmemb));
 
        return res;
    }
@@ -1260,7 +1261,8 @@ ahwrite(const void *ptr, size_t size, size_t nmemb, ArchiveHandle *AH)
        {
            res = fwrite((void *) ptr, size, nmemb, AH->OF);
            if (res != nmemb)
-               die_horribly(AH, modulename, "could not write to output file (%d != %d)\n", res, nmemb);
+               die_horribly(AH, modulename, "could not write to output file (%d != %d)\n",
+                            res, (int) nmemb);
            return res;
        }
    }
index 66c142ce172a110426c2dcb69a28742d0534083c..30d1dbced8492ac46c21e19886ca36b9c2151165 100644 (file)
@@ -25,7 +25,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.60 2001/11/05 17:46:37 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.61 2001/11/08 04:05:13 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -128,7 +128,8 @@ pqPutBytes(const char *s, size_t nbytes, PGconn *conn)
        {
            printfPQExpBuffer(&conn->errorMessage,
                              libpq_gettext("could not flush enough data (space available: %d, space needed %d)\n"),
-                     Max(conn->outBufSize - conn->outCount, 0), nbytes);
+                             (int) Max(conn->outBufSize - conn->outCount, 0),
+                             (int) nbytes);
            return EOF;
        }
        /* fixup avail for while loop */