author | simon <simon> | 2002-11-08 15:20:59 (UTC) |
---|---|---|
committer | simon <simon> | 2002-11-08 15:20:59 (UTC) |
commit | d8ac5b68b504536136347547816992b1cf605cd4 (patch) (unidiff) | |
tree | 7e90b9c23b78c7c67b5433bebd6a29e3e98e4bac /noncore/unsupported/qpdf/xpdf/Object.cc | |
parent | 447735be20fad2642617e3ba4f7ef0b598f597db (diff) | |
download | opie-d8ac5b68b504536136347547816992b1cf605cd4.zip opie-d8ac5b68b504536136347547816992b1cf605cd4.tar.gz opie-d8ac5b68b504536136347547816992b1cf605cd4.tar.bz2 |
- a couple of fixes like this one:
- fprintf(f, "%g", real);
+ fprintf(f, "%g", static_cast<double>(real));
with 'real' being a fouble object. as fprintf is a c function with variable
arguments one cannot pass non-primitive objects through it and there is
no way for the compiler to figure out the right conversion operator, so
we give it a helping hand :)
Diffstat (limited to 'noncore/unsupported/qpdf/xpdf/Object.cc') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/qpdf/xpdf/Object.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/unsupported/qpdf/xpdf/Object.cc b/noncore/unsupported/qpdf/xpdf/Object.cc index 6d92c6a..77f1317 100644 --- a/noncore/unsupported/qpdf/xpdf/Object.cc +++ b/noncore/unsupported/qpdf/xpdf/Object.cc | |||
@@ -140,25 +140,25 @@ char *Object::getTypeName() { | |||
140 | void Object::print(FILE *f) { | 140 | void Object::print(FILE *f) { |
141 | Object obj; | 141 | Object obj; |
142 | int i; | 142 | int i; |
143 | 143 | ||
144 | switch (type) { | 144 | switch (type) { |
145 | case objBool: | 145 | case objBool: |
146 | fprintf(f, "%s", booln ? "true" : "false"); | 146 | fprintf(f, "%s", booln ? "true" : "false"); |
147 | break; | 147 | break; |
148 | case objInt: | 148 | case objInt: |
149 | fprintf(f, "%d", intg); | 149 | fprintf(f, "%d", intg); |
150 | break; | 150 | break; |
151 | case objReal: | 151 | case objReal: |
152 | fprintf(f, "%g", real); | 152 | fprintf(f, "%g", static_cast<double>(real)); |
153 | break; | 153 | break; |
154 | case objString: | 154 | case objString: |
155 | fprintf(f, "("); | 155 | fprintf(f, "("); |
156 | fwrite(string->getCString(), 1, string->getLength(), stdout); | 156 | fwrite(string->getCString(), 1, string->getLength(), stdout); |
157 | fprintf(f, ")"); | 157 | fprintf(f, ")"); |
158 | break; | 158 | break; |
159 | case objName: | 159 | case objName: |
160 | fprintf(f, "/%s", name); | 160 | fprintf(f, "/%s", name); |
161 | break; | 161 | break; |
162 | case objNull: | 162 | case objNull: |
163 | fprintf(f, "null"); | 163 | fprintf(f, "null"); |
164 | break; | 164 | break; |