Skip to content

Commit 3e65e9d

Browse files
committed
Use uint32 instead of uint
`uint` is not a standard type. `uint32` is a typedef for `unsigned int` which is a standard type.
1 parent a1831e1 commit 3e65e9d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

compact_enc_det/compact_enc_det.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2208,9 +2208,9 @@ void InitialBytesBoost(const uint8* src,
22082208
DetectEncodingState* destatep) {
22092209
if (text_length < 4) {return;}
22102210

2211-
uint pair01 = (src[0] << 8) | src[1];
2212-
uint pair23 = (src[2] << 8) | src[3];
2213-
uint quad0123 = (pair01 << 16) | pair23;
2211+
uint32 pair01 = (src[0] << 8) | src[1];
2212+
uint32 pair23 = (src[2] << 8) | src[3];
2213+
uint32 quad0123 = (pair01 << 16) | pair23;
22142214

22152215
bool utf_16_indication = false;
22162216
bool utf_32_indication = false;

compact_enc_det/compact_enc_det_hint_code.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ string MakeChar44(const string& str) {
109109
string res("________"); // eight underscores
110110
int l_ptr = 0;
111111
int d_ptr = 0;
112-
for (uint i = 0; i < str.size(); ++i) {
112+
for (uint32 i = 0; i < str.size(); ++i) {
113113
uint8 uc = static_cast<uint8>(str[i]);
114114
if (kIsAlpha[uc]) {
115115
if (l_ptr < 4) { // Else ignore
@@ -138,7 +138,7 @@ string MakeChar44(const string& str) {
138138
string MakeChar4(const string& str) {
139139
string res("____"); // four underscores
140140
int l_ptr = 0;
141-
for (uint i = 0; i < str.size(); ++i) {
141+
for (uint32 i = 0; i < str.size(); ++i) {
142142
uint8 uc = static_cast<uint8>(str[i]);
143143
if (kIsAlpha[uc] | kIsDigit[uc]) {
144144
if (l_ptr < 4) { // Else ignore
@@ -156,7 +156,7 @@ string MakeChar4(const string& str) {
156156
string MakeChar8(const string& str) {
157157
string res("________"); // eight dots
158158
int l_ptr = 0;
159-
for (uint i = 0; i < str.size(); ++i) {
159+
for (uint32 i = 0; i < str.size(); ++i) {
160160
uint8 uc = static_cast<uint8>(str[i]);
161161
if (kIsAlpha[uc] | kIsDigit[uc]) {
162162
if (l_ptr < 8) { // Else ignore

0 commit comments

Comments
 (0)