Skip to content

Commit

Permalink
Merge pull request #12 from sonicdoe/clang
Browse files Browse the repository at this point in the history
Fix compiling on macOS
  • Loading branch information
JinsukKim committed Jan 31, 2019
2 parents a1831e1 + 3e65e9d commit 9357fb5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions compact_enc_det/compact_enc_det.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2208,9 +2208,9 @@ void InitialBytesBoost(const uint8* src,
DetectEncodingState* destatep) {
if (text_length < 4) {return;}

uint pair01 = (src[0] << 8) | src[1];
uint pair23 = (src[2] << 8) | src[3];
uint quad0123 = (pair01 << 16) | pair23;
uint32 pair01 = (src[0] << 8) | src[1];
uint32 pair23 = (src[2] << 8) | src[3];
uint32 quad0123 = (pair01 << 16) | pair23;

bool utf_16_indication = false;
bool utf_32_indication = false;
Expand Down
6 changes: 3 additions & 3 deletions compact_enc_det/compact_enc_det_hint_code.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ string MakeChar44(const string& str) {
string res("________"); // eight underscores
int l_ptr = 0;
int d_ptr = 0;
for (uint i = 0; i < str.size(); ++i) {
for (uint32 i = 0; i < str.size(); ++i) {
uint8 uc = static_cast<uint8>(str[i]);
if (kIsAlpha[uc]) {
if (l_ptr < 4) { // Else ignore
Expand Down Expand Up @@ -138,7 +138,7 @@ string MakeChar44(const string& str) {
string MakeChar4(const string& str) {
string res("____"); // four underscores
int l_ptr = 0;
for (uint i = 0; i < str.size(); ++i) {
for (uint32 i = 0; i < str.size(); ++i) {
uint8 uc = static_cast<uint8>(str[i]);
if (kIsAlpha[uc] | kIsDigit[uc]) {
if (l_ptr < 4) { // Else ignore
Expand All @@ -156,7 +156,7 @@ string MakeChar4(const string& str) {
string MakeChar8(const string& str) {
string res("________"); // eight dots
int l_ptr = 0;
for (uint i = 0; i < str.size(); ++i) {
for (uint32 i = 0; i < str.size(); ++i) {
uint8 uc = static_cast<uint8>(str[i]);
if (kIsAlpha[uc] | kIsDigit[uc]) {
if (l_ptr < 8) { // Else ignore
Expand Down

0 comments on commit 9357fb5

Please sign in to comment.