diff options
Diffstat (limited to 'libqpdf')
-rw-r--r-- | libqpdf/Pl_DCT.cc | 4 | ||||
-rw-r--r-- | libqpdf/QPDF.cc | 2 | ||||
-rw-r--r-- | libqpdf/QPDFFormFieldObjectHelper.cc | 2 | ||||
-rw-r--r-- | libqpdf/QPDFObjectHandle.cc | 4 | ||||
-rw-r--r-- | libqpdf/QPDFPageObjectHelper.cc | 2 | ||||
-rw-r--r-- | libqpdf/QPDFWriter.cc | 4 | ||||
-rw-r--r-- | libqpdf/QPDF_encryption.cc | 12 |
7 files changed, 14 insertions, 16 deletions
diff --git a/libqpdf/Pl_DCT.cc b/libqpdf/Pl_DCT.cc index a05dd48b..9c33b6e1 100644 --- a/libqpdf/Pl_DCT.cc +++ b/libqpdf/Pl_DCT.cc @@ -348,9 +348,7 @@ Pl_DCT::decompress(void* cinfo_p, Buffer* b) (void)jpeg_start_decompress(cinfo); while (cinfo->output_scanline < cinfo->output_height) { (void)jpeg_read_scanlines(cinfo, buffer, 1); - this->getNext()->write( - reinterpret_cast<unsigned char*>(buffer[0]), - width * sizeof(buffer[0][0])); + this->getNext()->write(buffer[0], width * sizeof(buffer[0][0])); } (void)jpeg_finish_decompress(cinfo); this->getNext()->finish(); diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc index 815894d3..aa99942c 100644 --- a/libqpdf/QPDF.cc +++ b/libqpdf/QPDF.cc @@ -2739,7 +2739,7 @@ QPDF::pipeStreamData( "unexpected EOF reading stream data"); } length -= len; - pipeline->write(QUtil::unsigned_char_pointer(buf), len); + pipeline->write(buf, len); } pipeline->finish(); success = true; diff --git a/libqpdf/QPDFFormFieldObjectHelper.cc b/libqpdf/QPDFFormFieldObjectHelper.cc index bccea123..a89b8b82 100644 --- a/libqpdf/QPDFFormFieldObjectHelper.cc +++ b/libqpdf/QPDFFormFieldObjectHelper.cc @@ -863,7 +863,7 @@ QPDFFormFieldObjectHelper::generateTextAppearance( TfFinder tff; Pl_QPDFTokenizer tok("tf", &tff); - tok.write(QUtil::unsigned_char_pointer(DA.c_str()), DA.length()); + tok.writeString(DA); tok.finish(); double tf = tff.getTf(); DA = tff.getDA(); diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index e1c9488a..05a0f30d 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -127,7 +127,7 @@ QPDFObjectHandle::TokenFilter::write(char const* data, size_t len) return; } if (len) { - this->pipeline->write(QUtil::unsigned_char_pointer(data), len); + this->pipeline->write(data, len); } } @@ -1857,7 +1857,7 @@ QPDFObjectHandle::pipeContentStreams( Pl_Buffer buf("concatenated content stream buffer"); for (auto stream: streams) { if (need_newline) { - buf.write(QUtil::unsigned_char_pointer("\n"), 1); + buf.writeCStr("\n"); } LastChar lc(&buf); std::string og = QUtil::int_to_string(stream.getObjectID()) + " " + diff --git a/libqpdf/QPDFPageObjectHelper.cc b/libqpdf/QPDFPageObjectHelper.cc index 59b9b45f..a8880ec0 100644 --- a/libqpdf/QPDFPageObjectHelper.cc +++ b/libqpdf/QPDFPageObjectHelper.cc @@ -190,7 +190,7 @@ InlineImageTracker::handleToken(QPDFTokenizer::Token const& token) QTC::TC( "qpdf", "QPDFPageObjectHelper externalize inline image"); Pl_Buffer b("image_data"); - b.write(QUtil::unsigned_char_pointer(image_data), len); + b.writeString(image_data); b.finish(); QPDFObjectHandle dict = convertIIDict(QPDFObjectHandle::parse(dict_str)); diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc index 4b2e785a..35041249 100644 --- a/libqpdf/QPDFWriter.cc +++ b/libqpdf/QPDFWriter.cc @@ -961,7 +961,7 @@ QPDFWriter::writeBinary(unsigned long long val, unsigned int bytes) void QPDFWriter::writeString(std::string const& str) { - this->m->pipeline->write(QUtil::unsigned_char_pointer(str), str.length()); + this->m->pipeline->writeString(str); } void @@ -1736,7 +1736,7 @@ QPDFWriter::unparseObject( true, QUtil::unsigned_char_pointer(this->m->cur_data_key), this->m->cur_data_key.length()); - pl.write(QUtil::unsigned_char_pointer(val), val.length()); + pl.writeString(val); pl.finish(); auto buf = bufpl.getBufferSharedPointer(); val = QPDF_String(std::string( diff --git a/libqpdf/QPDF_encryption.cc b/libqpdf/QPDF_encryption.cc index 5fb1e808..5a7968ca 100644 --- a/libqpdf/QPDF_encryption.cc +++ b/libqpdf/QPDF_encryption.cc @@ -235,7 +235,7 @@ process_with_aes( } aes.disablePadding(); for (unsigned int i = 0; i < repetitions; ++i) { - aes.write(QUtil::unsigned_char_pointer(data), data.length()); + aes.writeString(data); } aes.finish(); auto bufp = buffer.getBufferSharedPointer(); @@ -255,9 +255,9 @@ hash_V5( QPDF::EncryptionData const& data) { Pl_SHA2 hash(256); - hash.write(QUtil::unsigned_char_pointer(password), password.length()); - hash.write(QUtil::unsigned_char_pointer(salt), salt.length()); - hash.write(QUtil::unsigned_char_pointer(udata), udata.length()); + hash.writeString(password); + hash.writeString(salt); + hash.writeString(udata); hash.finish(); std::string K = hash.getRawDigest(); @@ -311,7 +311,7 @@ hash_V5( E_mod_3 %= 3; int next_hash = ((E_mod_3 == 0) ? 256 : (E_mod_3 == 1) ? 384 : 512); Pl_SHA2 sha2(next_hash); - sha2.write(QUtil::unsigned_char_pointer(E), E.length()); + sha2.writeString(E); sha2.finish(); K = sha2.getRawDigest(); @@ -1151,7 +1151,7 @@ QPDF::decryptString(std::string& str, int objid, int generation) false, QUtil::unsigned_char_pointer(key), key.length()); - pl.write(QUtil::unsigned_char_pointer(str), str.length()); + pl.writeString(str); pl.finish(); auto buf = bufpl.getBufferSharedPointer(); str = std::string( |