diff options
author | lloyd <lloyd@randombit.net> | 2007-03-03 23:46:18 +0000 |
---|---|---|
committer | lloyd <lloyd@randombit.net> | 2007-03-03 23:46:18 +0000 |
commit | e4d501374fb23572727da8f01370fe9c1d803155 (patch) | |
tree | a8ab2c3312da13ed0f3a26a99d135937a92a7aa0 | |
parent | 9c99db0f0f8e61bb43bf51282aaf71e01cc05aa2 (diff) |
Use prefix rather than postfix increment in places where it can be used.
-rw-r--r-- | src/divide.cpp | 2 | ||||
-rw-r--r-- | src/libstate.cpp | 4 | ||||
-rw-r--r-- | src/rc2.cpp | 4 | ||||
-rw-r--r-- | src/x509cert.cpp | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/src/divide.cpp b/src/divide.cpp index 6df129911..bc1c9ef2d 100644 --- a/src/divide.cpp +++ b/src/divide.cpp @@ -63,7 +63,7 @@ void divide(const BigInt& x, const BigInt& y_arg, BigInt& q, BigInt& r) q.get_reg().create(n - t + 1); if(n <= t) { - while(r > y) { r -= y; q++; } + while(r > y) { r -= y; ++q; } r >>= shifts; sign_fixup(x, y_arg, q, r); return; diff --git a/src/libstate.cpp b/src/libstate.cpp index 9eaa8a8b3..e2a81d598 100644 --- a/src/libstate.cpp +++ b/src/libstate.cpp @@ -326,7 +326,7 @@ void Library_State::load(Modules& modules) set_transcoder(modules.transcoder()); std::vector<Allocator*> mod_allocs = modules.allocators(); - for(u32bit j = 0; j != mod_allocs.size(); j++) + for(u32bit j = 0; j != mod_allocs.size(); ++j) add_allocator(mod_allocs[j]); set_default_allocator(modules.default_allocator()); @@ -384,7 +384,7 @@ Library_State::~Library_State() cached_default_allocator = 0; - for(u32bit j = 0; j != allocators.size(); j++) + for(u32bit j = 0; j != allocators.size(); ++j) { allocators[j]->destroy(); delete allocators[j]; diff --git a/src/rc2.cpp b/src/rc2.cpp index 0e35950e7..fd6b4ccc6 100644 --- a/src/rc2.cpp +++ b/src/rc2.cpp @@ -16,7 +16,7 @@ void RC2::enc(const byte in[], byte out[]) const u16bit R0 = make_u16bit(in[1], in[0]), R1 = make_u16bit(in[3], in[2]), R2 = make_u16bit(in[5], in[4]), R3 = make_u16bit(in[7], in[6]); - for(u32bit j = 0; j != 16; j++) + for(u32bit j = 0; j != 16; ++j) { R0 += (R1 & ~R3) + (R2 & R3) + K[4*j]; R0 = rotate_left(R0, 1); @@ -53,7 +53,7 @@ void RC2::dec(const byte in[], byte out[]) const u16bit R0 = make_u16bit(in[1], in[0]), R1 = make_u16bit(in[3], in[2]), R2 = make_u16bit(in[5], in[4]), R3 = make_u16bit(in[7], in[6]); - for(u32bit j = 0; j != 16; j++) + for(u32bit j = 0; j != 16; ++j) { R3 = rotate_right(R3, 5); R3 -= (R0 & ~R2) + (R1 & R2) + K[63 - (4*j + 0)]; diff --git a/src/x509cert.cpp b/src/x509cert.cpp index f5a3eae99..3ea9cc833 100644 --- a/src/x509cert.cpp +++ b/src/x509cert.cpp @@ -335,7 +335,7 @@ AlternativeName create_alt_name(const Data_Store& info) public: bool operator()(const std::string& key, const std::string&) const { - for(u32bit j = 0; j != matches.size(); j++) + for(u32bit j = 0; j != matches.size(); ++j) if(key.compare(matches[j]) == 0) return true; return false; |