MCPcopy Create free account
hub / github.com/carbonengine/trinity / ParseFloat

Function ParseFloat

shadercompiler/ParserUtils.cpp:140–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140double ParseFloat( const char* start, const char* end )
141{
142 if( end[-1] == 'f' || end[-1] == 'F' )
143 {
144 --end;
145 }
146
147 bool negate = false;
148 if( start[0] == '-' )
149 {
150 ++start;
151 while( isspace( *start ) )
152 {
153 ++start;
154 }
155 negate = true;
156 }
157
158 char* stop;
159 double result = strtod( start, &stop );
160 if( negate )
161 {
162 result = -result;
163 }
164 return result;
165}
166
167void MarkUsedSymbols( ASTNode* entryPoint, SymbolTable& symbols )
168{

Calls

no outgoing calls

Tested by

no test coverage detected