Skip to content

Commit

Permalink
fix -Wvla
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengxwen committed Apr 11, 2024
1 parent aaa253c commit 5cdff0e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: HIBAG
Type: Package
Title: HLA Genotype Imputation with Attribute Bagging
Version: 1.39.4
Date: 2024-03-14
Version: 1.39.5
Date: 2024-04-11
Depends: R (>= 3.2.0)
Imports: methods, RcppParallel
Suggests: parallel, ggplot2, reshape2, gdsfmt, SNPRelate, SeqArray, knitr,
Expand Down
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CHANGES IN VERSION 1.39.4
CHANGES IN VERSION 1.40.0
-------------------------

o new option 'all' in `hlaUniqueAllele()`
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ HIBAG is a state of the art software package for imputing HLA types using SNP da

## Bioconductor Package

Release Version: 1.38.3
Release Version: 1.40.0

[http://www.bioconductor.org/packages/HIBAG/](http://www.bioconductor.org/packages/HIBAG/)

Expand Down
14 changes: 7 additions & 7 deletions src/LibHLA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -981,11 +981,12 @@ void CAlg_EM::PrepareHaplotypes(const CHaplotypeList &CurHaplo,

// the number of in-bag samples
const size_t n_samp_ib = vs.idx_inbag.size();
vector<int> StartIdx(nhla);
int st = 0;

if (GPUExtProcPtr && *GPUExtProcPtr->build_haplomatch)
{
// prepare data and check
int StartIdx[nhla], st=0;
for (int i=0; i < nhla; i++)
{
if (CurHaplo.LenPerHLA[i] > 65535)
Expand Down Expand Up @@ -1046,7 +1047,6 @@ void CAlg_EM::PrepareHaplotypes(const CHaplotypeList &CurHaplo,
} else {

// prepare data
int StartIdx[nhla], st=0;
for (int i=0; i < nhla; i++)
{
StartIdx[i] = st;
Expand Down Expand Up @@ -2471,9 +2471,9 @@ void CAttrBag_Model::_Init_GPU_PredHLA()
{
// prepare data structure for GPU
const size_t n_classifier = _ClassifierList.size();
THaplotype* haplo[n_classifier];
int p_n_haplo[n_classifier];
int p_n_snp[n_classifier];
vector<THaplotype*> haplo(n_classifier);
vector<int> p_n_haplo(n_classifier);
vector<int> p_n_snp(n_classifier);

gpu_geno_buf.resize(n_classifier);
vector<CAttrBag_Classifier>::iterator p = _ClassifierList.begin();
Expand All @@ -2487,8 +2487,8 @@ void CAttrBag_Model::_Init_GPU_PredHLA()
}

// call the external function
(*GPUExtProcPtr->predict_init)(nHLA(), n_classifier, haplo,
p_n_haplo, p_n_snp);
(*GPUExtProcPtr->predict_init)(nHLA(), n_classifier, &haplo[0],
&p_n_haplo[0], &p_n_snp[0]);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/samtools_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static int (*bgzf_close)(BGZF *fp) = NULL;
static ssize_t (*bgzf_write)(BGZF *fp, const void *data, ssize_t length) = NULL;


static void init_bgzf()
static void init_bgzf(void)
{
PKG_LOAD(bgzf_open);
PKG_LOAD(bgzf_close);
Expand Down

0 comments on commit 5cdff0e

Please sign in to comment.