Skip to content

Commit

Permalink
Fix gcc6 C++11 warnings. Issue marbl#270.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianwalenz committed Oct 17, 2016
1 parent a183769 commit 37c7d79
Show file tree
Hide file tree
Showing 114 changed files with 881 additions and 893 deletions.
4 changes: 2 additions & 2 deletions src/AS_RUN/fragmentDepth.C
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ computeStuff(uint32 *V, uint32 N,
}

if (histogramBig) {
fprintf(stderr, "histogramBig: "F_U32"\n", histogramBig);
fprintf(stderr, "histogramBig: " F_U32 "\n", histogramBig);
exit(1);
}

Expand Down Expand Up @@ -197,7 +197,7 @@ void outputResult(AS_IID lastiid,
if (E > N) { E = N; }

computeStuff(V, N, i, E, &mode, &mean, &median);
fprintf(stdout, "%s\t"F_U32"\t"F_U32"\t"F_U32"\t%f\t"F_U32"\n", lastiid, i, E, mode, mean, median);
fprintf(stdout, "%s\t" F_U32 "\t" F_U32 "\t" F_U32 "\t%f\t" F_U32 "\n", lastiid, i, E, mode, mean, median);
}
safe_free(V);
}
Expand Down
14 changes: 7 additions & 7 deletions src/AS_UTL/AS_UTL_fileIO.C
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ AS_UTL_safeWrite(FILE *file, const void *buffer, const char *desc, size_t size,

if (errno) {
fprintf(stderr, "safeWrite()-- Write failure on %s: %s\n", desc, strerror(errno));
fprintf(stderr, "safeWrite()-- Wanted to write "F_SIZE_T" objects (size="F_SIZE_T"), wrote "F_SIZE_T".\n",
fprintf(stderr, "safeWrite()-- Wanted to write " F_SIZE_T " objects (size=" F_SIZE_T "), wrote " F_SIZE_T ".\n",
towrite, size, written);
assert(errno == 0);
}
Expand All @@ -92,7 +92,7 @@ AS_UTL_safeWrite(FILE *file, const void *buffer, const char *desc, size_t size,
#ifdef VERIFY_WRITE_POSITIONS
if ((expectedposition > 0) &&
(AS_UTL_ftell(file) != expectedposition)) {
fprintf(stderr, "safeWrite()-- EXPECTED "F_OFF_T", ended up at "F_OFF_T"\n",
fprintf(stderr, "safeWrite()-- EXPECTED " F_OFF_T ", ended up at " F_OFF_T "\n",
expectedposition, AS_UTL_ftell(file));
assert(AS_UTL_ftell(file) == expectedposition);
}
Expand Down Expand Up @@ -121,7 +121,7 @@ AS_UTL_safeRead(FILE *file, void *buffer, const char *desc, size_t size, size_t

if ((errno) && (errno != EINTR)) {
fprintf(stderr, "safeRead()-- Read failure on %s: %s.\n", desc, strerror(errno));
fprintf(stderr, "safeRead()-- Wanted to read "F_SIZE_T" objects (size="F_SIZE_T"), read "F_SIZE_T".\n",
fprintf(stderr, "safeRead()-- Wanted to read " F_SIZE_T " objects (size=" F_SIZE_T "), read " F_SIZE_T ".\n",
toread, size, written);
assert(errno == 0);
}
Expand All @@ -130,7 +130,7 @@ AS_UTL_safeRead(FILE *file, void *buffer, const char *desc, size_t size, size_t
finish:
// Just annoys developers. Stop it.
//if (position != nobj)
// fprintf(stderr, "AS_UTL_safeRead()-- Short read; wanted "F_SIZE_T" objects, read "F_SIZE_T" instead.\n",
// fprintf(stderr, "AS_UTL_safeRead()-- Short read; wanted " F_SIZE_T " objects, read " F_SIZE_T " instead.\n",
// nobj, position);
return(position);
}
Expand Down Expand Up @@ -291,7 +291,7 @@ AS_UTL_sizeOfFile(const char *path) {
sprintf(cmd, "gzip -l %s", path);
F = popen(cmd, "r");
fscanf(F, " %*s %*s %*s %*s ");
fscanf(F, " %*d "F_OFF_T" %*s %*s ", &size);
fscanf(F, " %*d " F_OFF_T " %*s %*s ", &size);
pclose(F);
} else if (strcasecmp(path+strlen(path)-4, ".bz2") == 0) {
size = s.st_size * 14 / 10;
Expand Down Expand Up @@ -345,7 +345,7 @@ AS_UTL_fseek(FILE *stream, off_t offset, int whence) {
if ((whence == SEEK_SET) && (beginpos == offset)) {
#ifdef DEBUG_SEEK
// This isn't terribly informative, and adds a lot of clutter.
//fprintf(stderr, "AS_UTL_fseek()-- seek to "F_OFF_T" (whence=%d); already there\n", offset, whence);
//fprintf(stderr, "AS_UTL_fseek()-- seek to " F_OFF_T " (whence=%d); already there\n", offset, whence);
#endif
return;
}
Expand All @@ -357,7 +357,7 @@ AS_UTL_fseek(FILE *stream, off_t offset, int whence) {
}

#ifdef DEBUG_SEEK
fprintf(stderr, "AS_UTL_fseek()-- seek to "F_OFF_T" (requested "F_OFF_T", whence=%d) from "F_OFF_T"\n",
fprintf(stderr, "AS_UTL_fseek()-- seek to " F_OFF_T " (requested " F_OFF_T ", whence=%d) from " F_OFF_T "\n",
AS_UTL_ftell(stream), offset, whence, beginpos);
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/AS_UTL/AS_UTL_stackTrace.C
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ AS_UTL_envokeGDB(void) {

// Child

sprintf(cmd, "gdb -quiet -silent -p "F_U64" -batch -x commands", pid);
sprintf(cmd, "gdb -quiet -silent -p " F_U64 " -batch -x commands", pid);
system(cmd);
exit(0);
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/AS_UTL/bitPackedArray.C
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ bitPackedArray::get(uint64 idx) {
uint64 p = _valueWidth * (idx % _valuesPerSegment);

if (idx >= _nextElement) {
fprintf(stderr, "bitPackedArray::get()-- element index "F_U64" is out of range, only "F_U64" elements.\n",
fprintf(stderr, "bitPackedArray::get()-- element index " F_U64 " is out of range, only " F_U64 " elements.\n",
idx, _nextElement-1);
return(0xdeadbeefdeadbeefULL);
}
Expand All @@ -80,7 +80,7 @@ bitPackedArray::set(uint64 idx, uint64 val) {
uint64 s = idx / _valuesPerSegment;
uint64 p = _valueWidth * (idx % _valuesPerSegment);

//fprintf(stderr, "s="F_U64" p="F_U64" segments="F_U64"/"F_U64"\n", s, p, _numSegments, _maxSegments);
//fprintf(stderr, "s=" F_U64 " p=" F_U64 " segments=" F_U64 "/" F_U64 "\n", s, p, _numSegments, _maxSegments);

if (idx >= _nextElement)
_nextElement = idx+1;
Expand Down
20 changes: 10 additions & 10 deletions src/AS_UTL/bitPackedArray.H
Original file line number Diff line number Diff line change
Expand Up @@ -164,20 +164,20 @@ public:
}

#ifdef DEBUG_BPH_GET
fprintf(stderr, "test c="F_U64" and p="F_U64" lastVal="F_U64"\n",
fprintf(stderr, "test c=" F_U64 " and p=" F_U64 " lastVal=" F_U64 "\n",
cidx, pidx, _lastVal);
fprintf(stderr, "test c="F_U64"="F_U64"\n",
fprintf(stderr, "test c=" F_U64 "=" F_U64 "\n",
cidx, cval);
fprintf(stderr, "test p="F_U64"="F_U64"\n",
fprintf(stderr, "test p=" F_U64 "=" F_U64 "\n",
pidx, pval);
fprintf(stderr, "test c="F_U64"="F_U64" and p="F_U64"="F_U64"\n",
fprintf(stderr, "test c=" F_U64 "=" F_U64 " and p=" F_U64 "=" F_U64 "\n",
cidx, cval, pidx, pval);
#endif

if (cval < pval) {

#ifdef DEBUG_BPH_GET
fprintf(stderr, "swap c="F_U64"="F_U64" and p="F_U64"="F_U64"\n",
fprintf(stderr, "swap c=" F_U64 "=" F_U64 " and p=" F_U64 "=" F_U64 "\n",
cidx, cval, pidx, pval);
#endif

Expand All @@ -204,7 +204,7 @@ public:
bool more = false;

#ifdef DEBUG_BPH_ADD
fprintf(stderr, "add c="F_U64"="F_U64" -- lastVal="F_U64"\n",
fprintf(stderr, "add c=" F_U64 "=" F_U64 " -- lastVal=" F_U64 "\n",
cidx, cval, _lastVal);
#endif

Expand All @@ -217,20 +217,20 @@ public:
pidx = (cidx-1) / 2;

#ifdef DEBUG_BPH_ADD
fprintf(stderr, "more c="F_U64" and p="F_U64"\n", cidx, pidx);
fprintf(stderr, "more c=" F_U64 " and p=" F_U64 "\n", cidx, pidx);
#endif

pval = _array->get(pidx);

#ifdef DEBUG_BPH_ADD
fprintf(stderr, "test c="F_U64"="F_U64" and p="F_U64"="F_U64"\n",
fprintf(stderr, "test c=" F_U64 "=" F_U64 " and p=" F_U64 "=" F_U64 "\n",
cidx, cval, pidx, pval);
#endif

if (pval > cval) {

#ifdef DEBUG_BPH_ADD
fprintf(stderr, "swap c="F_U64"="F_U64" and p="F_U64"="F_U64"\n",
fprintf(stderr, "swap c=" F_U64 "=" F_U64 " and p=" F_U64 "=" F_U64 "\n",
cidx, cval, pidx, pval);
#endif

Expand All @@ -254,7 +254,7 @@ public:

void dump(void) {
for (uint32 i=0; i<_lastVal; i++)
fprintf(stderr, "HEAP["F_U32"]="F_U64"\n", i, _array->get(i));
fprintf(stderr, "HEAP[" F_U32 "]=" F_U64 "\n", i, _array->get(i));
}

void clear(void) {
Expand Down
10 changes: 5 additions & 5 deletions src/AS_UTL/bitPackedFile.C
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ bitPackedFile::bitPackedFile(char const *name, uint64 offset, bool forceTruncate
fprintf(stderr, "bitPackedFile::bitPackedFile()-- found ");
for (uint32 i=0; i<16; i++)
fprintf(stderr, "%c", isascii(c[i]) ? c[i] : '.');
fprintf(stderr, " at position "F_X64"\n", file_offset);
fprintf(stderr, " at position " F_X64 "\n", file_offset);
exit(1);
}

Expand Down Expand Up @@ -412,7 +412,7 @@ bitPackedFile::seekNormal(uint64 bitpos) {
errno = 0;
lseek(_file, _pos * 8 + endianess_offset, SEEK_SET);
if (errno) {
fprintf(stderr, "bitPackedFile::seekNormal() '%s' seek to pos="F_U64" failed: %s\n",
fprintf(stderr, "bitPackedFile::seekNormal() '%s' seek to pos=" F_U64 " failed: %s\n",
_name,
_pos * 8 + endianess_offset, strerror(errno));
exit(1);
Expand All @@ -421,7 +421,7 @@ bitPackedFile::seekNormal(uint64 bitpos) {
errno = 0;
size_t wordsread = read(_file, _bfr, sizeof(uint64) * _bfrmax);
if (errno) {
fprintf(stderr, "bitPackedFile::seekNormal() '%s' read of "F_U64" bytes failed': %s\n",
fprintf(stderr, "bitPackedFile::seekNormal() '%s' read of " F_U64 " bytes failed': %s\n",
_name,
sizeof(uint64) * _bfrmax,
strerror(errno));
Expand Down Expand Up @@ -459,7 +459,7 @@ bitPackedFile::seek(uint64 bitpos) {
if ((_pos <= np) && (np <= _pos + _bfrmax - 32)) {
_bit = bitpos - (_pos << 6);
stat_seekInside++;
//fprintf(stderr, "SEEK INSIDE to _bit="F_U64"\n", _bit);
//fprintf(stderr, "SEEK INSIDE to _bit=" F_U64 "\n", _bit);
return;
}
}
Expand All @@ -481,7 +481,7 @@ bitPackedFile::seek(uint64 bitpos) {

_forceFirstLoad = false;

//fprintf(stderr, "SEEK OUTSIDE to _pos="F_U64" _bit="F_U64"\n", _pos, _bit);
//fprintf(stderr, "SEEK OUTSIDE to _pos=" F_U64 " _bit=" F_U64 "\n", _pos, _bit);
}


Expand Down
2 changes: 1 addition & 1 deletion src/AS_UTL/bitPackedFile.H
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public:
uint64 loadInCore(void);

void showStats(FILE *f) {
fprintf(f, "inside: "F_U64" outside: "F_U64"\n", stat_seekInside, stat_seekOutside);
fprintf(f, "inside: " F_U64 " outside: " F_U64 "\n", stat_seekInside, stat_seekOutside);
fflush(f);
};
private:
Expand Down
4 changes: 2 additions & 2 deletions src/AS_UTL/kMer.C
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ kMerBuilder::addBaseCompressed(uint64 cf, uint64 cr) {
lb = 9; // No valid last base (should probably be ~uint64ZERO, but that screws up diagnostic output)

#ifdef DEBUGCOMP
fprintf(stderr, "kMerBuilder::addBaseCompressed()-- lb="uint64FMT" cf="uint64FMT" ms="F_U32" ccl="F_U32" lvl="F_U32"\n",
fprintf(stderr, "kMerBuilder::addBaseCompressed()-- lb="uint64FMT" cf="uint64FMT" ms=" F_U32 " ccl=" F_U32 " lvl=" F_U32 "\n",
lb, cf, ms, _compressionCurrentLength, _compression);
#endif

Expand Down Expand Up @@ -392,7 +392,7 @@ kMerBuilder::addBaseCompressed(uint64 cf, uint64 cr) {
ms -= _compressionLength[_compressionIndex]; // subtract the count for the letter we just shifted out

#ifdef DEBUGCOMP
fprintf(stderr, "kMerBuilder::addBaseCompressed()-- ADDNEWBASE shifted out at idx="F_U32" with "F_U32" positions; final span "F_U32"\n",
fprintf(stderr, "kMerBuilder::addBaseCompressed()-- ADDNEWBASE shifted out at idx=" F_U32 " with " F_U32 " positions; final span " F_U32 "\n",
_compressionIndex,
_compressionLength[_compressionIndex],
ms + 1);
Expand Down
10 changes: 5 additions & 5 deletions src/AS_UTL/kMerHuge.H
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public:
val &= uint64MASK(numbits);

if (wrd >= KMER_WORDS) {
fprintf(stderr, "kMer::setBits()-- ERROR: tried to set pos="F_U32" numbits="F_U32" larger than KMER_WORDS=%d\n",
fprintf(stderr, "kMer::setBits()-- ERROR: tried to set pos=" F_U32 " numbits=" F_U32 " larger than KMER_WORDS=%d\n",
pos, numbits, KMER_WORDS), exit(1);
}

Expand All @@ -274,7 +274,7 @@ public:
MERWORD(wrd) |= val << bit;
} else {
if (wrd+1 >= KMER_WORDS) {
fprintf(stderr, "kMer::setBits()-- ERROR: tried to set pos="F_U32" numbits="F_U32" larger than KMER_WORDS=%d\n",
fprintf(stderr, "kMer::setBits()-- ERROR: tried to set pos=" F_U32 " numbits=" F_U32 " larger than KMER_WORDS=%d\n",
pos, numbits, KMER_WORDS), exit(1);
}

Expand All @@ -295,15 +295,15 @@ public:
uint32 bit = pos & 0x3f;

if (wrd >= KMER_WORDS) {
fprintf(stderr, "kMer::getBits()-- ERROR: tried to get pos="F_U32" numbits="F_U32" larger than KMER_WORDS=%d\n",
fprintf(stderr, "kMer::getBits()-- ERROR: tried to get pos=" F_U32 " numbits=" F_U32 " larger than KMER_WORDS=%d\n",
pos, numbits, KMER_WORDS), exit(1);
}

if (64 - bit >= numbits) {
val = MERWORD(wrd) >> bit;
} else {
if (wrd+1 >= KMER_WORDS) {
fprintf(stderr, "kMer::getBits()-- ERROR: tried to get pos="F_U32" numbits="F_U32" larger than KMER_WORDS=%d\n",
fprintf(stderr, "kMer::getBits()-- ERROR: tried to get pos=" F_U32 " numbits=" F_U32 " larger than KMER_WORDS=%d\n",
pos, numbits, KMER_WORDS), exit(1);
}

Expand Down Expand Up @@ -395,7 +395,7 @@ kMerHuge::setMerSize(uint32 ms) {
}

if (_maskWord >= KMER_WORDS) {
fprintf(stderr, "kMer::setMerSize()-- ERROR! Desired merSize of "F_U32" larger than\n", _merSize);
fprintf(stderr, "kMer::setMerSize()-- ERROR! Desired merSize of " F_U32 " larger than\n", _merSize);
fprintf(stderr, " available storage space (KMER_WORDS=%d, max merSize %d).\n", KMER_WORDS, KMER_WORDS*32);
exit(1);
}
Expand Down
4 changes: 2 additions & 2 deletions src/AS_UTL/memoryMappedFile.H
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public:
: mmap(0L, _length, PROT_READ | PROT_WRITE, MAP_FILE | MAP_SHARED, fd, 0);

if (errno)
fprintf(stderr, "memoryMappedFile()-- Couldn't mmap '%s' of length "F_SIZE_T": %s\n", _name, _length, strerror(errno)), exit(1);
fprintf(stderr, "memoryMappedFile()-- Couldn't mmap '%s' of length " F_SIZE_T ": %s\n", _name, _length, strerror(errno)), exit(1);

close(fd);

Expand All @@ -135,7 +135,7 @@ public:
length = _length - offset;

if (offset + length > _length)
fprintf(stderr, "memoryMappedFile()-- Requested "F_SIZE_T" bytes at position "F_SIZE_T" in file '%s', but only "F_SIZE_T" bytes in file.\n",
fprintf(stderr, "memoryMappedFile()-- Requested " F_SIZE_T " bytes at position " F_SIZE_T " in file '%s', but only " F_SIZE_T " bytes in file.\n",
length, offset, _name, _length), exit(1);

_offset = offset + length;
Expand Down
6 changes: 3 additions & 3 deletions src/AS_UTL/readBuffer.C
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ readBuffer::fillBuffer(void) {
if (errno == EAGAIN)
goto again;
if (errno)
fprintf(stderr, "readBuffer::fillBuffer()-- only read "F_U64" bytes, couldn't read "F_U64" bytes from '%s': %s\n",
fprintf(stderr, "readBuffer::fillBuffer()-- only read " F_U64 " bytes, couldn't read " F_U64 " bytes from '%s': %s\n",
_bufferLen, _bufferMax, _filename, strerror(errno)), exit(1);

if (_bufferLen == 0)
Expand Down Expand Up @@ -209,7 +209,7 @@ readBuffer::seek(uint64 pos) {
errno = 0;
lseek(_file, pos, SEEK_SET);
if (errno)
fprintf(stderr, "readBuffer()-- '%s' couldn't seek to position "F_U64": %s\n",
fprintf(stderr, "readBuffer()-- '%s' couldn't seek to position " F_U64 ": %s\n",
_filename, pos, strerror(errno)), exit(1);

_bufferLen = 0;
Expand Down Expand Up @@ -272,7 +272,7 @@ readBuffer::read(void *buf, uint64 len) {
errno = 0;
bAct = (uint64)::read(_file, bufchar + bCopied + bRead, len - bCopied - bRead);
if (errno)
fprintf(stderr, "readBuffer()-- couldn't read "F_U64" bytes from '%s': n%s\n",
fprintf(stderr, "readBuffer()-- couldn't read " F_U64 " bytes from '%s': n%s\n",
len, _filename, strerror(errno)), exit(1);

// If we hit EOF, return a short read
Expand Down
2 changes: 1 addition & 1 deletion src/AS_UTL/stddev.H
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ public:
fprintf(F, "#%s\tquantity\n", label);

for (uint64 ii=0; ii <= _histogramMax; ii++)
fprintf(F, F_U64"\t"F_U64"\n", ii, _histogram[ii]);
fprintf(F, F_U64"\t" F_U64 "\n", ii, _histogram[ii]);
};


Expand Down
Loading

0 comments on commit 37c7d79

Please sign in to comment.