Commit 62bff4861fc884e7f0d5cfddca7a8357a19e3d78

Authored by Jay Berkenbilt
1 parent c7477e20

fix potential 64-bit issues

git-svn-id: svn+q:///qpdf/trunk@613 71b93d88-0707-0410-a8cf-f5a4172ac649
include/qpdf/QPDF.hh
@@ -85,7 +85,7 @@ class QPDF @@ -85,7 +85,7 @@ class QPDF
85 struct EncryptionData 85 struct EncryptionData
86 { 86 {
87 // This class holds data read from the encryption dictionary. 87 // This class holds data read from the encryption dictionary.
88 - EncryptionData(int V, int R, int Length_bytes, long P, 88 + EncryptionData(int V, int R, int Length_bytes, int P,
89 std::string const& O, std::string const& U, 89 std::string const& O, std::string const& U,
90 std::string const& id1) : 90 std::string const& id1) :
91 V(V), 91 V(V),
@@ -101,7 +101,7 @@ class QPDF @@ -101,7 +101,7 @@ class QPDF
101 int V; 101 int V;
102 int R; 102 int R;
103 int Length_bytes; 103 int Length_bytes;
104 - long P; 104 + int P;
105 std::string O; 105 std::string O;
106 std::string U; 106 std::string U;
107 std::string id1; 107 std::string id1;
@@ -115,7 +115,7 @@ class QPDF @@ -115,7 +115,7 @@ class QPDF
115 115
116 static void compute_encryption_O_U( 116 static void compute_encryption_O_U(
117 char const* user_password, char const* owner_password, 117 char const* user_password, char const* owner_password,
118 - int V, int R, int key_len, unsigned long P, 118 + int V, int R, int key_len, int P,
119 std::string const& id1, 119 std::string const& id1,
120 std::string& O, std::string& U); 120 std::string& O, std::string& U);
121 std::string const& getUserPassword() const; 121 std::string const& getUserPassword() const;
libqpdf/QPDFWriter.cc
@@ -230,7 +230,7 @@ QPDFWriter::setEncryptionParameters( @@ -230,7 +230,7 @@ QPDFWriter::setEncryptionParameters(
230 bits_to_clear.insert(1); 230 bits_to_clear.insert(1);
231 bits_to_clear.insert(2); 231 bits_to_clear.insert(2);
232 232
233 - unsigned long P = 0; 233 + int P = 0;
234 // Create the complement of P, then invert. 234 // Create the complement of P, then invert.
235 for (std::set<int>::iterator iter = bits_to_clear.begin(); 235 for (std::set<int>::iterator iter = bits_to_clear.begin();
236 iter != bits_to_clear.end(); ++iter) 236 iter != bits_to_clear.end(); ++iter)
libqpdf/QPDF_encryption.cc
@@ -427,7 +427,7 @@ QPDF::decryptStream(Pipeline*&amp; pipeline, int objid, int generation, @@ -427,7 +427,7 @@ QPDF::decryptStream(Pipeline*&amp; pipeline, int objid, int generation,
427 void 427 void
428 QPDF::compute_encryption_O_U( 428 QPDF::compute_encryption_O_U(
429 char const* user_password, char const* owner_password, 429 char const* user_password, char const* owner_password,
430 - int V, int R, int key_len, unsigned long P, 430 + int V, int R, int key_len, int P,
431 std::string const& id1, std::string& O, std::string& U) 431 std::string const& id1, std::string& O, std::string& U)
432 { 432 {
433 EncryptionData data(V, R, key_len, P, "", "", id1); 433 EncryptionData data(V, R, key_len, P, "", "", id1);