Lines Matching refs:stack
264 #define SL 8 /* stack limit in display, below */
449 unsigned int csp; /* next stack entry to use */
463 struct stack
474 } stack[SL]; /* Stack of entries being tested */
758 offset = dp->stack[sp-1].opt_string_end;
781 dp->stack[sp].opt_string_end = set_opt_string_(dp, sp, dp->stack[sp].opt,
782 options[dp->stack[sp].opt].values[dp->stack[sp].entry].name);
792 const unsigned int sp = dp->csp; /* stack entry of next searched option */
796 /* At top of stack; add the opt string for this entry to the previous
798 * on the stack yet (sp == 0).
803 dp->stack[sp-1].opt_string_end = offset;
827 /* Push a new option onto the stack, initializing the new stack entry
852 dp->stack[sp].best_size =
853 dp->stack[sp].lo_size =
854 dp->stack[sp].hi_size = MAX_SIZE;
858 dp->stack[sp].lo = options[opt].values[entry].value;
862 dp->stack[sp].hi = options[opt].values[entry+1].value;
868 dp->stack[sp].lo = INT_MAX;
869 dp->stack[sp].hi = INT_MIN; /* Prevent range chop */
872 dp->stack[sp].opt = opt;
873 dp->stack[sp].entry = entry;
874 dp->stack[sp].best_val = dp->value[opt] = options[opt].values[entry].value;
883 dp->stack[sp].end = 1;
894 dp->stack[sp].end = 0;
908 * the topmost stack entry - only the topmost entry changes each time round -
911 * set dp->stack[s].end to true.
918 /* dp->stack[sp] must be the top stack entry and it must be active: */
919 assert(sp+1U == dp->tsp && !dp->stack[sp].end);
921 opt = dp->stack[sp].opt;
922 entry = dp->stack[sp].entry;
933 * is indicated by hi < lo on the stack, otherwise the range being search
936 if (dp->stack[sp].lo > dp->stack[sp].hi)
942 png_alloc_size_t best_size = dp->stack[sp].best_size;
943 int lo = dp->stack[sp].lo;
944 int hi = dp->stack[sp].hi;
953 dp->stack[sp].lo_size = best_size;
957 dp->stack[sp].end = 1;
964 dp->stack[sp].hi_size = best_size;
968 dp->stack[sp].end = 1;
975 png_alloc_size_t lo_size = dp->stack[sp].lo_size;
976 png_alloc_size_t hi_size = dp->stack[sp].hi_size;
987 dp->stack[sp].lo = val;
988 dp->stack[sp].lo_size = best_size;
991 lo = dp->stack[sp].lo;
992 lo_size = dp->stack[sp].lo_size;
998 dp->stack[sp].hi = val;
999 dp->stack[sp].hi_size = best_size;
1002 hi = dp->stack[sp].hi;
1003 hi_size = dp->stack[sp].hi_size;
1019 dp->stack[sp].end = 1;
1042 dp->stack[sp].end = 1;
1047 dp->stack[sp].hi = hi = val;
1048 dp->stack[sp].hi_size = best_size;
1062 dp->stack[sp].end = 1;
1067 dp->stack[sp].lo = lo = val;
1068 dp->stack[sp].lo_size = best_size;
1090 dp->stack[sp].hi = val;
1091 dp->stack[sp].hi_size = best_size;
1097 dp->stack[sp].lo = val;
1098 dp->stack[sp].lo_size = best_size;
1107 dp->stack[sp].end = 1;
1111 assert(val != dp->stack[sp].best_val); /* should be a new value */
1113 dp->stack[sp].best_size = MAX_SIZE;
1121 dp->stack[sp].entry = entry;
1127 dp->stack[sp].end = 1;
1129 else if (!dp->stack[sp].end) /* still active after all these tests */
1136 int opt = dp->stack[sp].opt;
1141 if (dp->stack[sp].best_val < dp->value[opt])
1147 else if (dp->stack[sp].best_val > dp->value[opt])
1149 if (dp->stack[sp].lo <= dp->stack[sp].hi /*searching*/)
1163 unsigned int sp = dp->csp++; /* my stack entry */
1167 /* If the entry was active in the previous run dp->stack[sp] is already
1173 * 1) When an option is pushed onto the stack dp->nsp and dp->tsp are
1174 * both set (by push_opt) to the next stack entry *unless* there is
1175 * only one entry in the new list, in which case dp->stack[sp].end
1178 * 2) For the top stack entry next_opt is called. The entry must be
1179 * active (dp->stack[sp].end is not set) and either 'nsp' or 'end'
1182 * 3) For lower stack entries nsp is set unless the stack entry is
1196 /* An option that is already on the stack; update best_size and best_val
1203 if (dp->stack[sp].best_size > dp->write_size ||
1204 (dp->stack[sp].best_size == dp->write_size &&
1207 dp->stack[sp].best_size = dp->write_size;
1208 dp->stack[sp].best_val = dp->value[opt];
1217 else if (!dp->stack[sp].end) /* Active, not at top of stack */
1231 /* Simple, single value, entries don't have a stack frame and have a fixed
2118 * This function looks through the stack from the bottom up looking for an
2123 * Notice that this means that the order options are pushed onto the stack