From b047633de2db3895f043564c92cb2130a4adebec Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 14 Feb 2004 20:48:45 +0000 Subject: [PATCH] fix lots of warnings many still unfixed --- stepmania/src/crypto51/algparam.cpp | 1 + stepmania/src/crypto51/asn.cpp | 2 ++ stepmania/src/crypto51/basecode.cpp | 2 ++ stepmania/src/crypto51/channels.cpp | 2 ++ stepmania/src/crypto51/cryptlib.cpp | 2 ++ stepmania/src/crypto51/des.cpp | 2 ++ stepmania/src/crypto51/dessp.cpp | 2 ++ stepmania/src/crypto51/files.cpp | 2 ++ stepmania/src/crypto51/filters.cpp | 2 ++ stepmania/src/crypto51/fips140.cpp | 2 ++ stepmania/src/crypto51/hex.cpp | 2 ++ stepmania/src/crypto51/integer.cpp | 2 ++ stepmania/src/crypto51/iterhash.cpp | 2 ++ stepmania/src/crypto51/md5.cpp | 2 ++ stepmania/src/crypto51/misc.cpp | 2 ++ stepmania/src/crypto51/misc.h | 28 ++++++++++++++-------------- stepmania/src/crypto51/modes.cpp | 2 ++ stepmania/src/crypto51/mqueue.cpp | 2 ++ stepmania/src/crypto51/nbtheory.cpp | 2 ++ stepmania/src/crypto51/pkcspad.cpp | 2 ++ stepmania/src/crypto51/pssr.cpp | 2 ++ stepmania/src/crypto51/pubkey.cpp | 2 ++ stepmania/src/crypto51/queue.cpp | 2 ++ stepmania/src/crypto51/randpool.cpp | 2 ++ stepmania/src/crypto51/rsa.cpp | 2 ++ stepmania/src/crypto51/sha.cpp | 2 ++ stepmania/src/crypto51/simple.h | 18 +++++++++--------- stepmania/src/crypto51/strciphr.cpp | 2 ++ 28 files changed, 74 insertions(+), 23 deletions(-) diff --git a/stepmania/src/crypto51/algparam.cpp b/stepmania/src/crypto51/algparam.cpp index 1f49db6f9c..500651fc80 100644 --- a/stepmania/src/crypto51/algparam.cpp +++ b/stepmania/src/crypto51/algparam.cpp @@ -1,5 +1,6 @@ // algparam.cpp - written and placed in the public domain by Wei Dai +#include "global.h" #include "pch.h" #include "algparam.h" diff --git a/stepmania/src/crypto51/asn.cpp b/stepmania/src/crypto51/asn.cpp index 262a430406..30a3d2d587 100644 --- a/stepmania/src/crypto51/asn.cpp +++ b/stepmania/src/crypto51/asn.cpp @@ -1,5 +1,7 @@ // asn.cpp - written and placed in the public domain by Wei Dai +#include "global.h" + #include "pch.h" #include "asn.h" diff --git a/stepmania/src/crypto51/basecode.cpp b/stepmania/src/crypto51/basecode.cpp index 1e81ece478..cd64a67148 100644 --- a/stepmania/src/crypto51/basecode.cpp +++ b/stepmania/src/crypto51/basecode.cpp @@ -1,5 +1,7 @@ // basecode.cpp - written and placed in the public domain by Wei Dai +#include "global.h" + #include "pch.h" #include "basecode.h" #include "fltrimpl.h" diff --git a/stepmania/src/crypto51/channels.cpp b/stepmania/src/crypto51/channels.cpp index d13bcf429a..fa50d101d9 100644 --- a/stepmania/src/crypto51/channels.cpp +++ b/stepmania/src/crypto51/channels.cpp @@ -1,5 +1,7 @@ // channels.cpp - written and placed in the public domain by Wei Dai +#include "global.h" + #include "pch.h" #include "channels.h" diff --git a/stepmania/src/crypto51/cryptlib.cpp b/stepmania/src/crypto51/cryptlib.cpp index e3fe2d5f9d..a16198a5f7 100644 --- a/stepmania/src/crypto51/cryptlib.cpp +++ b/stepmania/src/crypto51/cryptlib.cpp @@ -1,5 +1,7 @@ // cryptlib.cpp - written and placed in the public domain by Wei Dai +#include "global.h" + #include "pch.h" #include "cryptlib.h" #include "misc.h" diff --git a/stepmania/src/crypto51/des.cpp b/stepmania/src/crypto51/des.cpp index b3a58e5059..fd49cc5df2 100644 --- a/stepmania/src/crypto51/des.cpp +++ b/stepmania/src/crypto51/des.cpp @@ -14,6 +14,8 @@ * Phil Karn KA9Q, karn@unix.ka9q.ampr.org, August 1994. */ +#include "global.h" + #include "pch.h" #include "misc.h" #include "des.h" diff --git a/stepmania/src/crypto51/dessp.cpp b/stepmania/src/crypto51/dessp.cpp index 1f7a9510c1..35f6e06336 100644 --- a/stepmania/src/crypto51/dessp.cpp +++ b/stepmania/src/crypto51/dessp.cpp @@ -1,5 +1,7 @@ // This file is mostly generated by Phil Karn's gensp.c +#include "global.h" + #include "pch.h" #include "des.h" diff --git a/stepmania/src/crypto51/files.cpp b/stepmania/src/crypto51/files.cpp index 2b42010ac8..5ff82d8818 100644 --- a/stepmania/src/crypto51/files.cpp +++ b/stepmania/src/crypto51/files.cpp @@ -1,5 +1,7 @@ // files.cpp - written and placed in the public domain by Wei Dai +#include "global.h" + #include "pch.h" #include "files.h" diff --git a/stepmania/src/crypto51/filters.cpp b/stepmania/src/crypto51/filters.cpp index 64c2a37dca..1600ce4533 100644 --- a/stepmania/src/crypto51/filters.cpp +++ b/stepmania/src/crypto51/filters.cpp @@ -1,5 +1,7 @@ // filters.cpp - written and placed in the public domain by Wei Dai +#include "global.h" + #include "pch.h" #include "filters.h" #include "mqueue.h" diff --git a/stepmania/src/crypto51/fips140.cpp b/stepmania/src/crypto51/fips140.cpp index 7781956a2e..8da1daa96a 100644 --- a/stepmania/src/crypto51/fips140.cpp +++ b/stepmania/src/crypto51/fips140.cpp @@ -1,5 +1,7 @@ // fips140.cpp - written and placed in the public domain by Wei Dai +#include "global.h" + #include "pch.h" #include "fips140.h" #include "trdlocal.h" // needs to be included last for cygwin diff --git a/stepmania/src/crypto51/hex.cpp b/stepmania/src/crypto51/hex.cpp index fb6537948d..e362841423 100644 --- a/stepmania/src/crypto51/hex.cpp +++ b/stepmania/src/crypto51/hex.cpp @@ -1,5 +1,7 @@ // hex.cpp - written and placed in the public domain by Wei Dai +#include "global.h" + #include "pch.h" #include "hex.h" diff --git a/stepmania/src/crypto51/integer.cpp b/stepmania/src/crypto51/integer.cpp index e18507fd33..070ffee01e 100644 --- a/stepmania/src/crypto51/integer.cpp +++ b/stepmania/src/crypto51/integer.cpp @@ -1,6 +1,8 @@ // integer.cpp - written and placed in the public domain by Wei Dai // contains public domain code contributed by Alister Lee and Leonard Janke +#include "global.h" + #include "pch.h" #include "integer.h" #include "modarith.h" diff --git a/stepmania/src/crypto51/iterhash.cpp b/stepmania/src/crypto51/iterhash.cpp index 00cc12bcd4..3cd16c7e07 100644 --- a/stepmania/src/crypto51/iterhash.cpp +++ b/stepmania/src/crypto51/iterhash.cpp @@ -1,5 +1,7 @@ // iterhash.cpp - written and placed in the public domain by Wei Dai +#include "global.h" + #include "pch.h" #include "iterhash.h" #include "misc.h" diff --git a/stepmania/src/crypto51/md5.cpp b/stepmania/src/crypto51/md5.cpp index 7bd4f38530..c23b7837fb 100644 --- a/stepmania/src/crypto51/md5.cpp +++ b/stepmania/src/crypto51/md5.cpp @@ -1,6 +1,8 @@ // md5.cpp - modified by Wei Dai from Colin Plumb's public domain md5.c // any modifications are placed in the public domain +#include "global.h" + #include "pch.h" #include "md5.h" #include "misc.h" diff --git a/stepmania/src/crypto51/misc.cpp b/stepmania/src/crypto51/misc.cpp index c193b3f3ed..0f41494a8c 100644 --- a/stepmania/src/crypto51/misc.cpp +++ b/stepmania/src/crypto51/misc.cpp @@ -1,5 +1,7 @@ // misc.cpp - written and placed in the public domain by Wei Dai +#include "global.h" + #include "pch.h" #include "misc.h" #include "words.h" diff --git a/stepmania/src/crypto51/misc.h b/stepmania/src/crypto51/misc.h index 1e341e2594..31f94c2ffc 100644 --- a/stepmania/src/crypto51/misc.h +++ b/stepmania/src/crypto51/misc.h @@ -209,7 +209,7 @@ inline CipherDir GetCipherDir(const T &obj) template inline T rotlFixed(T x, unsigned int y) { assert(y < sizeof(T)*8); - return (x<>(sizeof(T)*8-y)); + return T((x<>(sizeof(T)*8-y))); } template inline T rotrFixed(T x, unsigned int y) @@ -488,20 +488,20 @@ inline T UnalignedGetWord(ByteOrder order, const byte *block, T*dummy=NULL) inline void UnalignedPutWord(ByteOrder order, byte *block, byte value, const byte *xorBlock = NULL) { - block[0] = xorBlock ? (value ^ xorBlock[0]) : value; + block[0] = byte(xorBlock ? (value ^ xorBlock[0]) : value); } inline void UnalignedPutWord(ByteOrder order, byte *block, word16 value, const byte *xorBlock = NULL) { if (order == BIG_ENDIAN_ORDER) { - block[0] = GETBYTE(value, 1); - block[1] = GETBYTE(value, 0); + block[0] = byte(GETBYTE(value, 1)); + block[1] = byte(GETBYTE(value, 0)); } else { - block[0] = GETBYTE(value, 0); - block[1] = GETBYTE(value, 1); + block[0] = byte(GETBYTE(value, 0)); + block[1] = byte(GETBYTE(value, 1)); } if (xorBlock) @@ -515,17 +515,17 @@ inline void UnalignedPutWord(ByteOrder order, byte *block, word32 value, const b { if (order == BIG_ENDIAN_ORDER) { - block[0] = GETBYTE(value, 3); - block[1] = GETBYTE(value, 2); - block[2] = GETBYTE(value, 1); - block[3] = GETBYTE(value, 0); + block[0] = byte(GETBYTE(value, 3)); + block[1] = byte(GETBYTE(value, 2)); + block[2] = byte(GETBYTE(value, 1)); + block[3] = byte(GETBYTE(value, 0)); } else { - block[0] = GETBYTE(value, 0); - block[1] = GETBYTE(value, 1); - block[2] = GETBYTE(value, 2); - block[3] = GETBYTE(value, 3); + block[0] = byte(GETBYTE(value, 0)); + block[1] = byte(GETBYTE(value, 1)); + block[2] = byte(GETBYTE(value, 2)); + block[3] = byte(GETBYTE(value, 3)); } if (xorBlock) diff --git a/stepmania/src/crypto51/modes.cpp b/stepmania/src/crypto51/modes.cpp index 70c23234f2..fbc6bc14f8 100644 --- a/stepmania/src/crypto51/modes.cpp +++ b/stepmania/src/crypto51/modes.cpp @@ -1,5 +1,7 @@ // modes.cpp - written and placed in the public domain by Wei Dai +#include "global.h" + #include "pch.h" #include "modes.h" diff --git a/stepmania/src/crypto51/mqueue.cpp b/stepmania/src/crypto51/mqueue.cpp index 2bac976c8f..67a07bc1f4 100644 --- a/stepmania/src/crypto51/mqueue.cpp +++ b/stepmania/src/crypto51/mqueue.cpp @@ -1,5 +1,7 @@ // mqueue.cpp - written and placed in the public domain by Wei Dai +#include "global.h" + #include "pch.h" #include "mqueue.h" diff --git a/stepmania/src/crypto51/nbtheory.cpp b/stepmania/src/crypto51/nbtheory.cpp index 852beb5712..65b17b99cd 100644 --- a/stepmania/src/crypto51/nbtheory.cpp +++ b/stepmania/src/crypto51/nbtheory.cpp @@ -1,5 +1,7 @@ // nbtheory.cpp - written and placed in the public domain by Wei Dai +#include "global.h" + #include "pch.h" #include "nbtheory.h" #include "modarith.h" diff --git a/stepmania/src/crypto51/pkcspad.cpp b/stepmania/src/crypto51/pkcspad.cpp index e04ac9ddee..58a46fdcc8 100644 --- a/stepmania/src/crypto51/pkcspad.cpp +++ b/stepmania/src/crypto51/pkcspad.cpp @@ -1,5 +1,7 @@ // pkcspad.cpp - written and placed in the public domain by Wei Dai +#include "global.h" + #include "pch.h" #include "pkcspad.h" #include diff --git a/stepmania/src/crypto51/pssr.cpp b/stepmania/src/crypto51/pssr.cpp index 5dc959aa1c..bd3745f01d 100644 --- a/stepmania/src/crypto51/pssr.cpp +++ b/stepmania/src/crypto51/pssr.cpp @@ -1,5 +1,7 @@ // pssr.cpp - written and placed in the public domain by Wei Dai +#include "global.h" + #include "pch.h" #include "pssr.h" diff --git a/stepmania/src/crypto51/pubkey.cpp b/stepmania/src/crypto51/pubkey.cpp index 000258997a..91a21053d1 100644 --- a/stepmania/src/crypto51/pubkey.cpp +++ b/stepmania/src/crypto51/pubkey.cpp @@ -1,5 +1,7 @@ // pubkey.cpp - written and placed in the public domain by Wei Dai +#include "global.h" + #include "pch.h" #include "pubkey.h" diff --git a/stepmania/src/crypto51/queue.cpp b/stepmania/src/crypto51/queue.cpp index a01e213845..b943ae3756 100644 --- a/stepmania/src/crypto51/queue.cpp +++ b/stepmania/src/crypto51/queue.cpp @@ -1,5 +1,7 @@ // queue.cpp - written and placed in the public domain by Wei Dai +#include "global.h" + #include "pch.h" #include "queue.h" #include "filters.h" diff --git a/stepmania/src/crypto51/randpool.cpp b/stepmania/src/crypto51/randpool.cpp index 9fa0b4beec..8768cbac53 100644 --- a/stepmania/src/crypto51/randpool.cpp +++ b/stepmania/src/crypto51/randpool.cpp @@ -1,6 +1,8 @@ // randpool.cpp - written and placed in the public domain by Wei Dai // The algorithm in this module comes from PGP's randpool.c +#include "global.h" + #include "pch.h" #include "randpool.h" #include "mdc.h" diff --git a/stepmania/src/crypto51/rsa.cpp b/stepmania/src/crypto51/rsa.cpp index 62e9592168..f90f28e07f 100644 --- a/stepmania/src/crypto51/rsa.cpp +++ b/stepmania/src/crypto51/rsa.cpp @@ -1,5 +1,7 @@ // rsa.cpp - written and placed in the public domain by Wei Dai +#include "global.h" + #include "pch.h" #include "rsa.h" #include "asn.h" diff --git a/stepmania/src/crypto51/sha.cpp b/stepmania/src/crypto51/sha.cpp index 958d9ea07b..0d4df59ef2 100644 --- a/stepmania/src/crypto51/sha.cpp +++ b/stepmania/src/crypto51/sha.cpp @@ -3,6 +3,8 @@ // Steve Reid implemented SHA-1. Wei Dai implemented SHA-2. // Both are in the public domain. +#include "global.h" + #include "pch.h" #include "sha.h" #include "misc.h" diff --git a/stepmania/src/crypto51/simple.h b/stepmania/src/crypto51/simple.h index e26cefd40f..bed18ece09 100644 --- a/stepmania/src/crypto51/simple.h +++ b/stepmania/src/crypto51/simple.h @@ -201,15 +201,15 @@ class Sink : public BufferedTransformation { protected: // make these functions protected to help prevent unintentional calls to them - BufferedTransformation::Get; - BufferedTransformation::Peek; - BufferedTransformation::TransferTo; - BufferedTransformation::CopyTo; - BufferedTransformation::CopyRangeTo; - BufferedTransformation::TransferMessagesTo; - BufferedTransformation::CopyMessagesTo; - BufferedTransformation::TransferAllTo; - BufferedTransformation::CopyAllTo; + using BufferedTransformation::Get; + using BufferedTransformation::Peek; + using BufferedTransformation::TransferTo; + using BufferedTransformation::CopyTo; + using BufferedTransformation::CopyRangeTo; + using BufferedTransformation::TransferMessagesTo; + using BufferedTransformation::CopyMessagesTo; + using BufferedTransformation::TransferAllTo; + using BufferedTransformation::CopyAllTo; unsigned int TransferTo2(BufferedTransformation &target, unsigned long &transferBytes, const std::string &channel=NULL_CHANNEL, bool blocking=true) {transferBytes = 0; return 0;} unsigned int CopyRangeTo2(BufferedTransformation &target, unsigned long &begin, unsigned long end=ULONG_MAX, const std::string &channel=NULL_CHANNEL, bool blocking=true) const diff --git a/stepmania/src/crypto51/strciphr.cpp b/stepmania/src/crypto51/strciphr.cpp index d948c57920..92f8bae75e 100644 --- a/stepmania/src/crypto51/strciphr.cpp +++ b/stepmania/src/crypto51/strciphr.cpp @@ -1,5 +1,7 @@ // strciphr.cpp - written and placed in the public domain by Wei Dai +#include "global.h" + #include "pch.h" #include "strciphr.h"