Skip to content

Commit

Permalink
Retire unread variables.
Browse files Browse the repository at this point in the history
All could at least potentially receive updates, but they were never
consulted or even logged.

Signed-off-by: Aaron M. Ucko <ucko@ncbi.nlm.nih.gov>
  • Loading branch information
ucko committed Feb 14, 2025
1 parent d9af644 commit c86e6ee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/dblib/bcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,6 @@ bcp_readfmt(DBPROCESS * dbproc, const char filename[])
BCP_HOSTCOLINFO hostcol[1];
FILE *ffile;
char buffer[1024];
float lf_version = 0.0;
int li_numcols = 0;
int colinfo_count = 0;

Expand All @@ -1704,7 +1703,7 @@ bcp_readfmt(DBPROCESS * dbproc, const char filename[])
}

if ((_bcp_fgets(buffer, sizeof(buffer), ffile)) != NULL) {
lf_version = (float)atof(buffer);
/* version (float), ignored */
} else if (ferror(ffile)) {
dbperror(dbproc, SYBEBRFF, errno);
goto Cleanup;
Expand Down
3 changes: 1 addition & 2 deletions src/tds/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,13 @@ static size_t
read_and_convert(TDSSOCKET * tds, TDSICONV * char_conv, size_t * wire_size, char *outbuf,
size_t outbytesleft)
{
int res;
TDSDATAINSTREAM r;
TDSSTATICOUTSTREAM w;

tds_datain_stream_init(&r, tds, *wire_size);
tds_staticout_stream_init(&w, outbuf, outbytesleft);

res = tds_convert_stream(tds, char_conv, to_client, &r.stream, &w.stream);
tds_convert_stream(tds, char_conv, to_client, &r.stream, &w.stream);
*wire_size = r.wire_size;
return (char *) w.stream.buffer - outbuf;
}
Expand Down
4 changes: 2 additions & 2 deletions src/tds/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ tds_put_n(TDSSOCKET * tds, const void *buf, size_t n)
int
tds_put_string(TDSSOCKET * tds, const char *s, int len)
{
int res;
TDSSTATICINSTREAM r;
TDSDATAOUTSTREAM w;
enum TDS_ICONV_ENTRY iconv_entry;
Expand Down Expand Up @@ -140,7 +139,8 @@ tds_put_string(TDSSOCKET * tds, const char *s, int len)
tds_staticin_stream_init(&r, s, len);
tds_dataout_stream_init(&w, tds);

res = tds_convert_stream(tds, tds->conn->char_convs[iconv_entry], to_server, &r.stream, &w.stream);
tds_convert_stream(tds, tds->conn->char_convs[iconv_entry], to_server,
&r.stream, &w.stream);
return (int) w.written;
}

Expand Down

0 comments on commit c86e6ee

Please sign in to comment.