1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-27 00:12:01 +03:00

Fix a bunch of minor portability problems and maybe-bugs revealed by

running gcc and HP's cc with warnings cranked way up.  Signed vs unsigned
comparisons, routines declared static and then defined not-static,
that kind of thing.  Tedious, but perhaps useful...
This commit is contained in:
Tom Lane
2000-03-17 02:36:41 +00:00
parent bc1f117094
commit 341b328b18
37 changed files with 118 additions and 116 deletions

View File

@@ -256,7 +256,7 @@ void DeleteComments(Oid oid) {
*------------------------------------------------------------------
*/
void CommentRelation(int reltype, char *relname, char *comment) {
static void CommentRelation(int reltype, char *relname, char *comment) {
HeapTuple reltuple;
Oid oid;
@@ -325,7 +325,7 @@ void CommentRelation(int reltype, char *relname, char *comment) {
*------------------------------------------------------------------
*/
void CommentAttribute(char *relname, char *attrname, char *comment) {
static void CommentAttribute(char *relname, char *attrname, char *comment) {
Relation relation;
HeapTuple attrtuple;
@@ -371,7 +371,7 @@ void CommentAttribute(char *relname, char *attrname, char *comment) {
*------------------------------------------------------------------
*/
void CommentDatabase(char *database, char *comment) {
static void CommentDatabase(char *database, char *comment) {
Relation pg_database;
HeapTuple dbtuple, usertuple;
@@ -439,7 +439,7 @@ void CommentDatabase(char *database, char *comment) {
*------------------------------------------------------------------
*/
void CommentRewrite(char *rule, char *comment) {
static void CommentRewrite(char *rule, char *comment) {
HeapTuple rewritetuple;
Oid oid;
@@ -485,7 +485,7 @@ void CommentRewrite(char *rule, char *comment) {
*------------------------------------------------------------------
*/
void CommentType(char *type, char *comment) {
static void CommentType(char *type, char *comment) {
HeapTuple typetuple;
Oid oid;
@@ -527,7 +527,7 @@ void CommentType(char *type, char *comment) {
*------------------------------------------------------------------
*/
void CommentAggregate(char *aggregate, char *argument, char *comment) {
static void CommentAggregate(char *aggregate, char *argument, char *comment) {
HeapTuple aggtuple;
Oid baseoid, oid;
@@ -592,7 +592,7 @@ void CommentAggregate(char *aggregate, char *argument, char *comment) {
*------------------------------------------------------------------
*/
void CommentProc(char *function, List *arguments, char *comment)
static void CommentProc(char *function, List *arguments, char *comment)
{
HeapTuple argtuple, functuple;
Oid oid, argoids[FUNC_MAX_ARGS];
@@ -663,7 +663,7 @@ void CommentProc(char *function, List *arguments, char *comment)
*------------------------------------------------------------------
*/
void CommentOperator(char *opername, List *arguments, char *comment) {
static void CommentOperator(char *opername, List *arguments, char *comment) {
Form_pg_operator data;
HeapTuple optuple;
@@ -752,7 +752,7 @@ void CommentOperator(char *opername, List *arguments, char *comment) {
*------------------------------------------------------------------
*/
void CommentTrigger(char *trigger, char *relname, char *comment) {
static void CommentTrigger(char *trigger, char *relname, char *comment) {
Form_pg_trigger data;
Relation pg_trigger, relation;

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.143 2000/03/09 05:00:23 inoue Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.144 2000/03/17 02:36:06 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -671,7 +671,7 @@ static void
vc_scanheap(VRelStats *vacrelstats, Relation onerel,
VPageList vacuum_pages, VPageList fraged_pages)
{
int nblocks,
BlockNumber nblocks,
blkno;
ItemId itemid;
Buffer buf;
@@ -1194,8 +1194,8 @@ vc_repair_frag(VRelStats *vacrelstats, Relation onerel,
last_vacuum_block = -1;
}
if (num_fraged_pages > 0 &&
blkno ==
fraged_pages->vpl_pagedesc[num_fraged_pages - 1]->vpd_blkno)
fraged_pages->vpl_pagedesc[num_fraged_pages - 1]->vpd_blkno ==
(BlockNumber) blkno)
{
/* page is in fraged_pages too; remove it */
--num_fraged_pages;
@@ -1820,7 +1820,7 @@ failed to add item with len = %u to page %u (free space %u, nusd %u, noff %u)",
checked_moved = 0;
for (i = 0, vpp = vacuum_pages->vpl_pagedesc; i < vacuumed_pages; i++, vpp++)
{
Assert((*vpp)->vpd_blkno < blkno);
Assert((*vpp)->vpd_blkno < (BlockNumber) blkno);
buf = ReadBuffer(onerel, (*vpp)->vpd_blkno);
page = BufferGetPage(buf);
if ((*vpp)->vpd_offsets_used == 0) /* this page was not used */
@@ -1894,7 +1894,8 @@ failed to add item with len = %u to page %u (free space %u, nusd %u, noff %u)",
}
/* clean moved tuples from last page in Nvpl list */
if (vpc->vpd_blkno == blkno - 1 && vpc->vpd_offsets_free > 0)
if (vpc->vpd_blkno == (BlockNumber) (blkno - 1) &&
vpc->vpd_offsets_free > 0)
{
buf = ReadBuffer(onerel, vpc->vpd_blkno);
page = BufferGetPage(buf);