MCPcopy Create free account
hub / github.com/Singular/Singular / iiTestConvert

Function iiTestConvert

Singular/gentable.cc:296–323  ·  view source on GitHub ↗

automatic conversions: 2 * try to convert 'inputType' in 'outputType' * return 0 on failure, an index (<>0) on success * GENTABLE variant! */

Source from the content-addressed store, hash-verified

294* GENTABLE variant!
295*/
296int iiTestConvert (int inputType, int outputType)
297{
298 if ((inputType==outputType)
299 || (outputType==DEF_CMD)
300 || (outputType==IDHDL)
301 || (outputType==ANY_TYPE))
302 {
303 return -1;
304 }
305 if (inputType==UNKNOWN) return 0;
306
307 // search the list
308 int i=0;
309 while (dConvertTypes[i].i_typ!=0)
310 {
311 if((dConvertTypes[i].i_typ==inputType)
312 &&(dConvertTypes[i].o_typ==outputType))
313 {
314 //Print("test convert %d to %d (%s -> %s):%d\n",inputType,outputType,
315 //Tok2Cmdname(inputType), Tok2Cmdname(outputType),i+1);
316 return i+1;
317 }
318 i++;
319 }
320 //Print("test convert %d to %d (%s -> %s):0\n",inputType,outputType,
321 // Tok2Cmdname(inputType), Tok2Cmdname(outputType));
322 return 0;
323}
324VAR char *iparith_inc;
325void ttGen1()
326{

Callers 1

ttGen1Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected