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 85 struct EncryptionData
86 86 {
87 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 89 std::string const& O, std::string const& U,
90 90 std::string const& id1) :
91 91 V(V),
... ... @@ -101,7 +101,7 @@ class QPDF
101 101 int V;
102 102 int R;
103 103 int Length_bytes;
104   - long P;
  104 + int P;
105 105 std::string O;
106 106 std::string U;
107 107 std::string id1;
... ... @@ -115,7 +115,7 @@ class QPDF
115 115  
116 116 static void compute_encryption_O_U(
117 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 119 std::string const& id1,
120 120 std::string& O, std::string& U);
121 121 std::string const& getUserPassword() const;
... ...
libqpdf/QPDFWriter.cc
... ... @@ -230,7 +230,7 @@ QPDFWriter::setEncryptionParameters(
230 230 bits_to_clear.insert(1);
231 231 bits_to_clear.insert(2);
232 232  
233   - unsigned long P = 0;
  233 + int P = 0;
234 234 // Create the complement of P, then invert.
235 235 for (std::set<int>::iterator iter = bits_to_clear.begin();
236 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 427 void
428 428 QPDF::compute_encryption_O_U(
429 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 431 std::string const& id1, std::string& O, std::string& U)
432 432 {
433 433 EncryptionData data(V, R, key_len, P, "", "", id1);
... ...