Skip to content

Commit

Permalink
-Wstrict-prototypes
Browse files Browse the repository at this point in the history
  • Loading branch information
Zilong-Li committed Dec 11, 2023
1 parent fea378e commit 488fc29
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ depend on your connection to the servers.

## Read VCF as tabular data in R

This example shows how to read only SNP variants with FILTER=“PASS” and
GT format in the VCF/BCF into R tables:
This example shows how to read only SNP variants with genotypes in the
VCF/BCF into R tables:

``` r
library(vcfppR)
vcffile <- "https://ftp.1000genomes.ebi.ac.uk/vol1/ftp/data_collections/1000G_2504_high_coverage/working/20220422_3202_phased_SNV_INDEL_SV/1kGP_high_coverage_Illumina.chr21.filtered.SNV_INDEL_SV_phased_panel.vcf.gz"
res <- vcftable(vcffile, "chr21:1-5100000", vartype = "snps", pass = TRUE)
res <- vcftable(vcffile, "chr21:1-5100000", vartype = "snps")
str(res)
```

Expand Down
2 changes: 1 addition & 1 deletion src/htslib-1.18/Makefile.vcfppR
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ CPPFLAGS =
# TODO: probably update cram code to make it compile cleanly with -Wc++-compat
# For testing strict C99 support add -std=c99 -D_XOPEN_SOURCE=600
#CFLAGS = -g -Wall -O2 -pedantic -std=c99 -D_XOPEN_SOURCE=600
CFLAGS += -fpic -fvisibility=hidden
CFLAGS += -fpic -fvisibility=hidden -Wstrict-prototypes
EXTRA_CFLAGS_PIC =
TARGET_CFLAGS =
LDFLAGS += -fvisibility=hidden
Expand Down
2 changes: 1 addition & 1 deletion src/htslib-1.18/Makefile.win
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DCURL_STATICLIB
# TODO: probably update cram code to make it compile cleanly with -Wc++-compat
# For testing strict C99 support add -std=c99 -D_XOPEN_SOURCE=600
#CFLAGS = -g -Wall -O2 -pedantic -std=c99 -D_XOPEN_SOURCE=600
CFLAGS += -fpic -fvisibility=hidden
CFLAGS += -fpic -fvisibility=hidden -Wstrict-prototypes
EXTRA_CFLAGS_PIC =
TARGET_CFLAGS =
LDFLAGS = -fvisibility=hidden
Expand Down
2 changes: 1 addition & 1 deletion src/htslib-1.18/header.c
Original file line number Diff line number Diff line change
Expand Up @@ -2295,7 +2295,7 @@ void sam_hdr_incr_ref(sam_hdr_t *bh) {
* Returns a sam_hrecs_t struct on success (free with sam_hrecs_free())
* NULL on failure
*/
sam_hrecs_t *sam_hrecs_new() {
sam_hrecs_t *sam_hrecs_new(void) {
sam_hrecs_t *hrecs = calloc(1, sizeof(*hrecs));

if (!hrecs)
Expand Down
4 changes: 2 additions & 2 deletions src/htslib-1.18/hfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ void hfile_shutdown(int do_close_plugin)
pthread_mutex_unlock(&plugins_lock);
}

static void hfile_exit()
static void hfile_exit(void)
{
hfile_shutdown(0);
pthread_mutex_destroy(&plugins_lock);
Expand Down Expand Up @@ -1057,7 +1057,7 @@ static int init_add_plugin(void *obj, int (*init)(struct hFILE_plugin *),
* Returns 0 on success,
* <0 on failure
*/
static int load_hfile_plugins()
static int load_hfile_plugins(void)
{
static const struct hFILE_scheme_handler
data = { hopen_mem, hfile_always_local, "built-in", 80 },
Expand Down
2 changes: 1 addition & 1 deletion src/htslib-1.18/hfile_libcurl.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ static void free_auth(auth_token *tok) {
free(tok);
}

static void libcurl_exit()
static void libcurl_exit(void)
{
if (curl_share_cleanup(curl.share) == CURLSHE_OK)
curl.share = NULL;
Expand Down
6 changes: 3 additions & 3 deletions src/htslib-1.18/hts.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ KHASH_INIT2(s2i,, kh_cstr_t, int64_t, 1, kh_str_hash_func, kh_str_hash_equal)
HTSLIB_EXPORT
int hts_verbose = HTS_LOG_WARNING;

const char *hts_version()
const char *hts_version(void)
{
return HTS_VERSION_TEXT;
}
Expand Down Expand Up @@ -4900,7 +4900,7 @@ int hts_resize_array_(size_t item_size, size_t num, size_t size_sz,
return 0;
}

void hts_lib_shutdown()
void hts_lib_shutdown(void)
{
hfile_shutdown(1);
}
Expand All @@ -4914,7 +4914,7 @@ void hts_set_log_level(enum htsLogLevel level)
hts_verbose = level;
}

enum htsLogLevel hts_get_log_level()
enum htsLogLevel hts_get_log_level(void)
{
return hts_verbose;
}
Expand Down
2 changes: 1 addition & 1 deletion src/htslib-1.18/htscodecs/htscodecs/htscodecs.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
* NB: This is obtained from the auto-generated version.h, so
* we can include release number and git hash.
*/
const char *htscodecs_version() {
const char *htscodecs_version(void) {
return HTSCODECS_VERSION_TEXT;
}
2 changes: 1 addition & 1 deletion src/htslib-1.18/htscodecs/htscodecs/htscodecs.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@
* NB: This is obtained from the auto-generated version.h, so
* we can include release number and git hash.
*/
const char *htscodecs_version();
const char *htscodecs_version(void);

#endif /* HTSCODECS_H */
4 changes: 2 additions & 2 deletions src/htslib-1.18/sam.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const int8_t bam_cigar_table[256] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
};

sam_hdr_t *sam_hdr_init()
sam_hdr_t *sam_hdr_init(void)
{
sam_hdr_t *bh = (sam_hdr_t*)calloc(1, sizeof(sam_hdr_t));
if (bh == NULL) return NULL;
Expand Down Expand Up @@ -410,7 +410,7 @@ const char *sam_parse_region(sam_hdr_t *h, const char *s, int *tid,
*** BAM alignment I/O ***
*************************/

bam1_t *bam_init1()
bam1_t *bam_init1(void)
{
return (bam1_t*)calloc(1, sizeof(bam1_t));
}
Expand Down
2 changes: 1 addition & 1 deletion src/htslib-1.18/textutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ static char token_type(hts_json_token *token)
}

HTSLIB_EXPORT
hts_json_token * hts_json_alloc_token() {
hts_json_token * hts_json_alloc_token(void) {
return calloc(1, sizeof(hts_json_token));
}

Expand Down
2 changes: 1 addition & 1 deletion src/htslib-1.18/vcf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ int bcf_hdr_write(htsFile *hfp, bcf_hdr_t *h)
*** BCF site I/O ***
********************/

bcf1_t *bcf_init()
bcf1_t *bcf_init(void)
{
bcf1_t *v;
v = (bcf1_t*)calloc(1, sizeof(bcf1_t));
Expand Down

0 comments on commit 488fc29

Please sign in to comment.