Lines Matching refs:ev
152 coerce_value(AstExprValue *ev, ExprType t) in coerce_value() argument
154 if (ev == NULL) in coerce_value()
160 switch (ev->et) in coerce_value()
163 return ev; in coerce_value()
165 if (ev->u.usval > SAL_MAX_INT16) in coerce_value()
167 ev->u.sval = (sal_Int16)ev->u.usval; in coerce_value()
168 ev->et = ET_short; in coerce_value()
169 return ev; in coerce_value()
171 if (ev->u.lval < SAL_MIN_INT16 || ev->u.lval > SAL_MAX_INT16) in coerce_value()
173 ev->u.sval = (sal_Int16)ev->u.lval; in coerce_value()
174 ev->et = ET_short; in coerce_value()
175 return ev; in coerce_value()
177 if (ev->u.ulval > SAL_MAX_INT16) in coerce_value()
179 ev->u.sval = (sal_Int16)ev->u.ulval; in coerce_value()
180 ev->et = ET_short; in coerce_value()
181 return ev; in coerce_value()
183 if (ev->u.hval < SAL_MIN_INT16 || ev->u.hval > SAL_MAX_INT16) in coerce_value()
185 ev->u.sval = (sal_Int16)ev->u.hval; in coerce_value()
186 ev->et = ET_short; in coerce_value()
187 return ev; in coerce_value()
189 if (ev->u.uhval > SAL_MAX_INT16) in coerce_value()
191 ev->u.sval = (sal_Int16)ev->u.uhval; in coerce_value()
192 ev->et = ET_short; in coerce_value()
193 return ev; in coerce_value()
195 ev->u.sval = (sal_Int16)ev->u.bval; in coerce_value()
196 ev->et = ET_short; in coerce_value()
197 return ev; in coerce_value()
199 if (ev->u.fval < SAL_MIN_INT16 || ev->u.fval > SAL_MAX_INT16) in coerce_value()
201 ev->u.sval = (sal_Int16)ev->u.fval; in coerce_value()
202 ev->et = ET_short; in coerce_value()
203 return ev; in coerce_value()
205 if (ev->u.dval < SAL_MIN_INT16 || ev->u.dval > SAL_MAX_INT16) in coerce_value()
207 ev->u.sval = (sal_Int16)ev->u.dval; in coerce_value()
208 ev->et = ET_short; in coerce_value()
209 return ev; in coerce_value()
211 ev->u.sval = (sal_Int16)ev->u.byval; in coerce_value()
212 ev->et = ET_short; in coerce_value()
213 return ev; in coerce_value()
219 switch (ev->et) in coerce_value()
222 if (ev->u.sval < 0) in coerce_value()
224 ev->u.usval = (sal_uInt16)ev->u.sval; in coerce_value()
225 ev->et = ET_ushort; in coerce_value()
226 return ev; in coerce_value()
228 return ev; in coerce_value()
230 if (ev->u.lval < 0 || ev->u.lval > SAL_MAX_UINT16) in coerce_value()
232 ev->u.usval = (sal_uInt16)ev->u.lval; in coerce_value()
233 ev->et = ET_ushort; in coerce_value()
234 return ev; in coerce_value()
236 if (ev->u.ulval > SAL_MAX_UINT16) in coerce_value()
238 ev->u.usval = (sal_uInt16)ev->u.ulval; in coerce_value()
239 ev->et = ET_ushort; in coerce_value()
240 return ev; in coerce_value()
242 if (ev->u.hval < 0 || ev->u.hval > SAL_MAX_UINT16) in coerce_value()
244 ev->u.usval = (sal_uInt16)ev->u.hval; in coerce_value()
245 ev->et = ET_ushort; in coerce_value()
246 return ev; in coerce_value()
248 if (ev->u.uhval > SAL_MAX_UINT16) in coerce_value()
250 ev->u.usval = (sal_uInt16)ev->u.uhval; in coerce_value()
251 ev->et = ET_ushort; in coerce_value()
252 return ev; in coerce_value()
254 ev->u.usval = (sal_uInt16)ev->u.bval; in coerce_value()
255 ev->et = ET_short; in coerce_value()
256 return ev; in coerce_value()
258 if (ev->u.fval < 0.0 || ev->u.fval > SAL_MAX_UINT16) in coerce_value()
260 ev->u.usval = (sal_uInt16)ev->u.fval; in coerce_value()
261 ev->et = ET_short; in coerce_value()
262 return ev; in coerce_value()
264 if (ev->u.dval < 0.0 || ev->u.dval > SAL_MAX_UINT16) in coerce_value()
266 ev->u.usval = (sal_uInt16)ev->u.dval; in coerce_value()
267 ev->et = ET_short; in coerce_value()
268 return ev; in coerce_value()
270 ev->u.usval = (sal_uInt16)ev->u.byval; in coerce_value()
271 ev->et = ET_ushort; in coerce_value()
272 return ev; in coerce_value()
278 switch (ev->et) in coerce_value()
281 ev->u.lval = (sal_Int32)ev->u.sval; in coerce_value()
282 ev->et = ET_long; in coerce_value()
283 return ev; in coerce_value()
285 ev->u.lval = (sal_Int32)ev->u.usval; in coerce_value()
286 ev->et = ET_long; in coerce_value()
287 return ev; in coerce_value()
289 return ev; in coerce_value()
291 if (ev->u.ulval > SAL_MAX_INT32) in coerce_value()
293 ev->u.lval = (sal_Int32)ev->u.ulval; in coerce_value()
294 ev->et = ET_long; in coerce_value()
295 return ev; in coerce_value()
297 if (ev->u.hval < SAL_MIN_INT32 || ev->u.hval > SAL_MAX_INT32) in coerce_value()
299 ev->u.lval = (sal_Int32)ev->u.hval; in coerce_value()
300 ev->et = ET_long; in coerce_value()
301 return ev; in coerce_value()
303 if (ev->u.uhval > SAL_MAX_INT32) in coerce_value()
305 ev->u.lval = (sal_Int32)ev->u.uhval; in coerce_value()
306 ev->et = ET_long; in coerce_value()
307 return ev; in coerce_value()
309 ev->u.lval = (sal_Int32)ev->u.bval; in coerce_value()
310 ev->et = ET_long; in coerce_value()
311 return ev; in coerce_value()
313 if (ev->u.fval < SAL_MIN_INT32 || ev->u.fval > SAL_MAX_INT32) in coerce_value()
315 ev->u.lval = (sal_Int32)ev->u.fval; in coerce_value()
316 ev->et = ET_long; in coerce_value()
317 return ev; in coerce_value()
319 if (ev->u.dval < SAL_MIN_INT32 || ev->u.dval > SAL_MAX_INT32) in coerce_value()
321 ev->u.lval = (sal_Int32)ev->u.dval; in coerce_value()
322 ev->et = ET_long; in coerce_value()
323 return ev; in coerce_value()
325 ev->u.lval = (sal_Int32) ev->u.byval; in coerce_value()
326 ev->et = ET_long; in coerce_value()
327 return ev; in coerce_value()
333 switch (ev->et) in coerce_value()
336 if (ev->u.sval < 0) in coerce_value()
338 ev->u.ulval = (sal_uInt32)ev->u.sval; in coerce_value()
339 ev->et = ET_ulong; in coerce_value()
340 return ev; in coerce_value()
342 ev->u.ulval = (sal_uInt32)ev->u.usval; in coerce_value()
343 ev->et = ET_ulong; in coerce_value()
344 return ev; in coerce_value()
346 if (ev->u.lval < 0) in coerce_value()
348 ev->u.ulval = (sal_uInt32)ev->u.lval; in coerce_value()
349 ev->et = ET_ulong; in coerce_value()
350 return ev; in coerce_value()
352 return ev; in coerce_value()
354 if (ev->u.hval < 0 || ev->u.hval > SAL_MAX_UINT32) in coerce_value()
356 ev->u.lval = (sal_uInt32)ev->u.hval; in coerce_value()
357 ev->et = ET_ulong; in coerce_value()
358 return ev; in coerce_value()
360 if (ev->u.uhval > SAL_MAX_UINT32) in coerce_value()
362 ev->u.ulval = (sal_uInt32)ev->u.uhval; in coerce_value()
363 ev->et = ET_ulong; in coerce_value()
364 return ev; in coerce_value()
366 ev->u.ulval = (sal_uInt32)ev->u.bval; in coerce_value()
367 ev->et = ET_ulong; in coerce_value()
368 return ev; in coerce_value()
370 if (ev->u.fval < 0.0 || ev->u.fval > SAL_MAX_UINT32) in coerce_value()
372 ev->u.ulval = (sal_uInt32)ev->u.fval; in coerce_value()
373 ev->et = ET_ulong; in coerce_value()
374 return ev; in coerce_value()
376 if (ev->u.dval < 0.0 || ev->u.dval > SAL_MAX_UINT32) in coerce_value()
378 ev->u.ulval = (sal_uInt32)ev->u.dval; in coerce_value()
379 ev->et = ET_ulong; in coerce_value()
380 return ev; in coerce_value()
382 ev->u.ulval = (sal_uInt32)ev->u.byval; in coerce_value()
383 ev->et = ET_ulong; in coerce_value()
384 return ev; in coerce_value()
390 switch (ev->et) in coerce_value()
393 ev->u.hval = (sal_Int64)ev->u.sval; in coerce_value()
394 ev->et = ET_hyper; in coerce_value()
395 return ev; in coerce_value()
397 ev->u.hval = (sal_Int64)ev->u.usval; in coerce_value()
398 ev->et = ET_hyper; in coerce_value()
399 return ev; in coerce_value()
401 ev->u.hval = (sal_Int64)ev->u.lval; in coerce_value()
402 ev->et = ET_hyper; in coerce_value()
403 return ev; in coerce_value()
405 ev->u.hval = (sal_Int64)ev->u.ulval; in coerce_value()
406 ev->et = ET_hyper; in coerce_value()
407 return ev; in coerce_value()
409 return ev; in coerce_value()
411 if (ev->u.uhval > SAL_MAX_INT64) in coerce_value()
413 ev->u.hval = (sal_Int64)ev->u.uhval; in coerce_value()
414 ev->et = ET_long; in coerce_value()
415 return ev; in coerce_value()
417 ev->u.hval = (sal_Int64)ev->u.bval; in coerce_value()
418 ev->et = ET_hyper; in coerce_value()
419 return ev; in coerce_value()
421 if (ev->u.fval < SAL_MIN_INT64 || ev->u.fval > SAL_MAX_INT64) in coerce_value()
423 ev->u.hval = (sal_Int64)ev->u.fval; in coerce_value()
424 ev->et = ET_hyper; in coerce_value()
425 return ev; in coerce_value()
427 if (ev->u.dval < SAL_MIN_INT64 || ev->u.dval > SAL_MAX_INT64) in coerce_value()
429 ev->u.hval = (sal_Int64)ev->u.dval; in coerce_value()
430 ev->et = ET_hyper; in coerce_value()
431 return ev; in coerce_value()
433 ev->u.hval = (sal_Int64)ev->u.byval; in coerce_value()
434 ev->et = ET_hyper; in coerce_value()
435 return ev; in coerce_value()
441 switch (ev->et) in coerce_value()
444 if (ev->u.sval < 0) in coerce_value()
446 ev->u.uhval = (sal_uInt64)ev->u.sval; in coerce_value()
447 ev->et = ET_uhyper; in coerce_value()
448 return ev; in coerce_value()
450 ev->u.uhval = (sal_uInt64)ev->u.usval; in coerce_value()
451 ev->et = ET_uhyper; in coerce_value()
452 return ev; in coerce_value()
454 if (ev->u.lval < 0) in coerce_value()
456 ev->u.uhval = (sal_uInt64)ev->u.lval; in coerce_value()
457 ev->et = ET_uhyper; in coerce_value()
458 return ev; in coerce_value()
460 ev->u.uhval = (sal_uInt64)ev->u.ulval; in coerce_value()
461 ev->et = ET_uhyper; in coerce_value()
462 return ev; in coerce_value()
464 if (ev->u.hval < 0) in coerce_value()
466 ev->u.uhval = (sal_uInt64)ev->u.hval; in coerce_value()
467 ev->et = ET_uhyper; in coerce_value()
468 return ev; in coerce_value()
470 return ev; in coerce_value()
472 ev->u.uhval = (sal_uInt64)ev->u.bval; in coerce_value()
473 ev->et = ET_uhyper; in coerce_value()
474 return ev; in coerce_value()
476 if (ev->u.fval < 0.0 || ev->u.fval > SAL_MAX_UINT64) in coerce_value()
478 ev->u.uhval = (sal_uInt64)ev->u.fval; in coerce_value()
479 ev->et = ET_uhyper; in coerce_value()
480 return ev; in coerce_value()
482 if (ev->u.dval < 0.0 || ev->u.dval > SAL_MAX_UINT64) in coerce_value()
484 ev->u.uhval = (sal_uInt64)ev->u.dval; in coerce_value()
485 ev->et = ET_uhyper; in coerce_value()
486 return ev; in coerce_value()
488 ev->u.uhval = (sal_uInt64)ev->u.byval; in coerce_value()
489 ev->et = ET_uhyper; in coerce_value()
490 return ev; in coerce_value()
496 switch (ev->et) in coerce_value()
499 ev->u.bval = (ev->u.sval == 0) ? sal_False : sal_True; in coerce_value()
500 ev->et = ET_boolean; in coerce_value()
501 return ev; in coerce_value()
503 ev->u.bval = (ev->u.usval == 0) ? sal_False : sal_True; in coerce_value()
504 ev->et = ET_boolean; in coerce_value()
505 return ev; in coerce_value()
507 ev->u.bval = (ev->u.lval == 0) ? sal_False : sal_True; in coerce_value()
508 ev->et = ET_boolean; in coerce_value()
509 return ev; in coerce_value()
511 ev->u.bval = (ev->u.ulval == 0) ? sal_False : sal_True; in coerce_value()
512 ev->et = ET_boolean; in coerce_value()
513 return ev; in coerce_value()
515 ev->u.bval = (ev->u.hval == 0) ? sal_False : sal_True; in coerce_value()
516 ev->et = ET_boolean; in coerce_value()
517 return ev; in coerce_value()
519 ev->u.bval = (ev->u.uhval == 0) ? sal_False : sal_True; in coerce_value()
520 ev->et = ET_boolean; in coerce_value()
521 return ev; in coerce_value()
523 return ev; in coerce_value()
525 ev->u.bval = (ev->u.fval == 0.0) ? sal_False : sal_True; in coerce_value()
526 ev->et = ET_boolean; in coerce_value()
527 return ev; in coerce_value()
529 ev->u.bval = (ev->u.dval == 0.0) ? sal_False : sal_True; in coerce_value()
530 ev->et = ET_boolean; in coerce_value()
531 return ev; in coerce_value()
533 ev->u.bval = (ev->u.byval == 0) ? sal_False : sal_True; in coerce_value()
534 ev->et = ET_boolean; in coerce_value()
535 return ev; in coerce_value()
541 switch (ev->et) in coerce_value()
544 ev->u.fval = (float)ev->u.sval; in coerce_value()
545 ev->et = ET_float; in coerce_value()
546 return ev; in coerce_value()
548 ev->u.fval = (float)ev->u.usval; in coerce_value()
549 ev->et = ET_float; in coerce_value()
550 return ev; in coerce_value()
552 ev->u.fval = (float)ev->u.lval; in coerce_value()
553 ev->et = ET_float; in coerce_value()
554 return ev; in coerce_value()
556 ev->u.fval = (float)ev->u.ulval; in coerce_value()
557 ev->et = ET_float; in coerce_value()
558 return ev; in coerce_value()
560 ev->u.fval = (float)ev->u.hval; in coerce_value()
561 ev->et = ET_float; in coerce_value()
562 return ev; in coerce_value()
564 if ((float)ev->u.ulval > FLT_MAX) in coerce_value()
566 ev->u.fval = (float)ev->u.ulval; in coerce_value()
567 ev->et = ET_float; in coerce_value()
568 return ev; in coerce_value()
570 ev->u.fval = (ev->u.bval == sal_True) ? 1.0f : 0.0f; in coerce_value()
571 ev->et = ET_float; in coerce_value()
572 return ev; in coerce_value()
574 return ev; in coerce_value()
576 if ((float)ev->u.dval > FLT_MAX || (float)ev->u.dval < -FLT_MAX) in coerce_value()
578 ev->u.fval = (float)ev->u.dval; in coerce_value()
579 ev->et = ET_float; in coerce_value()
580 return ev; in coerce_value()
582 ev->u.fval = (float)ev->u.byval; in coerce_value()
583 ev->et = ET_float; in coerce_value()
584 return ev; in coerce_value()
590 switch (ev->et) in coerce_value()
593 ev->u.dval = (double)ev->u.sval; in coerce_value()
594 ev->et = ET_double; in coerce_value()
595 return ev; in coerce_value()
597 ev->u.dval = (double)ev->u.usval; in coerce_value()
598 ev->et = ET_double; in coerce_value()
599 return ev; in coerce_value()
601 ev->u.dval = (double)ev->u.lval; in coerce_value()
602 ev->et = ET_double; in coerce_value()
603 return ev; in coerce_value()
605 ev->u.dval = (double)ev->u.ulval; in coerce_value()
606 ev->et = ET_double; in coerce_value()
607 return ev; in coerce_value()
609 ev->u.dval = (double)ev->u.hval; in coerce_value()
610 ev->et = ET_double; in coerce_value()
611 return ev; in coerce_value()
613 if ((double)ev->u.dval > FLT_MAX || (double)ev->u.dval < -FLT_MAX) in coerce_value()
615 ev->u.dval = (double)ev->u.ulval; in coerce_value()
616 ev->et = ET_double; in coerce_value()
617 return ev; in coerce_value()
619 ev->u.dval = (ev->u.bval == sal_True) ? 1.0 : 0.0; in coerce_value()
620 ev->et = ET_double; in coerce_value()
621 return ev; in coerce_value()
623 ev->u.dval = (double)ev->u.fval; in coerce_value()
624 ev->et = ET_double; in coerce_value()
625 return ev; in coerce_value()
627 return ev; in coerce_value()
629 ev->u.dval = (double)ev->u.byval; in coerce_value()
630 ev->et = ET_double; in coerce_value()
631 return ev; in coerce_value()
637 switch (ev->et) in coerce_value()
640 if (ev->u.sval < SAL_MIN_INT8 || ev->u.sval > SAL_MAX_UINT8) in coerce_value()
642 ev->u.byval = (sal_uChar)ev->u.sval; in coerce_value()
643 ev->et = ET_byte; in coerce_value()
644 return ev; in coerce_value()
646 if (ev->u.usval > SAL_MAX_UINT8) in coerce_value()
648 ev->u.byval = (sal_uChar)ev->u.usval; in coerce_value()
649 ev->et = ET_byte; in coerce_value()
650 return ev; in coerce_value()
652 if (ev->u.lval < SAL_MIN_INT8 || ev->u.lval > SAL_MAX_UINT8) in coerce_value()
654 ev->u.byval = (sal_uChar) ev->u.lval; in coerce_value()
655 ev->et = ET_byte; in coerce_value()
656 return ev; in coerce_value()
658 if (ev->u.ulval > SAL_MAX_UINT8) in coerce_value()
660 ev->u.byval = (sal_uChar) ev->u.ulval; in coerce_value()
661 ev->et = ET_byte; in coerce_value()
662 return ev; in coerce_value()
664 if (ev->u.hval < SAL_MIN_INT8 || ev->u.hval > SAL_MAX_UINT8) in coerce_value()
666 ev->u.byval = (sal_uChar) ev->u.hval; in coerce_value()
667 ev->et = ET_byte; in coerce_value()
668 return ev; in coerce_value()
670 if (ev->u.uhval > SAL_MAX_UINT8) in coerce_value()
672 ev->u.byval = (sal_uChar) ev->u.uhval; in coerce_value()
673 ev->et = ET_byte; in coerce_value()
674 return ev; in coerce_value()
676 ev->u.byval = (ev->u.bval == sal_False) ? 1 : 0; in coerce_value()
677 ev->et = ET_byte; in coerce_value()
678 return ev; in coerce_value()
680 if (ev->u.fval < SAL_MIN_INT8 || ev->u.fval > SAL_MAX_UINT8) in coerce_value()
682 ev->u.byval = (sal_uChar) ev->u.fval; in coerce_value()
683 ev->et = ET_byte; in coerce_value()
684 return ev; in coerce_value()
686 if (ev->u.dval < SAL_MIN_INT8 || ev->u.dval > SAL_MAX_UINT8) in coerce_value()
688 ev->u.byval = (sal_uChar) ev->u.dval; in coerce_value()
689 ev->et = ET_byte; in coerce_value()
690 return ev; in coerce_value()
692 return ev; in coerce_value()
711 eval_kind(AstExprValue *ev, EvalKind ek) in eval_kind() argument
714 return ev; in eval_kind()
716 return coerce_value(ev, ET_ulong); in eval_kind()