| 712 | */ |
| 713 | |
| 714 | static int /* O - 0 on success, -1 on error */ |
| 715 | copy_stack(_cups_ps_stack_t *st, /* I - Stack */ |
| 716 | int c) /* I - Number of objects to copy */ |
| 717 | { |
| 718 | int n; /* Index */ |
| 719 | |
| 720 | |
| 721 | if (c < 0) |
| 722 | return (-1); |
| 723 | else if (c == 0) |
| 724 | return (0); |
| 725 | |
| 726 | if ((n = st->num_objs - c) < 0) |
| 727 | return (-1); |
| 728 | |
| 729 | while (c > 0) |
| 730 | { |
| 731 | _cups_ps_obj_t temp; /* Temporary copy of object */ |
| 732 | |
| 733 | temp = st->objs[n]; |
| 734 | if (!push_stack(st, &temp)) |
| 735 | return (-1); |
| 736 | |
| 737 | n ++; |
| 738 | c --; |
| 739 | } |
| 740 | |
| 741 | return (0); |
| 742 | } |
| 743 | |
| 744 | |
| 745 | /* |
no test coverage detected