Deprecate the internal int/uint types in favor of the cstdint types they were based on

This commit is contained in:
Tim Wojtulewicz 2019-07-30 11:38:42 -07:00
parent 18e4976c6c
commit 54752ef9a1
218 changed files with 1331 additions and 1323 deletions

View file

@ -11,7 +11,7 @@
using namespace file_analysis;
Extract::Extract(RecordVal* args, File* file, const string& arg_filename,
uint64 arg_limit)
uint64_t arg_limit)
: file_analysis::Analyzer(file_mgr->GetComponentTag("EXTRACT"), args, file),
filename(arg_filename), limit(arg_limit), depth(0)
{
@ -54,7 +54,7 @@ file_analysis::Analyzer* Extract::Instantiate(RecordVal* args, File* file)
limit->AsCount());
}
static bool check_limit_exceeded(uint64 lim, uint64 depth, uint64 len, uint64* n)
static bool check_limit_exceeded(uint64_t lim, uint64_t depth, uint64_t len, uint64_t* n)
{
if ( lim == 0 )
{
@ -80,12 +80,12 @@ static bool check_limit_exceeded(uint64 lim, uint64 depth, uint64 len, uint64* n
return false;
}
bool Extract::DeliverStream(const u_char* data, uint64 len)
bool Extract::DeliverStream(const u_char* data, uint64_t len)
{
if ( ! fd )
return false;
uint64 towrite = 0;
uint64_t towrite = 0;
bool limit_exceeded = check_limit_exceeded(limit, depth, len, &towrite);
if ( limit_exceeded && file_extraction_limit )
@ -111,7 +111,7 @@ bool Extract::DeliverStream(const u_char* data, uint64 len)
return ( ! limit_exceeded );
}
bool Extract::Undelivered(uint64 offset, uint64 len)
bool Extract::Undelivered(uint64_t offset, uint64_t len)
{
if ( depth == offset )
{

View file

@ -31,7 +31,7 @@ public:
* @return false if there was no extraction file open and the data couldn't
* be written, else true.
*/
bool DeliverStream(const u_char* data, uint64 len) override;
bool DeliverStream(const u_char* data, uint64_t len) override;
/**
* Report undelivered bytes.
@ -39,7 +39,7 @@ public:
* @param len number of bytes undelivered.
* @return true
*/
bool Undelivered(uint64 offset, uint64 len) override;
bool Undelivered(uint64_t offset, uint64_t len) override;
/**
* Create a new instance of an Extract analyzer.
@ -55,7 +55,7 @@ public:
* "no limit".
* @param bytes number of bytes allowed to be extracted
*/
void SetLimit(uint64 bytes) { limit = bytes; }
void SetLimit(uint64_t bytes) { limit = bytes; }
protected:
@ -68,13 +68,13 @@ protected:
* @param arg_limit the maximum allowed file size.
*/
Extract(RecordVal* args, File* file, const string& arg_filename,
uint64 arg_limit);
uint64_t arg_limit);
private:
string filename;
int fd;
uint64 limit;
uint64 depth;
uint64_t limit;
uint64_t depth;
};
} // namespace file_analysis