Skip to content

Commit

Permalink
remove uses of std::cout and puts from C++ code
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverVoogd committed Jul 5, 2023
1 parent d5dfadd commit 8f17448
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/main-functions/get_transcript_seq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ get_transcript_seq(

fa_dict[transcript] = transcript_seq;
if (global_seq_dict.find(transcript_seq) != global_seq_dict.end()) {
std::cout << "Duplicate transcript sequence: " << global_seq_dict[transcript_seq] << ", " << transcript << "\n";
Rcpp::Rcout << "Duplicate transcript sequence: " << global_seq_dict[transcript_seq] << ", " << transcript << "\n";
} else {
global_seq_dict[transcript_seq] = transcript;
}
Expand Down
18 changes: 9 additions & 9 deletions src/utility/bam.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ char *bam_format1(const bam_header_t *header, const bam1_t *b)
return str.s;
}

int bam_view1(const bam_header_t *header, const bam1_t *b)
{
char *s = bam_format1(header, b);
int ret = -1;
if (!s) return -1;
if (puts(s) != EOF) ret = 0;
free(s);
return ret;
}
// int bam_view1(const bam_header_t *header, const bam1_t *b)
// {
// char *s = bam_format1(header, b);
// int ret = -1;
// if (!s) return -1;
// if (puts(s) != EOF) ret = 0;
// free(s);
// return ret;
// }

int bam_validate1(const bam_header_t *header, const bam1_t *b)
{
Expand Down
10 changes: 5 additions & 5 deletions src/utility/bam.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,11 @@ extern "C" {
*/
char *bam_format1(const bam_header_t *header, const bam1_t *b);

/*!
@abstract Formats a BAM record and writes it and \n to stdout
@return 0 if successful, -1 on error
*/
int bam_view1(const bam_header_t *header, const bam1_t *b);
// /*!
// @abstract Formats a BAM record and writes it and \n to stdout
// @return 0 if successful, -1 on error
// */
// int bam_view1(const bam_header_t *header, const bam1_t *b);

/*!
@abstract Check whether a BAM record is plausibly valid
Expand Down

0 comments on commit 8f17448

Please sign in to comment.