Skip to content

Commit 93f42af

Browse files
author
Roderick Kennedy
committed
Merge test changes
2 parents a3a3905 + aa5ed33 commit 93f42af

34 files changed

Lines changed: 93 additions & 93 deletions

Applications/Sfx/FileLoader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22
#include <vector>
33
#include <string>
4-
#include <stdint.h>
4+
#include <cstdint>
55
#ifndef _MAX_PATH
66
#define _MAX_PATH 260
77
#endif

Applications/Sfx/Preprocessor.ypp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <sstream> // For std::ostringstream
2121
#include <vector> // For std::vector
2222
#include <string> // For std::string
23+
#include <cstdint>
2324
#include "Preprocessor.h"
2425
extern void prepro_error(const char *s);
2526
extern void prepro_warning(const char *s);

Applications/Sfx/Sfx.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -319,19 +319,16 @@ RenderStateType renderState;
319319

320320
static std::string RewriteErrorLine(std::string line,const vector<string> &sourceFilesUtf8)
321321
{
322-
bool is_error=true;
323322
int errpos=(int)line.find("ERROR");
324323
if(errpos<0)
325324
errpos=(int)line.find("error");
326325
if(errpos<0)
327326
{
328327
errpos=(int)line.find("WARNING");
329-
is_error=false;
330328
}
331329
if(errpos<0)
332330
{
333331
errpos=(int)line.find("warning");
334-
is_error=false;
335332
}
336333
if(errpos>=0)
337334
{
@@ -340,30 +337,26 @@ static std::string RewriteErrorLine(std::string line,const vector<string> &sourc
340337
int third_colon =(int)line.find(":",second_colon+1);
341338
int first_bracket =(int)line.find("(");
342339
int second_bracket =(int)line.find(")",first_bracket+1);
343-
int numberstart,numberlen=0;
340+
int numberlen=0;
344341
//somefile.glsl(263): error C2065: 'space_' : undeclared identifier
345342
if(third_colon>=0&&second_colon>=0&&(second_colon-first_colon)<5)
346343
{
347-
numberstart =first_colon+1;
348344
numberlen =second_colon-first_colon-1;
349345
}
350346
// ERROR: 0:11: 'assign' : cannot convert from '2-component vector of float' to 'float'
351347
else if((third_colon<0||numberlen>6)&&second_bracket>=0)
352348
{
353349
if(first_colon<first_bracket)
354350
{
355-
numberstart =first_colon+1;
356351
numberlen =first_bracket-first_colon-1;
357352
}
358353
else
359354
{
360-
numberstart=0;
361355
numberlen=first_bracket;
362356
}
363357
}
364358
else
365359
{
366-
numberstart=0;
367360
numberlen=first_bracket;
368361
}
369362
if(numberlen>0)
@@ -524,6 +517,7 @@ std::string GetExecutableDirectory()
524517
#endif
525518
return WStringToUtf8(str);
526519
}
520+
527521
std::vector<std::string> extra_arguments;
528522
std::string ppfile;
529523

Applications/Sfx/Sfx.ypp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ primary_exp : IDENTIFIER
10941094
{
10951095
buildFunction.declarations.insert(varName);
10961096
buildFunction.declareResource(varName);
1097-
if (cb=gEffect->GetNamedConstantBufferForMember(varName);cb)
1097+
if (cb=gEffect->GetNamedConstantBufferForMember(varName); cb)
10981098
buildFunction.declareConstantBuffer(cb);
10991099
}
11001100
else if ((cb = gEffect->GetConstantBufferForMember(varName)) != nullptr)
@@ -3484,7 +3484,7 @@ shader_def : SHADER_COMMAND '(' shader_compile_or_instance ')' ';'
34843484
{
34853485
string shaderInstanceNames=$3.strs[0];
34863486
vector<string> shaderInstances;
3487-
for(const auto i:$3.children)
3487+
for(const auto const &i:$3.children)
34883488
{
34893489
shaderInstances.push_back(i.strs[0]);
34903490
}
@@ -4210,11 +4210,11 @@ void errSyn(const char* e)
42104210
ostringstream errMsg;
42114211
int lex_linenumber=sfxget_lineno();
42124212
int true_linenumber=lex_linenumber+last_linenumber-global_linenumber;
4213-
if (GetSfxOptions().disableLineWrites)
4214-
errMsg << ppfile;
4215-
else
4213+
if (GetSfxOptions().disableLineWrites)
4214+
errMsg << ppfile;
4215+
else
42164216
errMsg << current_filename;
4217-
4217+
42184218
errMsg<< "(" << true_linenumber << ") : sfx syntax error: \"" << sfxget_text() << "\" " << e;
42194219
const char *st=GetStartModeText();
42204220
if(st)
@@ -4230,11 +4230,11 @@ void errSem(const string& str, int lex_linenumber)
42304230

42314231
if(lex_linenumber==-1)
42324232
lex_linenumber= sfxget_lineno();
4233-
int true_linenumber = lex_linenumber + last_linenumber - global_linenumber;
4234-
if (GetSfxOptions().disableLineWrites)
4235-
errMsg << ppfile;
4236-
else
4237-
errMsg << current_filename;
4233+
int true_linenumber = lex_linenumber + last_linenumber - global_linenumber;
4234+
if (GetSfxOptions().disableLineWrites)
4235+
errMsg << ppfile;
4236+
else
4237+
errMsg << current_filename;
42384238
errMsg<<"("<<true_linenumber<<") : sfx error: "<<str;
42394239
const char *st=GetStartModeText();
42404240
if(st)

Applications/Sfx/SfxClasses.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
3030
#include <string>
3131
#include <sstream>
3232
#include <vector>
33+
#include <stdint.h>
3334

3435
int sfxparse();
3536
int sfxlex();
@@ -38,7 +39,7 @@ namespace sfx
3839
{
3940
typedef std::map<std::string, std::tuple<std::streampos, std::size_t>> BinaryMap;
4041
/// This must track platform::crossplatform::ShaderResourceType
41-
enum class ShaderResourceType : unsigned long long
42+
enum class ShaderResourceType : uint64_t
4243
{
4344
UNKNOWN = 0
4445
, RW = 1

Applications/Sfx/SfxEffect.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3081,7 +3081,6 @@ void Effect::ConstructSource(ShaderInstance *shaderInstance)
30813081
find_and_replace(m, "{type}", member.type);
30823082
find_and_replace(m, "{name}", member.name);
30833083
std::string slotidx;
3084-
int cnt = 0;
30853084
if (member.semantic == "SV_TARGET")
30863085
{
30873086
slotidx = "0";
@@ -3119,8 +3118,6 @@ void Effect::ConstructSource(ShaderInstance *shaderInstance)
31193118
find_and_replace(str, "{members}", m + "\n");
31203119
theShader << str.c_str() << endl;
31213120
content += member.name + " = tmp." + member.name + ";\n";
3122-
3123-
cnt++;
31243121
}
31253122
find_and_replace(content, "return", function->returnType + " tmp = ");
31263123
}

Applications/Sfx/SfxEffect.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "SfxParser.h"
66
#include "Function.h"
77
#include "ShaderInstance.h"
8+
#include <memory>
89

910
namespace sfx
1011
{

Applications/Sfx/StringFunctions.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@ vector<string> SplitPath(const string &fullPath)
493493

494494
#include <sstream>
495495
#include <iterator>
496+
#include <cstring>
496497

497498
template<typename Out>
498499
void split(const std::string &s, char delim, Out result) {

CMake/Shader.cmake

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,8 @@ function ( add_multiplatform_sfx_shader_project targetName )
115115
set( sfx_CONFIG_FILES ${sfx_CONFIG_FILES} "${SIMUL_PLATFORM_DIR}/${GRAPHICS_API}/Sfx/${GRAPHICS_API}.json" )
116116
endforeach()
117117
endif()
118-
#message("sfx_CONFIG_FILES ${sfx_CONFIG_FILES}")
119-
foreach(opt_cfg ${sfx_CONFIG_FILES})
120-
set(SET_CONFIGS "${SET_CONFIGS} -P\"${opt_cfg}\"" )
121-
endforeach()
118+
list(JOIN sfx_CONFIG_FILES "\" -P\"" SET_CONFIGS)
119+
set(SET_CONFIGS "-P\"${SET_CONFIGS}\"" )
122120
if(NOT "${SET_CONFIGS}" STREQUAL "")
123121
#message("SET_CONFIGS ${SET_CONFIGS}")
124122
set(EXTRA_OPTS)
@@ -165,7 +163,7 @@ function ( add_multiplatform_sfx_shader_project targetName )
165163
add_custom_command(OUTPUT ${main_output_file}
166164
COMMAND "${this_exe}" ${in_f} ${INCLUDE_OPTS} -O"${sfx_OUTPUT}" ${SET_CONFIGS} ${EXTRA_OPTS_S}
167165
MAIN_DEPENDENCY ${in_f}
168-
WORKING_DIRECTORY ${out_folder}
166+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
169167
DEPENDS ${PLATFORM_SFX_EXECUTABLE}
170168
COMMENT "\"${this_exe}\" ${in_f} ${INCLUDE_OPTS} -O\"${sfx_OUTPUT}\" ${SET_CONFIGS} ${EXTRA_OPTS_S}"
171169
#VERBATIM

Core/BaseMouseHandler.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef PLATFORM_CORE_MOUSEHANDLER_H
22
#define PLATFORM_CORE_MOUSEHANDLER_H
33

4+
#include <cstdint>
45
#include <functional>
56
#include <stdint.h>
67
#include "Platform/Core/Export.h"

0 commit comments

Comments
 (0)