From 6febecc569f42817b7b86a167a38e682317a6c2c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 25 Mar 1999 03:49:34 +0000 Subject: Clean up att_align calculations so that XXXALIGN macros need not be bogus. --- src/backend/bootstrap/bootstrap.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'src/backend/bootstrap/bootstrap.c') diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c index eacb0129f6b..c4cb0df1c56 100644 --- a/src/backend/bootstrap/bootstrap.c +++ b/src/backend/bootstrap/bootstrap.c @@ -7,7 +7,7 @@ * Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.56 1999/03/17 22:52:45 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.57 1999/03/25 03:49:25 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -605,8 +605,28 @@ DefineAttr(char *name, char *type, int attnum) printf("<%s %s> ", attrtypes[attnum]->attname.data, type); attrtypes[attnum]->attnum = 1 + attnum; /* fillatt */ attlen = attrtypes[attnum]->attlen = Procid[typeoid].len; - attrtypes[attnum]->attbyval = (attlen == 1) || (attlen == 2) || (attlen == 4); - attrtypes[attnum]->attalign = 'i'; + /* Cheat like mad to fill in these items from the length only. + * This only has to work for types used in the system catalogs... + */ + switch (attlen) + { + case 1: + attrtypes[attnum]->attbyval = true; + attrtypes[attnum]->attalign = 'c'; + break; + case 2: + attrtypes[attnum]->attbyval = true; + attrtypes[attnum]->attalign = 's'; + break; + case 4: + attrtypes[attnum]->attbyval = true; + attrtypes[attnum]->attalign = 'i'; + break; + default: + attrtypes[attnum]->attbyval = false; + attrtypes[attnum]->attalign = 'i'; + break; + } } attrtypes[attnum]->attcacheoff = -1; attrtypes[attnum]->atttypmod = -1; -- cgit v1.2.3