]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Fix some warnings in MSVC++2019. Add SDL2-nuget package as a dependency of the MSVC...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 9 May 2021 20:16:20 +0000 (20:16 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 9 May 2021 20:16:20 +0000 (20:16 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13132 d7cf8633-e32d-0410-b094-e92efae38249

cl_parse.c
darkplaces-sdl2-vs2019.vcxproj
fs.c
prvm_cmds.c

index 39d1bbe4f534605297bea10d54cd769eaca88a23..4fc4a9768284ce732dd7ec3196c77601dd8d8307 100644 (file)
@@ -3293,7 +3293,7 @@ static void CL_NetworkTimeReceived(double newtime)
        }
        else if (cls.protocol != PROTOCOL_QUAKEWORLD)
        {
-               double timehigh;
+               double timehigh = 0; // hush compiler warning
                cl.mtime[1] = max(cl.mtime[1], cl.mtime[0] - 0.1);
 
                if (developer_extra.integer && vid_activewindow)
index a44a9231634c208ac61e4e3f463be216c9fe7cdd..c24c3c28fbd8ec64c05782a16072475b14a96fda 100644 (file)
   <ItemGroup>\r
     <ResourceCompile Include="darkplaces.rc" />\r
   </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="packages.config" />\r
+  </ItemGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
   <ImportGroup Label="ExtensionTargets">\r
+    <Import Project="packages\sdl2.nuget.redist.2.0.14\build\native\sdl2.nuget.redist.targets" Condition="Exists('packages\sdl2.nuget.redist.2.0.14\build\native\sdl2.nuget.redist.targets')" />\r
+    <Import Project="packages\sdl2.nuget.2.0.14\build\native\sdl2.nuget.targets" Condition="Exists('packages\sdl2.nuget.2.0.14\build\native\sdl2.nuget.targets')" />\r
   </ImportGroup>\r
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">\r
+    <PropertyGroup>\r
+      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>\r
+    </PropertyGroup>\r
+    <Error Condition="!Exists('packages\sdl2.nuget.redist.2.0.14\build\native\sdl2.nuget.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\sdl2.nuget.redist.2.0.14\build\native\sdl2.nuget.redist.targets'))" />\r
+    <Error Condition="!Exists('packages\sdl2.nuget.2.0.14\build\native\sdl2.nuget.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\sdl2.nuget.2.0.14\build\native\sdl2.nuget.targets'))" />\r
+  </Target>\r
 </Project>
\ No newline at end of file
diff --git a/fs.c b/fs.c
index c4ecfe28decdef0e127e1d51374a0d1773e5b4fc..2efb08ec9109b59c84a53b9ee04190b73a8791f6 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -2520,13 +2520,9 @@ with portable ones in-place, etc)
 */
 void FS_SanitizePath(char *path)
 {
-       int i, size;
-
-       for(i = 0, size = strlen(path); i < size; i++)
-       {
-               if(path[i] == '\\')
-                       path[i] = '/';
-       }
+       for (; *path; path++)
+               if (*path == '\\')
+                       *path = '/';
 }
 
 /*
index 8658085ecfe1f630c787bfecd31635cd4b57788f..68e17589870d09bd890ef67ba6da3cdf3090f2d5 100644 (file)
@@ -61,7 +61,7 @@ void VM_CheckEmptyString(prvm_prog_t *prog, const char *s)
 qbool PRVM_ConsoleCommand (prvm_prog_t *prog, const char *text, int *func, qbool preserve_self, int curself, double ptime, qbool prog_loaded, const char *error_message)
 {
        int restorevm_tempstringsbuf_cursize;
-       int save_self;
+       int save_self = 0; // hush compiler warning
        qbool r = false;
 
        if(!prog_loaded)