Browse Source

Minor tweaks to FilterChain.* to eliminate compiler warnings.

git-svn-id: https://svn.microneil.com/svn/SNFMulti/trunk@5 dc71a809-1921-45c4-985c-09c81d0142d9
wx
madscientist 15 years ago
parent
commit
c4d8b3fcaa
2 changed files with 18 additions and 16 deletions
  1. 1
    1
      FilterChain.cpp
  2. 17
    15
      FilterChain.hpp

+ 1
- 1
FilterChain.cpp View File

unsigned char NumBfr[5]; // A buffer for digits. unsigned char NumBfr[5]; // A buffer for digits.
memset(NumBfr,0,sizeof(NumBfr)); // Clear the buffer. memset(NumBfr,0,sizeof(NumBfr)); // Clear the buffer.
for( // Let's read the number... for( // Let's read the number...
int i=0; // NumBfr position = 0;
unsigned int i=0; // NumBfr position = 0;
i<(sizeof(NumBfr)-1) && // Stay well within the NunBfr. i<(sizeof(NumBfr)-1) && // Stay well within the NunBfr.
(EnQueue(NumBfr[i]=GetStore()), // Read and EnQueue each byte. (EnQueue(NumBfr[i]=GetStore()), // Read and EnQueue each byte.
isdigit(NumBfr[i])); // Keep going if it's a digit. isdigit(NumBfr[i])); // Keep going if it's a digit.

+ 17
- 15
FilterChain.hpp View File

FilterChain(FilterChain* S) { FilterChain(FilterChain* S) {
if(NULL==S) throw BadSource("FilterChain: NULL source not valid"); if(NULL==S) throw BadSource("FilterChain: NULL source not valid");
else Source = S; else Source = S;
}
}
virtual ~FilterChain() {} // Stop Warns about no virt dtor
}; };


// FilterChainInput // FilterChainInput
private: private:


unsigned char* InputBuffer; unsigned char* InputBuffer;
int BufferIndex;
int BufferLength;
unsigned int BufferLength;
unsigned int BufferIndex;


stringstream& PrependedHeaders; stringstream& PrependedHeaders;


DECODING // Delivering filtered data. DECODING // Delivering filtered data.
} State; } State;


int ScanIx; // Scanning Index.
int DequeIx; // Dequeing Index.
unsigned int ScanIx; // Scanning Index.
unsigned int DequeIx; // Dequeing Index.
unsigned char Buffer; // Define a buffer. unsigned char Buffer; // Define a buffer.


bool ValidByte(unsigned char y); // True if y can be decoded. bool ValidByte(unsigned char y); // True if y can be decoded.


FilterChainDefunker(FilterChain* S) // Sourced constructor... FilterChainDefunker(FilterChain* S) // Sourced constructor...
:FilterChain(S), // Call the base constructor. :FilterChain(S), // Call the base constructor.
InputPosition(0), // Reset both position pointers.
OutputPosition(0),
LastRawByte(0),
LastReadOut(0),
LastGetStore(0),
Master(&FilterChainDefunker::SkipHeaders), // Set the initial external and Master(&FilterChainDefunker::SkipHeaders), // Set the initial external and
Internal(&FilterChainDefunker::Preamble), // internal states.
InputPosition(0), // Reset both position pointers.
OutputPosition(0),
LastReadOut(0),
LastGetStore(0),
LastRawByte(0) {
Internal(&FilterChainDefunker::Preamble) { // internal states.


ClearQueue(); // Clear the queue; ClearQueue(); // Clear the queue;


private: private:


unsigned char DecodeBfr[UrlDecodeBfrSize]; // Decoded anchor buffer. unsigned char DecodeBfr[UrlDecodeBfrSize]; // Decoded anchor buffer.
int DecodeLength; // Decoded anchor length.
int DecodePosition; // Read (Inject) Position.
unsigned int DecodeLength; // Decoded anchor length.
unsigned int DecodePosition; // Read (Inject) Position.
bool DecodeFlag; // True if the URL was decoded. bool DecodeFlag; // True if the URL was decoded.


void Clear() { // Function to clear the bfr. void Clear() { // Function to clear the bfr.


FilterChainHeaderAnalysis(FilterChain* S, FilterChainIPTester& T) : // Construct with the chain and a tester. FilterChainHeaderAnalysis(FilterChain* S, FilterChainIPTester& T) : // Construct with the chain and a tester.
FilterChain(S), // Capture the chain. FilterChain(S), // Capture the chain.
Mode(&FilterChainHeaderAnalysis::doSeekDispatch), // Start in SeekDispatch() mode
IPTester(T), // Capture the tester. IPTester(T), // Capture the tester.
IPToTest(""), // IPToTest and IPToTest(""), // IPToTest and
IPTestResult(""), // IPTestResult are both empty to start. IPTestResult(""), // IPTestResult are both empty to start.
FoundMessageID(false), FoundMessageID(false),
FoundDate(false), FoundDate(false),
FoundSubject(false), FoundSubject(false),
FoundHighBitCharacters(false),
Mode(&FilterChainHeaderAnalysis::doSeekDispatch) { // Start in SeekDispatch() mode
FoundHighBitCharacters(false) {
} // -- first byte of a new line ;-) } // -- first byte of a new line ;-)


bool MissingFrom() { return (!FoundFrom); } // True if missing From header. bool MissingFrom() { return (!FoundFrom); } // True if missing From header.

Loading…
Cancel
Save