MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / get_range

Function get_range

src/common/sdl.cpp:638–756  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

636
637
638static const UCHAR* get_range(const UCHAR* sdl, array_range* arg,
639 SLONG* min, SLONG* max)
640{
641/**************************************
642 *
643 * g e t _ r a n g e
644 *
645 **************************************
646 *
647 * Functional description
648 * Analyse a piece of slice description language to get bounds
649 * of array references.
650 *
651 **************************************/
652 SLONG n, variable, value, min1, max1, min2, max2, junk1, junk2;
653 sdl_info* info;
654
655 const UCHAR* p = sdl;
656
657 const UCHAR op = *p++;
658 switch (op)
659 {
660 case isc_sdl_do1:
661 case isc_sdl_do2:
662 case isc_sdl_do3:
663 variable = *p++;
664 if (op == isc_sdl_do1)
665 arg->rng_minima[variable] = 1;
666 else
667 {
668 if (!(p = get_range(p, arg, &arg->rng_minima[variable], &junk1)))
669 return NULL;
670 }
671 if (!(p = get_range(p, arg, &junk1, &arg->rng_maxima[variable])))
672 return NULL;
673 if (op == isc_sdl_do3)
674 {
675 if (!(p = get_range(p, arg, &junk1, &junk2)))
676 return NULL;
677 }
678 return get_range(p, arg, min, max);
679
680 case isc_sdl_variable:
681 variable = *p++;
682 *min = arg->rng_minima[variable];
683 *max = arg->rng_maxima[variable];
684 return p;
685
686 case isc_sdl_tiny_integer:
687 value = (SCHAR) * p++;
688 *min = *max = value;
689 return p;
690
691 case isc_sdl_short_integer:
692 value = (SSHORT) (p[0] | (p[1] << 8));
693 *min = *max = value;
694 return p + 2;
695

Callers 1

SDL_infoFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected