Showing the changes to array.c (1 of 16 files). Show all
Unified · Split
| @@ -1,12 +1,11 @@ | ||
| 1 | 1 | #include <u.h> |
| 2 | 2 | #include <libc.h> |
| 3 | −#include <bio.h> | |
| 4 | 3 | #include "pdf.h" |
| 5 | 4 | |
| 6 | 5 | /* 7.3.6 Array Objects */ |
| 7 | 6 | |
| 8 | 7 | Object * |
| 9 | −pdfarray(Pdf *pdf, Biobuf *b) | |
| 8 | +pdfarray(Pdf *pdf, Stream *s) | |
| 10 | 9 | { |
| 11 | 10 | Object *o, *m; |
| 12 | 11 | Object **a; |
| @@ -15,18 +14,18 @@ pdfarray(Pdf *pdf, Biobuf *b) · 2 unmodified lines | ||
| 15 | 14 | o = calloc(1, sizeof(*o)); |
| 16 | 15 | o->pdf = pdf; |
| 17 | 16 | o->type = Oarray; |
| 18 | − Bgetc(b); /* throw away '[' */ | |
| 17 | + Sgetc(s); /* throw away '[' */ | |
| 19 | 18 | |
| 20 | 19 | for(noel = 0;;){ |
| 21 | − if((c = Bgetc(b)) < 0 || c == ']') | |
| 20 | + if((c = Sgetc(s)) < 0 || c == ']') | |
| 22 | 21 | break; |
| 23 | 22 | if(noel){ |
| 24 | 23 | werrstr("no ']'"); |
| 25 | 24 | goto err; |
| 26 | 25 | } |
| 27 | 26 | |
| 28 | − Bungetc(b); | |
| 29 | − if((m = pdfobj(pdf, b)) == nil){ | |
| 27 | + Sungetc(s); | |
| 28 | + if((m = pdfobj(pdf, s)) == nil){ | |
| 30 | 29 | noel = 1; |
| 31 | 30 | continue; |
| 32 | 31 | } |
| @@ -65,7 +64,9 @@ arrayget(Object *o, int i) · 32 unmodified lines | ||
| 65 | 64 | { |
| 66 | 65 | if(arraylen(o) <= i) |
| 67 | 66 | sysfatal("array: indexing out of range"); |
| 68 | − return o->type == Oarray ? o->array.e[i] : o; | |
| 67 | + o = o->type == Oarray ? o->array.e[i] : o; | |
| 68 | + | |
| 69 | + return pdfeval(&o); | |
| 69 | 70 | } |
| 70 | 71 | |
| 71 | 72 | int |