Browse Source

Minor tweaks to eliminate compiler warnings in SNFMulti.*.

git-svn-id: https://svn.microneil.com/svn/SNFMulti/trunk@10 dc71a809-1921-45c4-985c-09c81d0142d9
wx
madscientist 15 years ago
parent
commit
6ba9690b26
3 changed files with 17 additions and 12 deletions
  1. 15
    10
      SNFMulti.cpp
  2. 1
    1
      SNFMulti.hpp
  3. 1
    1
      snfLOGmgr.hpp

+ 15
- 10
SNFMulti.cpp View File

const ThreadType snf_Reloader::Type("snf_Reloader"); // The thread's type. const ThreadType snf_Reloader::Type("snf_Reloader"); // The thread's type.


snf_Reloader::snf_Reloader(snf_RulebaseHandler& R) : // When we are created, we snf_Reloader::snf_Reloader(snf_RulebaseHandler& R) : // When we are created, we
Thread(snf_Reloader::Type, "Reloader"), // brand and name our thread,
RulebaseGetterIsTurnedOn(false), // rulebase getter is off at first,
RulebaseGetter("RulebaseGetter"), // setup our ScriptCaller thread,
MyRulebase(R), // capture the rulebase handler.
TimeToStop(false) { // It's not time to stop yet.
Thread(snf_Reloader::Type, "Reloader"), // brand and name our thread.
MyRulebase(R), // Capture the rulebase handler.
TimeToStop(false), // It's not time to stop yet.
RulebaseGetter("RulebaseGetter"), // Setup our ScriptCaller thread.
RulebaseGetterIsTurnedOn(false) { // Rulebase getter is off at first.
captureFileStats(); // Set up the initial stats. captureFileStats(); // Set up the initial stats.
captureGetterConfig(); // Set up RulebaseGetter config. captureGetterConfig(); // Set up RulebaseGetter config.
run(); // Run our maintenenace thread. run(); // Run our maintenenace thread.
struct tm FileNameTime; // Allocate a time structure. struct tm FileNameTime; // Allocate a time structure.
FileNameTime = *(gmtime(&FileNameStat.st_mtime)); // Copy the file time to it as UTC. FileNameTime = *(gmtime(&FileNameStat.st_mtime)); // Copy the file time to it as UTC.


char TimestampBfr[20]; // Timestamp buffer.
char TimestampBfr[20]; // Timestamp buffer.


sprintf(TimestampBfr,"%04d%02d%02d%02d%02d%02d\0", // Format yyyymmddhhmmss
sprintf(TimestampBfr,"%04d%02d%02d%02d%02d%02d", // Format yyyymmddhhmmss
FileNameTime.tm_year+1900, FileNameTime.tm_year+1900,
FileNameTime.tm_mon+1, FileNameTime.tm_mon+1,
FileNameTime.tm_mday, FileNameTime.tm_mday,


void snf_RulebaseHandler::drop(snfCFGPacket& CP) { // Deactiveate this Rulebase. void snf_RulebaseHandler::drop(snfCFGPacket& CP) { // Deactiveate this Rulebase.
const TokenMatrix* t = CP.MyTokenMatrix; // Grab the token matrix pointer. const TokenMatrix* t = CP.MyTokenMatrix; // Grab the token matrix pointer.
CP.MyCFGData == NULL; // Null the configuration pointer.
CP.MyCFGData = NULL; // Null the configuration pointer.
ScopeMutex HoldStillPlease(MyMutex); // Lock the rulebase until we're done. ScopeMutex HoldStillPlease(MyMutex); // Lock the rulebase until we're done.
if(t==Rulebase) { // If we're dropping the current rulebase if(t==Rulebase) { // If we're dropping the current rulebase
CurrentCount--; // then reduce the current count. CurrentCount--; // then reduce the current count.
// *nix like systems if the software and/or scripting involved isn't // *nix like systems if the software and/or scripting involved isn't
// quite up to spec. We are reading a file, after all. // quite up to spec. We are reading a file, after all.


int ipt = 0; // Insert search point.
unsigned int ipt = 0; // Insert search point.


if(MessageBuffer.size() != MyScanData.ScanSize) { // If our scanner skipped data at if(MessageBuffer.size() != MyScanData.ScanSize) { // If our scanner skipped data at
ipt = MessageBuffer.size() - MyScanData.ScanSize; // the top of the message buffer then ipt = MessageBuffer.size() - MyScanData.ScanSize; // the top of the message buffer then
break; // That's all. break; // That's all.
} }


case New: {
case New: {
break; break;
} }


} }
} }
break; break;
}
case Unknown: // Unknown - most likely we couldn't
default: { // find a usable source.
break; // Do nothing.
} }
} }
} // End of IP source depended work (GBUdbOverrides) } // End of IP source depended work (GBUdbOverrides)

+ 1
- 1
SNFMulti.hpp View File



snf_RulebaseHandler(): // Initialization is straight forward. snf_RulebaseHandler(): // Initialization is straight forward.
MyReloader(0), MyReloader(0),
MyGeneration(0),
ReferenceCount(0), ReferenceCount(0),
Rulebase(NULL), Rulebase(NULL),
CurrentCount(0), CurrentCount(0),
OldRulebase(NULL), OldRulebase(NULL),
RetiringCount(0), RetiringCount(0),
RefreshInProgress(false), RefreshInProgress(false),
MyGeneration(0),
myXCIServerCommandHandler(0) { myXCIServerCommandHandler(0) {
MyNETmgr.linkLOGmgr(MyLOGmgr); // Link the NET manager to the LOGmgr. MyNETmgr.linkLOGmgr(MyLOGmgr); // Link the NET manager to the LOGmgr.
MyNETmgr.linkGBUdbmgr(MyGBUdbmgr); // Link the NET manager to the GBUdbmgr. MyNETmgr.linkGBUdbmgr(MyGBUdbmgr); // Link the NET manager to the GBUdbmgr.

+ 1
- 1
snfLOGmgr.hpp View File



bool MessageFileTypeCGPOn; // Expect a CGP type message file. bool MessageFileTypeCGPOn; // Expect a CGP type message file.


int ScanSize; // What size is the scan request.
unsigned int ScanSize; // What size is the scan request.


// GBUdb Activity Flags // GBUdb Activity Flags



Loading…
Cancel
Save