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

Remove un-needed braces around single statements.

This commit is contained in:
Bruce Momjian
1998-06-15 19:30:31 +00:00
parent 27db9ecd0b
commit 6bd323c6b3
224 changed files with 221 additions and 2504 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.20 1998/05/12 21:43:58 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.21 1998/06/15 19:28:25 momjian Exp $
*
* NOTES
* This should be moved to a more appropriate place. It is here
@@ -69,9 +69,7 @@ lo_open(Oid lobjId, int mode)
#endif
if (fscxt == NULL)
{
fscxt = CreateGlobalMemory("Filesystem");
}
currentContext = MemoryContextSwitchTo((MemoryContext) fscxt);
lobjDesc = inv_open(lobjId, mode);
@@ -171,9 +169,7 @@ lo_creat(int mode)
Oid lobjId;
if (fscxt == NULL)
{
fscxt = CreateGlobalMemory("Filesystem");
}
currentContext = MemoryContextSwitchTo((MemoryContext) fscxt);

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-pqexec.c,v 1.16 1998/06/04 17:26:39 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-pqexec.c,v 1.17 1998/06/15 19:28:25 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -77,17 +77,11 @@ PQfn(int fnid,
for (i = 0; i < nargs; i++)
{
if (args[i].len == VAR_LENGTH_ARG)
{
arg[i] = (char *) args[i].u.ptr;
}
else if (args[i].len > sizeof(int4))
{
elog(ERROR, "arg_length of argument %d too long", i);
}
else
{
arg[i] = (char *) args[i].u.integer;
}
}
/* ----------------
@@ -107,13 +101,9 @@ PQfn(int fnid,
return "0";
if (result_is_int)
{
*result_buf = (int) retval;
}
else
{
memmove(result_buf, retval, result_len);
}
return "G";
}

View File

@@ -145,9 +145,7 @@ crypt_loadpwdfile()
{ /* free the old data only if this is a
* reload */
while (pwd_cache_count--)
{
free((void *) pwd_cache[pwd_cache_count]);
}
free((void *) pwd_cache);
pwd_cache = NULL;
pwd_cache_count = 0;

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.32 1998/06/13 05:14:55 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.33 1998/06/15 19:28:26 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -995,9 +995,7 @@ GetCharSetByHost(char TableName[], int host, const char DataDir[])
/* Read the charset */
next_token(file, buf, sizeof(buf));
if (buf[0] != '\0')
{
strcpy(HostCharset, buf);
}
}
}
break;
@@ -1005,9 +1003,7 @@ GetCharSetByHost(char TableName[], int host, const char DataDir[])
/* Read the base charset */
next_token(file, buf, sizeof(buf));
if (buf[0] != '\0')
{
strcpy(BaseCharset, buf);
}
break;
case KEY_TABLE:
/* Read the original charset */
@@ -1046,9 +1042,7 @@ GetCharSetByHost(char TableName[], int host, const char DataDir[])
{
if (!strcasecmp(BaseCharset, ChArray[i]->Orig) &&
!strcasecmp(HostCharset, ChArray[i]->Dest))
{
strncpy(TableName, ChArray[i]->Table, 79);
}
free((struct CharsetItem *) ChArray[i]);
}
}

View File

@@ -48,9 +48,7 @@ verify_password(char *auth_arg, char *user, char *password)
test_pw = strtok(NULL, ":");
if (!test_user || !test_pw ||
test_user[0] == '\0' || test_pw[0] == '\0')
{
continue;
}
/* kill the newline */
if (test_pw[strlen(test_pw) - 1] == '\n')

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portal.c,v 1.13 1998/02/26 04:31:51 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portal.c,v 1.14 1998/06/15 19:28:27 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -119,9 +119,7 @@ PQnportals(int rule_p)
if (portals[i] && portals[i]->portal)
{
if (!rule_p || portals[i]->portal->rule_p)
{
++n;
}
}
}
return (n);
@@ -690,9 +688,7 @@ PQnotifies_init()
PQNotifyList *p;
if (pqNotifyList == NULL)
{
pqNotifyList = DLNewList();
}
else
{
/* clean all notifies */

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.43 1998/05/29 17:00:07 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.44 1998/06/15 19:28:27 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -89,13 +89,9 @@ pq_init(int fd)
elog(FATAL, "pq_init: Couldn't initialize socket connection");
PQnotifies_init();
if (getenv("LIBPQ_DEBUG"))
{
Pfdebug = stderr;
}
else
{
Pfdebug = NULL;
}
}
/* -------------------------
@@ -229,9 +225,7 @@ PQgetline(char *s, int maxlen)
return (EOF);
if (fgets(s, maxlen - 1, Pfin) == NULL)
{
return feof(Pfin) ? EOF : 1;
}
else
{
for (; *s; s++)
@@ -643,9 +637,7 @@ StreamServerPort(char *hostName, short portName, int *fdP)
*fdP = fd;
if (family == AF_UNIX)
{
chmod(sock_path, 0777);
}
return (STATUS_OK);
}

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/pqsignal.c,v 1.7 1997/09/08 02:23:19 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/pqsignal.c,v 1.8 1998/06/15 19:28:27 momjian Exp $
*
* NOTES
* This shouldn't be in libpq, but the monitor and some other
@@ -56,9 +56,7 @@ pqsignal(int signo, pqsigfunc func)
sigemptyset(&act.sa_mask);
act.sa_flags = 0;
if (signo != SIGALRM)
{
act.sa_flags |= SA_RESTART;
}
if (sigaction(signo, &act, &oact) < 0)
return (SIG_ERR);
return (oact.sa_handler);