Skip to content

Commit

Permalink
Fix array sizes. Use %p for printing pointer addresses. Fix global ex…
Browse files Browse the repository at this point in the history
…terns.
  • Loading branch information
bumblenick authored and MatthewMah committed Aug 15, 2024
1 parent 53793dc commit de6d9ee
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/h2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ remaph2d (SNP ** snpmarkers, int numsnps, Indiv ** indivmarkers,
int *tind, tt, t, i, j, k, j1, j2;
Indiv *indx;
SNP *cupt;
char s1[50], s2[50];
char s1[IDSIZE+10], s2[IDSIZE+10];

ZALLOC (g2, numind2, int);
ZALLOC (g1, numindivs, int);
Expand Down
2 changes: 1 addition & 1 deletion src/mapfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ genFile* constructMap(char* filename, long numrows, long rowSize, long hdrSize)
geno -> hdrSize = hdrSize ;
geno->snps = (char*) mmfaddr;

printf("mmfaddr: %x fileLength: %ld\n", geno -> snps, fileLength) ;;
printf("mmfaddr: %p fileLength: %ld\n", geno -> snps, fileLength) ;;
fflush(stdout) ;

return geno;
Expand Down
4 changes: 2 additions & 2 deletions src/qpAdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2064,8 +2064,8 @@ void loadymv(double *ymean, double *yvar, char *fstatsname, char **popllist, ch

int mkfstats(char *parname)
{
char sss[256] ;
char fsx[256] ;
char sss[512] ;
char fsx[256+10] ;
char ppp[256] ;
char pops[256] ;
char tpar[256] ;
Expand Down
9 changes: 2 additions & 7 deletions src/qpGraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,11 +431,6 @@ main (int argc, char **argv)
printf ("graph: %s\n", graphname);


/**
sprintf(sss, "cat %s", graphname) ;
system(sss) ;
fflush(stdout) ;
*/
printnl ();
printnl ();

Expand Down Expand Up @@ -1351,7 +1346,7 @@ printfit (double *ww)
double y, worstz, y1, y2, x1, x2, diff, sig, z;
double *ffaa ;
FILE *outff;
char ss[MAXSTR], ssworst[MAXSTR], *ssx ;
char ss[MAXSTR*2], ssworst[MAXSTR*2], *ssx ;
int isworst ;
char **ancnames ;

Expand Down Expand Up @@ -2932,7 +2927,7 @@ int usage (char *prog, int exval)

void mkfstats(char *parname)
{
char sss[128] ;
char sss[512] ;
char fsx[128] ;
char ppp[128] ;
char pops[128] ;
Expand Down
2 changes: 1 addition & 1 deletion src/qpWave.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ void loadymv(double *ymean, double *yvar, char *fstatsname, char **popllist, ch

int mkfstats(char *parname)
{
char sss[256] ;
char sss[512] ;
char fsx[256] ;
char ppp[256] ;
char pops[256] ;
Expand Down
2 changes: 1 addition & 1 deletion src/qpmix.c
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,7 @@ void printcv(double *coeffs, double *var, int n)
int mkfstats(char *parname)
// modified from qpAdm
{
char sss[256] ;
char sss[512] ;
char fsx[256] ;
char ppp[256] ;
char pops[256] ;
Expand Down
4 changes: 2 additions & 2 deletions src/snpunion.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "mcio.h"
#include "mcmcpars.h"

#define WVERSION "2500"
#define WVERSION "2501"
#define MAXFL 50
#define MAXSTR 512

Expand Down Expand Up @@ -64,7 +64,7 @@ int lopos = -999999999 ;
int hipos = 999999999 ;
int minchrom = 1 ;
int maxchrom = 97 ;
long rlen, packlen ;
extern long rlen, packlen ;

/**
docheck YES allele flipping check
Expand Down

0 comments on commit de6d9ee

Please sign in to comment.