mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 05:27:38 +03:00
Merged Ross's win32 patch(manually) In the course of merging, following files are added. * src/strptime.{h,c} * src/libgen.{h,c} * src/inet_aton.{h,c} * src/Platform.{h,cc} * src/localtime_r.{h,c} * src/getaddrinfo.{h,c} I've gethered network related things, and put them to following file: * src/a2netcompat.h Also io related things are put to following file: * src/a2io.h Changed %lld to %s because mingw32 doesn't recognize %lld. * src/message.h (MSG_ALLOCATION_COMPLETED) (EX_TOO_LARGE_FILE) (EX_SIZE_MISMATCH) (EX_FILE_OFFSET_OUT_OF_RANGE) (EX_INVALID_CHUNK_CHECKSUM) (EX_INVALID_RANGE_HEADER) * src/FileAllocationCommand.cc * src/HttpResponse.cc * src/RequestGroup.cc * src/MultiDiskAdaptor.cc * src/OptionHandlerImpl.h * src/HttpResponseCommand.cc * src/FtpNegotiateCommand.cc * src/IteratableChecksumValidator.cc * src/SegmentMan.cc * src/ChunkChecksumValidator.cc Added Randomizer::getRandomNumber(long int) * src/Randomizer.h (getRandomNumber) * src/SimpleRandomizer.h (getRandomNumber) * src/BitfieldMan.cc (getMissingIndexRandomly): Use this new function. * src/Util.cc (randomAlpha): Use this new function.
36 lines
677 B
C++
36 lines
677 B
C++
#ifndef _D_FIXED_NUMBER_RANDOMIZER_H_
|
|
#define _D_FIXED_NUMBER_RANDOMIZER_H_
|
|
|
|
#include "Randomizer.h"
|
|
|
|
class FixedNumberRandomizer : public Randomizer {
|
|
private:
|
|
int32_t fixedNumber;
|
|
public:
|
|
FixedNumberRandomizer():fixedNumber(0) {}
|
|
|
|
virtual ~FixedNumberRandomizer() {}
|
|
|
|
virtual long int getRandomNumber() {
|
|
return fixedNumber;
|
|
}
|
|
|
|
virtual long int getMaxRandomNumber() {
|
|
return RAND_MAX;
|
|
}
|
|
|
|
virtual long int getRandomNumber(long int to)
|
|
{
|
|
return getRandomNumber();
|
|
}
|
|
|
|
void setFixedNumber(int32_t num) {
|
|
this->fixedNumber = num;
|
|
}
|
|
|
|
int32_t getFixedNumber() const {
|
|
return fixedNumber;
|
|
}
|
|
};
|
|
|
|
#endif // _D_FIXED_NUMBER_RANDOMIZER_H_
|