Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 434054c

Browse filesBrowse files
stasoidtordex
authored andcommitted
fix Visual Studio warnings
1 parent 986a9c5 commit 434054c
Copy full SHA for 434054c

File tree

Expand file treeCollapse file tree

7 files changed

+38
-39
lines changed
Filter options
Expand file treeCollapse file tree

7 files changed

+38
-39
lines changed

‎containers/test/Bitmap.cpp

Copy file name to clipboardExpand all lines: containers/test/Bitmap.cpp
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ void Bitmap::draw_line(int x0, int y0, int x1, int y1, web_color color)
3636
}
3737
}
3838

39-
void Bitmap::draw_rect(int x, int y, int width, int height, web_color color)
39+
void Bitmap::draw_rect(int x, int y, int _width, int _height, web_color color)
4040
{
41-
draw_line(x, y, x + width, y, color); // top
42-
draw_line(x, y + height - 1, x + width, y + height - 1, color); // bottom
43-
draw_line(x, y, x, y + height, color); // left
44-
draw_line(x + width - 1, y, x + width - 1, y + height, color); // right
41+
draw_line(x, y, x + _width, y, color); // top
42+
draw_line(x, y + _height - 1, x + _width, y + _height - 1, color); // bottom
43+
draw_line(x, y, x, y + _height, color); // left
44+
draw_line(x + _width - 1, y, x + _width - 1, y + _height, color); // right
4545
}
4646

4747
void Bitmap::fill_rect(position rect, web_color color)

‎include/litehtml/types.h

Copy file name to clipboardExpand all lines: include/litehtml/types.h
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ namespace litehtml
108108
height = sz.height;
109109
}
110110

111-
void move_to(int x, int y)
111+
void move_to(int _x, int _y)
112112
{
113-
this->x = x;
114-
this->y = y;
113+
x = _x;
114+
y = _y;
115115
}
116116

117117
bool does_intersect(const position* val) const
@@ -139,9 +139,9 @@ namespace litehtml
139139
return false;
140140
}
141141

142-
bool is_point_inside(int x, int y) const
142+
bool is_point_inside(int _x, int _y) const
143143
{
144-
if(x >= left() && x <= right() && y >= top() && y <= bottom())
144+
if(_x >= left() && _x <= right() && _y >= top() && _y <= bottom())
145145
{
146146
return true;
147147
}

‎src/document_container.cpp

Copy file name to clipboardExpand all lines: src/document_container.cpp
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void litehtml::document_container::split_text(const char* text, const std::funct
1616
on_word(wchar_to_utf8(str.c_str()));
1717
str.clear();
1818
}
19-
str += c;
19+
str += (wchar_t)c;
2020
on_space(wchar_to_utf8(str.c_str()));
2121
str.clear();
2222
}
@@ -28,13 +28,13 @@ void litehtml::document_container::split_text(const char* text, const std::funct
2828
on_word(wchar_to_utf8(str.c_str()));
2929
str.clear();
3030
}
31-
str += c;
31+
str += (wchar_t)c;
3232
on_word(wchar_to_utf8(str.c_str()));
3333
str.clear();
3434
}
3535
else
3636
{
37-
str += c;
37+
str += (wchar_t)c;
3838
}
3939
}
4040
if (!str.empty())

‎src/encodings.cpp

Copy file name to clipboardExpand all lines: src/encodings.cpp
+16-16Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct decoder
2727
// invalid value of code_point or pointer (in std terminology, pointer is an offset into index table).
2828
// it is called null to match the standard.
2929
enum { null = -2 };
30-
static_assert(null != 0 && null != EOF);
30+
static_assert(null != 0 && null != EOF, "");
3131

3232
// https://encoding.spec.whatwg.org/#index-code-point
3333
template<int N>
@@ -407,9 +407,9 @@ decoder::result single_byte_decoder::handler(string& input, int& index, int ch[2
407407

408408
struct gb18030_decoder : decoder
409409
{
410-
byte m_first = 0;
411-
byte m_second = 0;
412-
byte m_third = 0;
410+
int m_first = 0;
411+
int m_second = 0;
412+
int m_third = 0;
413413

414414
result handler(string& input, int& index, int ch[2]) override;
415415

@@ -536,7 +536,7 @@ decoder::result gb18030_decoder::handler(string& input, int& index, int ch[2])
536536
}
537537

538538
// 2.
539-
byte lead = m_first;
539+
int lead = m_first;
540540
int pointer = null;
541541
m_first = 0;
542542

@@ -593,7 +593,7 @@ decoder::result gb18030_decoder::handler(string& input, int& index, int ch[2])
593593

594594
struct big5_decoder : decoder
595595
{
596-
byte m_lead = 0;
596+
int m_lead = 0;
597597

598598
result handler(string& input, int& index, int ch[2]) override;
599599

@@ -689,7 +689,7 @@ int jis_decoder::m_jis0212_index[] = {null,null,null,null,null,null,null,null,nu
689689

690690
struct euc_jp_decoder : jis_decoder
691691
{
692-
byte m_lead = 0;
692+
int m_lead = 0;
693693
bool m_jis0212 = false;
694694

695695
result handler(string& input, int& index, int ch[2]) override;
@@ -797,7 +797,7 @@ struct iso_2022_jp_decoder : jis_decoder
797797
ESCAPE
798798
};
799799

800-
byte m_lead = 0;
800+
int m_lead = 0;
801801
state m_state = ASCII;
802802
state m_output_state = ASCII;
803803
bool m_output = false;
@@ -980,7 +980,7 @@ decoder::result iso_2022_jp_decoder::handler(inout string& input, inout int& ind
980980
}
981981
// 8. If byte is end-of-queue, then prepend lead to ioQueue. Otherwise, prepend lead and byte to ioQueue.
982982
if (b == EOF)
983-
input.insert(index, 1, lead);
983+
input.insert(index, 1, (char)lead);
984984
else
985985
input.insert(index, {(char)lead, (char)b});
986986
// 9.
@@ -1001,7 +1001,7 @@ decoder::result iso_2022_jp_decoder::handler(inout string& input, inout int& ind
10011001

10021002
struct shift_jis_decoder : jis_decoder
10031003
{
1004-
byte m_lead = 0;
1004+
int m_lead = 0;
10051005

10061006
result handler(string& input, int& index, int ch[2]) override;
10071007
};
@@ -1090,7 +1090,7 @@ decoder::result shift_jis_decoder::handler(inout string& input, inout int& index
10901090

10911091
struct euc_kr_decoder : decoder
10921092
{
1093-
byte m_lead = 0;
1093+
int m_lead = 0;
10941094

10951095
result handler(string& input, int& index, int ch[2]) override;
10961096

@@ -1119,7 +1119,7 @@ decoder::result euc_kr_decoder::handler(inout string& input, inout int& index, o
11191119
// 3.
11201120
if (m_lead != 0)
11211121
{
1122-
byte lead = m_lead;
1122+
int lead = m_lead;
11231123
int pointer = null;
11241124
m_lead = 0;
11251125

@@ -1726,7 +1726,7 @@ bool prescan_get_attribute(const string& str, inout size_t& index, out string& n
17261726
else if (str[index] == '/' || str[index] == '>')
17271727
return true;
17281728
else // A..Z or anything else
1729-
name += lowcase(str[index]);
1729+
name += (char)lowcase(str[index]);
17301730

17311731
// 5.
17321732
increment(index, str);
@@ -1766,22 +1766,22 @@ bool prescan_get_attribute(const string& str, inout size_t& index, out string& n
17661766

17671767
// 4,5.
17681768
else
1769-
value += lowcase(str[index]);
1769+
value += (char)lowcase(str[index]);
17701770

17711771
// 6.
17721772
goto quote_loop;
17731773
}
17741774
else if (str[index] == '>')
17751775
return true;
17761776
else // A..Z or anything else
1777-
value += lowcase(str[index]);
1777+
value += (char)lowcase(str[index]);
17781778

17791779
// 11.
17801780
step_11:
17811781
if (is_whitespace(str[index]) || str[index] == '>')
17821782
return true;
17831783
else // A..Z or anything else
1784-
value += lowcase(str[index]);
1784+
value += (char)lowcase(str[index]);
17851785

17861786
// 12.
17871787
increment(index, str);

‎src/html.cpp

Copy file name to clipboardExpand all lines: src/html.cpp
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void lcase(string &s)
2828
{
2929
for(char & i : s)
3030
{
31-
i = t_tolower(i);
31+
i = (char)t_tolower(i);
3232
}
3333
}
3434

‎src/style.cpp

Copy file name to clipboardExpand all lines: src/style.cpp
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ void style::add_property(string_id name, const string& val, const string& baseur
9292
if (val.find("var(") != string::npos) return add_parsed_property(name, property_value(val, important, prop_type_var));
9393
if (val == "inherit" && name != _font_) return add_parsed_property(name, property_value(important, prop_type_inherit));
9494

95-
int idx;
9695
string url;
9796
css_length len[4], length;
9897

@@ -131,14 +130,14 @@ void style::add_property(string_id name, const string& val, const string& baseur
131130
case _align_content_:
132131

133132
case _caption_side_:
134-
135-
idx = value_index(val, m_valid_values[name]);
133+
{
134+
int idx = value_index(val, m_valid_values[name]);
136135
if (idx >= 0)
137136
{
138137
add_parsed_property(name, property_value(idx, important));
139138
}
140139
break;
141-
140+
}
142141
case _align_items_:
143142
case _align_self_:
144143
parse_align_self(name, val, important);
@@ -736,7 +735,7 @@ bool style::parse_one_background(const string& val, document_container* containe
736735

737736
if (position != "")
738737
{
739-
string_vector tokens;
738+
tokens.clear();
740739
split_string(position, tokens, "/");
741740

742741
if (tokens.size() > 2) return false;

‎src/utf8_strings.cpp

Copy file name to clipboardExpand all lines: src/utf8_strings.cpp
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ utf8_to_wchar::utf8_to_wchar(const char* val)
1313
{
1414
ucode_t wch = get_char();
1515
if (!wch) break;
16-
m_str += wch;
16+
m_str += (wchar_t)wch;
1717
}
1818
}
1919

@@ -73,7 +73,7 @@ void append_char(string& str, int code)
7373
}
7474
else if (code <= 0x7FF)
7575
{
76-
str += (code >> 6) + 192;
76+
str += char((code >> 6) + 192);
7777
str += (code & 63) + 128;
7878
}
7979
else if (0xd800 <= code && code <= 0xdfff)
@@ -82,13 +82,13 @@ void append_char(string& str, int code)
8282
}
8383
else if (code <= 0xFFFF)
8484
{
85-
str += (code >> 12) + 224;
85+
str += char((code >> 12) + 224);
8686
str += ((code >> 6) & 63) + 128;
8787
str += (code & 63) + 128;
8888
}
8989
else if (code <= 0x10FFFF)
9090
{
91-
str += (code >> 18) + 240;
91+
str += char((code >> 18) + 240);
9292
str += ((code >> 12) & 63) + 128;
9393
str += ((code >> 6) & 63) + 128;
9494
str += (code & 63) + 128;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.