1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Massive commit to run PGINDENT on all *.c and *.h files.

This commit is contained in:
Bruce Momjian
1997-09-07 05:04:48 +00:00
parent 8fecd4febf
commit 1ccd423235
687 changed files with 150775 additions and 136888 deletions

View File

@ -1,17 +1,17 @@
/*-------------------------------------------------------------------------
*
* dynloader.c--
* dynamic loader for HP-UX using the shared library mechanism
* dynamic loader for HP-UX using the shared library mechanism
*
* Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/port/hpux/Attic/dynloader.c,v 1.1.1.1 1996/07/09 06:21:43 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/port/hpux/Attic/dynloader.c,v 1.2 1997/09/07 04:45:44 momjian Exp $
*
* NOTES
* all functions are defined here -- it's impossible to trace the
* shl_* routines from the bundled HP-UX debugger.
* NOTES
* all functions are defined here -- it's impossible to trace the
* shl_* routines from the bundled HP-UX debugger.
*
*-------------------------------------------------------------------------
*/
@ -24,34 +24,36 @@
#include "utils/dynamic_loader.h"
#include "port-protos.h"
void *
void *
pg_dlopen(char *filename)
{
shl_t handle = shl_load(filename, BIND_DEFERRED, 0);
shl_t handle = shl_load(filename, BIND_DEFERRED, 0);
return((void *) handle);
return ((void *) handle);
}
func_ptr
pg_dlsym(void *handle, char *funcname)
{
func_ptr f;
func_ptr f;
if (shl_findsym((shl_t *) &handle, funcname, TYPE_PROCEDURE, &f) == -1) {
f = (func_ptr) NULL;
}
return(f);
if (shl_findsym((shl_t *) & handle, funcname, TYPE_PROCEDURE, &f) == -1)
{
f = (func_ptr) NULL;
}
return (f);
}
void
pg_dlclose(void *handle)
{
shl_unload((shl_t) handle);
shl_unload((shl_t) handle);
}
char *
char *
pg_dlerror()
{
static char errmsg[]= "shl_load failed";
return errmsg;
static char errmsg[] = "shl_load failed";
return errmsg;
}

View File

@ -1,63 +1,66 @@
/*-------------------------------------------------------------------------
*
* fixade.h--
* compiler tricks to make things work while POSTGRES does non-native
* dereferences on PA-RISC.
* compiler tricks to make things work while POSTGRES does non-native
* dereferences on PA-RISC.
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: fixade.h,v 1.1.1.1 1996/07/09 06:21:43 scrappy Exp $
* $Id: fixade.h,v 1.2 1997/09/07 04:45:48 momjian Exp $
*
* NOTES
* This must be included in EVERY source file.
* NOTES
* This must be included in EVERY source file.
*
*-------------------------------------------------------------------------
*/
#ifndef FIXADE_H
#ifndef FIXADE_H
#define FIXADE_H
#if !defined(NOFIXADE)
#if defined(HP_S500_ALIGN)
/* ----------------
* This cheesy hack turns ON unaligned-access fixup on H-P PA-RISC;
* the resulting object files contain code that explicitly handles
* realignment on reference, so it slows memory access down by a
* considerable factor. It must be used in conjunction with the +u
* flag to cc. The #pragma is included in c.h to be safe since EVERY
* source file that performs unaligned access must contain the #pragma.
* This cheesy hack turns ON unaligned-access fixup on H-P PA-RISC;
* the resulting object files contain code that explicitly handles
* realignment on reference, so it slows memory access down by a
* considerable factor. It must be used in conjunction with the +u
* flag to cc. The #pragma is included in c.h to be safe since EVERY
* source file that performs unaligned access must contain the #pragma.
* ----------------
*/
#pragma HP_ALIGN HPUX_NATURAL_S500
#if defined(BROKEN_STRUCT_INIT)
/* ----------------
* This is so bogus. The HP-UX 9.01 compiler has totally broken
* struct initialization code. It actually length-checks ALL
* array initializations within structs against the FIRST one that
* it sees (when #pragma HP_ALIGN HPUX_NATURAL_S500 is defined)..
* we have to throw in this unused structure before struct varlena
* is defined.
* This is so bogus. The HP-UX 9.01 compiler has totally broken
* struct initialization code. It actually length-checks ALL
* array initializations within structs against the FIRST one that
* it sees (when #pragma HP_ALIGN HPUX_NATURAL_S500 is defined)..
* we have to throw in this unused structure before struct varlena
* is defined.
*
* XXX guess you don't need the #pragma anymore after all :-)
* since no one looks at this except me i think i'll just leave
* this here for now..
* XXX guess you don't need the #pragma anymore after all :-)
* since no one looks at this except me i think i'll just leave
* this here for now..
* ----------------
*/
struct HP_WAY_BOGUS {
char hpwb_bogus[8192];
struct HP_WAY_BOGUS
{
char hpwb_bogus[8192];
};
struct HP_TOO_BOGUS {
int hptb_bogus[8192];
struct HP_TOO_BOGUS
{
int hptb_bogus[8192];
};
#endif /* BROKEN_STRUCT_INIT */
#endif /* HP_S500_ALIGN */
#endif /* BROKEN_STRUCT_INIT */
#endif /* HP_S500_ALIGN */
#if defined(WEAK_C_OPTIMIZER)
#pragma OPT_LEVEL 1
#endif /* WEAK_C_OPTIMIZER */
#endif /* WEAK_C_OPTIMIZER */
#endif /* !NOFIXADE */
#endif /* !NOFIXADE */
#endif /* FIXADE_H */
#endif /* FIXADE_H */

View File

@ -1,12 +1,12 @@
/*-------------------------------------------------------------------------
*
* port-protos.h--
* port-specific prototypes for HP-UX
* port-specific prototypes for HP-UX
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: port-protos.h,v 1.2 1997/07/27 18:51:57 momjian Exp $
* $Id: port-protos.h,v 1.3 1997/09/07 04:45:51 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -14,7 +14,7 @@
#define PORT_PROTOS_H
#include <sys/resource.h> /* for struct rusage */
#include <dl.h> /* for shl_t */
#include <dl.h> /* for shl_t */
#include "utils/dynamic_loader.h"
@ -24,11 +24,11 @@
/* port.c */
extern int init_address_fixup(void);
extern double rint(double x);
extern double cbrt(double x);
extern long random(void);
extern void srandom(unsigned seed);
extern int getrusage(int who, struct rusage *ru);
extern int init_address_fixup(void);
extern double rint(double x);
extern double cbrt(double x);
extern long random(void);
extern void srandom(unsigned seed);
extern int getrusage(int who, struct rusage * ru);
#endif /* PORT_PROTOS_H */
#endif /* PORT_PROTOS_H */

View File

@ -1,47 +1,49 @@
/*-------------------------------------------------------------------------
*
* port.c--
* port-specific routines for HP-UX
* port-specific routines for HP-UX
*
* Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/port/hpux/Attic/port.c,v 1.2 1997/07/27 18:52:05 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/port/hpux/Attic/port.c,v 1.3 1997/09/07 04:45:52 momjian Exp $
*
* NOTES
* For the most part, this file gets around some non-POSIX calls
* in POSTGRES.
* For the most part, this file gets around some non-POSIX calls
* in POSTGRES.
*
*-------------------------------------------------------------------------
*/
#include <unistd.h> /* for rand()/srand() prototypes */
#include <math.h> /* for pow() prototype */
#include <sys/syscall.h> /* for syscall #defines */
#include <unistd.h> /* for rand()/srand() prototypes */
#include <math.h> /* for pow() prototype */
#include <sys/syscall.h> /* for syscall #defines */
#include "c.h"
void
init_address_fixup()
{
/*
* On PA-RISC, unaligned access fixup is handled by the compiler,
* not by the kernel.
*/
/*
* On PA-RISC, unaligned access fixup is handled by the compiler, not
* by the kernel.
*/
}
long
random()
{
return(lrand48());
return (lrand48());
}
void srandom(unsigned seed)
void
srandom(unsigned seed)
{
srand48((long int) seed);
}
getrusage(int who, struct rusage *ru)
getrusage(int who, struct rusage * ru)
{
return(syscall(SYS_GETRUSAGE, who, ru));
return (syscall(SYS_GETRUSAGE, who, ru));
}

View File

@ -1,7 +1,7 @@
/*-------------------------------------------------------------------------
*
* rusagestub.h--
* Stubs for getrusage(3).
* Stubs for getrusage(3).
*
*
* Copyright (c) 1994, Regents of the University of California
@ -13,18 +13,19 @@
#ifndef RUSAGESTUB_H
#define RUSAGESTUB_H
#include <sys/time.h> /* for struct timeval */
#include <sys/times.h> /* for struct tms */
#include <limits.h> /* for CLK_TCK */
#include <sys/time.h> /* for struct timeval */
#include <sys/times.h> /* for struct tms */
#include <limits.h> /* for CLK_TCK */
#define RUSAGE_SELF 0
#define RUSAGE_CHILDREN -1
#define RUSAGE_SELF 0
#define RUSAGE_CHILDREN -1
struct rusage {
struct timeval ru_utime; /* user time used */
struct timeval ru_stime; /* system time used */
struct rusage
{
struct timeval ru_utime; /* user time used */
struct timeval ru_stime; /* system time used */
};
extern int getrusage(int who, struct rusage *rusage);
extern int getrusage(int who, struct rusage * rusage);
#endif /* RUSAGESTUB_H */
#endif /* RUSAGESTUB_H */