Remove useless "return;" lines
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Thu, 28 Nov 2019 19:48:37 +0000 (16:48 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Thu, 28 Nov 2019 19:48:37 +0000 (16:48 -0300)
Discussion: https://postgr.es/m/20191128144653.GA27883@alvherre.pgsql

40 files changed:
contrib/fuzzystrmatch/fuzzystrmatch.c
contrib/ltree/ltxtquery_io.c
contrib/pg_standby/pg_standby.c
contrib/pgcrypto/mbuf.c
contrib/seg/seg.c
contrib/sepgsql/selinux.c
src/backend/access/gist/gist.c
src/backend/access/rmgrdesc/genericdesc.c
src/backend/access/transam/twophase.c
src/backend/access/transam/xact.c
src/backend/executor/nodeTableFuncscan.c
src/backend/jit/llvm/llvmjit.c
src/backend/libpq/hba.c
src/backend/replication/logical/launcher.c
src/backend/replication/walsender.c
src/backend/rewrite/rowsecurity.c
src/backend/utils/adt/datetime.c
src/bin/pg_ctl/pg_ctl.c
src/bin/pg_dump/compress_io.c
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_backup_custom.c
src/bin/pg_dump/pg_backup_directory.c
src/bin/pg_dump/pg_backup_null.c
src/bin/pg_dump/pg_backup_tar.c
src/bin/pg_dump/pg_dump.c
src/bin/pg_upgrade/parallel.c
src/bin/pg_upgrade/relfilenode.c
src/bin/pg_upgrade/tablespace.c
src/bin/psql/common.c
src/fe_utils/print.c
src/interfaces/ecpg/compatlib/informix.c
src/interfaces/ecpg/pgtypeslib/datetime.c
src/interfaces/ecpg/pgtypeslib/dt_common.c
src/interfaces/ecpg/pgtypeslib/timestamp.c
src/interfaces/libpq/fe-auth-scram.c
src/pl/plperl/plperl.c
src/pl/plpgsql/src/pl_exec.c
src/port/win32error.c
src/test/examples/testlo.c
src/test/examples/testlo64.c

index b8992f7c3cb7a1f4472fed9ac2996a8a2442e6cd..ad1ea931960729bc731ee43c374b9b17fc41d267 100644 (file)
@@ -698,8 +698,6 @@ _metaphone(char *word,          /* IN */
    }                           /* END FOR */
 
    End_Phoned_Word;
-
-   return;
 }                              /* END metaphone */
 
 
index 054c5d9335678dd589910b6c2c09b8768a4f6548..db347f77721e16b784207ecc081aa4db012f41da 100644 (file)
@@ -192,7 +192,6 @@ pushval_asis(QPRS_STATE *state, int type, char *strval, int lenval, uint16 flag)
    *(state->curop) = '\0';
    state->curop++;
    state->sumlen += lenval + 1;
-   return;
 }
 
 #define STACKDEPTH     32
index c6beea707057bf40e5a88218280532a85b7d2020..9784d7aef38928d408f608dc446fbf212d3eecaf 100644 (file)
@@ -545,7 +545,6 @@ CheckForExternalTrigger(void)
 
    fprintf(stderr, "WARNING: invalid content in \"%s\"\n", triggerPath);
    fflush(stderr);
-   return;
 }
 
 /*
index 0467212a281bcbd486ab48be53c8a0b71a8f7a15..548ef6209745a51b948010541dd61e03f72b1891 100644 (file)
@@ -94,8 +94,6 @@ prepare_room(MBuf *mbuf, int block_len)
    mbuf->data_end = newbuf + (mbuf->data_end - mbuf->data);
    mbuf->read_pos = newbuf + (mbuf->read_pos - mbuf->data);
    mbuf->data = newbuf;
-
-   return;
 }
 
 int
index f87456405c332adab3aea0efe578788e9f07d01f..4ff6694193cbb70d85a7104586d58740ca993b80 100644 (file)
@@ -706,8 +706,6 @@ rt_seg_size(SEG *a, float *size)
        *size = 0.0;
    else
        *size = (float) Abs(a->upper - a->lower);
-
-   return;
 }
 
 Datum
index 5e6189a4c3180bc57dffa91ad24fd4162593cec2..7179272576696b1ff96d2afe804c9ec012fb0eb5 100644 (file)
@@ -809,8 +809,6 @@ sepgsql_compute_avd(const char *scontext,
        if (avd_ex.auditdeny & av_code_ex)
            avd->auditdeny |= av_code;
    }
-
-   return;
 }
 
 /*
index 8d9c8d025dcaa4d37d92e59c894e6b7f13174576..3800f58ce7244fecca99c8910179d86b09d52302 100644 (file)
@@ -1088,8 +1088,6 @@ gistFindCorrectParent(Relation r, GISTInsertStack *child)
        LockBuffer(child->parent->buffer, GIST_EXCLUSIVE);
        gistFindCorrectParent(r, child);
    }
-
-   return;
 }
 
 /*
index 0fe02dc85a7a70f6546e625f68e21c943f8a302b..3bad0578eb799a3acdcbf0f502bdb47701484b5b 100644 (file)
@@ -43,8 +43,6 @@ generic_desc(StringInfo buf, XLogReaderState *record)
        else
            appendStringInfo(buf, "offset %u, length %u", offset, length);
    }
-
-   return;
 }
 
 /*
index b3ad0d08e30f85d5b09147cc45ed792598bb0a88..529976885f6b72beae796a543f6395ef03e769f8 100644 (file)
@@ -2436,6 +2436,4 @@ PrepareRedoRemove(TransactionId xid, bool giveWarning)
    if (gxact->ondisk)
        RemoveTwoPhaseFile(xid, giveWarning);
    RemoveGXact(gxact);
-
-   return;
 }
index 5c0d0f2af068eb7ce536870f8075553eba18aacb..5353b6ab0b2f82f75c16c7a132b578ed5e5127d1 100644 (file)
@@ -3428,7 +3428,6 @@ CheckTransactionBlock(bool isTopLevel, bool throwError, const char *stmtType)
    /* translator: %s represents an SQL statement name */
             errmsg("%s can only be used in transaction blocks",
                    stmtType)));
-   return;
 }
 
 /*
index 21cf3ca0c9fcaab5fd9e438bac39aac0a234993d..ffcf4613f4419f7cd448c6ddbe01cfbf85def81d 100644 (file)
@@ -335,8 +335,6 @@ tfuncFetchRows(TableFuncScanState *tstate, ExprContext *econtext)
 
    MemoryContextSwitchTo(oldcxt);
    MemoryContextReset(tstate->perTableCxt);
-
-   return;
 }
 
 /*
index 1c851e00fc4834b2d5481ffd8a08a5ff65e26970..3b52d8cc2116aa03424e7f429befb2a80ee4bf92 100644 (file)
@@ -834,8 +834,6 @@ llvm_create_types(void)
     * Leave the module alive, otherwise references to function would be
     * dangling.
     */
-
-   return;
 }
 
 /*
index cc4b661433f54d37ed6c8300c4e15f81636c0708..9989904769c6fc707e390b0539cdc2d33b3276ba 100644 (file)
@@ -2903,7 +2903,6 @@ check_ident_usermap(IdentLine *identLine, const char *usermap_name,
                *found_p = true;
        }
    }
-   return;
 }
 
 
index 1f8821cc437cf523209cb31bee7ca08f60d58a4a..4643af95fee744d3a20f2f9ec8a130e153496533 100644 (file)
@@ -223,8 +223,6 @@ WaitForReplicationWorkerAttach(LogicalRepWorker *worker,
            CHECK_FOR_INTERRUPTS();
        }
    }
-
-   return;
 }
 
 /*
index ac9209747a4a1d931d1091a836a03211f4794ad0..8bafa65e50ad0317e2e7c607001f911e41bdf54d 100644 (file)
@@ -2301,7 +2301,6 @@ WalSndLoop(WalSndSendDataCallback send_data)
                                     WAIT_EVENT_WAL_SENDER_MAIN);
        }
    }
-   return;
 }
 
 /* Initialize a per-walsender data structure for this walsender process */
@@ -2757,8 +2756,6 @@ retry:
                 (uint32) (sentPtr >> 32), (uint32) sentPtr);
        set_ps_display(activitymsg, false);
    }
-
-   return;
 }
 
 /*
index df7bde380d0e83e6db509dd69473a2522f905418..1969d53a1106d74a44ed19e3dde4e9fe9a7d2413 100644 (file)
@@ -394,8 +394,6 @@ get_row_security_policies(Query *root, RangeTblEntry *rte, int rt_index,
     * when necessary (eg: role changes)
     */
    *hasRowSecurity = true;
-
-   return;
 }
 
 /*
index c911d7223c26870ecfbc93dc7b628255aabdd26e..b6ac90c05121cd41ec741a6af2d2e3ead40c067f 100644 (file)
@@ -313,8 +313,6 @@ j2date(int jd, int *year, int *month, int *day)
    quad = julian * 2141 / 65536;
    *day = julian - 7834 * quad / 256;
    *month = (quad + 10) % MONTHS_PER_YEAR + 1;
-
-   return;
 }                              /* j2date() */
 
 
index 95e5fafe1f41fdb451c4c21006492650f974e5d7..65f9fb4c0a92910045720810f604864c5dcb959a 100644 (file)
@@ -422,8 +422,6 @@ free_readfile(char **optlines)
        free(curr_line);
 
    free(optlines);
-
-   return;
 }
 
 /*
index 03c3e73ad0406f6cecf527a71627b191e417f068..b2ca5654945fccee2938a117618d42ef50625b76 100644 (file)
@@ -192,7 +192,6 @@ WriteDataToArchive(ArchiveHandle *AH, CompressorState *cs,
            WriteDataToArchiveNone(AH, cs, data, dLen);
            break;
    }
-   return;
 }
 
 /*
@@ -308,8 +307,6 @@ WriteDataToArchiveZlib(ArchiveHandle *AH, CompressorState *cs,
    cs->zp->next_in = (void *) unconstify(char *, data);
    cs->zp->avail_in = dLen;
    DeflateCompressorZlib(AH, cs, false);
-
-   return;
 }
 
 static void
@@ -407,7 +404,6 @@ WriteDataToArchiveNone(ArchiveHandle *AH, CompressorState *cs,
                       const char *data, size_t dLen)
 {
    cs->writeF(AH, data, dLen);
-   return;
 }
 
 
index d051f267baad4bf0ed398d844a35b9761a512b67..77bf9edaba46dec6568f56ee57f8182272f5796b 100644 (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");
 
    AH->WriteDataPtr(AH, data, dLen);
-
-   return;
 }
 
 /*
@@ -1461,7 +1459,6 @@ void
 archputs(const char *s, Archive *AH)
 {
    WriteData(AH, s, strlen(s));
-   return;
 }
 
 /* Public */
@@ -1736,8 +1733,6 @@ ahwrite(const void *ptr, size_t size, size_t nmemb, ArchiveHandle *AH)
 
    if (bytes_written != size * nmemb)
        WRITE_ERROR_EXIT;
-
-   return;
 }
 
 /* on some error, we may decide to go on... */
index fc742f5b560404e20ff2cb6527a4b6e6ba6ea95f..369dcea42912818c42e69b5a23ae4d89ccb50f62 100644 (file)
@@ -317,8 +317,6 @@ _WriteData(ArchiveHandle *AH, const void *data, size_t dLen)
    if (dLen > 0)
        /* WriteDataToArchive() internally throws write errors */
        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)
        WRITE_ERROR_EXIT;
    ctx->filePos += len;
-
-   return;
 }
 
 /*
@@ -663,8 +659,6 @@ _ReadBuf(ArchiveHandle *AH, void *buf, size_t len)
    if (fread(buf, 1, len, AH->FH) != len)
        READ_ERROR_EXIT(AH->FH);
    ctx->filePos += len;
-
-   return;
 }
 
 /*
@@ -945,7 +939,6 @@ _CustomWriteFunc(ArchiveHandle *AH, const char *buf, size_t len)
        WriteInt(AH, len);
        _WriteBuf(AH, buf, len);
    }
-   return;
 }
 
 /*
index aa00bcaaff235ef223e4a0692de81e8df71a6b60..8631abb43a1f65e250ef8742e7f501f4c7bae593 100644 (file)
@@ -349,9 +349,6 @@ _WriteData(ArchiveHandle *AH, const void *data, size_t dLen)
    if (dLen > 0 && cfwrite(data, dLen, ctx->dataFH) != dLen)
        fatal("could not write to output file: %s",
              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)
        fatal("could not write to output file: %s",
              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)
        fatal("could not read from input file: end of file");
-
-   return;
 }
 
 /*
index c62f9436aaa7af56f9788355e98810cd709f41e9..0458979f3c0af524592d0167dbaf054f2c9e9e9a 100644 (file)
@@ -86,7 +86,6 @@ _WriteData(ArchiveHandle *AH, const void *data, size_t dLen)
 {
    /* Just send it to output, ahwrite() already errors on failure */
    ahwrite(data, 1, dLen, AH);
-   return;
 }
 
 /*
@@ -109,7 +108,6 @@ _WriteBlobData(ArchiveHandle *AH, const void *data, size_t dLen)
 
        destroyPQExpBuffer(buf);
    }
-   return;
 }
 
 static void
@@ -221,7 +219,6 @@ static void
 _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len)
 {
    /* Don't do anything */
-   return;
 }
 
 static void
index fd74835165b5a97cb04a90e683c7bb2381cfd7cd..775118f2978072fdec58c33bf9f463cefacc0ab4 100644 (file)
@@ -615,8 +615,6 @@ _WriteData(ArchiveHandle *AH, const void *data, size_t dLen)
 
    if (tarWrite(data, dLen, tctx->TH) != dLen)
        WRITE_ERROR_EXIT;
-
-   return;
 }
 
 static void
@@ -818,7 +816,6 @@ _ReadBuf(ArchiveHandle *AH, void *buf, size_t len)
        fatal("could not read from input file: end of file");
 
    ctx->filePos += len;
-   return;
 }
 
 static void
index bf69adc2f4de6226b6bbc129a73705e42af2b568..08658c8e8606154b9f9bc3419734dd5047b48423 100644 (file)
@@ -15416,8 +15416,6 @@ dumpTable(Archive *fout, TableInfo *tbinfo)
    }
 
    free(namecopy);
-
-   return;
 }
 
 /*
index 39c508e73b2b36b6aee8d8fed7c36dc857d28984..22fc7e5e0f9821efabae324cd9ad656035eb562c 100644 (file)
@@ -148,8 +148,6 @@ parallel_exec_prog(const char *log_file, const char *opt_log_file,
        thread_handles[parallel_jobs - 1] = child;
 #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;
 #endif
    }
-
-   return;
 }
 
 
index f9d0812cc5f5732d42f87dab20d5edf51898d8b0..9e6013bff14c448bb3b8ad49f0e611fcd7494e7f 100644 (file)
@@ -73,8 +73,6 @@ transfer_all_new_tablespaces(DbInfoArr *old_db_arr, DbInfoArr *new_db_arr,
 
    end_progress_output();
    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 */
        pg_free(mappings);
    }
-
-   return;
 }
 
 /*
index dfe5bfdcfd54886255b2674a0ca37adabb2f8678..7f42d1e3c97bcd037fc0183c45f8f055ec6646a8 100644 (file)
@@ -100,8 +100,6 @@ get_tablespace_paths(void)
    PQclear(res);
 
    PQfinish(conn);
-
-   return;
 }
 
 
index 90f6380170a91a4446c95fbd78b649c05c76a0d5..53a1ea2bdb9728ecd19fc056043be00615492dff 100644 (file)
@@ -2399,8 +2399,6 @@ expand_tilde(char **filename)
        }
    }
 #endif
-
-   return;
 }
 
 /*
index 1f8bde84433de8dd6cfada270c2f69f9f4b67ec3..b9cd6a17521be3fd73ba0844573912b3af12e4e3 100644 (file)
@@ -3619,8 +3619,6 @@ refresh_utf8format(const printTableOpt *opt)
    popt->wrap_left = unicode_style.wrap_left;
    popt->wrap_right = unicode_style.wrap_right;
    popt->wrap_right_border = unicode_style.wrap_right_border;
-
-   return;
 }
 
 /*
index d921b974aaf140b9ded6fa04d3c065d2f9582e55..a7bbeb9223f775873572a1d0d759c39b384b9eba 100644 (file)
@@ -529,7 +529,6 @@ void
 rtoday(date * d)
 {
    PGTYPESdate_today(d);
-   return;
 }
 
 int
@@ -959,7 +958,6 @@ rupshift(char *str)
    for (; *str != '\0'; str++)
        if (islower((unsigned char) *str))
            *str = toupper((unsigned char) *str);
-   return;
 }
 
 int
index 71dc1a5ff8bdaec3a55be96061399acfe8bc982c..1b253747fc403d7134cf9d2117c482c3c6590429 100644 (file)
@@ -152,7 +152,6 @@ PGTYPESdate_today(date * d)
    GetCurrentDateTime(&ts);
    if (errno == 0)
        *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
index c22f6576740f011c657b12b167dc94069ce9b9d5..c1a3a3e2cb7e2d4f375a3b1a2e858f7347a867ea 100644 (file)
@@ -624,8 +624,6 @@ j2date(int jd, int *year, int *month, int *day)
    quad = julian * 2141 / 65536;
    *day = julian - 7834 * quad / 256;
    *month = (quad + 10) % 12 + 1;
-
-   return;
 }                              /* j2date() */
 
 /* DecodeSpecial()
index 7816e6fdc05b66a9941e3474a2bcfca43a73ffca..810dd06ee68b9e39bfbb8d1fb4b58b8205f24246 100644 (file)
@@ -297,7 +297,6 @@ PGTYPEStimestamp_current(timestamp * ts)
    GetCurrentDateTime(&tm);
    if (errno == 0)
        tm2timestamp(&tm, 0, NULL, ts);
-   return;
 }
 
 static int
index 741f566a724a53d32fa1449411fdf3e2b17eb83a..3bfcafa1e0a6fe0f75b93531f3385b3e42433a11 100644 (file)
@@ -279,7 +279,6 @@ pg_fe_scram_exchange(void *opaq, char *input, int inputlen,
 error:
    *done = true;
    *success = false;
-   return;
 }
 
 /*
index 0b224b933cb9760d3f0c5d6c5f609ae7fa4e0e47..c78891868a5c07a50ca10f73f14d4c15004642f9 100644 (file)
@@ -2147,8 +2147,6 @@ plperl_create_sub(plperl_proc_desc *prodesc, const char *s, Oid fn_oid)
                        prodesc->proname)));
 
    prodesc->reference = subref;
-
-   return;
 }
 
 
@@ -2388,8 +2386,6 @@ plperl_call_perl_event_trigger_func(plperl_proc_desc *desc,
    PUTBACK;
    FREETMPS;
    LEAVE;
-
-   return;
 }
 
 static Datum
index 4a9ed83030a703f3abdf7573fa81cd0bc32d9b71..4f0de7a8112ef8a3ca226accbdfe936989df2d0e 100644 (file)
@@ -1189,8 +1189,6 @@ plpgsql_exec_event_trigger(PLpgSQL_function *func, EventTriggerData *trigdata)
     * Pop the error context stack
     */
    error_context_stack = plerrcontext.previous;
-
-   return;
 }
 
 /*
index f0582c8dad4e46790ef7d37517333bdb172067de..04a3247cefd9a495fee739f0aacedebf12d9eeea 100644 (file)
@@ -205,5 +205,4 @@ _dosmaperr(unsigned long e)
 #endif
 
    errno = EINVAL;
-   return;
 }
index a0c442a549d1bf0df018648bcde653dfcf730a4b..5fd40263710153df4beb4abe308fe94b7f29c6e8 100644 (file)
@@ -187,8 +187,6 @@ exportFile(PGconn *conn, Oid lobjId, char *filename)
 
    lo_close(conn, lobj_fd);
    close(fd);
-
-   return;
 }
 
 static void
index 915aa70c862fb7950b8a2109757748a5f2094f53..5faca64856250b3e190bc12d5bdc3af5d1041ceb 100644 (file)
@@ -209,8 +209,6 @@ exportFile(PGconn *conn, Oid lobjId, char *filename)
 
    lo_close(conn, lobj_fd);
    close(fd);
-
-   return;
 }
 
 static void