OK, I have applied the following patch to fix these warnings. However,
I need Mario to confirm these are the right changes. Thanks.
---------------------------------------------------------------------------
Peter Eisentraut wrote:
> This patch does not compile correctly:
>
> pg_backup_archiver.c: In function `ahwrite':
> pg_backup_archiver.c:1252: warning: pointer of type `void *' used in arithmetic
> pg_backup_archiver.c:1259: warning: pointer of type `void *' used in arithmetic
> pg_backup_archiver.c:1263: warning: pointer of type `void *' used in arithmetic
> make: *** [pg_backup_archiver.o] Error 1
>
>
> Bruce Momjian writes:
>
> >
> > Patch applied. Thanks.
> >
> > ---------------------------------------------------------------------------
> >
> >
> > Mario Weilguni wrote:
> > > Am Donnerstag, 11. April 2002 17:44 schrieb Tom Lane:
> > > > "Mario Weilguni" <[EMAIL PROTECTED]> writes:
> > > > > And I did not find out how I can detect the large object
> > > > > chunksize, either from getting it from the headers (include
> > > > > "storage/large_object.h" did not work)
> > > >
> > >
> > > You did not answer if it's ok to post the patch, hope it's ok:
> >
> >
>
> --
> Peter Eisentraut [EMAIL PROTECTED]
>
>
--
Bruce Momjian | http://candle.pha.pa.us
[EMAIL PROTECTED] | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
Index: src/bin/pg_dump/pg_backup_archiver.c
===================================================================
RCS file: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v
retrieving revision 1.43
diff -c -r1.43 pg_backup_archiver.c
*** src/bin/pg_dump/pg_backup_archiver.c 24 Apr 2002 02:21:04 -0000 1.43
--- src/bin/pg_dump/pg_backup_archiver.c 24 Apr 2002 14:01:15 -0000
***************
*** 1249,1266 ****
int remaining = AH->lo_buf_size - AH->lo_buf_used;
int slack = nmemb * size - remaining;
! memcpy(AH->lo_buf + AH->lo_buf_used, ptr, remaining);
res = lo_write(AH->connection, AH->loFd, AH->lo_buf,
AH->lo_buf_size);
ahlog(AH, 5, "wrote %d bytes of large object data (result = %d)\n",
AH->lo_buf_size, res);
if (res != AH->lo_buf_size)
die_horribly(AH, modulename, "could not write to large object
(result: %d, expected: %d)\n",
res, AH->lo_buf_size);
! memcpy(AH->lo_buf, ptr + remaining, slack);
AH->lo_buf_used = slack;
} else {
/* LO Buffer is still large enough, buffer it */
! memcpy(AH->lo_buf + AH->lo_buf_used, ptr, size * nmemb);
AH->lo_buf_used += size * nmemb;
}
--- 1249,1266 ----
int remaining = AH->lo_buf_size - AH->lo_buf_used;
int slack = nmemb * size - remaining;
! memcpy((char *)AH->lo_buf + AH->lo_buf_used, ptr, remaining);
res = lo_write(AH->connection, AH->loFd, AH->lo_buf,
AH->lo_buf_size);
ahlog(AH, 5, "wrote %d bytes of large object data (result = %d)\n",
AH->lo_buf_size, res);
if (res != AH->lo_buf_size)
die_horribly(AH, modulename, "could not write to large object
(result: %d, expected: %d)\n",
res, AH->lo_buf_size);
! memcpy(AH->lo_buf, (char *)ptr + remaining, slack);
AH->lo_buf_used = slack;
} else {
/* LO Buffer is still large enough, buffer it */
! memcpy((char *)AH->lo_buf + AH->lo_buf_used, ptr, size * nmemb);
AH->lo_buf_used += size * nmemb;
}
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html