mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
pgindent run on all C files. Java run to follow. initdb/regression
tests pass.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.53 2001/10/06 23:21:44 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.54 2001/10/25 05:49:48 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -46,12 +46,12 @@ static DynamicFileList *file_tail = (DynamicFileList *) NULL;
|
||||
|
||||
#define SAME_INODE(A,B) ((A).st_ino == (B).inode && (A).st_dev == (B).device)
|
||||
|
||||
char * Dynamic_library_path;
|
||||
char *Dynamic_library_path;
|
||||
|
||||
static bool file_exists(const char *name);
|
||||
static char * find_in_dynamic_libpath(const char * basename);
|
||||
static char * expand_dynamic_library_name(const char *name);
|
||||
static char * substitute_libpath_macro(const char * name);
|
||||
static char *find_in_dynamic_libpath(const char *basename);
|
||||
static char *expand_dynamic_library_name(const char *name);
|
||||
static char *substitute_libpath_macro(const char *name);
|
||||
|
||||
/*
|
||||
* Load the specified dynamic-link library file, and look for a function
|
||||
@@ -237,7 +237,7 @@ file_exists(const char *name)
|
||||
if (stat(name, &st) == 0)
|
||||
return S_ISDIR(st.st_mode) ? false : true;
|
||||
else if (!(errno == ENOENT || errno == ENOTDIR || errno == EACCES))
|
||||
elog(ERROR, "stat failed on %s: %s", name, strerror(errno));
|
||||
elog(ERROR, "stat failed on %s: %s", name, strerror(errno));
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -258,7 +258,7 @@ file_exists(const char *name)
|
||||
* If name contains a slash, check if the file exists, if so return
|
||||
* the name. Else (no slash) try to expand using search path (see
|
||||
* find_in_dynamic_libpath below); if that works, return the fully
|
||||
* expanded file name. If the previous failed, append DLSUFFIX and
|
||||
* expanded file name. If the previous failed, append DLSUFFIX and
|
||||
* try again. If all fails, return NULL.
|
||||
*
|
||||
* A non-NULL result will always be freshly palloc'd.
|
||||
@@ -266,9 +266,9 @@ file_exists(const char *name)
|
||||
static char *
|
||||
expand_dynamic_library_name(const char *name)
|
||||
{
|
||||
bool have_slash;
|
||||
char * new;
|
||||
char * full;
|
||||
bool have_slash;
|
||||
char *new;
|
||||
char *full;
|
||||
|
||||
AssertArg(name);
|
||||
|
||||
@@ -288,7 +288,7 @@ expand_dynamic_library_name(const char *name)
|
||||
pfree(full);
|
||||
}
|
||||
|
||||
new = palloc(strlen(name)+ strlen(DLSUFFIX) + 1);
|
||||
new = palloc(strlen(name) + strlen(DLSUFFIX) + 1);
|
||||
strcpy(new, name);
|
||||
strcat(new, DLSUFFIX);
|
||||
|
||||
@@ -307,7 +307,7 @@ expand_dynamic_library_name(const char *name)
|
||||
return full;
|
||||
pfree(full);
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -317,10 +317,10 @@ expand_dynamic_library_name(const char *name)
|
||||
* Result is always freshly palloc'd.
|
||||
*/
|
||||
static char *
|
||||
substitute_libpath_macro(const char * name)
|
||||
substitute_libpath_macro(const char *name)
|
||||
{
|
||||
size_t macroname_len;
|
||||
char * replacement = NULL;
|
||||
size_t macroname_len;
|
||||
char *replacement = NULL;
|
||||
|
||||
AssertArg(name != NULL);
|
||||
|
||||
@@ -329,7 +329,7 @@ substitute_libpath_macro(const char * name)
|
||||
|
||||
macroname_len = strcspn(name + 1, "/") + 1;
|
||||
|
||||
if (strncmp(name, "$libdir", macroname_len)==0)
|
||||
if (strncmp(name, "$libdir", macroname_len) == 0)
|
||||
replacement = PKGLIBDIR;
|
||||
else
|
||||
elog(ERROR, "invalid macro name in dynamic library path");
|
||||
@@ -338,7 +338,7 @@ substitute_libpath_macro(const char * name)
|
||||
return pstrdup(replacement);
|
||||
else
|
||||
{
|
||||
char * new;
|
||||
char *new;
|
||||
|
||||
new = palloc(strlen(replacement) + (strlen(name) - macroname_len) + 1);
|
||||
|
||||
@@ -357,10 +357,10 @@ substitute_libpath_macro(const char * name)
|
||||
* return NULL.
|
||||
*/
|
||||
static char *
|
||||
find_in_dynamic_libpath(const char * basename)
|
||||
find_in_dynamic_libpath(const char *basename)
|
||||
{
|
||||
const char *p;
|
||||
size_t baselen;
|
||||
size_t baselen;
|
||||
|
||||
AssertArg(basename != NULL);
|
||||
AssertArg(strchr(basename, '/') == NULL);
|
||||
@@ -374,10 +374,10 @@ find_in_dynamic_libpath(const char * basename)
|
||||
|
||||
for (;;)
|
||||
{
|
||||
size_t len;
|
||||
char * piece;
|
||||
char * mangled;
|
||||
char *full;
|
||||
size_t len;
|
||||
char *piece;
|
||||
char *mangled;
|
||||
char *full;
|
||||
|
||||
len = strcspn(p, ":");
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.55 2001/10/06 23:21:44 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.56 2001/10/25 05:49:50 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -43,7 +43,6 @@ typedef int32 ((*func_ptr) ());
|
||||
|
||||
#else
|
||||
typedef char *((*func_ptr) ());
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -143,9 +142,9 @@ fmgr_info_cxt(Oid functionId, FmgrInfo *finfo, MemoryContext mcxt)
|
||||
char *prosrc;
|
||||
|
||||
/*
|
||||
* fn_oid *must* be filled in last. Some code assumes that if fn_oid is
|
||||
* valid, the whole struct is valid. Some FmgrInfo struct's do survive
|
||||
* elogs.
|
||||
* fn_oid *must* be filled in last. Some code assumes that if fn_oid
|
||||
* is valid, the whole struct is valid. Some FmgrInfo struct's do
|
||||
* survive elogs.
|
||||
*/
|
||||
finfo->fn_oid = InvalidOid;
|
||||
finfo->fn_extra = NULL;
|
||||
@@ -154,7 +153,8 @@ fmgr_info_cxt(Oid functionId, FmgrInfo *finfo, MemoryContext mcxt)
|
||||
if ((fbp = fmgr_isbuiltin(functionId)) != NULL)
|
||||
{
|
||||
/*
|
||||
* Fast path for builtin functions: don't bother consulting pg_proc
|
||||
* Fast path for builtin functions: don't bother consulting
|
||||
* pg_proc
|
||||
*/
|
||||
finfo->fn_nargs = fbp->nargs;
|
||||
finfo->fn_strict = fbp->strict;
|
||||
@@ -189,6 +189,7 @@ fmgr_info_cxt(Oid functionId, FmgrInfo *finfo, MemoryContext mcxt)
|
||||
switch (procedureStruct->prolang)
|
||||
{
|
||||
case INTERNALlanguageId:
|
||||
|
||||
/*
|
||||
* For an ordinary builtin function, we should never get here
|
||||
* because the isbuiltin() search above will have succeeded.
|
||||
@@ -405,7 +406,7 @@ fetch_finfo_record(void *filehandle, char *funcname)
|
||||
* Copy an FmgrInfo struct
|
||||
*
|
||||
* This is inherently somewhat bogus since we can't reliably duplicate
|
||||
* language-dependent subsidiary info. We cheat by zeroing fn_extra,
|
||||
* language-dependent subsidiary info. We cheat by zeroing fn_extra,
|
||||
* instead, meaning that subsidiary info will have to be recomputed.
|
||||
*/
|
||||
void
|
||||
@@ -624,7 +625,6 @@ fmgr_oldstyle(PG_FUNCTION_ARGS)
|
||||
static Datum
|
||||
fmgr_untrusted(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
||||
/*
|
||||
* Currently these are unsupported. Someday we might do something
|
||||
* like forking a subprocess to execute 'em.
|
||||
@@ -1457,19 +1457,20 @@ Int64GetDatum(int64 X)
|
||||
|
||||
*retval = X;
|
||||
return PointerGetDatum(retval);
|
||||
#else /* INT64_IS_BUSTED */
|
||||
#else /* INT64_IS_BUSTED */
|
||||
|
||||
/*
|
||||
* On a machine with no 64-bit-int C datatype, sizeof(int64) will not be
|
||||
* 8, but we want Int64GetDatum to return an 8-byte object anyway, with
|
||||
* zeroes in the unused bits. This is needed so that, for example,
|
||||
* hash join of int8 will behave properly.
|
||||
* On a machine with no 64-bit-int C datatype, sizeof(int64) will not
|
||||
* be 8, but we want Int64GetDatum to return an 8-byte object anyway,
|
||||
* with zeroes in the unused bits. This is needed so that, for
|
||||
* example, hash join of int8 will behave properly.
|
||||
*/
|
||||
int64 *retval = (int64 *) palloc(Max(sizeof(int64), 8));
|
||||
|
||||
MemSet(retval, 0, Max(sizeof(int64), 8));
|
||||
*retval = X;
|
||||
return PointerGetDatum(retval);
|
||||
#endif /* INT64_IS_BUSTED */
|
||||
#endif /* INT64_IS_BUSTED */
|
||||
}
|
||||
|
||||
Datum
|
||||
|
||||
Reference in New Issue
Block a user