Skip to content

Commit

Permalink
Fix compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ch4rr0 committed Jun 30, 2021
1 parent b4d6ed8 commit a8441a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion shmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#ifdef BOWTIE_SHARED_MEM

#include <iostream>
#include <string>
#include <sys/shm.h>
#include <unistd.h>
Expand Down Expand Up @@ -102,7 +103,7 @@ bool allocSharedMem(std::string fname,
cerr << "shmctl returned " << ret << " for IPC_STAT and errno is " << errno << endl;
throw 1;
}
if(ds.shm_segsz != shmemLen) {
if((size_t)ds.shm_segsz != shmemLen) {
cerr << "Warning: shared-memory chunk's segment size (" << ds.shm_segsz
<< ") doesn't match expected size (" << shmemLen << ")" << endl
<< "Deleting old shared memory block and trying again." << endl;
Expand Down
2 changes: 1 addition & 1 deletion util.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ char* itoa10(const T& value, char* result) {
// Only apply negative sign for base 10
if(std::numeric_limits<T>::is_signed) {
// Avoid compiler warning in cases where T is unsigned
if (value <= 0 && value != 0) *out++ = '-';
if (value < 0) *out++ = '-';
}
std::reverse( result, out );
*out = 0; // terminator
Expand Down

0 comments on commit a8441a5

Please sign in to comment.