1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-16 06:01:02 +03:00

Remove useless "return;" lines

Discussion: https://postgr.es/m/20191128144653.GA27883@alvherre.pgsql
This commit is contained in:
Alvaro Herrera
2019-11-28 16:48:37 -03:00
parent 8a7e9e9dad
commit 3974c4a724
40 changed files with 0 additions and 96 deletions

View File

@ -698,8 +698,6 @@ _metaphone(char *word, /* IN */
} /* END FOR */ } /* END FOR */
End_Phoned_Word; End_Phoned_Word;
return;
} /* END metaphone */ } /* END metaphone */

View File

@ -192,7 +192,6 @@ pushval_asis(QPRS_STATE *state, int type, char *strval, int lenval, uint16 flag)
*(state->curop) = '\0'; *(state->curop) = '\0';
state->curop++; state->curop++;
state->sumlen += lenval + 1; state->sumlen += lenval + 1;
return;
} }
#define STACKDEPTH 32 #define STACKDEPTH 32

View File

@ -545,7 +545,6 @@ CheckForExternalTrigger(void)
fprintf(stderr, "WARNING: invalid content in \"%s\"\n", triggerPath); fprintf(stderr, "WARNING: invalid content in \"%s\"\n", triggerPath);
fflush(stderr); fflush(stderr);
return;
} }
/* /*

View File

@ -94,8 +94,6 @@ prepare_room(MBuf *mbuf, int block_len)
mbuf->data_end = newbuf + (mbuf->data_end - mbuf->data); mbuf->data_end = newbuf + (mbuf->data_end - mbuf->data);
mbuf->read_pos = newbuf + (mbuf->read_pos - mbuf->data); mbuf->read_pos = newbuf + (mbuf->read_pos - mbuf->data);
mbuf->data = newbuf; mbuf->data = newbuf;
return;
} }
int int

View File

@ -706,8 +706,6 @@ rt_seg_size(SEG *a, float *size)
*size = 0.0; *size = 0.0;
else else
*size = (float) Abs(a->upper - a->lower); *size = (float) Abs(a->upper - a->lower);
return;
} }
Datum Datum

View File

@ -809,8 +809,6 @@ sepgsql_compute_avd(const char *scontext,
if (avd_ex.auditdeny & av_code_ex) if (avd_ex.auditdeny & av_code_ex)
avd->auditdeny |= av_code; avd->auditdeny |= av_code;
} }
return;
} }
/* /*

View File

@ -1088,8 +1088,6 @@ gistFindCorrectParent(Relation r, GISTInsertStack *child)
LockBuffer(child->parent->buffer, GIST_EXCLUSIVE); LockBuffer(child->parent->buffer, GIST_EXCLUSIVE);
gistFindCorrectParent(r, child); gistFindCorrectParent(r, child);
} }
return;
} }
/* /*

View File

@ -43,8 +43,6 @@ generic_desc(StringInfo buf, XLogReaderState *record)
else else
appendStringInfo(buf, "offset %u, length %u", offset, length); appendStringInfo(buf, "offset %u, length %u", offset, length);
} }
return;
} }
/* /*

View File

@ -2436,6 +2436,4 @@ PrepareRedoRemove(TransactionId xid, bool giveWarning)
if (gxact->ondisk) if (gxact->ondisk)
RemoveTwoPhaseFile(xid, giveWarning); RemoveTwoPhaseFile(xid, giveWarning);
RemoveGXact(gxact); RemoveGXact(gxact);
return;
} }

View File

@ -3428,7 +3428,6 @@ CheckTransactionBlock(bool isTopLevel, bool throwError, const char *stmtType)
/* translator: %s represents an SQL statement name */ /* translator: %s represents an SQL statement name */
errmsg("%s can only be used in transaction blocks", errmsg("%s can only be used in transaction blocks",
stmtType))); stmtType)));
return;
} }
/* /*

View File

@ -335,8 +335,6 @@ tfuncFetchRows(TableFuncScanState *tstate, ExprContext *econtext)
MemoryContextSwitchTo(oldcxt); MemoryContextSwitchTo(oldcxt);
MemoryContextReset(tstate->perTableCxt); MemoryContextReset(tstate->perTableCxt);
return;
} }
/* /*

View File

@ -834,8 +834,6 @@ llvm_create_types(void)
* Leave the module alive, otherwise references to function would be * Leave the module alive, otherwise references to function would be
* dangling. * dangling.
*/ */
return;
} }
/* /*

View File

@ -2903,7 +2903,6 @@ check_ident_usermap(IdentLine *identLine, const char *usermap_name,
*found_p = true; *found_p = true;
} }
} }
return;
} }

View File

@ -223,8 +223,6 @@ WaitForReplicationWorkerAttach(LogicalRepWorker *worker,
CHECK_FOR_INTERRUPTS(); CHECK_FOR_INTERRUPTS();
} }
} }
return;
} }
/* /*

View File

@ -2301,7 +2301,6 @@ WalSndLoop(WalSndSendDataCallback send_data)
WAIT_EVENT_WAL_SENDER_MAIN); WAIT_EVENT_WAL_SENDER_MAIN);
} }
} }
return;
} }
/* Initialize a per-walsender data structure for this walsender process */ /* Initialize a per-walsender data structure for this walsender process */
@ -2757,8 +2756,6 @@ retry:
(uint32) (sentPtr >> 32), (uint32) sentPtr); (uint32) (sentPtr >> 32), (uint32) sentPtr);
set_ps_display(activitymsg, false); set_ps_display(activitymsg, false);
} }
return;
} }
/* /*

View File

@ -394,8 +394,6 @@ get_row_security_policies(Query *root, RangeTblEntry *rte, int rt_index,
* when necessary (eg: role changes) * when necessary (eg: role changes)
*/ */
*hasRowSecurity = true; *hasRowSecurity = true;
return;
} }
/* /*

View File

@ -313,8 +313,6 @@ j2date(int jd, int *year, int *month, int *day)
quad = julian * 2141 / 65536; quad = julian * 2141 / 65536;
*day = julian - 7834 * quad / 256; *day = julian - 7834 * quad / 256;
*month = (quad + 10) % MONTHS_PER_YEAR + 1; *month = (quad + 10) % MONTHS_PER_YEAR + 1;
return;
} /* j2date() */ } /* j2date() */

View File

@ -422,8 +422,6 @@ free_readfile(char **optlines)
free(curr_line); free(curr_line);
free(optlines); free(optlines);
return;
} }
/* /*

View File

@ -192,7 +192,6 @@ WriteDataToArchive(ArchiveHandle *AH, CompressorState *cs,
WriteDataToArchiveNone(AH, cs, data, dLen); WriteDataToArchiveNone(AH, cs, data, dLen);
break; break;
} }
return;
} }
/* /*
@ -308,8 +307,6 @@ WriteDataToArchiveZlib(ArchiveHandle *AH, CompressorState *cs,
cs->zp->next_in = (void *) unconstify(char *, data); cs->zp->next_in = (void *) unconstify(char *, data);
cs->zp->avail_in = dLen; cs->zp->avail_in = dLen;
DeflateCompressorZlib(AH, cs, false); DeflateCompressorZlib(AH, cs, false);
return;
} }
static void static void
@ -407,7 +404,6 @@ WriteDataToArchiveNone(ArchiveHandle *AH, CompressorState *cs,
const char *data, size_t dLen) const char *data, size_t dLen)
{ {
cs->writeF(AH, data, dLen); cs->writeF(AH, data, dLen);
return;
} }

View File

@ -1045,8 +1045,6 @@ WriteData(Archive *AHX, const void *data, size_t dLen)
fatal("internal error -- WriteData cannot be called outside the context of a DataDumper routine"); fatal("internal error -- WriteData cannot be called outside the context of a DataDumper routine");
AH->WriteDataPtr(AH, data, dLen); AH->WriteDataPtr(AH, data, dLen);
return;
} }
/* /*
@ -1461,7 +1459,6 @@ void
archputs(const char *s, Archive *AH) archputs(const char *s, Archive *AH)
{ {
WriteData(AH, s, strlen(s)); WriteData(AH, s, strlen(s));
return;
} }
/* Public */ /* Public */
@ -1736,8 +1733,6 @@ ahwrite(const void *ptr, size_t size, size_t nmemb, ArchiveHandle *AH)
if (bytes_written != size * nmemb) if (bytes_written != size * nmemb)
WRITE_ERROR_EXIT; WRITE_ERROR_EXIT;
return;
} }
/* on some error, we may decide to go on... */ /* on some error, we may decide to go on... */

View File

@ -317,8 +317,6 @@ _WriteData(ArchiveHandle *AH, const void *data, size_t dLen)
if (dLen > 0) if (dLen > 0)
/* WriteDataToArchive() internally throws write errors */ /* WriteDataToArchive() internally throws write errors */
WriteDataToArchive(AH, cs, data, dLen); WriteDataToArchive(AH, cs, data, dLen);
return;
} }
/* /*
@ -644,8 +642,6 @@ _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len)
if (fwrite(buf, 1, len, AH->FH) != len) if (fwrite(buf, 1, len, AH->FH) != len)
WRITE_ERROR_EXIT; WRITE_ERROR_EXIT;
ctx->filePos += len; ctx->filePos += len;
return;
} }
/* /*
@ -663,8 +659,6 @@ _ReadBuf(ArchiveHandle *AH, void *buf, size_t len)
if (fread(buf, 1, len, AH->FH) != len) if (fread(buf, 1, len, AH->FH) != len)
READ_ERROR_EXIT(AH->FH); READ_ERROR_EXIT(AH->FH);
ctx->filePos += len; ctx->filePos += len;
return;
} }
/* /*
@ -945,7 +939,6 @@ _CustomWriteFunc(ArchiveHandle *AH, const char *buf, size_t len)
WriteInt(AH, len); WriteInt(AH, len);
_WriteBuf(AH, buf, len); _WriteBuf(AH, buf, len);
} }
return;
} }
/* /*

View File

@ -349,9 +349,6 @@ _WriteData(ArchiveHandle *AH, const void *data, size_t dLen)
if (dLen > 0 && cfwrite(data, dLen, ctx->dataFH) != dLen) if (dLen > 0 && cfwrite(data, dLen, ctx->dataFH) != dLen)
fatal("could not write to output file: %s", fatal("could not write to output file: %s",
get_cfp_error(ctx->dataFH)); get_cfp_error(ctx->dataFH));
return;
} }
/* /*
@ -517,8 +514,6 @@ _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len)
if (cfwrite(buf, len, ctx->dataFH) != len) if (cfwrite(buf, len, ctx->dataFH) != len)
fatal("could not write to output file: %s", fatal("could not write to output file: %s",
get_cfp_error(ctx->dataFH)); get_cfp_error(ctx->dataFH));
return;
} }
/* /*
@ -537,8 +532,6 @@ _ReadBuf(ArchiveHandle *AH, void *buf, size_t len)
*/ */
if (cfread(buf, len, ctx->dataFH) != len) if (cfread(buf, len, ctx->dataFH) != len)
fatal("could not read from input file: end of file"); fatal("could not read from input file: end of file");
return;
} }
/* /*

View File

@ -86,7 +86,6 @@ _WriteData(ArchiveHandle *AH, const void *data, size_t dLen)
{ {
/* Just send it to output, ahwrite() already errors on failure */ /* Just send it to output, ahwrite() already errors on failure */
ahwrite(data, 1, dLen, AH); ahwrite(data, 1, dLen, AH);
return;
} }
/* /*
@ -109,7 +108,6 @@ _WriteBlobData(ArchiveHandle *AH, const void *data, size_t dLen)
destroyPQExpBuffer(buf); destroyPQExpBuffer(buf);
} }
return;
} }
static void static void
@ -221,7 +219,6 @@ static void
_WriteBuf(ArchiveHandle *AH, const void *buf, size_t len) _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len)
{ {
/* Don't do anything */ /* Don't do anything */
return;
} }
static void static void

View File

@ -615,8 +615,6 @@ _WriteData(ArchiveHandle *AH, const void *data, size_t dLen)
if (tarWrite(data, dLen, tctx->TH) != dLen) if (tarWrite(data, dLen, tctx->TH) != dLen)
WRITE_ERROR_EXIT; WRITE_ERROR_EXIT;
return;
} }
static void static void
@ -818,7 +816,6 @@ _ReadBuf(ArchiveHandle *AH, void *buf, size_t len)
fatal("could not read from input file: end of file"); fatal("could not read from input file: end of file");
ctx->filePos += len; ctx->filePos += len;
return;
} }
static void static void

View File

@ -15416,8 +15416,6 @@ dumpTable(Archive *fout, TableInfo *tbinfo)
} }
free(namecopy); free(namecopy);
return;
} }
/* /*

View File

@ -148,8 +148,6 @@ parallel_exec_prog(const char *log_file, const char *opt_log_file,
thread_handles[parallel_jobs - 1] = child; thread_handles[parallel_jobs - 1] = child;
#endif #endif
} }
return;
} }
@ -263,8 +261,6 @@ parallel_transfer_all_new_dbs(DbInfoArr *old_db_arr, DbInfoArr *new_db_arr,
thread_handles[parallel_jobs - 1] = child; thread_handles[parallel_jobs - 1] = child;
#endif #endif
} }
return;
} }

View File

@ -73,8 +73,6 @@ transfer_all_new_tablespaces(DbInfoArr *old_db_arr, DbInfoArr *new_db_arr,
end_progress_output(); end_progress_output();
check_ok(); check_ok();
return;
} }
@ -128,8 +126,6 @@ transfer_all_new_dbs(DbInfoArr *old_db_arr, DbInfoArr *new_db_arr,
/* We allocate something even for n_maps == 0 */ /* We allocate something even for n_maps == 0 */
pg_free(mappings); pg_free(mappings);
} }
return;
} }
/* /*

View File

@ -100,8 +100,6 @@ get_tablespace_paths(void)
PQclear(res); PQclear(res);
PQfinish(conn); PQfinish(conn);
return;
} }

View File

@ -2399,8 +2399,6 @@ expand_tilde(char **filename)
} }
} }
#endif #endif
return;
} }
/* /*

View File

@ -3619,8 +3619,6 @@ refresh_utf8format(const printTableOpt *opt)
popt->wrap_left = unicode_style.wrap_left; popt->wrap_left = unicode_style.wrap_left;
popt->wrap_right = unicode_style.wrap_right; popt->wrap_right = unicode_style.wrap_right;
popt->wrap_right_border = unicode_style.wrap_right_border; popt->wrap_right_border = unicode_style.wrap_right_border;
return;
} }
/* /*

View File

@ -529,7 +529,6 @@ void
rtoday(date * d) rtoday(date * d)
{ {
PGTYPESdate_today(d); PGTYPESdate_today(d);
return;
} }
int int
@ -959,7 +958,6 @@ rupshift(char *str)
for (; *str != '\0'; str++) for (; *str != '\0'; str++)
if (islower((unsigned char) *str)) if (islower((unsigned char) *str))
*str = toupper((unsigned char) *str); *str = toupper((unsigned char) *str);
return;
} }
int int

View File

@ -152,7 +152,6 @@ PGTYPESdate_today(date * d)
GetCurrentDateTime(&ts); GetCurrentDateTime(&ts);
if (errno == 0) if (errno == 0)
*d = date2j(ts.tm_year, ts.tm_mon, ts.tm_mday) - date2j(2000, 1, 1); *d = date2j(ts.tm_year, ts.tm_mon, ts.tm_mday) - date2j(2000, 1, 1);
return;
} }
#define PGTYPES_DATE_NUM_MAX_DIGITS 20 /* should suffice for most #define PGTYPES_DATE_NUM_MAX_DIGITS 20 /* should suffice for most

View File

@ -624,8 +624,6 @@ j2date(int jd, int *year, int *month, int *day)
quad = julian * 2141 / 65536; quad = julian * 2141 / 65536;
*day = julian - 7834 * quad / 256; *day = julian - 7834 * quad / 256;
*month = (quad + 10) % 12 + 1; *month = (quad + 10) % 12 + 1;
return;
} /* j2date() */ } /* j2date() */
/* DecodeSpecial() /* DecodeSpecial()

View File

@ -297,7 +297,6 @@ PGTYPEStimestamp_current(timestamp * ts)
GetCurrentDateTime(&tm); GetCurrentDateTime(&tm);
if (errno == 0) if (errno == 0)
tm2timestamp(&tm, 0, NULL, ts); tm2timestamp(&tm, 0, NULL, ts);
return;
} }
static int static int

View File

@ -279,7 +279,6 @@ pg_fe_scram_exchange(void *opaq, char *input, int inputlen,
error: error:
*done = true; *done = true;
*success = false; *success = false;
return;
} }
/* /*

View File

@ -2147,8 +2147,6 @@ plperl_create_sub(plperl_proc_desc *prodesc, const char *s, Oid fn_oid)
prodesc->proname))); prodesc->proname)));
prodesc->reference = subref; prodesc->reference = subref;
return;
} }
@ -2388,8 +2386,6 @@ plperl_call_perl_event_trigger_func(plperl_proc_desc *desc,
PUTBACK; PUTBACK;
FREETMPS; FREETMPS;
LEAVE; LEAVE;
return;
} }
static Datum static Datum

View File

@ -1189,8 +1189,6 @@ plpgsql_exec_event_trigger(PLpgSQL_function *func, EventTriggerData *trigdata)
* Pop the error context stack * Pop the error context stack
*/ */
error_context_stack = plerrcontext.previous; error_context_stack = plerrcontext.previous;
return;
} }
/* /*

View File

@ -205,5 +205,4 @@ _dosmaperr(unsigned long e)
#endif #endif
errno = EINVAL; errno = EINVAL;
return;
} }

View File

@ -187,8 +187,6 @@ exportFile(PGconn *conn, Oid lobjId, char *filename)
lo_close(conn, lobj_fd); lo_close(conn, lobj_fd);
close(fd); close(fd);
return;
} }
static void static void

View File

@ -209,8 +209,6 @@ exportFile(PGconn *conn, Oid lobjId, char *filename)
lo_close(conn, lobj_fd); lo_close(conn, lobj_fd);
close(fd); close(fd);
return;
} }
static void static void