Merge
This commit is contained in:
commit
def7d31721
8 changed files with 51 additions and 9 deletions
|
@ -394,7 +394,7 @@ public:
|
||||||
* If you are using the stream only in output mode, you can use this method as a faster version
|
* If you are using the stream only in output mode, you can use this method as a faster version
|
||||||
* of clear() *if you don't serialize pointers*.
|
* of clear() *if you don't serialize pointers*.
|
||||||
*/
|
*/
|
||||||
void resetBufPos()
|
virtual void resetBufPos()
|
||||||
{
|
{
|
||||||
// This is ensured in CMemStream::CMemStream() and CMemStream::clear()
|
// This is ensured in CMemStream::CMemStream() and CMemStream::clear()
|
||||||
//if ( (!isReading()) && _Buffer.empty() )
|
//if ( (!isReading()) && _Buffer.empty() )
|
||||||
|
@ -477,7 +477,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/// See doc in CMemStream::bufferToFill()
|
/// See doc in CMemStream::bufferToFill()
|
||||||
uint8 *bufferToFill( uint32 msgsize )
|
virtual uint8 *bufferToFill( uint32 msgsize )
|
||||||
{
|
{
|
||||||
_FreeBits = 8;
|
_FreeBits = 8;
|
||||||
_DbgInfo.clear();
|
_DbgInfo.clear();
|
||||||
|
@ -654,7 +654,7 @@ public:
|
||||||
virtual void serial(ucstring &b);
|
virtual void serial(ucstring &b);
|
||||||
|
|
||||||
virtual void serial(CBitMemStream &b) { serialMemStream(b); }
|
virtual void serial(CBitMemStream &b) { serialMemStream(b); }
|
||||||
virtual void serialMemStream(CBitMemStream &b);
|
virtual void serialMemStream(CMemStream &b);
|
||||||
|
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
|
@ -301,7 +301,7 @@ public:
|
||||||
* If you are using the stream only in output mode, you can use this method as a faster version
|
* If you are using the stream only in output mode, you can use this method as a faster version
|
||||||
* of clear() *if you don't serialize pointers*.
|
* of clear() *if you don't serialize pointers*.
|
||||||
*/
|
*/
|
||||||
void resetBufPos() { _Buffer.Pos = 0; }
|
virtual void resetBufPos() { _Buffer.Pos = 0; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resize the message buffer and fill data at position 0.
|
* Resize the message buffer and fill data at position 0.
|
||||||
|
@ -340,7 +340,7 @@ public:
|
||||||
* fill it with raw data using any filling function (warning: don't fill more than 'msgsize'
|
* fill it with raw data using any filling function (warning: don't fill more than 'msgsize'
|
||||||
* bytes!), then you are ready to read, using serial(), the data you've just filled.
|
* bytes!), then you are ready to read, using serial(), the data you've just filled.
|
||||||
*/
|
*/
|
||||||
uint8 *bufferToFill( uint32 msgsize )
|
virtual uint8 *bufferToFill( uint32 msgsize )
|
||||||
{
|
{
|
||||||
#ifdef NL_DEBUG
|
#ifdef NL_DEBUG
|
||||||
nlassert( isReading() );
|
nlassert( isReading() );
|
||||||
|
|
|
@ -599,7 +599,7 @@ void CBitMemStream::append( const CBitMemStream& newBits )
|
||||||
/*
|
/*
|
||||||
* Serial bitmemstream
|
* Serial bitmemstream
|
||||||
*/
|
*/
|
||||||
void CBitMemStream::serialMemStream(CBitMemStream &b)
|
void CBitMemStream::serialMemStream(CMemStream &b)
|
||||||
{
|
{
|
||||||
#ifdef LOG_ALL_TRAFFIC
|
#ifdef LOG_ALL_TRAFFIC
|
||||||
sint32 bitpos = getPosInBit();
|
sint32 bitpos = getPosInBit();
|
||||||
|
|
|
@ -109,7 +109,7 @@ static void jpgDecompressSkip(j_decompress_ptr cinfo, long num_bytes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void jpgDecompressTerm(j_decompress_ptr cinfo)
|
static void jpgDecompressTerm(j_decompress_ptr /* cinfo */)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -237,12 +237,15 @@ namespace NLMISC
|
||||||
_PImpl = new TCoTaskData(this);
|
_PImpl = new TCoTaskData(this);
|
||||||
// _PImpl->_TaskThreadId = 0;
|
// _PImpl->_TaskThreadId = 0;
|
||||||
// _PImpl->_ParentThreadId = 0;
|
// _PImpl->_ParentThreadId = 0;
|
||||||
|
nlunreferenced(stackSize);
|
||||||
#else //NL_USE_THREAD_COTASK
|
#else //NL_USE_THREAD_COTASK
|
||||||
// allocate platform specific data storage
|
// allocate platform specific data storage
|
||||||
_PImpl = new TCoTaskData;
|
_PImpl = new TCoTaskData;
|
||||||
|
nlunreferenced(stackSize);
|
||||||
#if defined (NL_OS_WINDOWS)
|
#if defined (NL_OS_WINDOWS)
|
||||||
_PImpl->_Fiber = NULL;
|
_PImpl->_Fiber = NULL;
|
||||||
_PImpl->_ParentFiber = NULL;
|
_PImpl->_ParentFiber = NULL;
|
||||||
|
nlunreferenced(stackSize);
|
||||||
#elif defined(NL_OS_UNIX)
|
#elif defined(NL_OS_UNIX)
|
||||||
// allocate the stack
|
// allocate the stack
|
||||||
_PImpl->_Stack = new uint8[stackSize];
|
_PImpl->_Stack = new uint8[stackSize];
|
||||||
|
|
|
@ -650,6 +650,9 @@ ICommand *CCommandRegistry::getCommand(const std::string &commandName)
|
||||||
|
|
||||||
NLMISC_CATEGORISED_COMMAND(nel,help,"display help on a specific variable/commands or on all variables and commands", "[<variable>|<command>]")
|
NLMISC_CATEGORISED_COMMAND(nel,help,"display help on a specific variable/commands or on all variables and commands", "[<variable>|<command>]")
|
||||||
{
|
{
|
||||||
|
nlunreferenced(rawCommandString);
|
||||||
|
nlunreferenced(quiet);
|
||||||
|
nlunreferenced(human);
|
||||||
// nlassert (_Commands != NULL);
|
// nlassert (_Commands != NULL);
|
||||||
|
|
||||||
// make sure we have a valid number of parameters
|
// make sure we have a valid number of parameters
|
||||||
|
|
|
@ -373,6 +373,10 @@ uint32 humanReadableToBytes (const string &str)
|
||||||
|
|
||||||
NLMISC_CATEGORISED_COMMAND(nel,btohr, "Convert a bytes number into an human readable number", "<int>")
|
NLMISC_CATEGORISED_COMMAND(nel,btohr, "Convert a bytes number into an human readable number", "<int>")
|
||||||
{
|
{
|
||||||
|
nlunreferenced(rawCommandString);
|
||||||
|
nlunreferenced(quiet);
|
||||||
|
nlunreferenced(human);
|
||||||
|
|
||||||
if (args.size() != 1)
|
if (args.size() != 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -384,6 +388,10 @@ NLMISC_CATEGORISED_COMMAND(nel,btohr, "Convert a bytes number into an human read
|
||||||
|
|
||||||
NLMISC_CATEGORISED_COMMAND(nel,hrtob, "Convert a human readable number into a bytes number", "<hr>")
|
NLMISC_CATEGORISED_COMMAND(nel,hrtob, "Convert a human readable number into a bytes number", "<hr>")
|
||||||
{
|
{
|
||||||
|
nlunreferenced(rawCommandString);
|
||||||
|
nlunreferenced(quiet);
|
||||||
|
nlunreferenced(human);
|
||||||
|
|
||||||
if (args.size() != 1)
|
if (args.size() != 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -446,6 +454,10 @@ uint32 fromHumanReadable (const std::string &str)
|
||||||
|
|
||||||
NLMISC_CATEGORISED_COMMAND(nel,stohr, "Convert a second number into an human readable time", "<int>")
|
NLMISC_CATEGORISED_COMMAND(nel,stohr, "Convert a second number into an human readable time", "<int>")
|
||||||
{
|
{
|
||||||
|
nlunreferenced(rawCommandString);
|
||||||
|
nlunreferenced(quiet);
|
||||||
|
nlunreferenced(human);
|
||||||
|
|
||||||
if (args.size() != 1)
|
if (args.size() != 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -829,6 +841,7 @@ int nlfseek64( FILE *stream, sint64 offset, int origin )
|
||||||
return fsetpos (stream, &pos64);
|
return fsetpos (stream, &pos64);
|
||||||
|
|
||||||
#else // NL_OS_WINDOWS
|
#else // NL_OS_WINDOWS
|
||||||
|
// TODO: to fix for Linux and Mac OS X
|
||||||
|
|
||||||
// This code doesn't work under windows : fseek() implementation uses a signed 32 bits offset. What ever we do, it can't seek more than 2 Go.
|
// This code doesn't work under windows : fseek() implementation uses a signed 32 bits offset. What ever we do, it can't seek more than 2 Go.
|
||||||
// For the moment, i don't know if it works under linux for seek of more than 2 Go.
|
// For the moment, i don't know if it works under linux for seek of more than 2 Go.
|
||||||
|
@ -871,6 +884,9 @@ sint64 nlftell64(FILE *stream)
|
||||||
}
|
}
|
||||||
else return -1;
|
else return -1;
|
||||||
#else
|
#else
|
||||||
|
nlunreferenced(stream);
|
||||||
|
|
||||||
|
// TODO: implement for Linux and Mac OS X
|
||||||
nlerror("Not implemented");
|
nlerror("Not implemented");
|
||||||
return -1;
|
return -1;
|
||||||
#endif
|
#endif
|
||||||
|
@ -885,9 +901,14 @@ sint64 nlftell64(FILE *stream)
|
||||||
|
|
||||||
NLMISC_CATEGORISED_COMMAND(nel, sleep, "Freeze the service for N seconds (for debug purpose)", "<N>")
|
NLMISC_CATEGORISED_COMMAND(nel, sleep, "Freeze the service for N seconds (for debug purpose)", "<N>")
|
||||||
{
|
{
|
||||||
|
nlunreferenced(rawCommandString);
|
||||||
|
nlunreferenced(quiet);
|
||||||
|
nlunreferenced(human);
|
||||||
|
|
||||||
if(args.size() != 1) return false;
|
if(args.size() != 1) return false;
|
||||||
|
|
||||||
sint32 n = atoi (args[0].c_str());
|
sint32 n;
|
||||||
|
fromString(args[0], n);
|
||||||
|
|
||||||
log.displayNL ("Sleeping during %d seconds", n);
|
log.displayNL ("Sleeping during %d seconds", n);
|
||||||
|
|
||||||
|
@ -897,6 +918,10 @@ NLMISC_CATEGORISED_COMMAND(nel, sleep, "Freeze the service for N seconds (for de
|
||||||
|
|
||||||
NLMISC_CATEGORISED_COMMAND(nel, system, "Execute the command line using system() function call (wait until the end of the command)", "<commandline>")
|
NLMISC_CATEGORISED_COMMAND(nel, system, "Execute the command line using system() function call (wait until the end of the command)", "<commandline>")
|
||||||
{
|
{
|
||||||
|
nlunreferenced(rawCommandString);
|
||||||
|
nlunreferenced(quiet);
|
||||||
|
nlunreferenced(human);
|
||||||
|
|
||||||
if(args.size() != 1) return false;
|
if(args.size() != 1) return false;
|
||||||
|
|
||||||
string cmd = args[0];
|
string cmd = args[0];
|
||||||
|
@ -915,6 +940,10 @@ NLMISC_CATEGORISED_COMMAND(nel, system, "Execute the command line using system()
|
||||||
|
|
||||||
NLMISC_CATEGORISED_COMMAND(nel, launchProgram, "Execute the command line using launcProgram() function call (launch in background task without waiting the end of the execution)", "<programName> <arguments>")
|
NLMISC_CATEGORISED_COMMAND(nel, launchProgram, "Execute the command line using launcProgram() function call (launch in background task without waiting the end of the execution)", "<programName> <arguments>")
|
||||||
{
|
{
|
||||||
|
nlunreferenced(rawCommandString);
|
||||||
|
nlunreferenced(quiet);
|
||||||
|
nlunreferenced(human);
|
||||||
|
|
||||||
if(args.size() != 2) return false;
|
if(args.size() != 2) return false;
|
||||||
|
|
||||||
string cmd = args[0];
|
string cmd = args[0];
|
||||||
|
@ -927,6 +956,10 @@ NLMISC_CATEGORISED_COMMAND(nel, launchProgram, "Execute the command line using l
|
||||||
|
|
||||||
NLMISC_CATEGORISED_COMMAND(nel, killProgram, "kill a program given the pid", "<pid>")
|
NLMISC_CATEGORISED_COMMAND(nel, killProgram, "kill a program given the pid", "<pid>")
|
||||||
{
|
{
|
||||||
|
nlunreferenced(rawCommandString);
|
||||||
|
nlunreferenced(quiet);
|
||||||
|
nlunreferenced(human);
|
||||||
|
|
||||||
if(args.size() != 1) return false;
|
if(args.size() != 1) return false;
|
||||||
uint32 pid;
|
uint32 pid;
|
||||||
fromString(args[0], pid);
|
fromString(args[0], pid);
|
||||||
|
@ -1030,6 +1063,9 @@ bool openDoc (const char *document)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return true;
|
return true;
|
||||||
|
#else
|
||||||
|
// TODO: implement for Linux and Mac OS X
|
||||||
|
nlunreferenced(document);
|
||||||
#endif // NL_OS_WINDOWS
|
#endif // NL_OS_WINDOWS
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -361,7 +361,7 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual void forceOpen() { setActive(true); }
|
virtual void forceOpen() { setActive(true); }
|
||||||
|
|
||||||
virtual void enableBlink(int /* numBlinks */ = 0) {}
|
virtual void enableBlink(uint /* numBlinks */ = 0) {}
|
||||||
virtual void disableBlink() {}
|
virtual void disableBlink() {}
|
||||||
virtual bool getBlink() const { return false; }
|
virtual bool getBlink() const { return false; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue