Skip to content

Commit

Permalink
Fix 'implicit fallthrough' warnings (addresses issue rimmartin#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
trueqbit committed Sep 3, 2020
1 parent e7801c1 commit ef6d9f1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/algorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <cstring>
#include <pion/algorithm.hpp>
#include <boost/assert.hpp>
#include <boost/config.hpp>

// macro to shift bitmask by a single bit
#define SHIFT_BITMASK(ptr, mask) if (mask & 0x01) { mask = 0x80; ++ptr; } else mask >>= 1;
Expand Down Expand Up @@ -212,10 +213,13 @@ std::string algorithm::url_encode(const std::string& str)
result += str[pos];
break;
}
// else pass through to next case
case ' ':
BOOST_FALLTHROUGH;
case ' ':
BOOST_FALLTHROUGH;
case '$': case '&': case '+': case ',': case '/': case ':':
BOOST_FALLTHROUGH;
case ';': case '=': case '?': case '@': case '"': case '<':
BOOST_FALLTHROUGH;
case '>': case '#': case '%': case '{': case '}': case '|':
case '\\': case '^': case '~': case '[': case ']': case '`':
// the character needs to be encoded
Expand Down
4 changes: 4 additions & 0 deletions src/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <sys/stat.h>
#endif

#include <boost/config.hpp>
#include <boost/filesystem.hpp>
#include <boost/date_time.hpp>

Expand Down Expand Up @@ -63,8 +64,11 @@ BOOL WINAPI console_ctrl_handler(DWORD ctrl_type)
{
switch(ctrl_type) {
case CTRL_C_EVENT:
BOOST_FALLTHROUGH;
case CTRL_BREAK_EVENT:
BOOST_FALLTHROUGH;
case CTRL_CLOSE_EVENT:
BOOST_FALLTHROUGH;
case CTRL_SHUTDOWN_EVENT:
process::shutdown();
return TRUE;
Expand Down

0 comments on commit ef6d9f1

Please sign in to comment.