Skip to content

Commit ce4ef08

Browse files
committed
Update to VS2015
Fix 64bit warnings and use std algorithms for doing binary searches
1 parent 4c987ba commit ce4ef08

File tree

9 files changed

+214
-111
lines changed

9 files changed

+214
-111
lines changed

.gitignore

Lines changed: 171 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,56 @@
1-
## From https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
2-
31
## Ignore Visual Studio temporary files, build results, and
42
## files generated by popular Visual Studio add-ons.
3+
##
4+
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
55

66
# User-specific files
77
*.suo
88
*.user
9+
*.userosscache
910
*.sln.docstates
1011

11-
# Build results
12+
# User-specific files (MonoDevelop/Xamarin Studio)
13+
*.userprefs
1214

15+
# Build results
1316
[Dd]ebug/
17+
[Dd]ebugPublic/
1418
[Rr]elease/
19+
[Rr]eleases/
1520
x64/
16-
build/
21+
x86/
22+
bld/
1723
[Bb]in/
1824
[Oo]bj/
25+
[Ll]og/
26+
27+
# Visual Studio 2015 cache/options directory
28+
.vs/
29+
# Uncomment if you have tasks that create the project's static files in wwwroot
30+
#wwwroot/
1931

2032
# MSTest test Results
2133
[Tt]est[Rr]esult*/
2234
[Bb]uild[Ll]og.*
2335

36+
# NUNIT
37+
*.VisualState.xml
38+
TestResult.xml
39+
40+
# Build Results of an ATL Project
41+
[Dd]ebugPS/
42+
[Rr]eleasePS/
43+
dlldata.c
44+
45+
# .NET Core
46+
project.lock.json
47+
project.fragment.lock.json
48+
artifacts/
49+
**/Properties/launchSettings.json
50+
2451
*_i.c
2552
*_p.c
53+
*_i.h
2654
*.ilk
2755
*.meta
2856
*.obj
@@ -42,38 +70,64 @@ build/
4270
*.vssscc
4371
.builds
4472
*.pidb
45-
*.log
73+
*.svclog
4674
*.scc
4775

76+
# Chutzpah Test files
77+
_Chutzpah*
78+
4879
# Visual C++ cache files
4980
ipch/
5081
*.aps
5182
*.ncb
83+
*.opendb
5284
*.opensdf
5385
*.sdf
5486
*.cachefile
87+
*.VC.db
88+
*.VC.VC.opendb
5589

5690
# Visual Studio profiler
5791
*.psess
5892
*.vsp
5993
*.vspx
94+
*.sap
95+
96+
# TFS 2012 Local Workspace
97+
$tf/
6098

6199
# Guidance Automation Toolkit
62100
*.gpState
63101

64102
# ReSharper is a .NET coding add-in
65103
_ReSharper*/
66104
*.[Rr]e[Ss]harper
105+
*.DotSettings.user
106+
107+
# JustCode is a .NET coding add-in
108+
.JustCode
67109

68110
# TeamCity is a build add-in
69111
_TeamCity*
70112

71113
# DotCover is a Code Coverage Tool
72114
*.dotCover
73115

116+
# Visual Studio code coverage results
117+
*.coverage
118+
*.coveragexml
119+
74120
# NCrunch
75-
*.ncrunch*
121+
_NCrunch_*
76122
.*crunch*.local.xml
123+
nCrunchTemp_*
124+
125+
# MightyMoose
126+
*.mm.*
127+
AutoTest.Net/
128+
129+
# Web workbench (sass)
130+
.sass-cache/
77131

78132
# Installshield output folder
79133
[Ee]xpress/
@@ -92,69 +146,146 @@ DocProject/Help/html
92146
publish/
93147

94148
# Publish Web Output
95-
*.Publish.xml
149+
*.[Pp]ublish.xml
150+
*.azurePubxml
151+
# TODO: Comment the next line if you want to checkin your web deploy settings
152+
# but database connection strings (with potential passwords) will be unencrypted
96153
*.pubxml
154+
*.publishproj
97155

98-
# NuGet Packages Directory
99-
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
100-
#packages/
156+
# Microsoft Azure Web App publish settings. Comment the next line if you want to
157+
# checkin your Azure Web App publish settings, but sensitive information contained
158+
# in these scripts will be unencrypted
159+
PublishScripts/
101160

102-
# Windows Azure Build Output
103-
csx
161+
# NuGet Packages
162+
*.nupkg
163+
# The packages folder can be ignored because of Package Restore
164+
**/packages/*
165+
# except build/, which is used as an MSBuild target.
166+
!**/packages/build/
167+
# Uncomment if necessary however generally it will be regenerated when needed
168+
#!**/packages/repositories.config
169+
# NuGet v3's project.json files produces more ignorable files
170+
*.nuget.props
171+
*.nuget.targets
172+
173+
# Microsoft Azure Build Output
174+
csx/
104175
*.build.csdef
105176

106-
# Windows Store app package directory
177+
# Microsoft Azure Emulator
178+
ecf/
179+
rcf/
180+
181+
# Windows Store app package directories and files
107182
AppPackages/
183+
BundleArtifacts/
184+
Package.StoreAssociation.xml
185+
_pkginfo.txt
186+
187+
# Visual Studio cache files
188+
# files ending in .cache can be ignored
189+
*.[Cc]ache
190+
# but keep track of directories ending in .cache
191+
!*.[Cc]ache/
108192

109193
# Others
110-
sql/
111-
*.Cache
112194
ClientBin/
113-
[Ss]tyle[Cc]op.*
114195
~$*
115196
*~
116197
*.dbmdl
117-
*.[Pp]ublish.xml
198+
*.dbproj.schemaview
199+
*.jfm
118200
*.pfx
119201
*.publishsettings
202+
orleans.codegen.cs
203+
204+
# Since there are multiple workflows, uncomment next line to ignore bower_components
205+
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
206+
#bower_components/
120207

121208
# RIA/Silverlight projects
122209
Generated_Code/
123210

124-
# Backup & report files from converting an old project file to a newer
125-
# Visual Studio version. Backup files are not needed, because we have git ;-)
211+
# Backup & report files from converting an old project file
212+
# to a newer Visual Studio version. Backup files are not needed,
213+
# because we have git ;-)
126214
_UpgradeReport_Files/
127215
Backup*/
128216
UpgradeLog*.XML
129217
UpgradeLog*.htm
130218

131219
# SQL Server files
132-
App_Data/*.mdf
133-
App_Data/*.ldf
220+
*.mdf
221+
*.ldf
222+
*.ndf
223+
224+
# Business Intelligence projects
225+
*.rdl.data
226+
*.bim.layout
227+
*.bim_*.settings
228+
229+
# Microsoft Fakes
230+
FakesAssemblies/
231+
232+
# GhostDoc plugin setting file
233+
*.GhostDoc.xml
234+
235+
# Node.js Tools for Visual Studio
236+
.ntvs_analysis.dat
237+
node_modules/
238+
239+
# Typescript v1 declaration files
240+
typings/
241+
242+
# Visual Studio 6 build log
243+
*.plg
134244

135-
# =========================
136-
# Windows detritus
137-
# =========================
245+
# Visual Studio 6 workspace options file
246+
*.opt
138247

139-
# Windows image file caches
140-
Thumbs.db
141-
ehthumbs.db
248+
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
249+
*.vbw
142250

143-
# Folder config file
144-
Desktop.ini
251+
# Visual Studio LightSwitch build output
252+
**/*.HTMLClient/GeneratedArtifacts
253+
**/*.DesktopClient/GeneratedArtifacts
254+
**/*.DesktopClient/ModelManifest.xml
255+
**/*.Server/GeneratedArtifacts
256+
**/*.Server/ModelManifest.xml
257+
_Pvt_Extensions
145258

146-
# Recycle Bin used on file shares
147-
$RECYCLE.BIN/
259+
# Paket dependency manager
260+
.paket/paket.exe
261+
paket-files/
148262

149-
# Mac crap
150-
.DS_Store
263+
# FAKE - F# Make
264+
.fake/
265+
266+
# JetBrains Rider
267+
.idea/
268+
*.sln.iml
269+
270+
# CodeRush
271+
.cr/
272+
273+
# Python Tools for Visual Studio (PTVS)
274+
__pycache__/
275+
*.pyc
276+
277+
# Cake - Uncomment if you are using it
278+
# tools/**
279+
# !tools/packages.config
280+
281+
# Telerik's JustMock configuration file
282+
*.jmconfig
283+
284+
# BizTalk build output
285+
*.btp.cs
286+
*.btm.cs
287+
*.odx.cs
288+
*.xsd.cs
151289

152-
/Unicode Release
153-
/Unicode Debug
154-
/Release
155-
/Debug
156-
/ResEdit-x64
157290
LuaDist
158-
gh-pages
159291
/docs_gen/Editor.lua
160-
*.pyc

LuaScript.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2013
4-
VisualStudioVersion = 12.0.40629.0
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LuaScript", "src\LuaScript.vcxproj", "{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}"
77
ProjectSection(ProjectDependencies) = postProject

src/Lua.vcxproj

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup Label="ProjectConfigurations">
44
<ProjectConfiguration Include="Debug|Win32">
55
<Configuration>Debug</Configuration>
@@ -84,28 +84,29 @@
8484
<ProjectGuid>{FCFBB3B0-8628-4CD0-A9B7-1BFB34E31E2A}</ProjectGuid>
8585
<RootNamespace>LuaScript</RootNamespace>
8686
<Keyword>Win32Proj</Keyword>
87+
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
8788
</PropertyGroup>
8889
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
8990
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
9091
<ConfigurationType>StaticLibrary</ConfigurationType>
9192
<CharacterSet>Unicode</CharacterSet>
92-
<PlatformToolset>v120</PlatformToolset>
93+
<PlatformToolset>v140_xp</PlatformToolset>
9394
</PropertyGroup>
9495
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
9596
<ConfigurationType>StaticLibrary</ConfigurationType>
9697
<CharacterSet>Unicode</CharacterSet>
97-
<PlatformToolset>v120</PlatformToolset>
98+
<PlatformToolset>v140_xp</PlatformToolset>
9899
</PropertyGroup>
99100
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
100101
<ConfigurationType>StaticLibrary</ConfigurationType>
101102
<CharacterSet>Unicode</CharacterSet>
102-
<PlatformToolset>v120</PlatformToolset>
103+
<PlatformToolset>v140_xp</PlatformToolset>
103104
<WholeProgramOptimization>true</WholeProgramOptimization>
104105
</PropertyGroup>
105106
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
106107
<ConfigurationType>StaticLibrary</ConfigurationType>
107108
<CharacterSet>Unicode</CharacterSet>
108-
<PlatformToolset>v120</PlatformToolset>
109+
<PlatformToolset>v140_xp</PlatformToolset>
109110
<WholeProgramOptimization>true</WholeProgramOptimization>
110111
</PropertyGroup>
111112
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

src/LuaConsole.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,16 @@ struct Sorter {
6565
Sorter(bool ignoreCase_) : ignoreCase(ignoreCase_) {}
6666

6767
inline bool operator()(const std::string& a, const std::string& b) {
68-
int lenA = a.length();
69-
int lenB = b.length();
70-
int len = min(lenA, lenB);
68+
auto lenA = a.length();
69+
auto lenB = b.length();
70+
auto len = min(lenA, lenB);
7171
int cmp;
7272
if (ignoreCase)
7373
cmp = CompareNCaseInsensitive(a.c_str(), b.c_str(), len);
7474
else
7575
cmp = strncmp(a.c_str(), b.c_str(), len);
7676
if (cmp == 0)
77-
cmp = lenA - lenB;
77+
cmp = static_cast<int>(lenA - lenB);
7878
return cmp < 0;
7979
}
8080
};
@@ -344,7 +344,7 @@ void LuaConsole::showAutoCompletion() {
344344

345345
// Back up past the partial word
346346
prevCh = m_sciInput->Call(SCI_GETCHARAT, curPos - 1 - partialWord.size());
347-
curPos = curPos - partialWord.size();
347+
curPos = curPos - static_cast<int>(partialWord.size());
348348
}
349349

350350
if (prevCh == '.' || prevCh == ':') {

0 commit comments

Comments
 (0)