glslang-zig/glslang/MachineIndependent
Daniel Koch 883607d5fc Fix build warnings/errors:
1) On some old versions of MSVC:

	glslang\MachineIndependent\Constant.cpp(187): warning C4056: overflow in floating-point constant arithmetic

On this platform the definition of INFINITY is as follows:

	#ifndef _HUGE_ENUF
	   #define _HUGE_ENUF  1e+300  // _HUGE_ENUF*_HUGE_ENUF must overflow
	#endif
	#define INFINITY   ((float)(_HUGE_ENUF * _HUGE_ENUF))

Moving the negation outside the cast seems to resolve that issue.

2) Some Linux compilers were unhappy with lines 226/227

	glslang/MachineIndependent/Constant.cpp: In member function 'virtual glslang::TIntermTyped* glslang::TIntermConstantUnion::fold(glslang::TOperator, const glslang::TIntermTyped*) const':
	glslang/MachineIndependent/Constant.cpp:226:99: error: integer overflow in expression [-Werror=overflow]
			 else if (rightUnionArray[i].getIConst() == -1 && leftUnionArray[i].getIConst() == -(int)0x80000000)
													   ^~~~~~~~~~~~~~~~
	glslang/MachineIndependent/Constant.cpp:227:48: error: integer overflow in expression [-Werror=overflow]
			     newConstArray[i].setIConst(-(int)0x80000000);
	                                                ^~~~~~~~~~~~~~~~

Moving the negation to the right side of the cast made those happy, but then some Windows compilers were unhappy:

	glslang\MachineIndependent\Constant.cpp(226): warning C4146: unary minus operator applied to unsigned type, result still unsigned
	glslang\MachineIndependent\Constant.cpp(227): warning C4146: unary minus operator applied to unsigned type, result still unsigned

which required adding on the "ll" suffix.

3) Android builds where unhappy with line 242:

	glslang/MachineIndependent/Constant.cpp:242:100: error: comparison of integers of different signs: 'long long' and 'unsigned long long' [-Werror,-Wsign-compare]
        	        else if (rightUnionArray[i].getI64Const() == -1 && leftUnionArray[i].getI64Const() == -0x8000000000000000ll)
                	                                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~
	1 error generated.

Adding an explicit (long long) cast resolved this.
And the negation needs to be on the right side of the cast otherwise linux
builds are unhappy as in (2).

4) Android builds are unhappy with out of order initializers:

	glslang/MachineIndependent/reflection.h:60:84: error: field 'type' will be initialized after field 'stages' [-Werror,-Wreorder]
		glDefineType(pGLDefineType), size(pSize), index(pIndex), counterIndex(-1), type(pType.clone()), stages(EShLanguageMask(0)) { }
											   ^
	1 error generated.


Change-Id: Ic9a05fa7912498284885113d8b051f93f822f62b
2018-07-27 17:20:49 -04:00
..
preprocessor PP: Address #1456: Strip float suffixes before using platform library. 2018-07-27 13:08:05 -06:00
attribute.cpp Fix build several build errors 2018-03-13 17:06:51 -04:00
attribute.h GLSL: Implement GL_EXT_control_flow_attributes. 2018-02-01 00:55:08 -07:00
Constant.cpp Fix build warnings/errors: 2018-07-27 17:20:49 -04:00
gl_types.h Implement the extension GL_AMD_gpu_shader_half_float_fetch 2018-03-02 16:48:03 +08:00
glslang.y Implement GL_EXT_shader_16bit_storage and GL_EXT_shader_8bit_storage extensions. 2018-07-03 13:51:31 -06:00
glslang_tab.cpp Implement GL_EXT_shader_16bit_storage and GL_EXT_shader_8bit_storage extensions. 2018-07-03 13:51:31 -06:00
glslang_tab.cpp.h GLSL/SPV: Implement SPV_EXT_descriptor_indexing and GL_EXT_nonuniform_qualifier 2018-04-05 11:25:02 -06:00
InfoSink.cpp Non-functional: White space after "//", mostly for copyrights. 2017-01-06 12:34:14 -07:00
Initialize.cpp Add support for GL_EXT_samplerless_texture_functions 2018-07-01 10:58:53 +01:00
Initialize.h SPV: Implement Vulkan 1.1 features and extensions. 2018-03-06 16:12:04 -07:00
Intermediate.cpp Implement GL_EXT_shader_16bit_storage and GL_EXT_shader_8bit_storage extensions. 2018-07-03 13:51:31 -06:00
intermOut.cpp Fix several signed/unsigned comparison compile warnings. 2018-06-01 20:23:50 -06:00
IntermTraverse.cpp Non-functional: White space after "//", mostly for copyrights. 2017-01-06 12:34:14 -07:00
iomapper.cpp Fixes a crash when in/out varying variable had no semantic name and an error was reported in ioremapper phase when the variable was rejected 2018-07-25 13:43:14 +02:00
iomapper.h Non-functional: White space after "//", mostly for copyrights. 2017-01-06 12:34:14 -07:00
limits.cpp Non-functional: White space after "//", mostly for copyrights. 2017-01-06 12:34:14 -07:00
linkValidate.cpp Link: Merge all the settings in TIntermediate. 2018-07-20 12:34:59 -06:00
LiveTraverser.h [lumped builds] Add include guards (#pragma once) to header files that did not have any. 2017-05-10 16:58:38 +03:00
localintermediate.h Link: Merge all the settings in TIntermediate. 2018-07-20 12:34:59 -06:00
parseConst.cpp HLSL: Allow empty struct initializers 2017-04-27 18:22:52 -06:00
ParseContextBase.cpp Non-functional. Rationalizations enabling future generalizations: 2018-03-28 18:01:20 -06:00
ParseHelper.cpp GLSL: No more restrictions on (non)shadow sampler construction. 2018-07-25 12:11:04 -06:00
ParseHelper.h Implement GL_EXT_shader_16bit_storage and GL_EXT_shader_8bit_storage extensions. 2018-07-03 13:51:31 -06:00
parseVersions.h Errors and Build: Fix build warnings, which also improved error messages. 2018-07-12 15:11:07 -06:00
PoolAlloc.cpp Memory: Mak full explicit destructor functionality, techincally correctly. 2017-11-21 14:32:39 -07:00
propagateNoContraction.cpp HLSL: Add EOpMatrixSwizzle, selectively decomposed to other ops, for issue #670. 2017-01-13 12:35:01 -07:00
propagateNoContraction.h [lumped builds] Add include guards (#pragma once) to header files that did not have any. 2017-05-10 16:58:38 +03:00
reflection.cpp Reflection exposes the Shader Stages where a Uniform is present 2018-07-10 18:25:48 +03:00
reflection.h Fix build warnings/errors: 2018-07-27 17:20:49 -04:00
RemoveTree.cpp Non-functional: White space after "//", mostly for copyrights. 2017-01-06 12:34:14 -07:00
RemoveTree.h [lumped builds] Add include guards (#pragma once) to header files that did not have any. 2017-05-10 16:58:38 +03:00
Scan.cpp Implement GL_EXT_shader_16bit_storage and GL_EXT_shader_8bit_storage extensions. 2018-07-03 13:51:31 -06:00
Scan.h Fix #1043: set all scan string-locations to have bias, not just the first one. 2017-09-11 20:35:49 -06:00
ScanContext.h GLSL: Fix #1358: Support "struct name", where name could be a user type 2018-06-11 19:28:15 -06:00
ShaderLang.cpp Reflection exposes the Shader Stages where a Uniform is present 2018-07-10 18:25:48 +03:00
SymbolTable.cpp SPV: Implement Vulkan 1.1 features and extensions. 2018-03-06 16:12:04 -07:00
SymbolTable.h HLSL: Implement member functions calling member functions. 2017-05-17 02:20:34 -06:00
Versions.cpp Errors and Build: Fix build warnings, which also improved error messages. 2018-07-12 15:11:07 -06:00
Versions.h Implement GL_EXT_shader_16bit_storage and GL_EXT_shader_8bit_storage extensions. 2018-07-03 13:51:31 -06:00