Skip to content

Commit 92be77a

Browse files
committed
Merge pull request #1388 from mgreter/fix/msvc-warnings
Fix a few MSVC warnings
2 parents 434327b + c6d43fd commit 92be77a

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

src/ast.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1711,7 +1711,7 @@ namespace Sass {
17111711
}
17121712
// otherwise get the possible resolved color name
17131713
else {
1714-
int numval = r * 0x10000 + g * 0x100 + b;
1714+
double numval = r * 0x10000 + g * 0x100 + b;
17151715
if (color_to_name(numval))
17161716
res_name = color_to_name(numval);
17171717
}

src/color_maps.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,11 +627,16 @@ namespace Sass {
627627
return 0;
628628
}
629629

630+
const char* color_to_name(const double key)
631+
{
632+
return color_to_name((int)key);
633+
}
634+
630635
const char* color_to_name(const Color& c)
631636
{
632-
int key = c.r() * 0x10000
633-
+ c.g() * 0x100
634-
+ c.b();
637+
double key = c.r() * 0x10000
638+
+ c.g() * 0x100
639+
+ c.b();
635640
return color_to_name(key);
636641
}
637642

src/color_maps.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ namespace Sass {
326326
extern const Color* name_to_color(const std::string);
327327
extern const char* color_to_name(const int);
328328
extern const char* color_to_name(const Color&);
329+
extern const char* color_to_name(const double);
329330

330331
}
331332

win/libsass.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
<LinkIncremental>false</LinkIncremental>
117117
<TargetName>sassc</TargetName>
118118
<OutDir>$(SolutionDir)bin\</OutDir>
119-
<IntDir>$(SolutionDir)bin\obj</IntDir>
119+
<IntDir>$(SolutionDir)bin\obj\</IntDir>
120120
</PropertyGroup>
121121
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
122122
<LinkIncremental>false</LinkIncremental>

0 commit comments

Comments
 (0)